The original post: /r/php by /u/8bithjorth on 2024-11-08 10:31:40.
💡For anyone coming here in the future:
Short tags are not deprecated. It was just me looking at RC suggestions that I thought had been accepted but were actually declined.
I was curious why not to use the shorthand tags without using <?php. It seems if you run the local server, they are enabled by default. However, in the production version of the php.ini file, they are set to off. This creates a dangerous security risk because, even if they are on by default, any ini file—whether development or production—will change it to off 😓
Thanks to u/olelis for helping me for checking his settings.
; short_open_tag
; Default Value: On
; Development Value: Off
; Production Value: Off
OLD QUESTION
Is PHP likely to reconsider deprecating short tags? It seems odd to make built-in templating more verbose, only because short tags don’t mix well with XML.
Example:
if ()
VS
if()