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:
49.35 ms | 982 KiB | 5 Q