The examples in this article describe the use of PHP7 new operators. Share to everyone for your reference, specific as follows:
NULL merge operator
is actually a modification of the ternary operator, reducing the amount of code
Original Practice
//$lig = Isset ($_get[' Lig ')? $_get[' Lig ']: ' Bee ';
$lig = $_get[' Lig ']?? ' Bee ';
Echo $lig;
The Operation effect chart is as follows:
Spacecraft operator (combination comparison)
The essence is the size comparison character, but compared to the ' < ', ' > ' return value is more than 1, and Java string comparison CompareTo () function similar
<?php
Echo 1<=>1.1;
Print (php_eol);/newline character
echo "<br>";
Print (1.1<=>1);
echo "<br>";
echo 1<=> ' 1 ';
The Operation effect chart is as follows:
More interested in PHP related content readers can view the site topics: "Introduction to PHP Basic Grammar", "PHP operation and operator Usage Summary", "PHP object-oriented Program Design Introductory Course", "PHP Network Programming Skills Summary", "PHP Array" operation Skills Encyclopedia, " Summary of PHP string usage, Introduction to PHP+MYSQL database operations, and a summary of PHP common database operations Tips
I hope this article will help you with the PHP program design.