#49631 [NEW]: Documentation of ReflectionFunctionAbstract::getParameters return value

From: Date: Tue, 22 Sep 2009 18:52:47 +0000
Subject: #49631 [NEW]: Documentation of ReflectionFunctionAbstract::getParameters return value
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-2804@lists.php.net to get a copy of this message
From: julien_picalausa at yahoo dot fr Operating system: PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: Documentation of ReflectionFunctionAbstract::getParameters return value Description: ------------ The documentation of ReflectionFunctionAbstract::getParameters indicates that the return value is "The parameters, as a ReflectionParameter object.". Of course, since a ReflectionParameter object is just reflecting one single parameter, it cannot return all of them as a single of those objects. Testing reveals that ReflectionFunctionAbstract::getParameters returns an _array_ of ReflectionParameter objects (more or less as expected). I tested this on php 5.2.9, but whether or not this behavior has changed in newer versions shouldn't matter as the documentation would still be incorrect. Reproduce code: --------------- class Test { public function AFunction($x, $y, $z) { $this->AnotherFunction($z, $x, $y); } } $r = new ReflectionMethod('Test', 'Afunction'); $p = $r->getParameters(); var_dump($p); Actual result: -------------- array(3) { [0]=> &object(ReflectionParameter)#2 (1) { ["name"]=> string(1) "x" } [1]=> &object(ReflectionParameter)#3 (1) { ["name"]=> string(1) "y" } [2]=> &object(ReflectionParameter)#4 (1) { ["name"]=> string(1) "z" } -- Edit bug report at http://bugs.php.net/?id=49631&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49631&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49631&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49631&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49631&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49631&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49631&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49631&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49631&r=needscript Try newer version: http://bugs.php.net/fix.php?id=49631&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49631&r=support Expected behavior: http://bugs.php.net/fix.php?id=49631&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49631&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49631&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49631&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49631&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=49631&r=dst IIS Stability: http://bugs.php.net/fix.php?id=49631&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49631&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49631&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49631&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49631&r=mysqlcfg

« previous php.doc.bugs (#2804) next »