Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Not really dangerous, he is probably confused. But this is enabled on the language since version 5.6 I think(or 5.4) regardless of your ini files.
Its safe to use. -
I guess its not 'super dangerous' per se , but might not work in different devices
-
"<?=" *used* to be optionally enabled in earlier PHP versions (5.4 and earlier IIRC), so it *could* be a more dangerous then as, if misconfigured, you could just start spewing out raw server side PHP code. That's not generally considered a great thing.
These days they're identical however. Your other dev is probably just using a "legacy" mindset. -
"PHP includes a short echo tag <?= which is a short-hand to the more verbose <?php echo. "
https://php.net/manual/en/...
<?php is not the same as <?=
In worst case you echo your code instead of executing it
Edit: Migraine. Brain faulty. Oooopsie doopsie -
@gronostaj ohh right. Then if it works on one's server , then one should go for it (Btw am just starting to learn backend designing using php)
-
@naphetz It's permanently enabled since PHP 5.4. https://softwareengineering.stackexchange.com/...
-
hitzoR2635yYou should insist that you all should use a templating engine like Latte or Twig to not argue about such things. :D
-
C0D4669025yAs long as the .ini file has short open tags enabled, then whatever, I personally disable it.
It's not a big jump
From <?= to start using alternative syntax but whatever, each to their own after all. -
C0D4669025y@gronostaj wait a minute
🧢
*research cap on* 🤔
Note:
This directive also affected the shorthand <?= before PHP 5.4.0, which is identical to <? echo. Use of this shortcut required short_open_tag to be on. Since PHP 5.4.0, <?= is always available.
Well, there you go, it's been that long since I've used it, someone turned it on by default.
Related Rants
Hello, one of the other devs on my team insists that using:
<?=$myVar?>
In a template is super dangerous but:
<?php echo $myVar?>
Is safer.
Why? Is this valid in PHP 7.3?
question
security
php7
php