3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php /** * Inject invalid classname 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 (false) { # does work but crashes echo "new \$class "; try{new $class;}catch (Exception $e) {}; echo "\n"; } if (class_exists('ReflectionClass')) { echo 'new ReflectionClass() '; try {new ReflectionClass($class);} catch(Exception $e) {}; echo "\n"; } # Not Working (Tested against a single, quite recent PHP version): # unserialize # get_object_vars #
Output for 5.4.24 - 5.6.28, hhvm-3.12.0, 7.0.0 - 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_a(,) is_subclass_of(,,true) is_subclass_of(,,) method_exists() property_exists() trait_exists() new ReflectionClass()
Output for hhvm-3.10.0

Process exited with code 153.
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_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/LSusL 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/LSusL 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/LSusL on line 31 is_a(,) is_subclass_of(,,true) Warning: is_subclass_of() expects exactly 2 parameters, 3 given in /in/LSusL on line 35 is_subclass_of(,,) [Injected:Librarize_..\..\/\PSR-0\RoACKs] Warning: Unknown class passed as parameter in /in/LSusL 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.1 - 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/LSusL on line 31 Warning: Wrong parameter count for is_a() in /in/LSusL on line 31 is_a(,) Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /in/LSusL on line 33 is_subclass_of(,,true) Warning: Wrong parameter count for is_subclass_of() in /in/LSusL on line 35 is_subclass_of(,,) [Injected:Librarize_..\..\/\PSR-0\RoACKs] Warning: Unknown class passed as parameter in /in/LSusL 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
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/LSusL on line 63
Process exited with code 255.
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/LSusL on line 31 Warning: Wrong parameter count for is_a() in /in/LSusL on line 31 is_a(,) Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /in/LSusL on line 33 is_subclass_of(,,true) Warning: Wrong parameter count for is_subclass_of() in /in/LSusL on line 35 is_subclass_of(,,) [Injected:Librarize_..\..\/\PSR-0\RoACKs] Warning: Unknown class passed as parameter in /in/LSusL on line 37 method_exists() property_exists() Fatal error: Call to undefined function property_exists() in /in/LSusL 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/LSusL on line 31 Warning: Wrong parameter count for is_a() in /in/LSusL on line 31 is_a(,) Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /in/LSusL on line 33 is_subclass_of(,,true) Warning: Wrong parameter count for is_subclass_of() in /in/LSusL on line 35 is_subclass_of(,,) method_exists() property_exists() Fatal error: Call to undefined function property_exists() in /in/LSusL 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/LSusL on line 31 Warning: Wrong parameter count for is_a() in /in/LSusL on line 31 is_a(,) Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /in/LSusL on line 33 is_subclass_of(,,true) Warning: Wrong parameter count for is_subclass_of() in /in/LSusL on line 35 is_subclass_of(,,) method_exists() property_exists() Fatal error: Call to undefined function property_exists() in /in/LSusL on line 41
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/LSusL on line 50
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/LSusL on line 50
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/LSusL on line 50
Process exited with code 255.