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)(); } } (new Foo)->yesItDoes();
based on nccIC
Output for 7.0.0 - 7.2.0
hello world!
Output for 5.3.21 - 5.6.28
Parse error: syntax error, unexpected '(' in /in/Bl8th on line 12
Process exited with code 255.