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();

preferences:
49.73 ms | 402 KiB | 5 Q