Bug #53937 [NEW]: Documentation of method signiture not correct

From: Date: Sun, 06 Feb 2011 11:53:55 +0000
Subject: Bug #53937 [NEW]: Documentation of method signiture not correct
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-5922@lists.php.net to get a copy of this message
From: lapistano Operating system: PHP version: Irrelevant Package: Documentation problem Bug Type: Bug Bug description:Documentation of method signiture not correct 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 bug report at http://bugs.php.net/bug.php?id=53937&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53937&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53937&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53937&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53937&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53937&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53937&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53937&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53937&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53937&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53937&r=support Expected behavior: http://bugs.php.net/fix.php?id=53937&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53937&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53937&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53937&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53937&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53937&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53937&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53937&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53937&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53937&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53937&r=mysqlcfg

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