Doc #62642 [Opn->Csd]: ReflectionParameter::getDeclaringFunction() wrongly documented
| From: | krakjoe@php.net | Date: | Sun, 13 Oct 2013 17:25:03 +0000 |
| Subject: | Doc #62642 [Opn->Csd]: ReflectionParameter::getDeclaringFunction() wrongly documented | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-10479@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=62642&edit=1
ID: 62642
Updated by: krakjoe@php.net
Reported by: benjamin dot morel at strictcoding dot co dot uk
Summary: ReflectionParameter::getDeclaringFunction() wrongly
documented
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: Irrelevant
PHP Version: 5.4.5
-Assigned To:
+Assigned To: krakjoe
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2013-10-13 17:24:57] krakjoe@php.net
Automatic comment from SVN on behalf of krakjoe
Revision: http://svn.php.net/viewvc/?view=revision&revision=331803
Log: #62642 wrong prototype in docs
------------------------------------------------------------------------
[2012-07-23 16:13:46] benjamin dot morel at strictcoding dot co dot uk
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 this bug report at https://bugs.php.net/bug.php?id=62642&edit=1