#28241 [Opn->Sus]: Reflection_Parameter needs getDefault()

From: Date: Sat, 01 May 2004 10:20:08 +0000
Subject: #28241 [Opn->Sus]: Reflection_Parameter needs getDefault()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-59091@lists.php.net to get a copy of this message
ID: 28241 Updated by: helly@php.net Reported By: jevon at jevon dot org -Status: Open +Status: Suspended Bug Type: Zend Engine 2 problem -Operating System: WinXP +Operating System: * PHP Version: 5.0.0RC2 -Assigned To: +Assigned To: helly New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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 (#59091) next »