3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = 5; function v(){ return function ($x){ echo $x; }; } $func = v(); $func();
based on QMbMQ
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function {closure}(), 0 passed in /in/pvIdn on line 13 and exactly 1 expected in /in/pvIdn:7 Stack trace: #0 /in/pvIdn(13): {closure}() #1 {main} thrown in /in/pvIdn on line 7
Process exited with code 255.
Output for 5.3.21 - 7.0.20
Warning: Missing argument 1 for {closure}(), called in /in/pvIdn on line 13 and defined in /in/pvIdn on line 7 Notice: Undefined variable: x in /in/pvIdn on line 8