#28241 [Com]: Reflection_Parameter needs getDefault()

From: Date: Tue, 12 Oct 2004 07:56:07 +0000
Subject: #28241 [Com]: Reflection_Parameter needs getDefault()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-67464@lists.php.net to get a copy of this message
ID: 28241 Comment by: php at bobsilva dot com Reported By: jevon at jevon dot org Status: Suspended Bug Type: Zend Engine 2 problem Operating System: * PHP Version: 5.0.0RC2 Assigned To: helly New Comment: This has been fixed in 5.1 CVS Previous Comments: ------------------------------------------------------------------------ [2004-05-01 12:20:07] helly@php.net We also then need: hasDeclaredDefault() isRequired() but these will most probably not added before PHP 5.1 because it requires some internal stuctures to change. ------------------------------------------------------------------------ [2004-05-01 11:25:50] jevon at jevon dot org Oops, $p[0]->getDefault() (although this shouldn't affect the logic) ------------------------------------------------------------------------ [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 (#67464) next »