3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php /** * Inject invalid Classnames into autoload */ function __autoload($classname) { echo "[Injected:", $classname, "]"; } $class = 'Librarize_..\\..\\/\\PSR-0\\RoACKs'; echo 'class_exists() ', class_exists($class), "\n"; 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_subclass_of(,,true) ', is_subclass_of($class, $class, true), "\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 5.4.24 - 7.1.0
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_subclass_of(,,true) method_exists() property_exists() trait_exists() new ReflectionClass()
Output for 5.4.0 - 5.4.23
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_subclass_of(,,true) [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_subclass_of(,,true) [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.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/KJ2TM on line 29 is_subclass_of(,,true) Warning: is_subclass_of() expects exactly 2 parameters, 3 given in /in/KJ2TM on line 31 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.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/KJ2TM on line 29 Warning: Wrong parameter count for is_a() in /in/KJ2TM on line 29 is_subclass_of(,,true) Warning: Wrong parameter count for is_subclass_of() in /in/KJ2TM on line 31 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.2 - 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/KJ2TM on line 29 Warning: Wrong parameter count for is_a() in /in/KJ2TM on line 29 is_subclass_of(,,true) Warning: Wrong parameter count for is_subclass_of() in /in/KJ2TM on line 31 method_exists() property_exists() Fatal error: Call to undefined function property_exists() in /in/KJ2TM on line 35
Process exited with code 255.
Output for 5.0.0 - 5.0.1
class_exists() [Injected:Librarize_..\..\/\PSR-0\RoACKs] interface_exists() Fatal error: Call to undefined function interface_exists() in /in/KJ2TM on line 15
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/KJ2TM on line 43
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '{' in /in/KJ2TM on line 43
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/KJ2TM on line 43
Process exited with code 255.