3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { private $x = 3; } $foo = new Foo; $foobar = function ($y) { var_dump($this->x + $y); }; $foobar->call($foo, 2); // int(5)
based on AupjH
Output for 7.0.0 - 7.2.6
int(5)
Output for 5.3.20 - 5.6.28
Fatal error: Call to undefined method Closure::call() in /in/MM6g0 on line 9
Process exited with code 255.