Answers for "php 7.1 functions parameters with "?""

PHP
0

php 7.1 functions parameters with "?"

function sayHello(?string $name) {
    echo "Hello " . $name . PHP_EOL;
}
sayHello(null); // Hello
sayHello("John"); //Hello John
Posted by: Guest on November-19-2020

Browse Popular Code Answers by Language