3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public function f() { static function ($x) { var_dump($x); }; $x(1); } } (new A())->f();
based on 1ilFL
Output for 7.0.0 - 7.3.0rc3
Notice: Undefined variable: x in /in/jEFvM on line 6 Fatal error: Uncaught Error: Function name must be a string in /in/jEFvM:6 Stack trace: #0 /in/jEFvM(10): A->f() #1 {main} thrown in /in/jEFvM on line 6
Process exited with code 255.
Output for hhvm-3.15.4
Notice: Undefined variable: x in /in/jEFvM on line 6 Fatal error: Uncaught Error: Function name must be a string in /in/jEFvM:6 Stack trace: #0 /in/jEFvM(10): A->f() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Notice: Undefined variable: x in /in/jEFvM on line 6 Fatal error: Function name must be a string in /in/jEFvM on line 6
Process exited with code 255.