Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108322 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 83056 invoked from network); 29 Jan 2020 20:32:25 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Jan 2020 20:32:25 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EF76E18050F for ; Wed, 29 Jan 2020 10:43:04 -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=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, 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-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) (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 ; Wed, 29 Jan 2020 10:43:04 -0800 (PST) Received: by mail-qt1-f172.google.com with SMTP id t13so312759qto.3 for ; Wed, 29 Jan 2020 10:43:04 -0800 (PST) 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:reply-to :from:date:message-id:subject:to:cc; bh=kUHZYB2Oe4eSojwZUOiButEf+Zr5hyZ7EUbspsRStQQ=; b=YAqIdnuP1vdDKJa5k7OXSTl2Ekr5SCBriIPZ2SIoF+EMJKYpzdhPqMTfqRpb+Nnh/a ByjMqaTLZjh6SrBfpq4b/7H4wDHoRYi9TL1qzI2lZ8A2emB3b3dXodFtcoJ69eClgOeQ qSGyawQAZ94Nk/vjXoLQ+YyyXxrTVZuTmc8x/QdRjB35iWA9XkW14J96dB8PgEqRoIi/ WWGv6WfmWnwzrzEoLTGrB/dZFPcQsR68OauLvipnN3HslPDod2tlIUpB+JO1u9oNgqob wICK4hex+4XrzivrUckpf5FC49lKQ0pujq0BuPQAbTov87/hmPE7e+Bk3S6kMNmBTG/h QECg== X-Gm-Message-State: APjAAAV89HMP0iuSK0x8wNo+0GQTIaWFR9NmdNDrgzyaSAvalpvThim7 c8dIuN0IH+yf4+zG5/5IPyXVid2PKUiup+5wwms= X-Google-Smtp-Source: APXvYqxUb8l94/4vTWTV7PbjymeFIOq1rlz8lZO02HqeicMSxHN5HqS2wdnkDguiQxHwY8RPsO1N+bpU8rubYw8KkbM= X-Received: by 2002:ac8:198c:: with SMTP id u12mr603895qtj.225.1580323382271; Wed, 29 Jan 2020 10:43:02 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Reply-To: bishop@php.net Date: Wed, 29 Jan 2020 13:42:55 -0500 Message-ID: To: Marco Pivetta Cc: tyson andre , "internals@lists.php.net" Content-Type: multipart/alternative; boundary="000000000000d4a3b7059d4bb56b" Subject: Re: [PHP-DEV] [VOTE] declare(function_and_const_lookup='global') From: bishop@php.net (Bishop Bettini) --000000000000d4a3b7059d4bb56b Content-Type: text/plain; charset="UTF-8" On Wed, Jan 29, 2020 at 5:56 AM Marco Pivetta wrote: > I voted "No" on this one, sorry. > > TL;DR: I'd rather have a mechanism to disable global function fallback, not > something that makes un-imported symbols immediately global. > > The idea to disable PHP's implicit > "fallback-to-something-that-may-or-may-not-exist" is great, and it could > simplify some of the engine, as well as remove some caching mechanisms > (lookup) in some contexts, but I'm pretty happy with disabling all global > lookup functionality, rather than making them the default. > > I don't have a problem with `use function sprintf;` to import things from > PHP, and actually use it to quickly grep whenever I do something extremely > dangerous (like `use function umask;`). > This gives me also a good overview of how much of the global symbols are > still in my system, and to be replaced with something like > `thecodingmachine/safe`. > Agreed. I want to force explicit qualifications, and raise error on unqualified names: