|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-01-19 16:52 UTC] diogo86 at gmail dot com
Description:
------------
The date() function keep consuming memory each time it's called even if it's not assigned to any variable.
Reproduce code:
---------------
<?php
for($i=0; $i<10000; $i++)
date('d/m/Y H:i:s');
echo memory_get_usage();
?>
Expected result:
----------------
Something about 46436 bytes of memory usage just like when I call this statement inside that loop:
$str = strtoupper($_SERVER['PHP_SELF']);
Actual result:
--------------
5485532 bytes of memory usage.
----
Debian Linux 2.6.15-1-486
PHP 5.2.0-8 (cli) (built: Dec 17 2006 20:03:51)
[PHP Modules]
bcmath
bz2
calendar
ctype
date
dba
dom
exif
filter
ftp
gettext
hash
iconv
json
libxml
mbstring
mime_magic
ncurses
openssl
pcntl
pcre
PDO
pdo_pgsql
posix
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
zip
zlib
[Zend Modules]
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 13 07:00:02 2025 UTC |
Debian Box Etch with PHP 5.2 continues with this problem (with an empty or complete php.ini file). With ini_set ("date.timezone", "America/Toronto"); in php code, the problem is solved. Debian version : php5-common 5.2.0-8+etch13