Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107883 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 43230 invoked from network); 28 Nov 2019 14:01:57 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 28 Nov 2019 14:01:57 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 21EDC2D1FF3 for ; Thu, 28 Nov 2019 03:57:06 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Thu, 28 Nov 2019 03:57:05 -0800 (PST) Received: by mail-il1-x133.google.com with SMTP id a7so23999869ild.6 for ; Thu, 28 Nov 2019 03:57:05 -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=6qDQkdgyU7UWMSAu+wH8uU1FDBNaBkcRU1ghvepkNcY=; b=qOErIiv95pKeU6etM/a1gtJCJuWkpcuZu4ounM/Fk0uSZJpyKZ/yBVZM9d+dbpDmlb 0Psaxm/jKyTidVZ1ute5o3od1C2+9XuG8WA9ijWS7rXG7xeJ9DvTv90cqA2mrpHafL7d i/0pdxecbYPll0OAUpBOVdVK+O9aiASZyULL1NVzioseP0oJ15QmYak2JYL09F6tHv/F XxwpJ37BPj4wsZutU0Wl2DnVQaNYUZouEJOdjeBMD5xbb4DLcBEVHjU1RqiRL2P1znEI PzAmSwn84nvqmHHgZWluYut+TACnJes8KZGSa0HqGTDi7qsLrg6BoomTBSuES1yMenPY QMTQ== 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=6qDQkdgyU7UWMSAu+wH8uU1FDBNaBkcRU1ghvepkNcY=; b=MKw+OLuK5EyVMlg3sqJnhRm6YI+ZZPHd3Ubnd8YkBYLY7SuXs9o+iklZg0zZrllvvf mrrw+JsZNToN6KFCa1jog87dNt9/35NH581RG3xLTrxhABeXYh1sOQHMx02ep0krlHUB oHS85Iqi3Kjy+pIh9Jqu0xa9ZfROEJvk/wjp3la8PPnOuwJo80Nkx/K2sDi0swW1bUnk C/PldjIT24dv9mUh6AfCQuRpywl6//2erAm5aUNQcilsbXhkY2uC03WcdxDJ+aLrbBxW g8Z9cMAvXU3skJLmx2asm3p/U9W1mulNQH45ss40dQuapiCPgcaM7PuXoNfZ4OpFHQC4 Zh8A== X-Gm-Message-State: APjAAAUURk4jlRRU1GjVgY05S0wQiSxzemcC7InFDQh4M4Pd+ogsDGcu 5IErKLllr33XNtXj4xxlpLThJdaj1s7nL8B1ZYSE7MAI X-Google-Smtp-Source: APXvYqxLMWaDrHej2v5bNK9WRUeRVtHzMeT2N7FwardIQMXLN5tgeoAYX8/LcEXuEeln0Qq0BJCqCIW7o80xB83LCDs= X-Received: by 2002:a92:b657:: with SMTP id s84mr570444ili.253.1574942224561; Thu, 28 Nov 2019 03:57:04 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 28 Nov 2019 11:56:53 +0000 Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary="000000000000d63b2d059866cfe8" X-Envelope-From: Subject: Re: [PHP-DEV] Opt-in "use function *;" for skipping check for function/const in alternate namespace From: rowan.collins@gmail.com (Rowan Tommins) --000000000000d63b2d059866cfe8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 28 Nov 2019 at 11:01, Claude Pache wrote: > I think it is better to keep the language as regular as possible, and consider that every non-fully-qualified name is relative to the current namespace, unless there is an explicit `use` declaration that says otherwis= e That's already false, and will only be true if we deprecate and remove the fallback to global scope. > use function *; // don't know what this does, but apparently it's good fo= r > > performance =C2=AF\_(=E3=83=84)_/=C2=AF > > Or: =E2=80=9Cdon't know what this does, but apparently it silences deprec= ation > notices...=E2=80=9D > Silencing deprecation notices is always a temporary side-effect of fixing code to work *at all* in some future release. Or rather, it should be - I am 100% against any notion of "indefinitely deprecated and may never be removed", that should always be some other type of notice. If we were deprecating unqualified functions from being looked up in the current namespace, we would not need to add this new directive, we could raise deprecation notices whenever the current lookup logic succeeded in finding a namespaced function. Silencing the deprecation notice would require either fully qualifying the function name, or explicitly adding a "use" statement. The issue indeed is that the meaning is far from self-evident. Maybe one > could use something that everyone and their mother could understand at > first reading, such as: > > use function from global namespace; > That still doesn't really explain what's happening, because in code that doesn't use any namespaced functions, the line has no user-visible effect at all - functions are *always* used from the global namespace. What it actually does is switch *off* a language feature, so perhaps it should be something more like: declare(lookup_functions_in_current_namespace=3Dfalse); That would also mean that it can be covered by any future way of setting language directives, such as settings per "module", bundling into "editions", etc. Regards, --=20 Rowan Tommins [IMSoP] --000000000000d63b2d059866cfe8--