Bug #53937 [Opn->Csd]: Documentation of method signiture not correct
| From: | vrana@php.net | Date: | Thu, 10 Feb 2011 11:28:14 +0000 |
| Subject: | Bug #53937 [Opn->Csd]: Documentation of method signiture not correct | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5939@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
Updated by: vrana@php.net
Reported by: lapistano@php.net
Summary: Documentation of method signiture not correct
-Status: Open
+Status: Closed
Type: Bug
Package: Documentation problem
PHP Version: Irrelevant
-Assigned To:
+Assigned To: vrana
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Previous Comments:
------------------------------------------------------------------------
[2011-02-10 12:26:54] vrana@php.net
Automatic comment from SVN on behalf of vrana
Revision: http://svn.php.net/viewvc/?view=revision&revision=308178
Log: Fix proto (doc bug #53937)
------------------------------------------------------------------------
[2011-02-06 12:59:42] lapistano@php.net
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
------------------------------------------------------------------------
[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