Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67458 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96728 invoked from network); 23 May 2013 18:40:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 May 2013 18:40:08 -0000 Authentication-Results: pb1.pair.com header.from=rdlowrey@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rdlowrey@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.174 as permitted sender) X-PHP-List-Original-Sender: rdlowrey@gmail.com X-Host-Fingerprint: 209.85.223.174 mail-ie0-f174.google.com Received: from [209.85.223.174] ([209.85.223.174:60803] helo=mail-ie0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BF/4A-26812-7826E915 for ; Thu, 23 May 2013 14:40:07 -0400 Received: by mail-ie0-f174.google.com with SMTP id 10so9413146ied.5 for ; Thu, 23 May 2013 11:40:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=SUhYegwCAIVRm0NP7eIom7u6jxBpfv+7NImr6bUCs7s=; b=RkUTWpXXwxzA3ix2J3flBR2Y8eMervRT0P74J98orjpJIDJvFn4/ZQYZ972cpUbJA+ I3fvHOSkl6FcCob41loxTLOjb5x/EKbJrMRiUodmv1imlH/nNHkcSO77LBE/rzO2lfXG vBuF0QpKaC6YRkt4P7f1w88gnMNbocZ48I6PLHhzx+PR+Qp8H7/qcol0dzcMin3OpTNB g/2wMM0ZfFUln3kOtS50VlxvYSDTDJuYtQ/xkGeJnDcydwWGskoXZXZChiamIF9NlGvN 8Pcv211OI68OZsIlfImNTfnJeDnMcv9Bpst4rexlhzv2Zg+Kb8nit8I4i2wmLwaoq73L JBkA== MIME-Version: 1.0 X-Received: by 10.42.196.138 with SMTP id eg10mr10714348icb.5.1369334402632; Thu, 23 May 2013 11:40:02 -0700 (PDT) Received: by 10.50.56.103 with HTTP; Thu, 23 May 2013 11:40:02 -0700 (PDT) Date: Thu, 23 May 2013 14:40:02 -0400 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: date.timezone E_WARNING -- Really necessary? What's the rationale? From: rdlowrey@gmail.com (Daniel Lowrey) I'm probably not the typical PHP user; I spend 99% of my PHP time using the CLI (and not web SAPIs). This means that I frequently run PHP without an .ini file. As a result, when I use any of the date/time functionality I invariably end up with this awesomeness: > Warning: date(): It is not safe to rely on the system's timezone settings blah blah blah. Could I run `$ php -d date.timezone=UTC myfile.php`? Of course, but should that really be necessary? It seems to me this warning caters to the very lowest common denominator among PHP devs who can't be bothered to understand how PHP handles timezones. The warning also seems to assume that people only use PHP as a web framework and not as an actual programming language (otherwise I wouldn't have to explain to the CLI which timezone I want to use). I don't need php.ini ... I want to use PHP to *program*. If it's going to default to UTC anyway should there really be an E_WARNING? Can't PHP just quietly use UTC? The "U" in UTC *does* stand for "Universal," after all. It's a sensible default and as such shouldn't merit a warning. Besides, if someone doesn't understand what's happening and gets unexpected date/time results the first thing they're going to do (I hope) is hit their favorite search engine for "set PHP timezone." Perhaps I'm the only person to experience ongoing annoyance at the hands of this protective "feature?" Is there a substantive reason why this warning exists other than the error message's suggestion that "you most likely misspelled the timezone identifier?" I understand that one of PHP's most attractive features is ease-of-use for programming novices but you can only go so far in preventing people who don't know what they're doing from shooting themselves in the foot. I'm not sure if it's possible but perhaps a compromise might be to disable this warning in the CLI, at least?