3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Inject invalid Classnames into autoload */ function __autoload($classname) { echo "[Injected:", $classname, "]"; } $class = 'Librarize_..\\..\\/\\PSR-0\\RoACKs'; echo 'class_exists() ', class_exists($class), "\n"; if (function_exists('interface_exists')) { echo 'interface_exists() ', interface_exists($class). "\n" ; } echo 'is_callable() ', is_callable($class . '::f()'), "\n"; echo 'call_user_func() ', @call_user_func(array($class, 'test')), "\n"; echo 'call_user_func_array() ', @call_user_func_array(array($class, 'test'), array()), "\n"; echo 'get_class_methods() ', get_class_methods($class), "\n"; echo 'get_class_vars() ', get_class_vars($class), "\n"; echo 'get_parent_class() ', get_parent_class($class), "\n"; echo 'is_a(,,true) ', is_a($class, $class, true), "\n"; echo 'is_a(,) ', is_a($class, $class), "\n"; echo 'is_subclass_of(,,true) ', is_subclass_of($class, $class, true), "\n"; echo 'is_subclass_of(,,) ', is_subclass_of($class, $class), "\n"; echo 'method_exists() ', method_exists($class, 'f'), "\n"; echo 'property_exists() ', property_exists($class, 'p'), "\n"; if (function_exists('trait_exists')) { echo 'trait_exists() ', trait_exists($class), "\n"; } if (class_exists('ReflectionClass')) { echo 'new ReflectionClass() '; try {new ReflectionClass($class);} catch(Exception $e) {}; echo "\n"; }
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/YXJjt on line 6
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in /in/YXJjt on line 6 class_exists() interface_exists() is_callable() call_user_func() call_user_func_array() get_class_methods() get_class_vars() get_parent_class() is_a(,,true) is_a(,) is_subclass_of(,,true) is_subclass_of(,,) method_exists() property_exists() trait_exists() new ReflectionClass()
Output for 5.4.24 - 5.4.45, 5.5.8 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.3.32 - 7.3.33
class_exists() interface_exists() is_callable() call_user_func() call_user_func_array() get_class_methods() get_class_vars() get_parent_class() is_a(,,true) is_a(,) is_subclass_of(,,true) is_subclass_of(,,) method_exists() property_exists() trait_exists() new ReflectionClass()
Output for 5.4.0 - 5.4.23, 5.5.0 - 5.5.7
class_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] interface_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] is_callable() [Injected:Librarize_..\..\/\PSR-0\RoACKs] call_user_func() [Injected:Librarize_..\..\/\PSR-0\RoACKs] call_user_func_array() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_class_methods() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_class_vars() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_parent_class() [Injected:Librarize_..\..\/\PSR-0\RoACKs] is_a(,,true) [Injected:Librarize_..\..\/\PSR-0\RoACKs] is_a(,) is_subclass_of(,,true) [Injected:Librarize_..\..\/\PSR-0\RoACKs] is_subclass_of(,,) [Injected:Librarize_..\..\/\PSR-0\RoACKs] method_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] property_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] trait_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] new ReflectionClass() [Injected:Librarize_..\..\/\PSR-0\RoACKs]
Output for 5.3.9 - 5.3.29
class_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] interface_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] is_callable() [Injected:Librarize_..\..\/\PSR-0\RoACKs] call_user_func() [Injected:Librarize_..\..\/\PSR-0\RoACKs] call_user_func_array() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_class_methods() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_class_vars() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_parent_class() [Injected:Librarize_..\..\/\PSR-0\RoACKs] is_a(,,true) [Injected:Librarize_..\..\/\PSR-0\RoACKs] is_a(,) is_subclass_of(,,true) [Injected:Librarize_..\..\/\PSR-0\RoACKs] is_subclass_of(,,) [Injected:Librarize_..\..\/\PSR-0\RoACKs] method_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] property_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] new ReflectionClass() [Injected:Librarize_..\..\/\PSR-0\RoACKs]
Output for 5.3.7 - 5.3.8
class_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] interface_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] is_callable() [Injected:Librarize_..\..\/\PSR-0\RoACKs] call_user_func() [Injected:Librarize_..\..\/\PSR-0\RoACKs] call_user_func_array() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_class_methods() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_class_vars() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_parent_class() [Injected:Librarize_..\..\/\PSR-0\RoACKs] is_a(,,true) Warning: is_a() expects exactly 2 parameters, 3 given in /in/YXJjt on line 31 is_a(,) [Injected:Librarize_..\..\/\PSR-0\RoACKs] is_subclass_of(,,true) Warning: is_subclass_of() expects exactly 2 parameters, 3 given in /in/YXJjt on line 35 is_subclass_of(,,) [Injected:Librarize_..\..\/\PSR-0\RoACKs] method_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] property_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] new ReflectionClass() [Injected:Librarize_..\..\/\PSR-0\RoACKs]
Output for 5.3.0 - 5.3.6
class_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] interface_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] is_callable() [Injected:Librarize_..\..\/\PSR-0\RoACKs] call_user_func() [Injected:Librarize_..\..\/\PSR-0\RoACKs] call_user_func_array() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_class_methods() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_class_vars() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_parent_class() [Injected:Librarize_..\..\/\PSR-0\RoACKs] is_a(,,true) Warning: is_a() expects exactly 2 parameters, 3 given in /in/YXJjt on line 31 is_a(,) is_subclass_of(,,true) Warning: is_subclass_of() expects exactly 2 parameters, 3 given in /in/YXJjt on line 35 is_subclass_of(,,) [Injected:Librarize_..\..\/\PSR-0\RoACKs] Warning: Unknown class passed as parameter in /in/YXJjt on line 37 method_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] property_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] new ReflectionClass() [Injected:Librarize_..\..\/\PSR-0\RoACKs]
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
class_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] interface_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] is_callable() [Injected:Librarize_..\..\/\PSR-0\RoACKs] call_user_func() [Injected:Librarize_..\..\/\PSR-0\RoACKs] call_user_func_array() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_class_methods() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_class_vars() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_parent_class() [Injected:Librarize_..\..\/\PSR-0\RoACKs] is_a(,,true) Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /in/YXJjt on line 31 Warning: Wrong parameter count for is_a() in /in/YXJjt on line 31 is_a(,) Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /in/YXJjt on line 33 is_subclass_of(,,true) Warning: Wrong parameter count for is_subclass_of() in /in/YXJjt on line 35 is_subclass_of(,,) [Injected:Librarize_..\..\/\PSR-0\RoACKs] Warning: Unknown class passed as parameter in /in/YXJjt on line 37 method_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] property_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] new ReflectionClass() [Injected:Librarize_..\..\/\PSR-0\RoACKs]
Output for 5.0.3 - 5.0.5
class_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] interface_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] is_callable() call_user_func() [Injected:Librarize_..\..\/\PSR-0\RoACKs] call_user_func_array() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_class_methods() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_class_vars() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_parent_class() [Injected:Librarize_..\..\/\PSR-0\RoACKs] is_a(,,true) Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /in/YXJjt on line 31 Warning: Wrong parameter count for is_a() in /in/YXJjt on line 31 is_a(,) Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /in/YXJjt on line 33 is_subclass_of(,,true) Warning: Wrong parameter count for is_subclass_of() in /in/YXJjt on line 35 is_subclass_of(,,) [Injected:Librarize_..\..\/\PSR-0\RoACKs] Warning: Unknown class passed as parameter in /in/YXJjt on line 37 method_exists() property_exists() Fatal error: Call to undefined function property_exists() in /in/YXJjt on line 41
Process exited with code 255.
Output for 5.0.2
class_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] interface_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] is_callable() call_user_func() [Injected:Librarize_..\..\/\PSR-0\RoACKs] call_user_func_array() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_class_methods() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_class_vars() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_parent_class() [Injected:Librarize_..\..\/\PSR-0\RoACKs] is_a(,,true) Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /in/YXJjt on line 31 Warning: Wrong parameter count for is_a() in /in/YXJjt on line 31 is_a(,) Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /in/YXJjt on line 33 is_subclass_of(,,true) Warning: Wrong parameter count for is_subclass_of() in /in/YXJjt on line 35 is_subclass_of(,,) method_exists() property_exists() Fatal error: Call to undefined function property_exists() in /in/YXJjt on line 41
Process exited with code 255.
Output for 5.0.0 - 5.0.1
class_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] is_callable() call_user_func() [Injected:Librarize_..\..\/\PSR-0\RoACKs] call_user_func_array() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_class_methods() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_class_vars() [Injected:Librarize_..\..\/\PSR-0\RoACKs] get_parent_class() [Injected:Librarize_..\..\/\PSR-0\RoACKs] is_a(,,true) Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /in/YXJjt on line 31 Warning: Wrong parameter count for is_a() in /in/YXJjt on line 31 is_a(,) Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /in/YXJjt on line 33 is_subclass_of(,,true) Warning: Wrong parameter count for is_subclass_of() in /in/YXJjt on line 35 is_subclass_of(,,) method_exists() property_exists() Fatal error: Call to undefined function property_exists() in /in/YXJjt on line 41
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/YXJjt on line 49
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
Parse error: parse error, unexpected '{' in /in/YXJjt on line 49
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/YXJjt on line 49
Process exited with code 255.

preferences:
233.72 ms | 401 KiB | 393 Q