This article is about introducing the two new features of ?: and ?? in PHP, and using code to explain them. Interested friends can learn about them.
?: and ?? are new features added by PHP. We can understand it through the following code
$z = $x ?? $y; //等价于下面 $z = isset($x) ? $x : $y; $z = $x ?: $y; //等价于下面 $z = $x ? $x : $y;
If you want to know more about PHP, please pay attention to PHP on the PHP Chinese website Video tutorial.
The above is the detailed content of The difference between ?: and ?? among the new features of PHP7. For more information, please follow other related articles on the PHP Chinese website!