On 20/02/14 01:46, Brad Jorsch (Anomie) wrote:
On Wed, Feb 19, 2014 at 5:49 AM, Antoine Musso hashar+wmf@free.fr wrote:
- short ternary operator '?:' : haven't seen it
It's being used in a few places; probably a variation that was equivalent to isset( $foo ) ? $foo : $bar would see more use though.
On one code review when Aaron used ?:, he said that he was surprised that I didn't object to it. I said that it's basically the same as the "or" operator in Lua or JavaScript, and I think it's used quite elegantly in those languages.
I think it's ridiculous to refer to it as a ternary operator when it takes two operands, and by extension, in the PHP grammar, it should have been a single token binary operator ?: with space disallowed in between ? and :, but other than that, I am fine with it.
-- Tim Starling