3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $func = function($a) { return $a + 2; }; $func = function($a) use($func) { return $func() * 2; }; var_dump( $func(2) );
based on JbuT1
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function {closure}(), 0 passed in /in/vaC15 on line 8 and exactly 1 expected in /in/vaC15:3 Stack trace: #0 /in/vaC15(8): {closure}() #1 /in/vaC15(11): {closure}(2) #2 {main} thrown in /in/vaC15 on line 3
Process exited with code 255.
Output for 5.3.19 - 7.0.20
Warning: Missing argument 1 for {closure}(), called in /in/vaC15 on line 8 and defined in /in/vaC15 on line 3 Notice: Undefined variable: a in /in/vaC15 on line 4 int(4)