What are the differences between PHP 5.6 and PHP 7 in terms of syntax and functionality?

PHP 7 introduced several new features and improvements over PHP 5.6, including improved performance, scalar type declarations, return type declarations, null coalescing operator, spaceship operator, anonymous classes, and more. These changes impact syntax and functionality, making PHP 7 code more modern, efficient, and easier to maintain.

// PHP 5.6 code
function addNumbers($num1, $num2) {
    return $num1 + $num2;
}

// PHP 7 code
function addNumbers(int $num1, int $num2): int {
    return $num1 + $num2;
}