For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > December 2006 > #39876 [Opn]: ReflectionParameter::getDeclaringFunction() method not available









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #39876 [Opn]: ReflectionParameter::getDeclaringFunction() method not available
bugs at php dot frankkleine dot de

2006-12-20, 7:00 pm

ID: 39876
User updated by: bugs at php dot frankkleine dot de
-Summary: ReflectionParameter::getClass() throws exception for
type hint self
Reported By: bugs at php dot frankkleine dot de
Status: Open
Bug Type: Documentation problem
PHP Version: 5.2.0
New Comment:

Summary was changed to a wrong title, corrected this.


Previous Comments:
------------------------------------------------------------------------

[2006-12-19 17:26:24] thekid@php.net

This is the commit that included the MBO_0s:

revision 1.164.2.32
date: 2006/03/12 17:22:34; author: helly; state: Exp; lines: +66
-10

[...]
. (inactive but tested) Add getDeclaringFunction()
. (inactive but tested) Add getPosition()
[...]

Sadly, no reason is given why these methods are "inactive but tested".

------------------------------------------------------------------------

[2006-12-19 05:59:27] judas dot iscariote at gmail dot com

either the docs needs fixing, or the #if MBO_0 's in php_reflection.c
needs to removed ;)

------------------------------------------------------------------------

[2006-12-18 21:16:02] bugs at php dot frankkleine dot de

Description:
------------
The manual states on
http://www.php.net/manual/en/langua....reflection.php that the
ReflectionParameter::getDeclaringFunctio
n() method is available since
PHP 5.1.3. However this method is neither available in 5.1.4 nor in
5.2.

Reproduce code:
---------------
function test1($param) {}
$refParam = new ReflectionParameter('test1', 'param');
var_dump($refParam->getDeclaringFunction());

Expected result:
----------------
object(ReflectionFunction)[1]
public 'name' => 'test1' (length=5)


Actual result:
--------------
Fatal error: Call to undefined method
ReflectionParameter::getDeclaringFunctio
n() in
E:\php\tests\reflection_parameter.php on line 4


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=39876&edit=1
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com