Bug #54013 [Com]: ReflectionParam for duplicate parameter contains garbage
| From: | arjen at react dot nl | Date: | Mon, 14 Feb 2011 13:52:45 +0000 |
| Subject: | Bug #54013 [Com]: ReflectionParam for duplicate parameter contains garbage | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-158763@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=54013&edit=1
ID: 54013
Comment by: arjen at react dot nl
Reported by: arjen at react dot nl
Summary: ReflectionParam for duplicate parameter contains
garbage
Status: Open
Type: Bug
Package: Reflection related
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
Related to http://bugs.php.net/bug.php?id=43512
Previous Comments:
------------------------------------------------------------------------
[2011-02-14 14:52:23] arjen at react dot nl
Description:
------------
ReflectionParam object for 2nd parameter contains random value for name
property.
Test script:
---------------
<?php
class a
{
function b($a, $a)
{
$params = func_get_args();
var_dump($params, $a);
}
}
$c = new a;
$c->b('waa?', 'meukee!');
$reflectionClass = new ReflectionClass($c);
$params = $reflectionClass->getMethod('b')->getParameters();
var_dump($params);
Expected result:
----------------
array
0 => string 'waa?' (length=4)
1 => string 'meukee!' (length=7)
string 'meukee!' (length=7)
array
0 => &
object(ReflectionParameter)[4]
public 'name' => string 'a' (length=1)
1 => &
object(ReflectionParameter)[5]
public 'name' => string 'a' (length=1)
or exception/error..
Actual result:
--------------
array
0 => string 'waa?' (length=4)
1 => string 'meukee!' (length=7)
string 'meukee!' (length=7)
array
0 => &
object(ReflectionParameter)[4]
public 'name' => string 'a' (length=1)
1 => &
object(ReflectionParameter)[5]
public 'name' => string '<<insert random byte here>>'
(length=1)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=54013&edit=1