Bug #75242 [NEW]: RecursiveArrayIterator doesn't have constants from parent class
| From: | kukulich at kukulich dot cz | Date: | Thu, 21 Sep 2017 21:07:22 +0000 |
| Subject: | Bug #75242 [NEW]: RecursiveArrayIterator doesn't have constants from parent class | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-211318@lists.php.net to get a copy of this message | ||
From: kukulich at kukulich dot cz
Operating system:
PHP version: Irrelevant
Package: Reflection related
Bug Type: Bug
Bug description:RecursiveArrayIterator doesn't have constants from parent class
Description:
------------
RecursiveArrayIterator doesn't have constants from parent class
See https://3v4l.org/7fVc4
Test script:
---------------
<?php
class Foo extends \ArrayIterator
{
}
$fooReflection = new \ReflectionClass(\Foo::class);
$recursiveArrayIteratorReflection = new
\ReflectionClass(\RecursiveArrayIterator::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($recursiveArrayIteratorReflection->getConstants()),
\RecursiveArrayIterator::class);
if ($recursiveArrayIteratorReflection->getParentClass()) {
printf("%s extends %s\n", \RecursiveArrayIterator::class,
$recursiveArrayIteratorReflection->getParentClass()->getName());
}
printf("%d constants in %s\n", count((new
\ReflectionClass(\ArrayIterator::class))->getConstants()),
\ArrayIterator::class);
Expected result:
----------------
2 constants in Foo, Foo extends ArrayIterator
3 constants in RecursiveArrayIterator, RecursiveArrayIterator extends
ArrayIterator
2 constants in ArrayIterator
Actual result:
--------------
2 constants in Foo, Foo extends ArrayIterator
1 constants in RecursiveArrayIterator, RecursiveArrayIterator extends
ArrayIterator
2 constants in ArrayIterator
--
Edit bug report at https://bugs.php.net/bug.php?id=75242&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75242&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75242&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75242&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75242&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75242&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75242&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75242&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75242&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75242&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75242&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75242&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75242&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75242&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75242&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75242&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75242&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75242&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75242&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75242&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75242&r=mysqlcfg