Null coalescing operator (??) has been introduced in PHP 7.This is replacement of ternary operator in conjunction with isset() function.It (??) returns its first operand if it exists and not NULL; otherwise it returns its second operand.
$varible = $a ?? $b; // return value of $a if it exist and not null.
<?php // if $_GET['salary'] does not exist.It will return 100000. $salary = $_GET['salary'] ?? '100000'; // This is equivalent to: $salary = isset($_GET['salary']) ? $_GET['salary'] : '100000'; ?>
Spaceship Operator has been introduced in PHP 7.It returns -1, 0 or 1 when varible $a is respectively less than, equal to, or greater than varible $b.
Scalar type declarations has been introduced in PHP 7. Scalar type declaration has following two option.
To define Array constants we used define() In PHP 7.In PHP 5.6, they could only be defined with const.