3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait foo { } class bar { use foo; } print_r(class_uses(new bar)); print_r(class_uses('bar')); function __autoload($class_name) { require_once $class_name . '.php'; } // use __autoload to load the 'not_loaded' class print_r(class_uses('not_loaded', true)); ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: __autoload() is no longer supported, use spl_autoload_register() instead in /in/dD0WN on line 12
Process exited with code 255.
Output for 7.4.33
Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in /in/dD0WN on line 12 Array ( [foo] => foo ) Array ( [foo] => foo ) Warning: require_once(not_loaded.php): failed to open stream: No such file or directory in /in/dD0WN on line 13 Fatal error: require_once(): Failed opening required 'not_loaded.php' (include_path='.:') in /in/dD0WN on line 13
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.25, 7.4.27 - 7.4.32
Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in /in/dD0WN on line 12 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/dD0WN on line 13 Warning: require_once(not_loaded.php): failed to open stream: Operation not permitted in /in/dD0WN on line 13 Fatal error: require_once(): Failed opening required 'not_loaded.php' (include_path='.:') in /in/dD0WN on line 13
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.3.32 - 7.3.33, 7.4.26
Array ( [foo] => foo ) Array ( [foo] => foo ) Warning: require_once(not_loaded.php): failed to open stream: No such file or directory in /in/dD0WN on line 13 Fatal error: require_once(): Failed opening required 'not_loaded.php' (include_path='.:') in /in/dD0WN on line 13
Process exited with code 255.
Output for 7.1.25 - 7.1.33
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/dD0WN on line 13 Warning: require_once(not_loaded.php): failed to open stream: Operation not permitted in /in/dD0WN on line 13 Fatal error: require_once(): Failed opening required 'not_loaded.php' (include_path='.:') in /in/dD0WN on line 13
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/dD0WN on line 13 Warning: require_once(not_loaded.php): failed to open stream: Operation not permitted in /in/dD0WN on line 13 Fatal error: require_once(): Failed opening required 'not_loaded.php' (include_path='.:') in /in/dD0WN on line 13
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/dD0WN on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_STRING in /in/dD0WN on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/dD0WN on line 3
Process exited with code 255.

preferences:
273.78 ms | 401 KiB | 396 Q