News for hackers. Stuff that matters.
Re:Higher Order PHP by IsaacSchlueter on Friday February 06, 2009 @07:48PM (#470645)
Ars, the point is that $var = $tom || 'ed'; is much less verbose than the alternatives.

More generally, it's just strange to me that || and && don't operate the same in PHP as they do in every other C-style language. Neither does the ternary if, for that matter.

Re:Higher Order PHP by salathe on Saturday February 07, 2009 @07:26AM (#471082)
PHP 5.3 (and/or 6, I forget) gives us

    $var = $tom ?: 'ed';
Re:Higher Order PHP by compay on Saturday February 07, 2009 @11:04PM (#471804)
I love how Groovy refers to that as the "Elvis" operator.