3v4l.org

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