📜  将参数发送到 php 中的函数可以为空 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:06.340000             🧑  作者: Mango

代码示例1
function foo(?Type $t) {
}
this will result in

$this->foo(new Type()); // ok
$this->foo(null); // ok
$this->foo(); // error