PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Caching » Cache_Lite » Bug #7446

Using mktime() with no args is generating strict errors

Details

Submitted2006-04-20 22:06 UTC
Fromron at roncemer dot com
Assignedtacker
StatusClosed
PackageCache_Lite
PHP Version5.1.2
OSFC5
Roadmaps1.7.5

Comments

[2006-04-20 22:06 UTC] ron at roncemer dot com

Description:
------------
On line 624 of Lite.php, please change the mktime() call to time().

On FC5 (PHP 5.1.2), the use of mktime() without any arguments causes the following error when strict error reporting is turned on:

Apr 20 15:45:02 10.2.3.8 httpd[3177]: [error] [client 10.2.9.2] PHP Strict Standards: mktime() [<a href='function.mktime'>function.mktime</a>]: You should be using the time() function instead in /var/www/html/classes/Cache/Lite.php on line 624

This appears to be happening when the time comes for Cache_Lite to automatically clean out expired entries in the cache.

Thanks!
Ron

Test script:
---------------
<?php
echo mktime();
?>

Expected result:
----------------
With E_STRICT turned on in php.ini, you'll get the above-mentioned error message.

Apparently the PHP authors arbitrarily decided that using mktime() with no arguments instead of time() is a problem. I fail to see how it's problemmatic, but they do, and I guess it's easier to fix this in Cache_Lite than in PHP.

Actual result:
--------------
Calling mktime() with no arguments in PHP 5.1.2 causes the following error if E_STRICT is turned on in php.ini:

Apr 20 15:45:02 10.2.3.8 httpd[3177]: [error] [client 10.2.9.2] PHP Strict Standards: mktime() [<a href='function.mktime'>function.mktime</a>]: You should be using the time() function instead in /var/www/html/classes/Cache/Lite.php on line 624

[2006-04-21 17:30 UTC] fab at php dot net

Cache_Lite is compatible with PHP4 and PHP5. So it can't be "E_STRICT PHP5" safe (because of use of "var" instead of "public" or "private"...) ? Am I missing something ?

[2006-05-13 09:47 UTC] fab at php dot net

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.