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.3.1
39 constants in Foo, Foo extends IntlCalendar 39 constants in IntlGregorianCalendar, IntlGregorianCalendar extends IntlCalendar 39 constants in IntlCalendar
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