Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php 7.1 functions parameters with "?"

function sayHello(?string $name) {
    echo "Hello " . $name . PHP_EOL;
}
sayHello(null); // Hello
sayHello("John"); //Hello John
Source by blog.shameerc.com #
 
PREVIOUS NEXT
Tagged: #php #functions #parameters
ADD COMMENT
Topic
Name
1+1 =