Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108299 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 39888 invoked from network); 28 Jan 2020 20:41:32 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Jan 2020 20:41:32 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4CFBF18050F for ; Tue, 28 Jan 2020 10:52:00 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-il1-f177.google.com (mail-il1-f177.google.com [209.85.166.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 28 Jan 2020 10:51:59 -0800 (PST) Received: by mail-il1-f177.google.com with SMTP id v13so6770947iln.4 for ; Tue, 28 Jan 2020 10:51:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=nOJgG6fd0GvvsLIhgd2HJDIUTc2QIOcHH0H/PVYDm00=; b=udczabvgkAE/gZ6DOa10JxlfRCnggJbsLcpXhhfisjG+kpgdaqobe7gt5q6Kge2K+Y XPb4enxXiTsqokZ6f0oDhqOrqcsfyVsSec2WofnVgQHPsqSTuU10oNdwRT3+kkDdQACD vbtT/KrdqA46j5wvXHqFOYl0bHrK4o8wd7KzzOyXd7SjRiYiqunME0EbtAxBqbVFc2Wy ZRw60D6+ZVw3PhAPIEG7eWLqWimicKhOnlwk7nDVQsbyU3ckEg1nO8Q90cyNVLEALZAV D1EWMMQIHfUGg8cBrneoUr/RhR8UfuybeqFvlHPA/jfqLVAYFP6Bz9CYc7RWNFOXB9k7 lwMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=nOJgG6fd0GvvsLIhgd2HJDIUTc2QIOcHH0H/PVYDm00=; b=kHnjFb6nbvyJrRPioS6lpmLWt8XbsDNmqJ/R13zCWuLsHDwoprF3AVqE7EatuF7kpI UYOquA5Ze0Xo3Ofntp+y4eAon2wFRGHpeicNUrCfLho8VsciSQO+skmGBt6rAkqOF9Zi C/DnK1MhxTlnJiVQ9YE97ViFBemSvSbbxSjW/D2+EuQ86RfaNPL3PCugyfi7DjIQd5Xy 6MCg2TncbJ7bfGBn5yLFAwAQBysbd6l6EJRA2N96U/pSPPD1sJTXluJ+jOCiIdlcda36 rBIf7u1D/jonuJwp7AS5wYq+JawhMHl/nappC8sXfzid3vb8oF+N8ztrCZCzC40QQPpP ZGuA== X-Gm-Message-State: APjAAAVbyqFoYr3n2S/aemxu8RPt20MEorO7d052qdGEaWfymSoPjRoq gLfnEp+OJU6DKNo4B0EE89S7+yjSjKBzKLHcMnfeCMDC X-Google-Smtp-Source: APXvYqxPzCG99oT3cL2wiGiUmVHLYq0FKHg4FaxN51eLNoYRLku13edOQ/cFns/9z1jAWv1FZz6CW4EietkhatPSAuo= X-Received: by 2002:a92:d702:: with SMTP id m2mr20213779iln.149.1580237517418; Tue, 28 Jan 2020 10:51:57 -0800 (PST) MIME-Version: 1.0 References: <2d50c8c0-cbd1-0a0e-4098-eb00facf86db@gmail.com> In-Reply-To: Date: Tue, 28 Jan 2020 18:51:46 +0000 Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary="000000000000e2f488059d37b79f" Subject: Re: [PHP-DEV] [RFC] "use global functions/consts" statement From: rowan.collins@gmail.com (Rowan Tommins) --000000000000e2f488059d37b79f Content-Type: text/plain; charset="UTF-8" On Tue, 28 Jan 2020 at 18:13, tyson andre wrote: > That's more of an objection to 'global' than an argument about 'fallback' > or 'default'. > It isn't suggesting a name to use instead of 'global'. > No, it's saying that whatever name you use, the guarantees of behaviour are only as strong or weak as decisions we make in the future about Backwards Compatibility. That's no more or less true for one mode than the other, regardless of what we call them. > Any changes I don't expect to strict_types or function_and_const_lookup > would be discussed in the RFCs proposing those changes. > Yes, and that includes changes to how 'fallback' mode works. > For allowing a particular cast with strict_types=1, > only strict_types=1 would probably need to be changed to keep backwards > compatibility, > since code without TypeErrors would continue to work. > OK, bad example; what if we make the rules around int->float coercion stricter? The point is, why is a breaking change to mode 1 fundamentally different from a breaking change to mode 0? If 'fallback' and 'default' ever mean different things, > we'll very likely need to add 'default' again if namespace-scoped declares > become a thing. > I still don't understand why you would ever want that. Perhaps it would help to think about specific examples: When I write file foo.php, I know that I want to use functions in the current namespace if they are defined. So I add declare(function_and_const_lookup='fallback') to that file to make sure it continues to work: * If the PHP default changes to 'global', the file setting will tell it to use 'fallback' mode instead * If a namespace-scoped declare is set to 'global', the file setting will take precedence, so it will still use 'fallback' mode Similarly, when I write file bar.php, I add declare(function_and_const_lookup='global'); no matter what the PHP default or namespace-scoped setting say, the file will act as I intended. Can you provide an example of when you'd want to use 'default' instead of specifying the mode you've written the file to run in? > A 'fallback' can be added if and when we have a use case for it. > I'm saying we do have a use case: enabling forwards compatibility so that we can change the default in future if we want to. I'm still trying to understand the use case for 'default', though. > There are large numbers of settings with values of 'standard'/'default' > that became problems. > There are large numbers of settings with values of 'standard'/'default' > that made perfect sense > and didn't cause any issues. > Sure, and I gave a rule of thumb for that earlier: "default" makes sense when the setting *doesn't actually matter*, and you want to delegate the decision. That doesn't seem to apply to this case. Regards, -- Rowan Tommins [IMSoP] --000000000000e2f488059d37b79f--