3v4l.org

run code in 500+ PHP versions simultaneously
<?php function foo(string $param = null) { var_dump($param); } function bar(\Foo\Bar|\Foo\Baz $param = null) { var_dump($param); } foo(null); bar(null);
Output for 8.1.11 - 8.1.34, 8.2.0 - 8.2.34, 8.3.0 - 8.3.35
NULL NULL
Output for 8.4.1 - 8.4.26, 8.5.0 - 8.5.11
Deprecated: foo(): Implicitly marking parameter $param as nullable is deprecated, the explicit nullable type must be used instead in /in/iBlne on line 2 Deprecated: bar(): Implicitly marking parameter $param as nullable is deprecated, the explicit nullable type must be used instead in /in/iBlne on line 3 NULL NULL

preferences:
32.21 ms | 1140 KiB | 9 Q