3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo($bar = new DateTimeImmutabe('now')) { } $rf = new \ReflectionFunction('foo'); $rp = $rf->getParameters()[0]; var_dump((string) $rp);
Output for 8.1.8 - 8.1.30, 8.2.22 - 8.2.25, 8.3.5 - 8.3.13
string(63) "Parameter #0 [ <optional> $bar = new \DateTimeImmutabe('now') ]"

preferences:
52.57 ms | 406 KiB | 5 Q