3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class foo { } class bar extends foo {} print_r(class_parents(new bar)); // since PHP 5.1.0 you may also specify the parameter as a string print_r(class_parents('bar')); function __autoload($class_name) { require_once $class_name . '.php'; } // use __autoload to load the 'not_loaded' class print_r(class_parents('not_loaded', true)); ?>
Output for 7.2.0
Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in /in/YAinM on line 13 Array ( [foo] => foo ) Array ( [foo] => foo ) Warning: require_once(not_loaded.php): failed to open stream: No such file or directory in /in/YAinM on line 14 Fatal error: require_once(): Failed opening required 'not_loaded.php' (include_path='.:') in /in/YAinM on line 14
Process exited with code 255.
Output for 5.3.20 - 7.1.10
Array ( [foo] => foo ) Array ( [foo] => foo ) Warning: require_once(not_loaded.php): failed to open stream: No such file or directory in /in/YAinM on line 14 Fatal error: require_once(): Failed opening required 'not_loaded.php' (include_path='.:') in /in/YAinM on line 14
Process exited with code 255.