|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2012-06-01 06:21 UTC] reeze dot xia at gmail dot com
  [2012-06-01 06:57 UTC] laruence@php.net
  [2012-06-01 07:00 UTC] laruence@php.net
  [2012-06-01 07:01 UTC] laruence@php.net
  [2012-06-01 07:18 UTC] laruence@php.net
 
-Status:      Open
+Status:      Closed
-Assigned To:
+Assigned To: laruence
  [2012-06-01 07:18 UTC] laruence@php.net
  [2014-10-07 23:24 UTC] stas@php.net
  [2014-10-07 23:35 UTC] stas@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 03:00:01 2025 UTC | 
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 ===