2

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.

Ben Pilbrow
  • 12,041
  • 5
  • 36
  • 57
p4bl0
  • 121
  • 3

2 Answers2

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.

Jay
  • 6,544
  • 25
  • 34
1

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

DerfK
  • 19,493
  • 2
  • 38
  • 54