3v4l.org

run code in 300+ PHP versions simultaneously
<?php use Foo\Bar; $f = function ($a = new Bar) {}; $r = new ReflectionFunction($f); $p = $r->getParameters()[0]; echo $p;
Output for 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.5 - 8.3.13
Parameter #0 [ <optional> $a = new \Foo\Bar() ]
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.29
Fatal error: Constant expression contains invalid operations in /in/F2bjF on line 5
Process exited with code 255.

preferences:
55.49 ms | 407 KiB | 5 Q