php - Can <?=$var?> syntax cause problems? -


this question has answer here:

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

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -