Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67568 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89032 invoked from network); 28 May 2013 00:12:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 May 2013 00:12:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=kris.craig@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kris.craig@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.176 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 74.125.82.176 mail-we0-f176.google.com Received: from [74.125.82.176] ([74.125.82.176:50985] helo=mail-we0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 01/97-44058-A66F3A15 for ; Mon, 27 May 2013 20:12:27 -0400 Received: by mail-we0-f176.google.com with SMTP id p58so4660407wes.21 for ; Mon, 27 May 2013 17:12:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=DgRSCMxjc/qWtiQAmj4z/TRkSGCvNACY+aDmzwtgDhU=; b=Dq34CxuVDs3vzXHZTgLHA6SgieV0d0JP6QifIeu81+7awoSOALzicjNXWOegn2wDJV 1pR9kP+GJWkasWa2Z1vsRE/62q8SRynzrpBPmlMGRNia8ZpWuB5eG794GvVcIFaDv5Ef L7d4rjj8Ejd6qv/8tSRemAlqe1xxKD7nv/J1ls1cWUdhxHRMCTQeyzLDbD3wZpDqx7qg pKDpRcwmTEUDNVUkylZD+Cw8djKvSNyP5dtD8gMvetxYmwSQGMwoURfXZkn8WKoIslT8 9UcDolGb9oHSznBTLXGS/yNLhOiBXJb1XrFQGJpkUUdmdRdqR8F6lVGA3AkIxj1NDha9 ScaA== MIME-Version: 1.0 X-Received: by 10.180.21.167 with SMTP id w7mr9935139wie.2.1369699943229; Mon, 27 May 2013 17:12:23 -0700 (PDT) Received: by 10.194.90.39 with HTTP; Mon, 27 May 2013 17:12:23 -0700 (PDT) In-Reply-To: References: Date: Mon, 27 May 2013 17:12:23 -0700 Message-ID: To: Daniel Lowrey Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=047d7b6d9a8890ac9704ddbc1e6b Subject: Re: [PHP-DEV] date.timezone E_WARNING -- Really necessary? What's the rationale? From: kris.craig@gmail.com (Kris Craig) --047d7b6d9a8890ac9704ddbc1e6b Content-Type: text/plain; charset=ISO-8859-1 On Mon, May 27, 2013 at 4:35 PM, Daniel Lowrey wrote: > I understand that you can use php -d, but this is not a portable solution. > My specific use case is running a libevent-based HTTP server and I cannot > even run unit test suites without an .ini file because of this warning. Why > does PHP force me to include configuration directives that it clearly > doesn't need to function correctly? Forcing users to specify additional > command line options on every execution is no less pointless than than > requiring an .ini file where none is needed. A user's time zone setting is > simply not a language-level concern. Nor is a user's inability to > understand how timezones work. I appreciate Derrick's work on the extension > but I have yet to see any valid justification for triggering an error when > no error actually exists. > > On Monday, May 27, 2013, Pierre Joye wrote: > > > On Tue, May 28, 2013 at 12:57 AM, Daniel Lowrey > > wrote: > > > > > > My problem with the current behavior is that it essentially *forces* > > > the use of an .ini file by triggering an error if no default is > > > assigned. > > > > No it does not. You can use: > > > > - php -d ... > > - date_default_timezone_set > > > > > Now, as far as I can tell the only argument put forward to justify > > > triggering the error is (summarized): many people are too stupid to > > > set a timezone and don't understand why the results of their date() > > > calls are different from their own timezone. This results in many > > > erroneous bug reports. > > > > It is not one of the arguments. The arguments are bad TZ, invalid TZ > > or inconsistent in system's TZ, which causes hard to catch bugs (and > > not possible to fix), non portable code (if you rely on a bad TZ), to > > name only a few. > > > > And I stop here for this discussion, I do not see any new arguments on > > both sides and a default TZ will very unlikely happen. Packagers could > > deal with that easily and application developers as well. > > > > Cheers, > > -- > > Pierre > > > > @pierrejoye | http://www.libgd.org > > > At the risk of sounding like a broken record, adding a configure option would render this entire debate moot. PHP's behavior without the option specified would be identical to the way it is now. With the option specified, PHP would assume a default timezone if one is not set in php.ini, including if php.ini doesn't exist at all. So, bug tracker wouldn't get filled-up with default timezone behavior confusion like before and people like Daniel would be able to easily do their thing without php.ini and without having to change any of their runtime parameters or muck around with the source code. It's win-win. I'd be happy to draft an RFC for this. I really don't see the point in dragging on this heated argument when we can so easily skip around it altogether. --Kris --047d7b6d9a8890ac9704ddbc1e6b--