php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74416 Wrong reflection on DOMNode::cloneNode
Submitted: 2017-04-11 15:24 UTC Modified: 2017-04-13 05:13 UTC
From: fabien dot villepinte at gmail dot com Assigned: remi (profile)
Status: Closed Package: DOM XML related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: fabien dot villepinte at gmail dot com
New email:
PHP Version: OS:

 

 [2017-04-11 15:24 UTC] 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

Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-13 05:13 UTC] remi@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: remi
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 17:01:30 2024 UTC