-1

In coding i always write

<?= $this->description?> rather than <?php echo $this->description ?>

it is little bit faster and easier. However, after i started using zend framework, i couldn't use that feature. so do you have any idea about it.

Doksh
  • 143
  • 2
  • 13
  • 2
    http://www.php.net/manual/en/ini.core.php#ini.short-open-tag – Jon Apr 08 '13 at 08:32
  • What error do you get? – Matteo Tassinari Apr 08 '13 at 08:33
  • 1
    My idea is that you should probably stop using short tags. Otherwise, you can look for the php.ini file and set short tags to be on: http://stackoverflow.com/questions/2185320/how-to-enable-php-short-tags – Stegrex Apr 08 '13 at 08:33
  • Also read this discussion on why it's oftentimes not a good idea to use them: http://stackoverflow.com/questions/200640/are-php-short-tags-acceptable-to-use – Stegrex Apr 08 '13 at 08:34
  • Looking through all the answers I was amazed that no one opted in that [from PHP 5.4.0 the short_open_tag directive does not include the short echo tag](http://goo.gl/N6Pyi) **`= $example;?>`**! This is very important as the use of all other short tags is considered futile. Anyway the use of the short echo tag is encouraged from now on. It does provide for a smoother and tidier code-base - esp. in view files. So _for PHP >= 5.4.0_ **`= ?>`** can be used **without setting** `short_open_tag`. Please do not use the other short tags in your code. The code-Gods get very angry when you do so... – Borislav Sabev Apr 08 '13 at 22:16

1 Answers1

-1

You need to enable the short_open_tag option in the configuration file php.ini. Short tags are disabled by default.

fredrik
  • 6,483
  • 3
  • 35
  • 45