mirror of
https://github.com/codeguy/php-the-right-way.git
synced 2025-08-08 06:56:33 +02:00
[Basic]Ternary operators inform minor change
This commit is contained in:
@@ -385,6 +385,9 @@ Another example is the snippet below which will return true if ($a != 3 AND $b !
|
|||||||
return ($a != 3 && $b != 4) || $c == 5;
|
return ($a != 3 && $b != 4) || $c == 5;
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
* [Ternary operators](http://php.net/language.operators.comparison)
|
* [Ternary operators](http://php.net/language.operators.comparison)
|
||||||
|
|
||||||
## Variable declarations
|
## Variable declarations
|
||||||
|
Reference in New Issue
Block a user