Found a legacy web site at work today running on PHP4. As the PHP folks no longer support version 4, I started testing the site on PHP5 to prep it for migration. I was rather surprised to find that some very basic pages, with just some if/else blocks for conditional content, were causing errors. The error being returned was “parse error, unexpected ‘;’”, which was rather odd, particularly because it was still giving the same error when I removed all ;’s from the offending line (!?).
The issue turned out to be that PHP4 allows you to just use
echo ; or
echo [your text] ;
PHP5, however, requires quotes:
echo ""; or
echo "[your text]";
I couldn’t find this with 15-20 minutes of searching the web, just figured it out by trying various changes to the page, so here it is for posterity and people looking in the future