Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81402 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79435 invoked from network); 30 Jan 2015 05:37:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jan 2015 05:37:01 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.176 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.216.176 mail-qc0-f176.google.com Received: from [209.85.216.176] ([209.85.216.176:39470] helo=mail-qc0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0F/85-47940-C781BC45 for ; Fri, 30 Jan 2015 00:37:00 -0500 Received: by mail-qc0-f176.google.com with SMTP id c9so19112949qcz.7 for ; Thu, 29 Jan 2015 21:36:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=XplRwks9lur6udhTVxYzUCpQm7y3RSSWEgINfhLc6YU=; b=lsYmGbfp8NVpddEqKUXuo4F6tlUjJcN4fME9O0IZhS4CGc2aK860tsBehlnctofZmk B1ioj9UyRzOwV7YafG/1Ttj4cmOm0jYca54tEMEfIlA1NdQ2XkkpnIsJI1nbLs1JhLOl i91cKf9FA+NGnpsdTc9dujsE7GgX3VVqqdAOj9Eji13R9j3ZTqpmvRBFTJyyo4JTJe0p AS6VME7d7VYBBOjqpVuLbDtWEcFYM0SiChV4G79ikaRmPT6+6I3EGHVisrIcjk8Ycc4Q ANhoMAhE2WwZ6rjaMbCWNYA4J41vJ6ZKwQ1RMrSdXXQ34IpNaUXnyoRcQ3SvqfE1C8T1 R+bQ== X-Received: by 10.140.90.112 with SMTP id w103mr5055703qgd.65.1422596217825; Thu, 29 Jan 2015 21:36:57 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.229.93.70 with HTTP; Thu, 29 Jan 2015 21:36:17 -0800 (PST) In-Reply-To: <54CB13A4.9060900@rodas.me> References: <54CB13A4.9060900@rodas.me> Date: Fri, 30 Jan 2015 14:36:17 +0900 X-Google-Sender-Auth: Whs42g6VkjCs_36DxjS0XdICL3U Message-ID: To: =?UTF-8?B?Q8Opc2FyIFJvZGFz?= Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c11a9838efd0050dd7fe04 Subject: Re: [PHP-DEV] Is it a good idea to have a "strict" mode? From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c11a9838efd0050dd7fe04 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Cesar, On Fri, Jan 30, 2015 at 2:16 PM, C=C3=A9sar Rodas wrote: > I'm wondering if it would be a good idea to have a `strict` mode in PHP. > Many language have them and it is a good idea. > > I think it should be a bit different in PHP, it should encourage the > following things: > > - Avoid deprecated things, it should throw an exception. > - Avoid explicit conversions of undefined constants to strings. > - Anything else that could make run-time slower *or* bad practice. > > ```php > "use strict"; > > var_dump(FOOBAR); // should throw an exception, undefined constant. > ``` > We have error_reporting INI for this purpose. Users may be strict or lazy for errors by the INI setting. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c11a9838efd0050dd7fe04--