One thing in particular is tripping people up: the short open tag. I’ve had a few questions on this so here’s the advice I am giving to clients and friends.
What Actually Changed
The short_open_tag
configuration directive was removed, but the short echo syntax <?=
is always available.
How To Upgrade Your Codebase
- If you have
<?=
in your templates, leave it alone, those will still work - If you have short tags
<?
in your code, including in any of your libraries, then you need to do a global find-and-replace and turn them all into<?php
If you have short tags somewhere in your codebase, you probably won’t get errors, you’ll just suddenly start seeing PHP code in your output as PHP doesn’t recognise the tag and therefore doesn’t evaluate the code! To find them, try searching for <?
followed by a whitespace character.
Hopefully that helps; there are a few gotchas to getting upgraded from older versions (especially from PHP 5.2) but this particular gotcha really isn’t a problem and the instructions here should see you through.