Is it now totally and completely safe to use
<?=$var ?>
instead of
<?php echo $var; ?>
I wouldn't use the words "totally" and "completely", but with PHP5.4 the "short-open-and-echo"-syntax is part of the core and thus always available. Remind, that I only talk about <?= ?>
and not the "regular" short-open-tags <? ?>
.
Yes. As of PHP 5.4.0 from 01-Mar-2012 you can use short tag. From php 5.4 change log,
<?= is now always available regardless of the short_open_tag setting.
This was a General improvement.
So if you have PHP 5.4 you can use <?=
syntax.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With