Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107884 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 61003 invoked from network); 28 Nov 2019 15:23:55 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 28 Nov 2019 15:23:55 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 6F93C2D2005 for ; Thu, 28 Nov 2019 05:19:04 -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,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (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 05:19:03 -0800 (PST) Received: by mail-wm1-x32b.google.com with SMTP id l17so10962747wmh.0 for ; Thu, 28 Nov 2019 05:19:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=jLzVwu59PsVpIRjvJ4oZ6Jhr3DL1IUMZrEaSwYHKZ+g=; b=h+OVdXiyEkdtdbzjF3cQqOSI+j+G6S0vcEGKnmpvPiiWE1pEOtc5buwGBNI46nDFjF /7PX0N8QEb8Y9CyGuHcezmm7TrcuDkXlNS/azPIj6xvTJATwizk5vK41PsjHIl+ORMiH 6n+ic7ZISeMymN1oaOInJf0M///VnxY2gBKwMDfaaVFsrChPtxu6+okmEFERwI7NKNVy qNdHIrR45lEjcJp3Z8p1kAFiNiPRQaAZSnnrd4TVVqHf6ys3BNFz+n1bLiQlcpPwtaXE 4VsbmI0+L0m8KQOIAFFAVM7RBuGrDOsemXYG/1imjGmWulkX6e0VwiVo6qp82Bb4joG4 PXiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=jLzVwu59PsVpIRjvJ4oZ6Jhr3DL1IUMZrEaSwYHKZ+g=; b=n61aive3UjaqrLa5UV1haDRZsEAWv7+skeLu9fp0EBcJhZrsQjoZODGTjlNQ4piwrs jIlkyaI0xE7jTb8A7z0cxUb3Gj2iY+ZN8g0mfAy1uz5I4sc6HOOva+PO88LhgB2TKNmV ThJeBkk9C7xRmBoVi34D/nx2eY86u+o5/S9J8BmGqWuT0H9377DwJVTLB7TDaTqZQxA9 xIujGbQQyK+F3pm8qgdi9wT/1WDwfTvML7Cg1e2Az3Cz6WYu4P78zUGyKDrqzUQe6qM2 E2lrwxKxfA4DjE7EjJgiFuwJhmZTSpddJ1uPSTL3rpS0W9XE92b+2ECVSkAOwCoxMKIb PEzQ== X-Gm-Message-State: APjAAAVsRpvUUbNqzLpYx7ka7Joo5oKDwdTBtF+CGEaRpIFX03nWMIkK 2nYfAmL8MjhSsEYNo5qPIvw= X-Google-Smtp-Source: APXvYqxLRmmIXjBOvZ0KVFiAQhKOBORny5e1poQDTxV/Ft8EfUbRL44HxB3dBJuDEMAxw1jITnPj7A== X-Received: by 2002:a7b:ce11:: with SMTP id m17mr8749219wmc.123.1574947142744; Thu, 28 Nov 2019 05:19:02 -0800 (PST) Received: from [192.168.0.63] (84-75-30-51.dclient.hispeed.ch. [84.75.30.51]) by smtp.gmail.com with ESMTPSA id b186sm10057889wmb.21.2019.11.28.05.19.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Nov 2019 05:19:01 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) In-Reply-To: Date: Thu, 28 Nov 2019 14:19:00 +0100 Cc: "internals@lists.php.net" Content-Transfer-Encoding: quoted-printable Message-ID: References: To: Rowan Tommins X-Mailer: Apple Mail (2.3445.104.11) X-Envelope-From: Subject: Re: [PHP-DEV] Opt-in "use function *;" for skipping check for function/const in alternate namespace From: claude.pache@gmail.com (Claude Pache) > Le 28 nov. 2019 =C3=A0 12:56, Rowan Tommins = a =C3=A9crit : >=20 > 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 = otherwise >=20 > That's already false, and will only be true if we deprecate and remove = the > fallback to global scope. >=20 >=20 >> use function *; // don't know what this does, but apparently it's = good for >>> performance =C2=AF\_(=E3=83=84)_/=C2=AF >>=20 >> Or: =E2=80=9Cdon't know what this does, but apparently it silences = deprecation >> notices...=E2=80=9D >>=20 >=20 >=20 > 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. >=20 > 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. >=20 >=20 >=20 > 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: >>=20 >> use function from global namespace; >>=20 >=20 >=20 > 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: >=20 > declare(lookup_functions_in_current_namespace=3Dfalse); >=20 > 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. >=20 > Regards, > --=20 > Rowan Tommins > [IMSoP] I wasn=E2=80=99t clear enough in my previous post: I was assuming that = the ultimate goal was to remove (after deprecation) the fallback to = global namespace. In that regard, the `use function *` declaration (or = whatever variation of that) is both a way to programmer to say the = preferred semantics regarding not-fully-qualified function names, and a = tool to let most legacy scripts survive without too much effort. But probably I made a too strong assumption about the intended goal of = the proposed feature? =E2=80=94Claude