3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(gc_enabled()); $objstore = new SplObjectStorage(); $a = new StdClass; $b = new StdClass; $c = new StdClass; $a->b = $b; $b->a = $a; $c->b = $b; $b->c = $c; $objstore->attach($a); $objstore->attach($b); $objstore->attach($c); gc_collect_cycles(); var_dump($objstore); print serialize($objstore);
Output for git.master, git.master_jit, rfc.property-hooks
bool(true) object(SplObjectStorage)#1 (1) { ["storage":"SplObjectStorage":private]=> array(3) { [0]=> array(2) { ["obj"]=> object(stdClass)#2 (1) { ["b"]=> object(stdClass)#3 (2) { ["a"]=> *RECURSION* ["c"]=> object(stdClass)#4 (1) { ["b"]=> *RECURSION* } } } ["inf"]=> NULL } [1]=> array(2) { ["obj"]=> object(stdClass)#3 (2) { ["a"]=> object(stdClass)#2 (1) { ["b"]=> *RECURSION* } ["c"]=> object(stdClass)#4 (1) { ["b"]=> *RECURSION* } } ["inf"]=> NULL } [2]=> array(2) { ["obj"]=> object(stdClass)#4 (1) { ["b"]=> object(stdClass)#3 (2) { ["a"]=> object(stdClass)#2 (1) { ["b"]=> *RECURSION* } ["c"]=> *RECURSION* } } ["inf"]=> NULL } } } O:16:"SplObjectStorage":2:{i:0;a:6:{i:0;O:8:"stdClass":1:{s:1:"b";O:8:"stdClass":2:{s:1:"a";r:3;s:1:"c";O:8:"stdClass":1:{s:1:"b";r:4;}}}i:1;N;i:2;r:4;i:3;N;i:4;r:6;i:5;N;}i:1;a:0:{}}

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
30.09 ms | 404 KiB | 8 Q