我在违反直觉的错误/属性上有盖章。
class xxx{
public ?int $a, $b;
public function __construct($a, $b){
$this->a = $a;
$this->b = $b;
}
}
new xxx(null, 10); //Working
new xxx(10, null); //Not working
有人可以向我解释为什么第二行不起作用。
PHP 版本 7.4.2。