3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $value; public function __construct($value) { $this->value = $value; } public function Weeee() { $that = &$this; return function() use ($that) { return str_repeat($that->value, 1000); }; } } $foo = new Foo('stuff'); $func = $foo->Weeee() echo $func();
Output for 5.4.0 - 5.4.17, 5.5.0 - 5.5.1
Parse error: syntax error, unexpected 'echo' (T_ECHO) in /in/jFCij on line 23
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_ECHO in /in/jFCij on line 23
Process exited with code 255.

preferences:
182.09 ms | 1395 KiB | 55 Q