ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

PHP Side "chat" -- PHP Short Tags

January 19, 2010 11:08am

Subscribe [2]
  • #1 / Jan 19, 2010 11:08am

    dmyers

    43 posts

    Are short tags going away in PHP 6 or not? I read only <% (ASP style) but, another developer I know just made a big stink because I “still use short tags”.

    I noticed Zend Framework uses them a lot and, in there documentation they actually recommend it!

    61.1.4. Short Tags with View Scripts

    In our examples and documentation, we make use of PHP short tags: <? and <?=. In addition, we typically use the alternate syntax for control structures. These are convenient shorthands to use when writing view scripts, as they make the constructs more terse, and keep statements on single lines.

    Seem odd that Zend would recommend it if they are taking them away???

    I also noticed EE 2.0 has over 9999+ (maximum textwrangler will find) short tags in use at this time.

    Comments, Thoughts, References - Anyone???

  • #2 / Jan 20, 2010 9:39am

    Actually, we (ZF, for which I am project lead) no longer recommend short tags. Because short tags are configurable, and because you can only change the configuration at the php.ini or vhost level, using them is a portability problem. While we do have an emulation layer for them via PHP streams, we’ve found it’s simply easier to recommend using regular “long” tags, and we’ve updated the examples in our manual to use them as well.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases