Bug #52909 [Com]: ReflectionMethod::getParameters() return incorrect number of arguments

From: Date: Tue, 11 Sep 2012 16:50:48 +0000
Subject: Bug #52909 [Com]: ReflectionMethod::getParameters() return incorrect number of arguments
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-173337@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=52909&edit=1

 ID:                 52909
 Comment by:         reeze@php.net
 Reported by:        frederic dot hardy at mageekbox dot net
 Summary:            ReflectionMethod::getParameters() return incorrect
                     number of arguments
 Status:             Assigned
 Type:               Bug
 Package:            PHAR related
 Operating System:   FreeBSD 8.0
 PHP Version:        5.3.3
 Assigned To:        aharvey
 Block user comment: N
 Private report:     N

 New Comment:

Hi aharvey
   reopen and what to do next :)


Previous Comments:
------------------------------------------------------------------------
[2010-09-23 17:37:05] aharvey@php.net

Reopening per IRC discussion.

------------------------------------------------------------------------
[2010-09-23 06:52:42] aharvey@php.net

This bug has been fixed in SVN.

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.



------------------------------------------------------------------------
[2010-09-23 06:52:32] aharvey@php.net

Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=303712
Log: Fix doc bug #52909 by documenting the extra parameters available in
PharData::__construct().

------------------------------------------------------------------------
[2010-09-23 06:41:17] aharvey@php.net

Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=303709
Log: Fix up the vim folds in phar_object.c and add a note that the two prototypes
before Phar::__construct() are actually valid and not a mistake, per bug
#52909.

------------------------------------------------------------------------
[2010-09-23 06:39:18] aharvey@php.net

The reason for this is that Phar and PharData actually use the same function for their __construct
implementations -- internally it calls instanceof_function() to figure out whether it's
constructing a Phar or PharData object and then has some if statements to handle things from there.
There's no distinct arginfo for the PharData implementation, so reflection has no way of
distinguishing the three parameter Phar constructor from the four parameter PharData constructor.

I'll make the proto comment in phar_object.c a little clearer (and remove the extra vim fold
that doesn't do anything useful). Beyond that, the manual's correct for
Phar::__construct() but not for PharData::__construct() (which is currently documented as accepted
two parameters when it actually accepts four), so I'll fix that up.

I don't see any way of getting reflection to do the right thing short of refactoring the
function into two -- which might be the right thing to do anyway, but is a decision for Greg or
Marcus to make.

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=52909


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=52909&edit=1


Thread (7 messages)

« previous php.bugs (#173337) next »