Bug #78248 [NEW]: ReflectionClass::getMethods() filters as ANY not ALL bitmap fields

From: Date: Thu, 04 Jul 2019 04:14:44 +0000
Subject: Bug #78248 [NEW]: ReflectionClass::getMethods() filters as ANY not ALL bitmap fields
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-221628@lists.php.net to get a copy of this message
From: zerkms at zerkms dot ru Operating system: any PHP version: 7.3.6 Package: Reflection related Bug Type: Bug Bug description:ReflectionClass::getMethods() filters as ANY not ALL bitmap fields Description: ------------ As always with bitmap filtering the items should be checked to satisfy all bitfields, not any of those Test script: --------------- <?php class Foo { public function one() {} static public function two() {} static protected function three() {} } $class = new ReflectionClass(Foo::class); $methods = $class->getMethods(ReflectionMethod::IS_STATIC | ReflectionMethod::IS_PUBLIC); foreach ($methods as $method) { var_dump($method); } Expected result: ---------------- object(ReflectionMethod)#3 (2) { ["name"]=> string(3) "two" ["class"]=> string(3) "Foo" } Actual result: -------------- object(ReflectionMethod)#2 (2) { ["name"]=> string(3) "one" ["class"]=> string(3) "Foo" } object(ReflectionMethod)#3 (2) { ["name"]=> string(3) "two" ["class"]=> string(3) "Foo" } object(ReflectionMethod)#4 (2) { ["name"]=> string(5) "three" ["class"]=> string(3) "Foo" } -- Edit bug report at https://bugs.php.net/bug.php?id=78248&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=78248&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=78248&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=78248&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=78248&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=78248&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=78248&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=78248&r=needscript Try newer version: https://bugs.php.net/fix.php?id=78248&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=78248&r=support Expected behavior: https://bugs.php.net/fix.php?id=78248&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=78248&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=78248&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=78248&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=78248&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=78248&r=dst IIS Stability: https://bugs.php.net/fix.php?id=78248&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=78248&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=78248&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=78248&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=78248&r=mysqlcfg

« previous php.bugs (#221628) next »