|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-05-13 10:30 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 01:00:02 2025 UTC |
Description: ------------ The isDefaultValueAvailable() of ReflectionParameter object doesn't return true for any parameter if the next parameter in collection has no default value. To regenerate the bug, execute the following script Reproduce code: --------------- <? class TestClass { public function __construct($a , $b=6 , $c = "hh", $d, $e=76) { } } $class = new ReflectionClass("TestClass"); $method= $class->getMethod("__construct"); $parameter = $method->getParameters(); foreach ($parameter as $param) { if ($param->isDefaultValueAvailable()) { if (is_null($param->getDefaultValue())) echo $param->getName()." : null \n"; else echo $param->getName()." : ".$param->getDefaultValue()."\n"; } } ?> Expected result: ---------------- b : 6 c : hh e : 76 Actual result: -------------- e : 76