3v4l.org

run code in 500+ PHP versions simultaneously
<?php $foo = 'foo'; define('C', static fn (array $bar): array => [$foo, $bar]); var_dump((C)(['bar'])); #[SomeAttr(C)] function baz() {}

preferences:
71.93 ms | 1040 KiB | 5 Q