3v4l.org

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

preferences:
22.03 ms | 405 KiB | 5 Q