To PHP Short Tag or not to PHP Short Tag?

In PHP 5.4 the echo “short tag” (<?=) is permanently enabled regardless of short_open_tag settings now. So it would be save to use <?= since Kirby has dropped PHP 5.3 support in 2.2.

As regards the opening short tag <?, I guess that is enabled in most hosting environments. For the widest compatibility of your code, avoiding the open short tag is still your best bet. There’s also supposed to be a possible conflict issue with XML.

2 Likes