3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL); $f=function($var){ echo "the closure test $var\n"; }; class Bla { public $foo; public function __construct($f){ $this->foo = $f; } } $bla = new Bla($f); ($bla->foo)("someval");
based on qRS19
Output for 7.0.0 - 7.2.0
the closure test someval
Output for 5.3.21 - 5.6.28
Parse error: syntax error, unexpected '(' in /in/PoatM on line 17
Process exited with code 255.