3v4l.org

run code in 200+ PHP versions simultaneously
<?php const DEFAULT_VALUE = null; function foo(\stdClass $arg = DEFAULT_VALUE) { var_dump($arg); } var_dump((new ReflectionFunction('foo'))->getParameters()[0]->allowsNull()); foo(null);
based on 2ivFW
Output for 5.6.38 - 7.4.1
bool(false) NULL