From: Operating system: Irrelevant PHP version: 5.3.2 Package: Unknown/Other Function Bug Type: Feature/Change Request Bug description:Optional tuning parameter for get_defined_functions and get_defined_constants
Description: ------------ get_defined_constants() offers an optional parameter which, when passed true, categorises the constants by extension. get_defined_functions() returns a list of function names categorised by whether they are "user" or "internal". Both could benefit from being able to specify an actual category, instead of just that the returned list be categorised. For example, get_defined_functions('internal') would return a one-dimensional numerically-indexed array of internally-defined functions. It's mainly for convenience: avoiding the extra variable, and depending on the internals some work collating the data. Since the list of extensions is so variable from configuration to configuration, it would be infeasible to define("DEFINED_CONSTANTS_PCRE", "pcre") and so forth. If the syntax engine could be convinced then this suggestion would be redundant, since it could then be achieved as get_defined_functions()['internal']. Test script: --------------- print_r(get_defined_functions('internal')); Equivalent to: $functions = get_defined_functions(); print_r($functions['internal']); Expected result: ---------------- Array( [0] => zend_version [1] => func_num_args [2] => func_get_arg [3] => func_get_args [4] => strlen .... ) Actual result: -------------- A Warning is triggered stating that get_defined_functions() expects exactly 0 parameters, not the 1 that it was given. print_r() outputs null. -- Edit bug report at http://bugs.php.net/bug.php?id=51855&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51855&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51855&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51855&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=51855&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51855&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=51855&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=51855&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=51855&r=needscript Try newer version: http://bugs.php.net/fix.php?id=51855&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=51855&r=support Expected behavior: http://bugs.php.net/fix.php?id=51855&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=51855&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=51855&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=51855&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51855&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=51855&r=dst IIS Stability: http://bugs.php.net/fix.php?id=51855&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=51855&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=51855&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=51855&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=51855&r=mysqlcfg