|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75799 arg of get_defined_functions is optional
Submitted: 2018-01-11 10:00 UTC Modified: 2018-01-11 12:05 UTC
From: zoeslam at gmail dot com Assigned: cmb (profile)
Status: Closed Package: Reflection related
PHP Version: 7.2.1 OS:
Private report: No CVE-ID: None
 [2018-01-11 10:00 UTC] zoeslam at gmail dot com
get_defined_functions has 1 optinal parameter.
ReflectionFunction instead reports it as mandatory.

Bug present since 7.1.10

Possible commit that introduced the bug:

Test script:

$refFunc = new \ReflectionFunction('get_defined_functions');
foreach ($refFunc->getParameters() as $parameter) {
    var_dump(sprintf('Parameter: "%s"; optional: %s', $parameter->name, var_export($parameter->isOptional(), true)));

Expected result:
string(46) "Parameter: "exclude_disabled"; optional: true"

Actual result:
string(46) "Parameter: "exclude_disabled"; optional: false"


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-01-11 12:05 UTC]
-Summary: ReflectionFunction on get_defined_functions reports mandatory parameters +Summary: arg of get_defined_functions is optional -Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2018-01-11 12:16 UTC]
Automatic comment on behalf of
Log: Fixed bug #75799 (arg of get_defined_functions is optional)
 [2018-01-11 12:16 UTC]
-Status: Verified +Status: Closed
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon May 29 02:03:39 2023 UTC