From:
Operating system:
PHP version: 5.3.5
Package: Reflection related
Bug Type: Bug
Bug description:ReflectionParam for duplicate parameter contains garbage
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 bug report at http://bugs.php.net/bug.php?id=54013&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=54013&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=54013&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=54013&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=54013&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=54013&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=54013&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=54013&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=54013&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=54013&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=54013&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=54013&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=54013&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=54013&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=54013&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54013&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=54013&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=54013&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=54013&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=54013&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=54013&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=54013&r=mysqlcfg