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'); echo $foo->Weeee()();

preferences:
37.49 ms | 402 KiB | 5 Q