3v4l.org

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