Parse error: syntax error, unexpected ';'
I am migrating my site from PHP 4 to 5
I keep getting this error on version 5 server:
Parse error: syntax error, unexpected ';' in / var / www / vhosts / ****. php on line 1688
I, when I check the code, something like this:
<?=#something here being commented out?>
This worked fine in v4, but now it generated an error. I don't really understand the error because there is no in the whole line ;
?
I can just delete the line, but I'm wondering why is this error happening in the first place, and if there is anything else I can do other than hunting down every case of this?
Thanks!!
a source to share
unexpected ';' indicates that he was not expecting the command to end. In your code, you have a shorthand open tag. You basically tell it to echo and not pass an argument to it when you do:
<?= //comment ?>
If you shorten this value to:
<?php //echo 'something'; ?>
You would be safe.
a source to share