<h2>Manage Role: > (<?= $myACL->getRoleNameFromID($_GET['roleID']); ?>)</h2>
views:
237answers:
4
+5
A:
It's functionally the same as <?php echo $myACL->getRoleNameFromID($_GET['roleID']); ?>
Mark Biek
2009-12-26 17:49:27
+3
A:
It's the PHP Short Tag equivalent of printing.
From the PHP INI:
Using short tags is discouraged when developing code meant for redistribution ; since short tags may not be supported on the target server.
See "Are PHP Short Tags Acceptable to Use?" on StackOverflow.
Jonathan Sampson
2009-12-26 17:50:44
A:
The <?= ... > tag says to execute whatever is in ... and output the results.
Milan Ramaiya
2009-12-26 17:50:58
+7
A:
To add to Mark's answer: The short_tags option must be enabled for the <?=
syntax to be valid. This presents a major portability problem when moving to a server that has this option disabled.
Mike B
2009-12-26 17:51:12
Couldn't the user simply call `ini_set('short_open_tag', 1)` to override? Or if short tags are disabled, is the `ini_set` function normally disabled as well?
Doug Neiner
2009-12-26 17:52:35
@Doug: actually, by the time the user was allowed to call `ini_set`, the file was already parsed. So it's too late at that point. The best alternative is a directive in `.htaccess` or `httpd.conf` if you can.
gahooa
2009-12-26 17:57:10
Doh! Of course. Thanks for the response @gahooa!
Doug Neiner
2009-12-26 18:06:49