Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108522 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 5915 invoked from network); 12 Feb 2020 23:46:57 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Feb 2020 23:46:57 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C58BC180533 for ; Wed, 12 Feb 2020 14:01:12 -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.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, SUBJ_ALL_CAPS 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-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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, 12 Feb 2020 14:01:11 -0800 (PST) Received: by mail-wr1-f51.google.com with SMTP id w12so4267526wrt.2 for ; Wed, 12 Feb 2020 14:01:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=RtiPt/sbmesnNL6I2Nx40Dek7Pw2swu8Z7rS2dVvKWU=; b=MW/rIQDrCgg0xlGRQSVidn28wWcUeRnqbz797YIt+pSZqIQYzqOFdHSoHQHD9V7SZQ X/kCYCP0ncX+VLhiG2jfM5ofo3RuTUBggnoS4qEwpN4vmOculbNSuxFie8TOJ+hncJO4 xkHTvBK4eN7VAJ8UZiaSvxnwn5ThZ0AMav8EJyIRLwZkJSNVQdBtOjtHx5C28LCQBTBw 4jr77WF7T9iWDWNI3b9cBBiQhJ5SPkaedIblM1ICo1eZDXJb5woZ8ceGEOkA0Impg20O vn5FbbTHiuvzBFdBH0T8lcwsuYGB3500DS6XTT3n7bl9VUXqwjR7numhQjpV0UB+WcBt C7Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=RtiPt/sbmesnNL6I2Nx40Dek7Pw2swu8Z7rS2dVvKWU=; b=oc+0qqZ1uW12K4ZinIUCFbmmovsxBo7TG0NPR8KBHRyt7iNg7tYjDS25xcRRT7dvdT W7kUj8W3U+ZTv3owRaBfQ2bOljsHJ1s/F8O/bTghK/ugOCrJ2q2kJJHEYiau1rmbMbB/ XNqADlA27xSTQYXt7yZhL9EL/DuK7CyEuRNX1EnDjshoztqq35k9h7wFKiu6osc9Y5/d wyZaC6luf6OwEIxXVuxElUstvuzFzhk2Q/5IbjCruCE3mBQAq2kIp/Up0+AMjTTTmhZY t77jY2F/p1B0ZOTKJpTFomSJp6jU6nYAoIxL9OzdadC9LTipXlAfl1IrtB2sXTB68hKy Qp1Q== X-Gm-Message-State: APjAAAXgEhaPJX1ixM5VHGYs6AbUl2gNnngFbBAc498QHpvoposRmN7E LaKXT+cEnQBEhzX+/DcPf7S+Wm3d X-Google-Smtp-Source: APXvYqy8Wfz0qdHC6NMyqTn1O18d66mQDeFKysNRLXsdIF6yBIHHzROe8C2Xelw+hko92idqLAyvJA== X-Received: by 2002:adf:e88f:: with SMTP id d15mr16545582wrm.186.1581544868408; Wed, 12 Feb 2020 14:01:08 -0800 (PST) Received: from [192.168.0.14] (cpc84253-brig22-2-0-cust114.3-3.cable.virginm.net. [81.108.141.115]) by smtp.googlemail.com with ESMTPSA id s23sm190067wra.15.2020.02.12.14.01.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Feb 2020 14:01:07 -0800 (PST) To: PHP Internals List References: <9829e5c9-9e32-9686-8ff2-ec7930dda709@gmail.com> Message-ID: <20d9da97-243a-a171-0412-7298b79e4dde@gmail.com> Date: Wed, 12 Feb 2020 22:01:05 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [PHP-DEV] [RFC] From: rowan.collins@gmail.com (Rowan Tommins) On 12/02/2020 21:47, Manuel Canga wrote: > You is importing function and you are  using different. It is the same > case like: > > namespace MyProject; > > use Vendor/Controller; > > class Controller extends Controller { > } In that example, you're defining two things of the same type with the same name, which would be an error; that's not what was happening in my example. In a call like Acme\Global\I18N::translate, or a callable like ['Acme\Global\I18N', 'translate'], the "translate" part never refers to a function in the current namespace, or indeed any namespace, only to a method of that particular class. But if you write ['Acme\Global\I18N', translate::function], there's no way for the engine to know that you wanted a method name rather than a function name, so it will try to resolve it in the current namespace and import list. That will either give an error, because there is no function called translate; or it will give you a fully-qualified name, which isn't what you wanted, you just wanted the string 'translate'. Regards, -- Rowan Tommins (né Collins) [IMSoP]