Is it bad practice to use <?= tag in PHP
- by marco-fiset
I've come across this PHP tag <?= ?> recently and I am reluctant to use it, but it itches so hard that I wanted to have your take on it. I know it is bad practice to use short tags <? ?> and that we should use full tags <?php ?> instead, but what about this one : <?= ?>?
It would save some typing and it would be better for code readability, IMO. So instead of this:
<input name="someVar" value="<?php echo $someVar; ?>">
I could write it like this, which is cleaner :
<input name="someVar" value="<?= $someVar ?>">
Is using this operator frowned upon?