PHP echo vs PHP short tags
Echo is generally just better to use because...
- It supports good programming style.
- It can't be turned off in php.ini (short tags can be)
Short tags will be removed in PHP 6)
But, they are generally the same. See also:
Are they equal in safeness? I was informed that using
was less safe, and that it slows down page load times. I am strictly biased to using echo.
What are the advantages/disadvantages?
As of PHP 5.4,
<?= ?> is essentially the short-hand way of writing
Using = instead of echo in PHP (Laravel 5)?
<?= $var; ?> is a short tag and is available for some time. In MVC's it is quite common to use and it is not bad, but not always the right choice. Some servers doesn't allow short tags at all. You can change this settings by enabling it in .htaccess, but until you try, you are not certain it will work.
<IfModule mod_php5.c> php_value short_open_tag 1 </IfModule>
Most of the times, you won't have to do anything to use short tags.