CodeIgniter Forums
Short Open Tags - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Best Practices (https://forum.codeigniter.com/forumdisplay.php?fid=12)
+--- Thread: Short Open Tags (/showthread.php?tid=64679)



Short Open Tags - RHF - 03-20-2016

For those of us new to CI and who wish to use it with 'best practices', it would be helpful to have consistent guidance regarding 'short open tags' .
The CI PHP Style Guide says not to use them, but in Alternate PHP Syntax for View Files it is recommended to use "short tag echo statements".
This issue is discussed in other forums, but I am curious as to the latest thinking on this.
Thanks.


RE: Short Open Tags - Narf - 03-21-2016

There's a difference between the two ...

<? depends on an INI setting
<?= is always available since PHP 5.4


RE: Short Open Tags - InsiteFX - 03-21-2016

The reason they say not to use short tags is because it can cause conflict with the xml open tag.