|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41525 ReflectionParameter::getPosition() not available
Submitted: 2007-05-29 06:58 UTC Modified: 2007-05-29 08:44 UTC
From: Assigned: helly (profile)
Status: Closed Package: Class/Object related
PHP Version: 5.2.2 OS: *
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
New email:
PHP Version: OS:


 [2007-05-29 06:58 UTC]
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) {
  string(6) "export"
  string(11) "__construct"
  string(10) "__toString"
  string(7) "getName"
  string(19) "isPassedByReference"
  string(17) "getDeclaringClass"
  string(8) "getClass"
  string(7) "isArray"
  string(10) "allowsNull"
  string(10) "isOptional"
  string(23) "isDefaultValueAvailable"
  string(15) "getDefaultValue"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-29 08:26 UTC]
getPosition() & getDeclaringFunction() are still ifdefed out
 [2007-05-29 08:44 UTC]
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
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Sep 23 05:03:37 2021 UTC