Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.