Req #74261 [NEW]: getConstants() should accept filter argument

From: Date: Fri, 17 Mar 2017 12:35:16 +0000
Subject: Req #74261 [NEW]: getConstants() should accept filter argument
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-207894@lists.php.net to get a copy of this message
From: cmb Operating system: * PHP version: 7.1.3 Package: Reflection related Bug Type: Feature/Change Request Bug description:getConstants() should accept filter argument Description: ------------ As of PHP 7.1.0 it is possible to explicitly specify the visibility of class constants. However, ReflectionClass::getConstants() returns all constants as simple associative array, and ::getConstant() returns a simple string, so there is no way to find out which of the constants can be accessed from outside the class. Therefore, it would be nice if an optional $filter argument could be passed to ::getConstants() similar to ::getMethods(). Another option would be to implement ReflectionConstant as suggested in request #45569. -- Edit bug report at https://bugs.php.net/bug.php?id=74261&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74261&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74261&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74261&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=74261&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=74261&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=74261&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=74261&r=needscript Try newer version: https://bugs.php.net/fix.php?id=74261&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=74261&r=support Expected behavior: https://bugs.php.net/fix.php?id=74261&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=74261&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=74261&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=74261&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74261&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=74261&r=dst IIS Stability: https://bugs.php.net/fix.php?id=74261&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=74261&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=74261&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=74261&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=74261&r=mysqlcfg

« previous php.bugs (#207894) next »