php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #62642 ReflectionParameter::getDeclaringFunction() wrongly documented
Submitted: 2012-07-23 16:13 UTC Modified: 2013-10-13 17:25 UTC
From: benjamin dot morel at strictcoding dot co dot uk Assigned: krakjoe (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.4.5 OS: Irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: benjamin dot morel at strictcoding dot co dot uk
New email:
PHP Version: OS:

 

 [2012-07-23 16:13 UTC] 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
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-13 17:24 UTC] 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
 [2013-10-13 17:25 UTC] krakjoe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: krakjoe
 [2013-10-13 17:25 UTC] krakjoe@php.net
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.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 15:00:01 2026 UTC