]> granicus.if.org Git - php/commitdiff
- Fixed bug #43512 (same parameter name can be used multiple times in method/function...
authorFelipe Pena <felipe@php.net>
Thu, 17 Feb 2011 23:24:50 +0000 (23:24 +0000)
committerFelipe Pena <felipe@php.net>
Thu, 17 Feb 2011 23:24:50 +0000 (23:24 +0000)
Zend/tests/bug54013.phpt [new file with mode: 0644]

diff --git a/Zend/tests/bug54013.phpt b/Zend/tests/bug54013.phpt
new file mode 100644 (file)
index 0000000..4219eed
--- /dev/null
@@ -0,0 +1,31 @@
+--TEST--
+Bug #54013 (ReflectionParam for duplicate parameter contains garbage)
+--FILE--
+<?php
+
+class a
+{
+        function b($aaaaaaaa, $aaaaaaaa)
+        {
+                $params = func_get_args();
+        }
+}
+
+$c = new a;
+$c->b('waa?', 'meukee!');
+
+$reflectionClass = new ReflectionClass($c);
+$params = $reflectionClass->getMethod('b')->getParameters();
+
+var_dump($params[0], $params[1]);
+
+?>
+--EXPECTF--
+object(ReflectionParameter)#%d (1) {
+  ["name"]=>
+  string(8) "aaaaaaaa"
+}
+object(ReflectionParameter)#%d (1) {
+  ["name"]=>
+  string(8) "aaaaaaaa"
+}