This topic is locked
[SOLVED]

 syntax erro Unexpected T_STRING

12/20/2011 2:51:01 PM
PHPRunner General questions
L
lhcaetano author

Hi to all!
I keep on getting this syntax erro msg on line 2: Unexpected T_STRING.
This is the code:

  1. $dc_soma = $values['dobra_peitoral'] + $values['dobra_abdominal'] + $values['dobra_coxa'];
  2. $dc = 1.109380 – (0.0008267 $dc_soma) + (0.0000016 $dc_soma)^2 – (0.0002574 * $oldvalues['aluno_idade']);
    This in done on: Events, Edit Page, Before record updated.
    Am I missing something here? Please help out!
    PHPRunner 6.0 Buld 9948.

L
lhcaetano author 12/20/2011

OK.
Syntactically, there is no error on the code.
I tried fusing around with line 2 and strangely got it to finally accept the syntax. This is odd, so I strongly suggest that this is a Bug on the Event Editor.
This is how I managed to fix the problem.
line 2. $dc = 1.109380 - (0.0008267 $dc_soma) + (0.0000016 $dc_soma)^2 - (0.0002574 $oldvalues['aluno_idade']);
Step 1:
I deleted the final part of the string " - (0.0002574
$oldvalues['aluno_idade'])" and it finally compiled.
Step 2:
After that, I put the part I took out back in the code again " - (0.0002574 * $oldvalues['aluno_idade']) " and it compiled ok as if nothing was wrong.
Attention: this has to be a bug.

Admin 12/20/2011

PHPRunner uses built-in PHP functionality to verify the syntax. I doubt you found a new bug in PHP. Most likely that were some sort of bad character that you have deleted in order to fix the error.