3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $classes = get_declared_classes(); $implementsIface = array(); foreach($classes as $klass) { $reflect = new ReflectionClass($klass); if($reflect->implementsInterface('JsonSerializable')) $implementsIface [] = $klass; } print_r($implementsIface);
based on 2I3I0
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
Array ( )
Output for hhvm-3.12.0
Array ( [0] => HH\Client\TypecheckResult )
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.3 - 5.3.29
Fatal error: Uncaught exception 'ReflectionException' with message 'Interface JsonSerializable does not exist' in /in/EfW69:6 Stack trace: #0 /in/EfW69(6): ReflectionClass->implementsInterface('JsonSerializabl...') #1 {main} thrown in /in/EfW69 on line 6
Process exited with code 255.
Output for 5.0.1 - 5.0.2
Fatal error: Uncaught exception 'ReflectionException' with message 'Interface JsonSerializable does not exist' in /in/EfW69:6 Stack trace: #0 {main} thrown in /in/EfW69 on line 6
Process exited with code 255.
Output for 5.0.0
Fatal error: Uncaught exception 'ReflectionException' with message 'Interface JsonSerializable doesn't exist' in /in/EfW69:6 Stack trace: #0 {main} thrown in /in/EfW69 on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: reflectionclass in /in/EfW69 on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: reflectionclass in /in/EfW69 on line 5