php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #37486 Docs do not reflect E_STRICT warning for timestamp functions
Submitted: 2006-05-18 04:00 UTC Modified: 2006-09-08 09:09 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: brianm-phpbugs at dealnews dot com Assigned: philip (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
 [2006-05-18 04:00 UTC] brianm-phpbugs at dealnews dot com
Description:
------------
Enabling E_STRICT and using strtotime() yields this error:

Strict Standards: strftime() [function.strftime]: 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. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in /www/dev.phorum/phorum5-dev/include/format_functions.php on line 157

However, the docs at http://us3.php.net/function.strftime/ make no mention of this.  I believe if you are going to throw warnings for things in E_STRICT, it should at least be documented.

Reproduce code:
---------------
use strtotime() without setting a timezone in php.ini

Expected result:
----------------
Documentation would have headed this warning.

Actual result:
--------------
No docs about this being a possible problem.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-18 06:02 UTC] philip@php.net
We need a script to check all of php-src (and PECL) for what functions may emits errors, and document accordingly. E_STRICT and E_WARNING especially. In fact, it should check return types too. And compare prototypes. Sounds like a large task so we can simply add E_STRICT info to strftime() for now :)
 [2006-05-18 12:09 UTC] crescentfreshpot at yahoo dot com
E_STRICT is only thrown in latest snaps, not in any official release (f.e. not in 5.1.4). You can't expect the documentation to be _that_ up to date.

There is a huge thread on internals going on right now on whether E_STRICT should be triggered for this sort of thing (i.e. when E_ALL is set) in the next release.

This is not a doc bug. Not yet at least ;)
 [2006-05-18 12:47 UTC] brianm-phpbugs at dealnews dot com
E_STRICT is thrown when you set error_reporting to throw it.  And according to the discussion on internals (of which I am a part of), they want people to develop that way.

Mark it will fix later or whatever, but, this will need to be addressed as E_STRICT gets more and more steam.
 [2006-05-18 16:29 UTC] philip@php.net
Whether E_STRICT is in E_ALL does not relate to this bug, this function emits E_STRICT regardless. And since we document future releases, including PHP 6, it's still a valid bug. Or wait, maybe it's a feature request until 5.2.0 is out? ;)

This bug report has been changed to include "all date functions that result in this error" as I believe all are affected that pass in a timestamp. If you know of one not in ref.datetime please write that here. Assigning to self. Creating an entity to include in all such functions. 
 [2006-05-18 18:15 UTC] philip@php.net
This error came about in PHP 5.1.0
 [2006-09-08 09:09 UTC] philip@php.net
This is now [finally] documented in CVS and will show up after the next manual build, thanks for reporting the bug :)

See the diff/info here:
http://news.php.net/php.doc/969373952
http://news.php.net/php.doc/969373953
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 07 05:01:36 2025 UTC