Skip to content

Commit bc4bb78

Browse files
villfaremicollet
authored andcommitted
Fixed bug #74416 Wrong reflection on DOMNode::cloneNode
1 parent f4a41fe commit bc4bb78

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

ext/dom/node.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ ZEND_END_ARG_INFO();
4949
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_has_child_nodes, 0, 0, 0)
5050
ZEND_END_ARG_INFO();
5151

52-
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_clone_node, 0, 0, 1)
52+
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_clone_node, 0, 0, 0)
5353
ZEND_ARG_INFO(0, deep)
5454
ZEND_END_ARG_INFO();
5555

ext/dom/tests/bug74416.phpt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
Bug #74416 Wrong reflection on DOMNode::cloneNode
3+
--SKIPIF--
4+
<?php
5+
require_once('skipif.inc');
6+
if (!extension_loaded('reflection')) die('skip reflection extension not available');
7+
?>
8+
--FILE--
9+
<?php
10+
$rm = new ReflectionMethod(DOMNode::class, "cloneNode");
11+
printf("%d\n%d\n", $rm->getNumberOfParameters(), $rm->getNumberOfRequiredParameters());
12+
foreach ($rm->getParameters() as $param) {
13+
printf("Parameter #%d %s OPTIONAL\n", $param->getPosition(), $param->isOptional() ? "IS" : "IS NOT");
14+
}
15+
?>
16+
===DONE===
17+
--EXPECT--
18+
1
19+
0
20+
Parameter #0 IS OPTIONAL
21+
===DONE===

0 commit comments

Comments
 (0)