Reading some PHP code and I cannot understand the usage of:
<?=
I understand the php tag use of:
<?php and <?
The exact usage I am reading is:
<?=$form->hidden('mode',$mode); ?>
where $form is a new instantiated class of an object and “hidden” a class method. All of that is understood, but when I place even a space between the ? and = of <?= I get an error of:
Parse error: syntax error, unexpected '=' in /home/...
I cannot find anything on google or php.net regarding the syntax.
Any help would be appreciated.
<?=is shorthand for<?php echo. Its usage isn’t recommended any more, apparently because of some ambiguity with the parser or incompatibility with some PHP versions, though I still see it in big projects like Drupal.Edit: They’re called “short tags” and a discussion on whether they should be used or not can be found here: Are PHP short tags acceptable to use?