Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

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.