Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85090 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15681 invoked from network); 16 Mar 2015 20:58:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Mar 2015 20:58:29 -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.218.53 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.218.53 mail-oi0-f53.google.com Received: from [209.85.218.53] ([209.85.218.53:36055] helo=mail-oi0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C7/8C-34940-4F347055 for ; Mon, 16 Mar 2015 15:58:28 -0500 Received: by oigv203 with SMTP id v203so14503305oig.3 for ; Mon, 16 Mar 2015 13:58:25 -0700 (PDT) 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=S19PaJ0DfcCfgDz72uNQcX4GH4h475H+JpHCbs6P2fs=; b=HrNRQopeTPgV+nzJ23ygduzZGEaQxmxGSPvrYpUj2xVrFuJ6hv02HNXtN/4x+hrI3M 4oi11WwTaSeGFfBgaocFtRBPbdDNdU5GuhcmB/DDEm3pcOti/tD0NF5Yf+fJSjqN37GP Qj4WnJ7RI7kWrKMjirx2aeMrE7L7SMdWCYRVs4V3fU7901/q2yeVce25IJRuY6DpNi2P NpOk6NVM4UumIO71nAV0MC7i6ptDouLBUZ21WCdE7KV5UrrHnIyeQPhbydMIud7BTQx/ COQ3efBlA0vNP/xaCDQhm5eIb0PCF7IGtYTHnjhfUjGRt/5GXYMPMd0ijgruJBmGFeu7 YOlg== X-Received: by 10.182.158.195 with SMTP id ww3mr49911398obb.22.1426539505602; Mon, 16 Mar 2015 13:58:25 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.202.58.2 with HTTP; Mon, 16 Mar 2015 13:57:45 -0700 (PDT) In-Reply-To: References: Date: Tue, 17 Mar 2015 05:57:45 +0900 X-Google-Sender-Auth: UOZYKOymllvE7FcZxfgvOP30l1Q Message-ID: To: Matthew Leverton Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e01537d1e7d562005116e1cdf Subject: Re: [PHP-DEV] "strict_types" should be renamed "raise_type_error". WAS: About declare(strict_types = 1) From: yohgaki@ohgaki.net (Yasuo Ohgaki) --089e01537d1e7d562005116e1cdf Content-Type: text/plain; charset=UTF-8 Hi Matthew and all, On Tue, Mar 17, 2015 at 5:34 AM, Matthew Leverton wrote: > On Mon, Mar 16, 2015 at 2:53 PM, Yasuo Ohgaki wrote: > > Hi all, > > > > I think this is important, but not many people realize the importance. > > Therefore I created this as a new thread at the last minutes of vote. > > > ... > > > > "strict_mode" is just controlling errors, then it should be named as > error > > controlling directive and raise E_WARNING/E_TYPE or whatever. > > > > Even if what its controlling is error that can be overridden by caller, > yet > > calling it "strict_types" is not correct. Proper name would be something > > like "raise_type_error". > > > > Let's see how it looks if "strict_types" is renamed to "raise_type_error" > > > ... > > > declare(raise_type_error = 1); > > require "lib.php"; > > foo("123"); // will give an error > > ?> > > > I agree that the name doesn't by itself explain the feature, but how > could it possibly? You'd end up with something like: > > > declare(raise_type_errors_on_parameter_mismatches_when_calling_functions_from_this_file_regardless_of_where_the_functions_are_defined_and_what_the_setting_is_in_other_files=1); > > I don't think your suggestion explains the feature any better than > strict_types. The word "strict" is not right word for the feature. It should not be used to avoid confusions at least. Anyway, my point is "Is everyone feel right about following behavior" regardless of directive name. The declare here does just nothing. This is the same basically as The error_reporting() here does just nothing. Does this make sense? Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --089e01537d1e7d562005116e1cdf--