3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Test { static function blah() { $get_closure = function() { return function(){ echo $this->bobo; } }; $a = new static($get_closure()); return $a; } public $clos; public $bobo = 22; function __construct(\Closure $c) { $this->clos = $c->bindTo($this, $this); } } $a = Test::blah(); $ss = $a->clos; $ss();
Output for 5.3.0 - 5.4.14
Parse error: syntax error, unexpected '}' in /in/MLOl6 on line 8
Process exited with code 255.