Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.8.3

Bug #7446 Using mktime() with no args is generating strict errors
Submitted: 2006-04-20 22:06 UTC
From: ron at roncemer dot com Assigned: tacker
Status: Closed Package: Cache_Lite (version 1.7.0)
PHP Version: 5.1.2 OS: FC5
Roadmaps: 1.7.5    
Subscription  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
2009-01-13 10:28 UTC
Package:
Bug Type:
Summary:
From: ron at roncemer dot com
New email:
PHP Version: Package Version: OS:

 

 [2006-04-20 22:06 UTC] ron at roncemer dot com (Ron)
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

Comments

 [2006-04-21 17:30 UTC] fab at php dot net (Fabien MARTY)
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 (Fabien MARTY)
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.
 [2009-01-12 17:08 UTC] austinb (Austin Bis)
Added a patch to quick fix the problem if you are worried about it. We use a centralize logging system so we manually applied the patch to our code to prevent being flooded with error lines when the gc happened.
 [2009-01-13 10:28 UTC] tacker (Markus Tacker)
It's not related to PHP5 oo features but due to the fact that the documentation is not explicit about calling mktime() w/o arguments. I've opened a bug report for that: http://bugs.php.net/bug.php?id=47084 and replaced the mktime() usage with time().