3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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; true; $i++) { //$deep_clone = unserialize(serialize($foo)); $deep_clone = clone $foo; gc_collect_cycles(); var_dump($i); }

Verbose script

This script was stopped because it was generating too much output