ID: 28241 Updated by: [EMAIL PROTECTED] Reported By: jevon at jevon dot org -Status: Suspended +Status: Closed Bug Type: Zend Engine 2 problem Operating System: * -PHP Version: 5.0.0RC2 +PHP Version: 5.0.* Assigned To: helly
Previous Comments: ------------------------------------------------------------------------ [2004-10-12 09:56:05] php at bobsilva dot com This has been fixed in 5.1 CVS ------------------------------------------------------------------------ [2004-05-01 12:20:07] [EMAIL PROTECTED] 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