|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-12-15 01:57 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2016-12-15 01:57 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 17 10:00:01 2025 UTC |
Description: ------------ ReflectionParameter.getDefaultValue returning wrong value when default parameter have leading zeros. Test script: --------------- <?php class Foo { public function Bar($n1 = 09, $n2 = 9){ return 0; } } $r = new ReflectionObject(new Foo()); $m = $r->getMethod("Bar"); $p1 = $m->getParameters()[0]; $p2 = $m->getParameters()[1]; echo "p1=".$p1->getDefaultValue(); //not ok. expected = 9, returning 0. echo "<br>"; echo "p2=".$p2->getDefaultValue(); //ok = 9 ?>