3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { function __destruct() { echo "a dtor\n"; $GLOBALS['b']->doSomething(); } } class B { function __destruct() { echo "b dtor\n"; } function doSomething() { echo "b still alive\n"; } } $b = new B; $a = new A;
Output for 5.2.0 - 5.6.28, 7.0.0 - 7.1.0
a dtor b still alive b dtor
Output for 5.0.0 - 5.1.6, hhvm-3.10.0 - 3.12.0
b dtor a dtor b still alive
Output for 4.3.0 - 4.4.9