Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108229 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 16462 invoked from network); 24 Jan 2020 18:01:07 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Jan 2020 18:01:07 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E08111805BF for ; Fri, 24 Jan 2020 08:10:32 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,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-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) (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 ; Fri, 24 Jan 2020 08:10:31 -0800 (PST) Received: by mail-oi1-f174.google.com with SMTP id z64so2317750oia.4 for ; Fri, 24 Jan 2020 08:10:31 -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 :cc; bh=/kyPxAZyxnuCHBXET17FfR46efjQCxZexc3r+UZruwM=; b=fSXiZxbf9exa40RFblwooehtMAtCVK+23R4JoTS8hrAPJBjolJOFrVdi2u108ErJFS SUTNLd/e+fbojDPwigaCKzNX6HGFiHno7sIpkTTDTvO3L1EAdIbBdr3nacAQgLb0wAkx JNTjpcdfBF+Fsa9/a3Gz4dWis8KcT715qNdALpFcJIpsRQT1W56GvIshy8x7ykkKWBl4 /R94khbOOPCbxYIyDlD8zwBu41f2Nc0EZZHB9C1fIkyw9XFLlPh9ye60iEcrt1/GME5G WQmpPpqh3S10yYcHMtLDJDGbg5whZ+lbUiSVdGgcbszCKF4ZF9h1e1cIoRW3f/WYP3oZ YFHg== 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:cc; bh=/kyPxAZyxnuCHBXET17FfR46efjQCxZexc3r+UZruwM=; b=jiuCquAC02ej1wT+kYlkgo2RqDOe6NWw4joNZMK4L3Uj09FxYSemIQ/Wk6z0Quw6si 8i707mi7DVrsY76woDzdDgzwuG9Hqwtquex93CT544Z3P5e9/BTJQa3vOTzXuKfGxAPQ bmLfe1/2Ak8XDd+8n//oHIMjRIcvy7rhLvOBowo4zdDg0RnY6+/ks+Y6p31Pv3FMf724 L7HLqS6eYp2KfB6tCls1VjRP4wheTNfLAzXJSM3pYAabfCe8+mA/PPoL7yKRL0BI1m80 4LAYn9lEDEgQN0zFSRAZh1rMc1dQMLFLXLL1USJpxspnjEm62N/i3nEiJNjNen1dy67l 9AnA== X-Gm-Message-State: APjAAAUKyky/cJB8EDbLECkjlaRACGisUQmmKZm2OIA6QKpYnvbceKkP uvg7HME2O5L+8X3I0xrPEQnLHBTtk8G5x1Orh64= X-Google-Smtp-Source: APXvYqyLhmxtVTExqtr6Lr50PcXMGT1vRp71sry2I0rr6i3VN8Wl0rvxmS/dGEE5v76hjVyLFBSA6VpYgs17rLdSoYQ= X-Received: by 2002:a54:4715:: with SMTP id k21mr2454642oik.163.1579882230428; Fri, 24 Jan 2020 08:10:30 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 24 Jan 2020 17:10:18 +0100 Message-ID: To: Nikita Popov Cc: tyson andre , Mark Randall , "internals@lists.php.net" Content-Type: multipart/alternative; boundary="00000000000021befc059ce4ff70" Subject: Re: [PHP-DEV] Re: [RFC] "use global functions/consts" statement From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --00000000000021befc059ce4ff70 Content-Type: text/plain; charset="UTF-8" > One option that I haven't seem much discussion on is the opposite: Always > only look in the global namespace. Any unimported unqualified usages will > be treated as fully qualified names. This would match the proposed > semantics for functions/consts and change the resolution rules for classes. > I think this would have relatively little impact on how code is written, as > classes already tend to make extensive use of cross-namespace references > and the import is usually IDE managed. > Quick reaction: that'd make sense to me! Adding a "use CurrentNamespace\Foo" or using "namespace\Foo" looks easy enough to adopt. Does this mean you're suggesting to use declare(symbol_lookup='global')? Or shorter: declare(lookup='global'), or maybe even declare(global_lookup=1) as I'm not sure we need 3 options here? --00000000000021befc059ce4ff70--