Quote:
"The declaration can be made to accept NULL values if the default value of the parameter is set to NULL."
But you can do this (PHP 7.1+):
<?php
function foo(?string $bar) {
//...
}
foo(); // Fatal error
foo(null); // Okay
foo('Hello world'); // Okay
?>