3v4l.org

run code in 150+ 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 - 5.6.28, 7.0.0 - 7.1.0
object(Closure)#1 (1) { ["static"]=> array(1) { ["f"]=> *RECURSION* } }
Output for hhvm-3.12.0
object(Closure$__destruct;1246382654$c95c02746a488a0adae97bfd1017c908$)#1 (1) { ["static"]=> array(1) { ["f"]=> *RECURSION* } }
Output for hhvm-3.10.0
object(Closure$__destruct;1246382654$61d6bbf029a770e9cda4374817e49bf1$)#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.