Submission Tip: Don’t Use Short PHP Tags (TF)

 5   Tweet

Howdy talented authors! In this ongoing quest for more transparency, here I am, again, with more juicy tidbits about the reviewing process. More specifically, I’d like to address some issues that seem to be tripping up a lot of authors. In the interest of brevity, I won’t go too much into the issues themselves since they’re a single search away.

This time we look at short PHP tags.

This is more a language issue than a WordPress issue. Refrain from using PHP short tags in your code. Support for these isn’t universal, and it’s better to take the safe way and start using the longer, universally compatible long form.

Chime in at the comments if you have any questions and thanks for reading!

  • http://www.mediabeast.co.nz mediabeast

    I think there is a place for short tags, and it’s very easy to turn them on? but I could be delusional :)

  • http://hishandiwork.biz Luke Smith

    I never really understood why people even use short php tags… the only difference is omitting “php” in the tag. Is this mainly because it’s easier to type, or do they think it’s more readable?

  • http://drollette.com Matt

    It looks like they are going to be always enabled in PHP >=5.4 so they won’t be such an evil at that point.

    https://wiki.php.net/rfc/shortags

  • http://www.duotive.com Duotive

    Never used them just because of this problem :)

  • http://chrl.ru/ chrl

    I also can recommend not to use closing php tag at the end of the php file. Sometimes unnoticable space character can hide himself after closing php tag, and spoil all view.