1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
--TEST-- Subtype can add nullability to a parameter (contravariance) --FILE-- <?php interface A { function method(int $p); } class B implements A { function method(?int $p) { } } $b = new B(); $b->method(null); --EXPECT--