Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101773 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68859 invoked from network); 5 Feb 2018 14:28:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2018 14:28:45 -0000 Authentication-Results: pb1.pair.com header.from=tendoaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tendoaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.170 as permitted sender) X-PHP-List-Original-Sender: tendoaki@gmail.com X-Host-Fingerprint: 209.85.161.170 mail-yw0-f170.google.com Received: from [209.85.161.170] ([209.85.161.170:43927] helo=mail-yw0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/1D-49805-B1A687A5 for ; Mon, 05 Feb 2018 09:28:43 -0500 Received: by mail-yw0-f170.google.com with SMTP id x190so18460021ywd.10 for ; Mon, 05 Feb 2018 06:28:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=Jgr1ACkOQRtbGbEmy950tSmXRlL/w4nJUrhnnLT+fN8=; b=t7O2HzkGPFxdSw9yVsk85JZZ9IrZoVxOd0Oziw6erhsv7X/dqDdI0fJo0AchaYXLqr v9DRMyVm7WPk7m3Gk7Z9qaeszCk/53SjO6/VCJVpD3ff/meqkcCq2MJNIAYdcjH3BMe9 CW2AwTHLv2f6QmQw2EnHhMsyLctmBQy2jfWUBwboVjtPordASFFesEEqIZYhjRFqhSny HDUm3VwI+ygT88Z9JjyMdmbTywLmX9+eL6KxFfGB0y/Be485o2wBm4Kv1S+GQaSc10LG bYsiZJH7RDHaK5iGmaGKn0Q4LsAeymaGrVoOZRSWV8xCYIBwQQr5+g7V9lzsJk9tEtnt YYpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=Jgr1ACkOQRtbGbEmy950tSmXRlL/w4nJUrhnnLT+fN8=; b=eDFu/W9gBc6vDp5tl4ZetL6LZoDDUE/4frdKfXJK/FDgO0HUYEtraMLkQPBouzvhr1 HFFR3qELl9tE2ogVWJ2mX2ZRk06guvz/6ipVyI1PNi0hi1VXPZS0EWAT9FAxour1xqF0 3/fEzoi85vWeHfWHXp0Msw0VZf1kWyfuY3BaeEAGR/i0UQtMr+bpfXVsTWdlRON9ABGi yRV9y9O4hXEds6zq2JVidZ2JbXZJpA8BcQWtpYEvBV472fNpk7anOxIPubc+OJC6z+UX 1L28lYVJr1+IKiByRF2lSIwOPBR4fe6DHdZqVXeVeAMzPGtt+SCezTjS49yzFC7ljwGw r48g== X-Gm-Message-State: APf1xPDpkurUGoebwtqrVWl6hm27Tf1PuYmnYDTDrAgCcw2uPA21wyjC NXN+yyuy+tP9NK9ed0NxoZYXEGT2do1ueJrDUs8= X-Google-Smtp-Source: AH8x225Ek/SvdauCDNfL8ATKsz2zx2PBNmqnGi2A2ozzIaOMjyCHyoLUC7Np5CFS8kNedQtJW1qfxXdxV7XRVT5AucY= X-Received: by 10.37.205.8 with SMTP id d8mr684402ybf.516.1517840919998; Mon, 05 Feb 2018 06:28:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.206.137 with HTTP; Mon, 5 Feb 2018 06:28:39 -0800 (PST) In-Reply-To: <79b192e6-a6bd-bd13-6bd4-b56011a5eac2@gmx.de> References: <07d9e3a0-d516-aa77-4818-ce8b02e8dd08@gmail.com> <79b192e6-a6bd-bd13-6bd4-b56011a5eac2@gmx.de> Date: Mon, 5 Feb 2018 08:28:39 -0600 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary="94eb2c188268dcb441056477e02a" Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Deprecation of fallback to root scope From: tendoaki@gmail.com (Michael Morris) --94eb2c188268dcb441056477e02a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable May I propose a compromise? If I understand what I've read over, the default of functions and constants to global scope is the primary blocking issue for creating an autoloader for these elements. Where that not PHP's behavior this functionality could have been implemented by now. The problem is that behavior has been around so long that any attempt to change it would incur a massive amount of changes. Using the E_STRICT notice level instead of E_DEPRECATED has been floated as one fix for this, but this doesn't change the fact that major applications and frameworks, such as Drupal, pride themselves in being able to pass all tests even with E_STRICT enabled. The maintainers of these projects would be annoyed to say the least to need to fix thousands of lines of code to get back to that point, and downstream projects such as Drupal could end up waiting years for all their upstream libraries to get their act together. Since the two issues are somewhat tied, why not bind them to a configuration flag following the pattern that was used to ultimately remove register_globals functionality from the language? At this point let it be known that when constant/function overloaders hit a php.ini config option will be added to turn them on -- and turning them on will turn global scoping for functions off. This solution isn't perfect. From where Drupal stands, even if all it's own code stopped using global functions the packages it relies on likely will continue to do so for some time. Even if they don't, there may be compatibility issues with the newer version. A slightly better solution would be to allow this to be set on a per namespace basis, but as PHP has no true notion of a namespace I don't think this can be implemented. The declare() statement might allow it to be done on a per file basis, but that's going to get messy fast. Still, I feel it is a workable approach despite the drawbacks. If anything this problem highlights another problem elsewhere in PHP - the inability to isolate package configuration, or configure packages at all. But that's a topic for another RFC, one I won't be starting cause I have no idea how to fix it. On Mon, Feb 5, 2018 at 8:09 AM, Christoph M. Becker wrote: > On 04.02.2018 at 22:56, Stanislav Malyshev wrote: > > >> 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, [=E2=80=A6] > > Do we? AFAIK, it is not possible to import *all* functions (or even all > symbols, for that matter) of a namespace, without explicitly mentioning > them. > > -- > Christoph M. Becker > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --94eb2c188268dcb441056477e02a--