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:
58.84 ms | 1039 KiB | 5 Q