Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85088 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11232 invoked from network); 16 Mar 2015 20:34:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Mar 2015 20:34:25 -0000 Authentication-Results: pb1.pair.com smtp.mail=leverton@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=leverton@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.51 as permitted sender) X-PHP-List-Original-Sender: leverton@gmail.com X-Host-Fingerprint: 209.85.220.51 mail-pa0-f51.google.com Received: from [209.85.220.51] ([209.85.220.51:35861] helo=mail-pa0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 26/DB-34940-05E37055 for ; Mon, 16 Mar 2015 15:34:24 -0500 Received: by padcy3 with SMTP id cy3so74920011pad.3 for ; Mon, 16 Mar 2015 13:34:21 -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=B/tczPv0vLhgXsqmlhsscY7Bzum98eYGUfcdhJAlnYc=; b=KoDkHQ5S/MW7VgRkMsyY4mzH9cnTXzEGH8hY7/rEebaA6yrearPt+ta0DIa+jpQ7lQ SHAeEDYmyYna8WzW0GIh+gfUUTvBUd8qRX9M9Nvvp1/DUYArgwJjBU0qt0D3QIAHocBr iNNDA80z3XHA7NjpdGrEvH4rhLRHMTRCY7DzWAdqJGCXdaTE7AamYg+H9iZV8bo3Hlln elGqrIqAyBk/ihDjOASMWvJ7duj+PYW0qzKuxg4rQkYD/9J2eqd9YJ2fE6URRaB1e9TK Sc34rns9SxqfK3Y5ZylQ5LojRjxe/QNo8YFnCluh8zGmDrRa6WPeHZw/V2tHsKCf5FDv 3evA== MIME-Version: 1.0 X-Received: by 10.66.66.7 with SMTP id b7mr143087465pat.9.1426538061530; Mon, 16 Mar 2015 13:34:21 -0700 (PDT) Received: by 10.70.74.170 with HTTP; Mon, 16 Mar 2015 13:34:21 -0700 (PDT) In-Reply-To: References: Date: Mon, 16 Mar 2015 15:34:21 -0500 Message-ID: To: Yasuo Ohgaki Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] "strict_types" should be renamed "raise_type_error". WAS: About declare(strict_types = 1) From: leverton@gmail.com (Matthew Leverton) 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. (Although the irony of using =1 instead of =true isn't lost on me!) -- Matthew Leverton