Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Did you correctly answer your own question? Looks like a syntax error to me. Commented May 24, 2014 at 16:07
  • 2
    @Popnoodles: No, that's valid syntax. It's called the shorthand ternary syntax. See the documentation: "Since PHP 5.3, it is possible to leave out the middle part of the ternary operator. Expression expr1 ?: expr3 returns expr1 if expr1 evaluates to TRUE, and expr3 otherwise.". Commented May 24, 2014 at 16:13
  • Ok thanks, I've never seen it before. So he answered his own question. Commented May 24, 2014 at 16:13