From: acc_php at riggers dot me dot uk
Operating system: Vista x64
PHP version: 5.2.6
PHP Bug Type: Date/time related
Bug description: strftime memory leak?
Description:
------------
strftime() called many times results in increasing memory usage. date() is
OK. This is on Vista x64. PHP 5.1.6 (only version i have at the moment) on
linux does not exhibit the same problem.
Reproduce code:
---------------
<?php
echo "=== strftime() ===\n";
echo "Start: ".memory_get_usage()."\n";
for($i = 0; $i < 10000; $i++ ) {
strftime("%d");
}
echo "End: ".memory_get_usage()."\n\n";
echo "=== date() ===\n";
echo "Start: ".memory_get_usage()."\n";
for($i = 0; $i < 10000; $i++ ) {
date("d");
}
echo "End: ".memory_get_usage()."\n";
?>
Expected result:
----------------
End memory usage for strftime() should be close to Start memory usage.
Actual result:
--------------
C:\php-gtk2>php andy\symftest\strftime.test.php
=== strftime() ===
Start: 54384
End: 119800
=== date() ===
Start: 119800
End: 119768
C:\php-gtk2>php -v
PHP 5.2.6 (cli) (built: May 2 2008 19:37:32)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
C:\php-gtk2>
--
Edit bug report at http://bugs.php.net/?id=46075&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=46075&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=46075&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=46075&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46075&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=46075&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=46075&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=46075&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=46075&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=46075&r=support
Expected behavior: http://bugs.php.net/fix.php?id=46075&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=46075&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=46075&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46075&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46075&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46075&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=46075&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=46075&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=46075&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=46075&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=46075&r=mysqlcfg