|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-05-19 02:04 UTC] a at b dot c dot de
[2016-03-25 20:06 UTC] andreas at dqxtech dot net
[2018-07-29 02:23 UTC] a at b dot c dot de
[2018-07-29 02:27 UTC] requinix@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: requinix
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 03:00:01 2025 UTC |
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.