|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #78120 No more warning for missing timezone
Submitted: 2019-06-06 11:55 UTC Modified: 2021-04-07 16:46 UTC
From: laurent dot lyaudet at gmail dot com Assigned: cmb (profile)
Status: Closed Package: Date/time related
PHP Version: 7.0.0 OS: Debian 9.7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: laurent dot lyaudet at gmail dot com
New email:
PHP Version: OS:


 [2019-06-06 11:55 UTC] laurent dot lyaudet at gmail dot com
From manual page:
The documentation contains

    Since PHP 5.1.0 (when the date/time functions were rewritten), every call to a date/time function will generate a E_NOTICE if the timezone isn't valid, and/or a E_WARNING message if using the system settings or the TZ environment variable.
However, I don't have any warning issued when I run the function date without timezone on Debian 9.7.

  grep -r 'date.timezone' /etc/php/7.0/
/etc/php/7.0/apache2/php.ini:;date.timezone =
/etc/php/7.0/phpdbg/php.ini:;date.timezone =
/etc/php/7.0/cli/php.ini:;date.timezone =

Test script:
echo date('Ymd');
20190606PHP Warning:  Division by zero in - on line 3
PHP Stack trace:
PHP   1. {main}() -:0

Warning: Division by zero in - on line 3

Call Stack:
   21.1228     344160   1. {main}() -:0


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-06-06 12:52 UTC]
-Status: Open +Status: Verified -Package: Documentation problem +Package: Date/time related -PHP Version: 7.1.30 +PHP Version: 7.0.0
 [2019-06-06 12:52 UTC]
Indeed, there is no longer any warning as of PHP 7.0.0[1].  The
notice for invalid timezones is still issued, though.

[1] <>
 [2019-12-16 16:17 UTC] antonino dot spampinato86 at gmail dot com
Your sistem have division by zero.
 [2019-12-17 13:44 UTC] laurent dot lyaudet at gmail dot com
Hello Antonino,

The "1/0;" code line is only here to show that warning/error display is activated,
and that it is not a problem with PHP cli parameter file cli/php.ini.

Best regards,
   Laurent Lyaudet
 [2021-04-07 16:46 UTC]
-Status: Verified +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-04-07 16:46 UTC]
This note has been removed in the meantime, since the PHP manual
is no longer supposed to document PHP 5 specifics.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Aug 10 17:05:45 2022 UTC