Bug #74416 [Opn->Csd]: Wrong reflection on DOMNode::cloneNode
| From: | remi@php.net | Date: | Thu, 13 Apr 2017 05:13:34 +0000 |
| Subject: | Bug #74416 [Opn->Csd]: Wrong reflection on DOMNode::cloneNode | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-208507@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74416&edit=1
ID: 74416
Updated by: remi@php.net
Reported by: fabien dot villepinte at gmail dot com
Summary: Wrong reflection on DOMNode::cloneNode
-Status: Open
+Status: Closed
Type: Bug
Package: DOM XML related
PHP Version: Irrelevant
-Assigned To:
+Assigned To: remi
Block user comment: N
Private report: N
New Comment:
Fixed in https://github.com/php/php-src/commit/bc4bb7882b823ce13e760a0a910d62f0d825a8a4
Previous Comments:
------------------------------------------------------------------------
[2017-04-11 15:24:14] fabien dot villepinte at gmail dot com
Description:
------------
The parameter of DOMNode::cloneNode is optional (see: http://php.net/manual/en/domnode.clonenode.php
), but it is described as required by reflection.
Test script:
---------------
<?php
$rm = new ReflectionMethod(DOMNode::class, "cloneNode");
printf("%d\n%d\n", $rm->getNumberOfParameters(),
$rm->getNumberOfRequiredParameters());
foreach ($rm->getParameters() as $param) {
printf("Parameter #%d %s OPTIONAL\n", $param->getPosition(),
$param->isOptional() ? "IS" : "IS NOT");
}
Expected result:
----------------
1
0
Parameter #0 IS OPTIONAL
Actual result:
--------------
1
1
Parameter #0 IS NOT OPTIONAL
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74416&edit=1