Take the 2-minute tour ×

In PHP I would like to be able to use the <?= open tag (which is similar in effect to <?php echo) but I would also like to disallow the use of the short open tag for any other use than quickly echo stuff.

Is that possible? If it is, how could I achive this? I tried searching serverfault and Google and nothing came up.

share|improve this question

2 Answers 2

I'm afraid the php.ini configuration wouldn't let you do that out of the box.

You could modify the PHP source (depending on your knowledge of C), but that'd made upgrading evermore annoying in the future as you'd have to patch every version.

share|improve this answer
I know C but I'm not that motivated ^^. I guess I'll simply stop using <?=. Thanks. –  p4bl0 Apr 8 '10 at 19:30

Wait until 5.4 is released. (Shamelessly copied from here)

If you build PHP yourself, you should be able to make the change to zend_language_scanner.l like so. I suspect the file should be there in 5.3.x

share|improve this answer

Your Answer


