3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo extends \IntlCalendar { } $fooReflection = new \ReflectionClass(\Foo::class); $intlGregorianCalendarReflection = new \ReflectionClass(\IntlGregorianCalendar::class); printf("%d constants in %s, ", count($fooReflection->getConstants()), \Foo::class); if ($fooReflection->getParentClass()) { printf("%s extends %s\n", Foo::class, $fooReflection->getParentClass()->getName()); } printf("%d constants in %s, ", count($intlGregorianCalendarReflection->getConstants()), \IntlGregorianCalendar::class); if ($intlGregorianCalendarReflection->getParentClass()) { printf("%s extends %s\n", \IntlGregorianCalendar::class, $intlGregorianCalendarReflection->getParentClass()->getName()); } printf("%d constants in %s\n", count((new \ReflectionClass(\IntlCalendar::class))->getConstants()), \IntlCalendar::class);
based on OdTOj
Output for hhvm-3.18.4 - 3.21.0, 7.1.20 - 7.2.6, 7.3.0rc3 - 7.3.0rc6
39 constants in Foo, Foo extends IntlCalendar 39 constants in IntlGregorianCalendar, IntlGregorianCalendar extends IntlCalendar 39 constants in IntlCalendar
Output for 7.3.0alpha1 - 7.3.0beta1
Fatal error: Uncaught Error: Class 'IntlCalendar' not found in /in/N8Ets:3 Stack trace: #0 {main} thrown in /in/N8Ets on line 3
Process exited with code 255.
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.8
39 constants in Foo, Foo extends IntlCalendar 0 constants in IntlGregorianCalendar, IntlGregorianCalendar extends IntlCalendar 39 constants in IntlCalendar