Possible Duplicate:
What is the difference between the PHP open tags “<?=” and “<?php”/“<?”?
Rather than type:
<?php echo $foo; ?>
I have seen it written
<?= $foo; ?>
But I’ve often wondered what the risk/impracticalities are of doing it? Just curious. Thanks!
If you happen to move the code to an environment where
short_open_tagisn’t enabled, you’ll be exposing a lot of internal variable names (security issue) and have a whole lot of damaged output.The other downside is that the same setting that allows usage of
<?=is the same that lets you open PHP tags with just<?, so having it disabled would not only expose those specific variables you were attempting to display, but also display any PHP code within short tags.