3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function __autoload($class) { var_dump("autoloading $class\n"); switch ($class) { case 'A': case 'B': class B extends C {}; break; case 'C': class C {}; class A extends B {}; break; } } echo (int) class_exists('A');
based on 00bIv
Output for 7.2.0
Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in /in/qhHTC on line 3 string(14) "autoloading A " string(14) "autoloading C " string(14) "autoloading B " Fatal error: Cannot declare class B, because the name is already in use in /in/qhHTC on line 10
Process exited with code 255.
Output for 7.0.0 - 7.1.10
string(14) "autoloading A " string(14) "autoloading C " string(14) "autoloading B " Fatal error: Cannot declare class B, because the name is already in use in /in/qhHTC on line 10
Process exited with code 255.
Output for 5.3.21 - 5.6.28
string(14) "autoloading A " string(14) "autoloading C " string(14) "autoloading B " Fatal error: Cannot redeclare class B in /in/qhHTC on line 10
Process exited with code 255.