summaryrefslogtreecommitdiff
path: root/ext/dom
diff options
context:
space:
mode:
authorFabien Villepinte <fabien.villepinte@gmail.com>2017-04-11 17:26:03 +0200
committerRemi Collet <remi@php.net>2017-04-13 07:07:24 +0200
commitbc4bb7882b823ce13e760a0a910d62f0d825a8a4 (patch)
tree919ecd50f529ba7d50dbdeaf45013fe4c57093f6 /ext/dom
parentf4a41fe7502d7659239e569bdac9a9c1edda13f2 (diff)
downloadphp-git-bc4bb7882b823ce13e760a0a910d62f0d825a8a4.tar.gz
Fixed bug #74416 Wrong reflection on DOMNode::cloneNode
Diffstat (limited to 'ext/dom')
-rw-r--r--ext/dom/node.c2
-rw-r--r--ext/dom/tests/bug74416.phpt21
2 files changed, 22 insertions, 1 deletions
diff --git a/ext/dom/node.c b/ext/dom/node.c
index 82879da3b5..b4ab9f896a 100644
--- a/ext/dom/node.c
+++ b/ext/dom/node.c
@@ -49,7 +49,7 @@ ZEND_END_ARG_INFO();
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_has_child_nodes, 0, 0, 0)
ZEND_END_ARG_INFO();
-ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_clone_node, 0, 0, 1)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_clone_node, 0, 0, 0)
ZEND_ARG_INFO(0, deep)
ZEND_END_ARG_INFO();
diff --git a/ext/dom/tests/bug74416.phpt b/ext/dom/tests/bug74416.phpt
new file mode 100644
index 0000000000..d441c0a7ab
--- /dev/null
+++ b/ext/dom/tests/bug74416.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #74416 Wrong reflection on DOMNode::cloneNode
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+if (!extension_loaded('reflection')) die('skip reflection extension not available');
+?>
+--FILE--
+<?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");
+}
+?>
+===DONE===
+--EXPECT--
+1
+0
+Parameter #0 IS OPTIONAL
+===DONE===