Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81210 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30091 invoked from network); 27 Jan 2015 09:36:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jan 2015 09:36:50 -0000 Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:46641] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 03/42-18778-23C57C45 for ; Tue, 27 Jan 2015 04:36:50 -0500 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 7D06E10C0DF; Tue, 27 Jan 2015 09:36:46 +0000 (GMT) Date: Tue, 27 Jan 2015 09:36:46 +0000 (GMT) X-X-Sender: derick@whisky.home.derickrethans.nl To: Pierre Joye cc: Yasuo Ohgaki , Bob Weinand , PHP internals , Kalle Sommer Nielsen In-Reply-To: Message-ID: References: User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] [RFC] Remove the date.timezone warning From: derick@php.net (Derick Rethans) On Tue, 27 Jan 2015, Pierre Joye wrote: > On Jan 27, 2015 11:25 AM, "Yasuo Ohgaki" wrote: > > > > On Tue, Jan 27, 2015 at 12:56 PM, Kalle Sommer Nielsen > > wrote: > > > > > I think the warning is fair as it is, if it is annoying for small > > > use cases like on the CLI then simply: php -d date.timezone=UTC -r > > > "echo date('H:i:s');" or the dirty way by using the silent > > > operator. It used to be a notice prior 5.3 I think or something. > > > > > > While I do agree that most applications should be using UTC, which > > > should be set by default we sometimes need to tell userland the > > > hard way how things work, and/or what they should care about, like > > > the E_WARNING, E_CORE_ERROR, E_DEPRECATED for old php.ini > > > settings. > > > > > > -1 for removing it from my side. > > > > I can understand your argument. Perhaps, we may reconsider to > > introduce E_DEBUG/E_USER_DEBUG for these purposes. There are many > > functions, e.g. file related, that I feel E_WARNING is excessive. > > I do not have a strong opinion on that. So keep it or make it UTC > default but please do not add yet another warning/notice/whatever. > > Also, setting a timezone is not about Dev or other fancy tasks, it is > about making datetime processing right. > > If anything I would enforce the default at configure/build time. So it > at least gets the correct one from a host point of view. That would be nice, but it's unfortuntately not really possible. You can't find out what timezone the OS is using in a portable way. Not even among different linux distributions, let alone having Windows in the mix. We tried this before, and because it caused so many issues, the current warning was added (instead of trying to guess a timezone). cheers, Derick