3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(callable $fn): void { // do something with $fn, call it maybe $fn(); } foo(static function (): void { echo 'hello world'; });
Output for 8.1.34, 8.2.27 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
hello world

preferences:
70.27 ms | 406 KiB | 5 Q