3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { private $f; public function __construct(&$f) { $this->f = &$f; } public function __destruct() { $this->f = "Some random string"; } } $f = function () use (&$f) { $t = new test($f); print "after this parent $f shouldn't be a closure anymore...\n"; }; $f(); var_dump($f);

preferences:
42.28 ms | 402 KiB | 5 Q