Bug #75799 [Ver->Csd]: arg of get_defined_functions is optional
| From: | cmb@php.net | Date: | Thu, 11 Jan 2018 12:16:32 +0000 |
| Subject: | Bug #75799 [Ver->Csd]: arg of get_defined_functions is optional | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-213470@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75799&edit=1
ID: 75799
Updated by: cmb@php.net
Reported by: zoeslam at gmail dot com
Summary: arg of get_defined_functions is optional
-Status: Verified
+Status: Closed
Type: Bug
Package: Reflection related
PHP Version: 7.2.1
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of carusogabriel34@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=a843a86e6f21ecc497cdd3c98d9cd5feb999f357
Log: Fixed bug #75799 (arg of get_defined_functions is optional)
Previous Comments:
------------------------------------------------------------------------
[2018-01-11 10:00:56] zoeslam at gmail dot com
Description:
------------
get_defined_functions has 1 optinal parameter.
ReflectionFunction instead reports it as mandatory.
https://3v4l.org/pRaFj
Bug present since 7.1.10
Possible commit that introduced the bug:
https://github.com/php/php-src/commit/58aa726548b18c4a48dd9804063b4eb8845aa7ef
Test script:
---------------
<?php
$refFunc = new \ReflectionFunction('get_defined_functions');
var_dump($refFunc->getNumberOfRequiredParameters());
foreach ($refFunc->getParameters() as $parameter) {
var_dump(sprintf('Parameter: "%s"; optional: %s', $parameter->name,
var_export($parameter->isOptional(), true)));
}
Expected result:
----------------
int(0)
string(46) "Parameter: "exclude_disabled"; optional: true"
Actual result:
--------------
int(1)
string(46) "Parameter: "exclude_disabled"; optional: false"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75799&edit=1