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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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)

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 14:01:33 2024 UTC