3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { static function blah() { $class = static; $a = new $class(function(){ echo $this->bobo; }); 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.4.0 - 5.4.14
Parse error: syntax error, unexpected ';', expecting :: (T_PAAMAYIM_NEKUDOTAYIM) in /in/4D7WV on line 8
Process exited with code 255.
Output for 5.3.0 - 5.3.24
Parse error: syntax error, unexpected ';', expecting T_PAAMAYIM_NEKUDOTAYIM in /in/4D7WV on line 8
Process exited with code 255.

preferences:
164.49 ms | 1395 KiB | 47 Q