3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { private $callable; public function __construct() { $this->callable = function () { echo "hello world!"; }; } public function yesItDoes() { $this->callable->call(); } } (new Foo)->yesItDoes();
based on nccIC
Output for 7.0.0 - 7.2.0
Warning: Closure::call() expects at least 1 parameter, 0 given in /in/K14qb on line 12
Output for 5.5.0 - 5.6.28
Fatal error: Call to undefined method Closure::call() in /in/K14qb on line 12
Process exited with code 255.