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

by posted in Submission Tips
Jun 27

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!

  1. mediabeast on the 27th June

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

  2. Luke Smith on the 27th June

    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?

  3. Matt on the 27th June

    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.

  4. Duotive on the 27th June

    Never used them just because of this problem :)

  5. chrl on the 29th June

    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.

leave a comment