#28241 [Opn]: Reflection_Parameter needs getDefault()

From: Date: Sat, 01 May 2004 09:25:51 +0000
Subject: #28241 [Opn]: Reflection_Parameter needs getDefault()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-59090@lists.php.net to get a copy of this message
ID: 28241 User updated by: jevon at jevon dot org Reported By: jevon at jevon dot org Status: Open Bug Type: Zend Engine 2 problem Operating System: WinXP PHP Version: 5.0.0RC2 New Comment: Oops, $p[0]->getDefault() (although this shouldn't affect the logic) Previous Comments: ------------------------------------------------------------------------ [2004-05-01 11:24:54] jevon at jevon dot org Description: ------------ It would be nice for Reflection_Parameter to have a "getDefault" method to get the default value for the parameter. Reproduce code: --------------- class Foo { function a($b = 1) { } } ... $r = new Reflection_Class("Foo")); $m = $r->getMethods(); $p = $m[0]->getParameters(); echo "p->getDefault = " . $p->getDefault(); Expected result: ---------------- p->getDefault = 1 Actual result: -------------- The function doesn't exist (Fatal error: Call to undefined method reflection_parameter::getDefault()) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28241&edit=1

« previous php.bugs (#59090) next »