3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Source: https://bugs.php.net/bug.php?id=64896 class bad { private $_private = array(); public function __construct() { $this->_private[] = 'oh noes'; } public function __destruct() { //echo "bad::destructor\n"; global $bar; $bar = $this->_private; } } $foo = new stdclass; $foo->foo = $foo; $foo->bad = new bad; print_r($foo); gc_disable(); for ($i=0; $i<9; $i++) { $deep_clone = unserialize(serialize($foo)); gc_collect_cycles(); var_dump($i); }
Output for git.master, git.master_jit, rfc.property-hooks
stdClass Object ( [foo] => stdClass Object *RECURSION* [bad] => bad Object ( [_private:bad:private] => Array ( [0] => oh noes ) ) ) int(0) int(1) int(2) int(3) int(4) int(5) int(6) int(7) int(8)

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:
33.4 ms | 401 KiB | 8 Q