|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-02-02 08:52 UTC] johannes@php.net
[2010-02-02 08:52 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 09:00:02 2025 UTC |
Description: ------------ The method isOptional() doesn't return the correct boolean-value. Reproduce code: --------------- <?php class Test { public function test( $a, $b = 1, $c ) {} } $reflection = new ReflectionClass( 'Test' ); $fparam = $reflection->getMethod( 'test' )->getParameters(); foreach( $fparam as $k => $v ) { echo $v->getName() . ' '; echo ( $v->isOptional() ? 'is optional' : 'is not optional' ) . "\n"; } ?> Expected result: ---------------- a is not optional b is optional c is not optional Actual result: -------------- a is not optional b is not optional c is not optional