3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class test { private $f; public function __construct(&$f) { $this->f = &$f; } public function __destruct() { $this->f = 1; } } $f = function () use (&$f) { $t = new test($f); print 1; }; var_dump($f);
Output for 5.3.3 - 7.3.0rc4
object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> *RECURSION* } }
Output for 5.3.1 - 5.3.2
object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> *RECURSION* } } } }
Output for 5.3.0
object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> &object(Closure)#1 (1) { ["static"]=>
Process exited with code 137.