Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67519 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57972 invoked from network); 25 May 2013 15:25:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 May 2013 15:25:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.172 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.223.172 mail-ie0-f172.google.com Received: from [209.85.223.172] ([209.85.223.172:47171] helo=mail-ie0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/D5-25010-2F7D0A15 for ; Sat, 25 May 2013 11:25:38 -0400 Received: by mail-ie0-f172.google.com with SMTP id 16so15174906iea.31 for ; Sat, 25 May 2013 08:25:36 -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=MQ4CXIC1ey7n3cp+zqGfefiYHUlIOyBQDZ0Xox8P8bQ=; b=h1xT7L7jU82urgCpAM+GYINy/0UICnJyBV2SzVLg0gWre3L6FWuyQIAMtfTK/emUYQ DCEcI4hs3CZLmMjDHvg6qxIa6AUyp8flfupyZLFPTW1Fe5zeV3GmMgMAxmbLzgZTHJDP d1dT4FFIP+9Qe92vSLOCUDhIyFqqAmphdIWbTa9h5Tu9flhXWEC4OBWTioqP0Dygf83j 0azY3KaUOWCOCW2/fiv6UUhIJaPYet2RztJybCCifr9z9DqxINDPega0ib3fRkLBawQR Qwn9JiDjryNvUGXuQtRN/2xIL/JdigSp3JNwiZFtUdTcXdFkMmVB37jZoL/Ss1u3gpM8 oI0A== MIME-Version: 1.0 X-Received: by 10.50.171.225 with SMTP id ax1mr1851291igc.17.1369495535611; Sat, 25 May 2013 08:25:35 -0700 (PDT) Received: by 10.50.209.3 with HTTP; Sat, 25 May 2013 08:25:35 -0700 (PDT) In-Reply-To: References: <51A092FC.4010700@wikimedia.org> <51A0D320.5020605@wikimedia.org> Date: Sat, 25 May 2013 17:25:35 +0200 Message-ID: To: Levi Morrison Cc: Tim Starling , Pierre Joye , PHP internals Content-Type: multipart/alternative; boundary=089e01176549ebfc4404dd8c862a Subject: Re: [PHP-DEV] date.timezone E_WARNING -- Really necessary? What's the rationale? From: tyra3l@gmail.com (Ferenc Kovacs) --089e01176549ebfc4404dd8c862a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sat, May 25, 2013 at 5:09 PM, Levi Morrison wro= te: > >> It is actually only about getting safe, cross platform/OS (even > >> between Linux versions) for the TZ database. It has nothing to do > >> with taste or similar subjective opinion. > >> > >> For the record, the behavior requested in this thread is what we had > >> in earlier versions, all we got was plenty of bugs reports about > >> wrong TZ detections. > >> > > > > I had missed the removal of the TZ detection code from > > guess_timezone() in 5.4. So @date_default_timezone_get() is somewhat > > less useful than it used to be, as a function for detecting system > > settings. > > > >> I think it is not too much asking to set it in php.ini or in your > >> application. > >> > > > > At least for MediaWiki, it's certainly more important to avoid > > warnings than it is to have the right local timezone. UTC is used in > > any case where consistency is important. Based on other posts to this > > list, I don't think we're alone in this. > > For the record, the PHP 5.4+ date_default_timezone_get is equivalent to > > ini_get('date.timezone') ?: 'UTC' > > except that date_default_timezone_get will raise a warning and the > above will not. > > and the fact that date_default_timezone_get wouldn't return invalid timezone, while ini_get would: ./sapi/cli/php -n -d date.timezone=3D"Foo/Bar" -r 'var_dump(@date_default_timezone_get());var_dump(ini_get("date.timezone")?:= "UTC");' string(3) "UTC" string(7) "Foo/Bar" --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --089e01176549ebfc4404dd8c862a--