3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = 4; function myFunction () { if (!func_num_args()) { $input = $GLOBALS['foo']; } else { $input = func_get_arg(0); } echo "$input\n"; } myFunction('hello'); myFunction();

preferences:
23.44 ms | 404 KiB | 5 Q