1--TEST-- 2Invariant parameter and return types work with nullable types 3--FILE-- 4<?php 5 6interface A { 7 function method(?int $i): ?int; 8} 9 10class B implements A { 11 function method(?int $i): ?int { 12 return $i; 13 } 14} 15 16$b = new B(); 17var_dump($b->method(null)); 18var_dump($b->method(1)); 19--EXPECT-- 20NULL 21int(1) 22