3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: __autoload() is no longer supported, use spl_autoload_register() instead in /in/YAinM on line 13
Process exited with code 255.
Output for 7.2.0, 7.4.33
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 7.2.29 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.32
Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in /in/YAinM on line 13 Array ( [foo] => foo ) Array ( [foo] => foo ) Warning: require_once(): open_basedir restriction in effect. File(not_loaded.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/YAinM on line 14 Warning: require_once(not_loaded.php): failed to open stream: Operation not permitted 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.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.3.32 - 7.3.33
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 7.2.6
Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in /in/YAinM on line 13 Array ( [foo] => foo ) Array ( [foo] => foo ) Warning: require_once(): open_basedir restriction in effect. File(not_loaded.php) is not within the allowed path(s): (/tmp:/in) in /in/YAinM on line 14 Warning: require_once(not_loaded.php): failed to open stream: Operation not permitted 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 7.1.20
Array ( [foo] => foo ) Array ( [foo] => foo ) Warning: require_once(): open_basedir restriction in effect. File(not_loaded.php) is not within the allowed path(s): (/tmp:/in) in /in/YAinM on line 14 Warning: require_once(not_loaded.php): failed to open stream: Operation not permitted 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.

preferences:
154.52 ms | 402 KiB | 183 Q