Short Ternary Operator
With the release of PHP 5.3.0 there is an option to shorten the ternary operator.
So, if we start with variable $foo, which is true ($foo = true), instead of writing:
$bar = $foo ? true : false; // $bar = true
you can easily shorten it like this
$bar = $foo ?: false // $bar = true
The bad side of using a short ternary operator is that most of PHP IDEs are marking it as syntax error (well, at least for now)
Comments Off