Bug #53937 [PATCH]: Documentation of method signiture not correct
| From: | lapistano@php.net | Date: | Sun, 06 Feb 2011 11:59:42 +0000 |
| Subject: | Bug #53937 [PATCH]: Documentation of method signiture not correct | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5923@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53937&edit=1
ID: 53937
Patch added by: lapistano@php.net
Reported by: lapistano@php.net
Summary: Documentation of method signiture not correct
Status: Open
Type: Bug
Package: Documentation problem
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
The following patch has been added/updated:
Patch Name: changeOfMethodSigniture
Revision: 1296993582
URL:
http://bugs.php.net/patch-display.php?bug=53937&patch=changeOfMethodSigniture&revision=1296993582
Previous Comments:
------------------------------------------------------------------------
[2011-02-06 12:53:54] lapistano@php.net
Description:
------------
documentation (http://php.net/manual/en/reflectionproperty.getvalue.php)
marks the parameter ($object) as optional. Also the type pf the expected
parameter is wrong. The docu says 'string', but an object is expected.
Using it as says results into a PHP warning.
Test script:
---------------
<?php
class tux
{
protected $sibling = 'beastie';
public function gnu()
{
echo 'gnu';
}
}
$class = new ReflectionClass('tux');
$property = $class->getProperty('sibling');
$property->setAccessible(true);
echo $property->getValue();
Expected result:
----------------
beastie
Actual result:
--------------
PHP Warning: ReflectionProperty::getValue() expects exactly 1
parameter, 0 given in /home/lapistano/tmp/relectionProperties.php on
line 20
PHP Stack trace:
PHP 1. {main}() /home/lapistano/tmp/relectionProperties.php:0
PHP 2. ReflectionProperty->getValue()
/home/lapistano/tmp/relectionProperties.php:20
Warning: ReflectionProperty::getValue() expects exactly 1 parameter, 0
given in /home/lapistano/tmp/relectionProperties.php on line 20
Call Stack:
0.0001 326584 1. {main}()
/home/lapistano/tmp/relectionProperties.php:0
0.0002 327924 2. ReflectionProperty->getValue()
/home/lapistano/tmp/relectionProperties.php:20
Variables in local scope (#1):
$class = class ReflectionClass { public $name = 'tux' }
$property = class ReflectionProperty { public $name = 'os'; public
$class = 'tux' }
$propertyValue = *uninitialized*
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53937&edit=1