3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { public null $property = null; } function foo(null $param): null { return null; } $a = new A(); var_dump($a->property); var_dump(foo(null));
Output for 8.2.0 - 8.2.30, 8.3.5 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
NULL NULL
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.34
Fatal error: Null can not be used as a standalone type in /in/kI7KP on line 5
Process exited with code 255.

preferences:
66.08 ms | 978 KiB | 4 Q