3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Container { protected $s=array(); function __set($k, $c) { $this->s[$k]=$c; } function __get($k) { return $this->s[$k]($this); } } $c = new Container; $c->something = function(){ var_dump("A"); return 'StdClass'; }; $k = $c->something
Output for 5.4.0 - 5.4.12
Parse error: syntax error, unexpected end of file in IZKa5 on line 16
Process exited with code 255.
Output for 5.3.0 - 5.3.22
Parse error: syntax error, unexpected $end in IZKa5 on line 16
Process exited with code 255.

preferences:
172.77 ms | 1395 KiB | 43 Q