From cbba996ea6a21bc80f0655ec83e17058e6351646 Mon Sep 17 00:00:00 2001 From: ftwbzhao Date: Tue, 17 Nov 2015 00:11:47 +0800 Subject: [PATCH] [Basic]Ternary operators inform minor change --- pages/The-Basics.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pages/The-Basics.md b/pages/The-Basics.md index 9628b60..a3a3886 100644 --- a/pages/The-Basics.md +++ b/pages/The-Basics.md @@ -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; {% 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) ## Variable declarations