Doc #62642 [NEW]: ReflectionParameter::getDeclaringFunction() wrongly documented

From: Date: Mon, 23 Jul 2012 16:13:46 +0000
Subject: Doc #62642 [NEW]: ReflectionParameter::getDeclaringFunction() wrongly documented
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8628@lists.php.net to get a copy of this message
From: benjamin dot morel at strictcoding dot co dot uk Operating system: Irrelevant PHP version: 5.4.5 Package: Documentation problem Bug Type: Documentation Problem Bug description:ReflectionParameter::getDeclaringFunction() wrongly documented Description: ------------ In the documentation for ReflectionParameter::getDeclaringFunction(): http://www.php.net/manual/en/class.reflectionparameter.php http://www.php.net/manual/en/reflectionparameter.getdeclaringfunction.php The function is declared as: public ReflectionFunction getDeclaringFunction ( void ) It should read as: public ReflectionFunctionAbstract getDeclaringFunction ( void ) When calling getDeclaringFunction() on a method parameter reflection, we get a ReflectionMethod object, which extends ReflectionFunctionAbstract, not ReflectionFunction. Test script: --------------- $method = new ReflectionMethod('Locale', 'getRegion'); foreach ($method->getParameters() as $parameter) { $function = $parameter->getDeclaringFunction(); var_export($function instanceof ReflectionFunction); // false var_export($function instanceof ReflectionFunctionAbstract); // true } -- Edit bug report at https://bugs.php.net/bug.php?id=62642&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62642&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62642&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62642&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=62642&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62642&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=62642&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=62642&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=62642&r=needscript Try newer version: https://bugs.php.net/fix.php?id=62642&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=62642&r=support Expected behavior: https://bugs.php.net/fix.php?id=62642&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=62642&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=62642&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=62642&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62642&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=62642&r=dst IIS Stability: https://bugs.php.net/fix.php?id=62642&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=62642&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=62642&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=62642&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=62642&r=mysqlcfg

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