3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $obj = new stdClass(); $obj->callback = function() { print "HelloWorld!"; }; print_r($obj); $obj->callback();
Output for 7.0.0 - 7.3.0rc3
stdClass Object ( [callback] => Closure Object ( ) ) Fatal error: Uncaught Error: Call to undefined method stdClass::callback() in /in/f0ivB:8 Stack trace: #0 {main} thrown in /in/f0ivB on line 8
Process exited with code 255.
Output for 5.5.0 - 5.6.23
stdClass Object ( [callback] => Closure Object ( ) ) Fatal error: Call to undefined method stdClass::callback() in /in/f0ivB on line 8
Process exited with code 255.