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:
21.57 ms | 475 KiB | 4 Q