Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101779 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2129 invoked from network); 6 Feb 2018 01:51:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Feb 2018 01:51:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.47 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 74.125.82.47 mail-wm0-f47.google.com Received: from [74.125.82.47] ([74.125.82.47:51003] helo=mail-wm0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/51-49805-B3A097A5 for ; Mon, 05 Feb 2018 20:51:55 -0500 Received: by mail-wm0-f47.google.com with SMTP id f71so751473wmf.0 for ; Mon, 05 Feb 2018 17:51:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=7TazQXNDYYHOO6es3gxm180i5W/fYkCr8xgAq5tBsuI=; b=QXGHyJ/n92BHitc5gIUuEpGKOIJNWQYyR++9/UAmHrCvcHn/4Q3LgtuAj8POOqIEjh ByY0bvu11b2lcdroziQUU+ghpSpE7qIZaNtKDMVwjncX1uW/hYv6fih8BnbAe4ztsuTP Bz4aaBUYRZmfIFKcj0dHeIH4k+Ut7HK/fm6PGKWNrpk61CX6Z14Mu5t8BNfV+SePMMuq TImLKLmr3a9vzWcCSwIoDryQSXtBBnRCuuqozEeQpHZq3YxAMdcLIA9umPvgNKj7SMZe ci6+Pf3uOqbqnR0tI+hbz1ICdkpYTicQ1HELyrCNtFLDAVWREnjSdLinsLNqTp3UUvTL A1uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=7TazQXNDYYHOO6es3gxm180i5W/fYkCr8xgAq5tBsuI=; b=c/0+CDjj+O1DThbdnXVIVZnd4JCKHTQYq8aIwOO9YtkhRap694QYz3tVnYe35BK8YO nEz2tSEJpgqI1kVJoU2bRurSipAdy2fXfHAPoCOM5h7KD+sk6J2S4CKXVzFPMCZwuanu eM6dyleN8iNUSkr1LgJsCiKfqJBWWd/ImmimCebsuYqkn6G0OzA6PqCr+dzBjESxRp8o 8CVhaKF/a/efz8NT1NFHiCW9x+qU+Ek+nFwvIz4cEPni9pzroeua4yZuBI7MXD7DMOfK 7nu20UpaGp6IR+lyL5VgLybMZfMrhrkWKJzC6kVVHRq+wYIx/nxaRkS7KEJn7ulLjtct S/hw== X-Gm-Message-State: APf1xPAsVL/l1SbG17YVBAuqwEjwgkKbG5SfcwokCOdgFXRaFHFfVVZ0 p3a7nwegFdrqvScO7mr5eZYWuks+ZozvL07dCx4= X-Google-Smtp-Source: AH8x227KAOolKkL/FBTEyMv/vfz/EKOFiV8+tk8bByPLeqT97AuNnESF1Rm4shjnYxc1D+9q9o7fnkWvfFCalTbifNQ= X-Received: by 10.28.84.87 with SMTP id p23mr489990wmi.92.1517881912397; Mon, 05 Feb 2018 17:51:52 -0800 (PST) MIME-Version: 1.0 Sender: morrison.levi@gmail.com Received: by 10.28.56.3 with HTTP; Mon, 5 Feb 2018 17:51:51 -0800 (PST) In-Reply-To: References: <07d9e3a0-d516-aa77-4818-ce8b02e8dd08@gmail.com> Date: Mon, 5 Feb 2018 18:51:51 -0700 X-Google-Sender-Auth: LdT14joqAXmydYsjK9NDxWivZig Message-ID: To: Benjamin Eberlei Cc: Stanislav Malyshev , Wes , PHP Internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Deprecation of fallback to root scope From: levim@php.net (Levi Morrison) On Mon, Feb 5, 2018 at 9:54 AM, Benjamin Eberlei wrote: > On Sun, Feb 4, 2018 at 10:56 PM, Stanislav Malyshev > wrote: > >> Hi! >> >> > To get the same benefits (jit and such) wouldn't it be better to >> introduce >> > a "use function root;" or similar statement or a declare() to specify >> this >> > file imports all root functions? >> >> We already have this right now, and realistically speaking, who wouldn't >> do that in their code instead of writing weird \strlen() code? Everybody >> would configure their IDEs and so to insert this automatically. So we're >> talking about RFC to make people work harder for what they already have >> now and then end up in the same place we are already right now. >> > > Yes we do have root namespace lookup, but its not automatic, it is only as > a fallback. This RFC is about removing the intermediate namespace'd check, > hence requiring \strlen. > > My idea was to force all function lookups into the global nameespace first > by doing the declare or use. This way someone writing a file could state "i > dont use namespaced functions in this file, don't try to load them". > > I agree its annoying and more work, just wanted to present it as an > alternative option. > > >> >> > was acted on at any time in the future. and in addition people will >> silence >> > the notices on global error reporting level, because violations would >> >> And note also that we can't silence just this warning. Which means >> people would have to silence *all* warnings, thus making all other >> messages useless. This is not a good development and this is not what we >> should be training users to do - saying "well, it's a warning, just >> silence it" is the worth idea we could have. If we create a warning, >> recommendation should be "it's important enough so we call your >> attention to it, please deal with it", not "just silence it". If it's OK >> in most cases (as opposed to rare exceptional cases) for it to be >> silenced, it shouldn't be there in the first place. >> > > Yes, this is why I have a problem with using E_STRICT (we don't have a lot > of them at the moment, but maybe in preparation of 8 more?) warning for it. > It would send a wrong signal to ignore rather than fix, because the amount > of violations would be massive. It's fine to ignore them as long as they fix them later. That's precisely why I think E_STRICT is a good category for these notices. If, however, they ignore them forever that's their fault; we are simply providing advanced notice of a behavior we'd like to eventually change. Let me put "eventually" into perspective. We will probably have a 7.3 before we have an 8.0. This means that 8.0, the absolute earliest version we could remove this feature, is at least 2 years away before it reaches *any* of our users. Unless we extend it like we did with the last 5.X release (and I think we probably should extend it) this means that users can run their existing code on an officially supported PHP 7 release for the next 4 years at the minimum. I am fairly confident that for one reason or another it will delay another year or two, putting it at 5-6 years. If we are uncomfortable removing this feature in PHP 8.0 that means support would extend until the end of the last PHP 8 release. My best guess is that is at least 5 more years but probably more. That puts us in the 10-12 years timeframe. If we cannot fix such an issue *over an entire decade* then we may as well call PHP 7 the last major release. And let me be clear: I would like there to be a PHP 8 and a PHP 9. I think most of our users would like that as well. This means we have breaking to do over the next decade. The responsible thing is to give users this information as early as possible.