3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Thing { public function stuff() { $lamda = new Closure(); var_dump(spl_object_hash($lambda)); } } $x = new Thing(); $x->stuff(); $x->stuff();
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Instantiation of 'Closure' is not allowed in /in/9pQc0:5 Stack trace: #0 /in/9pQc0(11): Thing->stuff() #1 {main} thrown in /in/9pQc0 on line 5
Process exited with code 255.
Output for 5.3.20 - 5.6.28
Catchable fatal error: Instantiation of 'Closure' is not allowed in /in/9pQc0 on line 5
Process exited with code 255.