php - Can <?=$var?> syntax cause problems? -
this question has answer here:
- are php short tags acceptable use? 24 answers
i know syntax <? ?>
not allowed, , spark notices if have them enabled... haven't seen many people use <?=$var?>
echo variable... illegal syntax or accepted in versions of php?
<?php echo $var; ?>
vs
<?=$var?>
yes, depends on php.ini settings. short_open_tag
has on
.
your code not work, if short open tags aren't allowed (old servers [< php 5.4.0] don't support default). if you'd write code downwards compatible, not use it.
i got lot of anoying trouble because of being lazy , using short open tags. ;-)
Comments
Post a Comment