Edit report at https://bugs.php.net/bug.php?id=62202&edit=1
ID: 62202 Updated by: larue...@php.net Reported by: reeze dot xia at gmail dot com Summary: ReflectionParameter::getDefaultValue() memory leaks with constant -Status: Open +Status: Closed Type: Bug Package: Reflection related PHP Version: Irrelevant -Assigned To: +Assigned To: laruence Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2012-06-01 07:01:14] larue...@php.net Automatic comment on behalf of laruence Revision: http://git.php.net/?p=php-src.git;a=commit;h=1f5327a6022fedc1985d2daa6d189313d808b08b Log: Fixed Bug #62202 (ReflectionParameter::getDefaultValue() memory leaks with constant) ------------------------------------------------------------------------ [2012-06-01 07:00:31] larue...@php.net Automatic comment on behalf of laruence Revision: http://git.php.net/?p=php-src.git;a=commit;h=1f5327a6022fedc1985d2daa6d189313d808b08b Log: Fixed Bug #62202 (ReflectionParameter::getDefaultValue() memory leaks with constant) ------------------------------------------------------------------------ [2012-06-01 06:57:50] larue...@php.net Automatic comment on behalf of laruence Revision: http://git.php.net/?p=php-src.git;a=commit;h=1f5327a6022fedc1985d2daa6d189313d808b08b Log: Fixed Bug #62202 (ReflectionParameter::getDefaultValue() memory leaks with constant) ------------------------------------------------------------------------ [2012-06-01 06:21:26] reeze dot xia at gmail dot com Hiï¼ I sent a PR here https://github.com/php/php-src/pull/97 Thanks:) ------------------------------------------------------------------------ [2012-06-01 06:13:43] reeze dot xia at gmail dot com Description: ------------ ReflectionParameter::getDefaultValue() memory leaks with constant. Test script: --------------- <?php define('TEST_CONST', '10'); class Foo { public function bar($param = TEST_CONST) { return $param; } } $refl_method = new ReflectionMethod('Foo::bar'); foreach ($refl_method->getParameters() as $param) { if ($param->isDefaultValueAvailable()) { var_dump($param->getDefaultValue()); } } ?> Expected result: ---------------- string(2) "10" Actual result: -------------- string(2) "10" [Fri Jun 1 14:09:29 2012] Script: '/Users/reeze/Opensource/php-src- 5.3/leak.php' /Users/reeze/Opensource/php-src-5.3/ext/reflection/php_reflection.c(2424) : Freeing 0x10C8A69E8 (11 bytes), script=/Users/reeze/Opensource/php-src- 5.3/leak.php /Users/reeze/Opensource/php-src-5.3/Zend/zend_variables.c(120) : Actual location (location was relayed) === Total 1 memory leaks detected === ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62202&edit=1