3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class a { function __destruct() { echo "DESTRUCTOR A CALLED\r\n"; } } class b { var $a; function __construct() { $a = new a(); } function __destruct() { echo "DESTRUCTOR B CALLED\r\n"; } } new b();
Output for 5.1.3 - 7.1.0
DESTRUCTOR A CALLED DESTRUCTOR B CALLED
Output for 5.0.0 - 5.1.2
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/1lCRC on line 11 DESTRUCTOR A CALLED DESTRUCTOR B CALLED
Output for 4.3.0 - 4.4.9