php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75090 IntlGregorianCalendar doesn't have constants from parent class
Submitted: 2017-08-18 08:57 UTC Modified: 2017-08-23 22:14 UTC
From: kukulich at kukulich dot cz Assigned: tpunt
Status: Closed Package: intl (PECL)
PHP Version: 7.1.8 OS:
Private report: No CVE-ID:
 [2017-08-18 08:57 UTC] kukulich at kukulich dot cz
Description:
------------
IntlGregorianCalendar doesn't have constants from parent class.

See https://3v4l.org/N8Ets

Test script:
---------------
<?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);

Expected result:
----------------
39 constants in Foo, Foo extends IntlCalendar
39 constants in IntlGregorianCalendar, IntlGregorianCalendar extends IntlCalendar
39 constants in IntlCalendar

Actual result:
--------------
39 constants in Foo, Foo extends IntlCalendar
0 constants in IntlGregorianCalendar, IntlGregorianCalendar extends IntlCalendar
39 constants in IntlCalendar

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-08-23 22:14 UTC] tpunt@php.net
-Assigned To: +Assigned To: tpunt
 [2017-08-25 20:03 UTC] nikic@php.net
Automatic comment on behalf of tpunt@hotmail.co.uk
Revision: http://git.php.net/?p=php-src.git;a=commit;h=be9edd83c2b3119018611e178da0ee55f7b71c28
Log: Fixed bug #75090
 [2017-08-25 20:03 UTC] nikic@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Tue Aug 29 15:01:52 2017 UTC