From: frederic dot hardy at mageekbox dot net Operating system: FreeBSD 7.1 PHP version: 5.3.1 PHP Bug Type: Reflection related Bug description: Unable to retrieve default value of argument of internal method with reflection
Description: ------------ It's not possible to retrieve default value of an SPL method argument with reflectionParameter class. If we try to do that, an exception was throwed to inform us that it's not possible. So, i known that it's a known issue (bug 28114), but it's very annoying and i would like to know the reason of this, or if there is a workaround. Reproduce code: --------------- <?php $method = new reflectionMethod('recursiveDirectoryIterator', 'setFlags'); foreach ($method->getParameters() as $parameter) { echo $parameter->getDefaultValue(); } Expected result: ---------------- Something that it's not an exception. Actual result: -------------- PHP Fatal error: Uncaught exception 'ReflectionException' with message 'Cannot determine default value for internal functions' in /usr/home/fch/tmp/class.php:7 Stack trace: #0 /usr/home/fch/tmp/class.php(7): ReflectionParameter->getDefaultValue() #1 {main} thrown in /usr/home/fch/tmp/class.php on line 7 -- Edit bug report at http://bugs.php.net/?id=50798&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50798&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50798&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50798&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=50798&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50798&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=50798&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=50798&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=50798&r=needscript Try newer version: http://bugs.php.net/fix.php?id=50798&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=50798&r=support Expected behavior: http://bugs.php.net/fix.php?id=50798&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=50798&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=50798&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=50798&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50798&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=50798&r=dst IIS Stability: http://bugs.php.net/fix.php?id=50798&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=50798&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=50798&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=50798&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=50798&r=mysqlcfg