3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { private $a = 42; } $closure = function() { var_dump($this->a); }; $closure->call(new Foo);
based on U2rOF
Output for 7.0.0 - 7.2.0
int(42)
Output for 5.4.0 - 5.6.28
Fatal error: Call to undefined method Closure::call() in /in/mruUY on line 6
Process exited with code 255.