Doc #78120 [Ver]: No more warning for missing timezone

From: Date: Tue, 17 Dec 2019 13:44:04 +0000
Subject: Doc #78120 [Ver]: No more warning for missing timezone
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-17138@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78120&edit=1

 ID:                 78120
 User updated by:    laurent dot lyaudet at gmail dot com
 Reported by:        laurent dot lyaudet at gmail dot com
 Summary:            No more warning for missing timezone
 Status:             Verified
 Type:               Documentation Problem
 Package:            Date/time related
 Operating System:   Debian 9.7
 PHP Version:        7.0.0
 Block user comment: N
 Private report:     N

 New Comment:

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


Previous Comments:
------------------------------------------------------------------------
[2019-12-16 16:17:45] antonino dot spampinato86 at gmail dot com

https://www.php.net/manual/en/migration70.incompatible.php
Your sistem have division by zero.

------------------------------------------------------------------------
[2019-06-06 12:52:27] cmb@php.net

Indeed, there is no longer any warning as of PHP 7.0.0[1].  The
notice for invalid timezones is still issued, though.

[1] <https://www.php.net/manual/en/migration70.other-changes.php#migration70.other-changes.remove-date-timezone-warning>

------------------------------------------------------------------------
[2019-06-06 11:55:04] laurent dot lyaudet at gmail dot com

Description:
------------
---
From manual page: https://php.net/function.date-default-timezone-set
---
The documentation contains
"
    Note:

    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.

root@StretchDevNewLaurent:/home/web/teliway.com/appli# 
  grep -r 'date.timezone' /etc/php/7.0/
/etc/php/7.0/apache2/php.ini:; http://php.net/date.timezone
/etc/php/7.0/apache2/php.ini:;date.timezone =
/etc/php/7.0/phpdbg/php.ini:; http://php.net/date.timezone
/etc/php/7.0/phpdbg/php.ini:;date.timezone =
/etc/php/7.0/cli/php.ini:; http://php.net/date.timezone
/etc/php/7.0/cli/php.ini:;date.timezone =




Test script:
---------------
<?php
echo date('Ymd');
1/0;
?>
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





------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=78120&edit=1


Thread (5 messages)

« previous php.doc.bugs (#17138) next »