Doc #76049 [NEW]: ReflectionParameter::__construct() accepts an array for $function

From: Date: Mon, 05 Mar 2018 11:12:50 +0000
Subject: Doc #76049 [NEW]: ReflectionParameter::__construct() accepts an array for $function
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-15489@lists.php.net to get a copy of this message
From:             benjamin dot morel at gmail dot com
Operating system: N/A
PHP version:      Irrelevant
Package:          Documentation problem
Bug Type:         Documentation Problem
Bug description:ReflectionParameter::__construct() accepts an array for $function

Description:
------------
The ReflectionParameter constructor is documented as accepting a string
only for the first parameter:

http://php.net/manual/en/reflectionparameter.construct.php

However, as mentioned in a comment on that page, it also accepts an
array containing a class name and a method name.

Test script:
---------------
class Foo {
    function bar($baz) {}
}
$r = new ReflectionParameter(array('Foo', 'bar'), 'baz');
echo $r->getName();

Expected result:
----------------
public ReflectionParameter::__construct ( string|array $function ,
string $parameter )

Actual result:
--------------
public ReflectionParameter::__construct ( string $function , string
$parameter )

-- 
Edit bug report at https://bugs.php.net/bug.php?id=76049&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=76049&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=76049&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=76049&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=76049&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=76049&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=76049&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=76049&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=76049&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=76049&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=76049&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=76049&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=76049&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=76049&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76049&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=76049&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=76049&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=76049&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76049&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=76049&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=76049&r=mysqlcfg



Thread (6 messages)

« previous php.doc.bugs (#15489) next »