Parse error in PHP4 and why not in PHP5

liunx

Guest
lengthlink.php file Line 126 : <img src=http://www.phpbuilder.com/board/archive/index.php/"chart.php?style=<?=GrowthChart::STYLE_LENGTH_AGE ?>&sex=<?=$mmonth?>&maxage=35&xvals=<?=$xvals?>&yvals=<?=$yvals?>"/>
Error:
Parse error:syntax error, unexpected ';', expecting '(' in /opt/lampp/htdocs/sourcejp1.21/lengthlink.php on line 126
Can you tell me why the error is coming in PHP4.4.6,no errors in PHP5.x?Thanks in advanceNothing obviously wrong with that particular line that I can see.

Doesn't make sense to do this on one version, but not the other.

Ordinarily, I'd say as it is reporting to have found a semicolon when it was looking for an open parenthesis, check one of the lines immediately before 126. Perhaps you have an 'If' statement with a ';' rather than a '(' at the end

Maybe PHP 4 is configured not to like short php tags? Strange one indeed.somehow I found out that error is coming for a declaration in growchart class the declaration states that:
const some_variable;
Is it true that 'const' keyword through errors in PHP4?It will work fine in PHP5.I hope it is true.

away from topic:
[Deleted by moderator]Class constants are not supported prior to PHP 5, so "const" is not a defined keyword in PHP 4 or earlier.By the way, don't use short open tags. Use <?php since it is guaranteed to work everywhere and that short tags will be disabled from PHP 6.
 
Back
Top