php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46166 E_STRICT error reporing not working correctly
Submitted: 2008-09-24 12:06 UTC Modified: 2008-09-25 02:29 UTC
From: wesleys at slakkie dot euronet dot nl Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.2.6 OS: Ubuntu 8.04
Private report: No CVE-ID: None
 [2008-09-24 12:06 UTC] wesleys at slakkie dot euronet dot nl
Description:
------------
E_STRICT error messages should be logged when date() is called when there is no timezone set via php.ini or via date-default-timezone-set when using php-cli. Running the same code via Apache does trigger such a message.

When setting an incorrect timezone, the NOTICE is present in both cli and mod_php.


Reproduce code:
---------------
# Nothing is set via php.ini or date_default_timezone_set()
# Tested in 5.2.[1346]
error_reporting(E_ALL | E_STRICT);
printf("Date: %s\n", date("Y-m-d H:i:s", time()));


Expected result:
----------------
Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in <file> on line <lineno>
Date: 2008-09-24 14:03:40 

Actual result:
--------------
Date: 2008-09-24 14:03:40 



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-24 23:04 UTC] wesleys at slakkie dot euronet dot nl
Never mind, I just realized I do have a TZ configured in my enviroment, which is not set for the Apache user. If I unset the TZ variable it does return the error. You can close this bug.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Nov 26 02:00:01 2025 UTC