#41525 [Asn->Csd]: ReflectionParameter::getPosition() not available
| From: | helly@php.net | Date: | Tue, 29 May 2007 08:44:35 +0000 |
| Subject: | #41525 [Asn->Csd]: ReflectionParameter::getPosition() not available | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-113143@lists.php.net to get a copy of this message | ||
ID: 41525
Updated by: helly@php.net
Reported By: toby@php.net
-Status: Assigned
+Status: Closed
Bug Type: Class/Object related
-Operating System: Gentoo
+Operating System: *
PHP Version: 5.2.2
Assigned To: helly
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2007-05-29 08:26:10] bjori@php.net
getPosition() & getDeclaringFunction() are still ifdefed out
------------------------------------------------------------------------
[2007-05-29 06:58:03] toby@php.net
Description:
------------
The reflection documentation states that there is a method
getPosition() on instances of ReflectionParameter since 5.1.3, but it
does not exist (at least here).
Reproduce code:
---------------
dotxp@tango ~ $ php -a
Interactive shell
php > function foo($param) {}
php > $fkt = new ReflectionFunction("foo");
php > $pars = $fkt->getParameters();
php > $par = $pars[0];
php > var_dump($par->getPosition());
-------------------------------------------------------
dotxp@tango ~ $ php -a
Interactive shell
php > var_dump(get_class_methods("ReflectionParameter"));
Actual result:
--------------
Fatal error: Call to undefined method
ReflectionParameter::getPosition() in php shell code on line 1
Call Stack:
60.5766 68372 1. {main}() php shell code:0
-------------------------------------------------------
array(12) {
[0]=>
string(6) "export"
[1]=>
string(11) "__construct"
[2]=>
string(10) "__toString"
[3]=>
string(7) "getName"
[4]=>
string(19) "isPassedByReference"
[5]=>
string(17) "getDeclaringClass"
[6]=>
string(8) "getClass"
[7]=>
string(7) "isArray"
[8]=>
string(10) "allowsNull"
[9]=>
string(10) "isOptional"
[10]=>
string(23) "isDefaultValueAvailable"
[11]=>
string(15) "getDefaultValue"
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41525&edit=1