php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53937 Documentation of method signiture not correct
Submitted: 2011-02-06 12:53 UTC Modified: 2011-02-10 12:28 UTC
From: lapistano@php.net Assigned: vrana (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant 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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: lapistano@php.net
New email:
PHP Version: OS:

 

 [2011-02-06 12:53 UTC] 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*

Patches

changeOfMethodSigniture (last revision 2011-02-06 11:59 UTC by lapistano@php.net)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-06 12:59 UTC] 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-10 12:26 UTC] vrana@php.net
Automatic comment from SVN on behalf of vrana
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=308178
Log: Fix proto (doc bug #53937)
 [2011-02-10 12:28 UTC] vrana@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: vrana
 [2011-02-10 12:28 UTC] vrana@php.net
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.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 15:00:02 2026 UTC