Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108531 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 83582 invoked from network); 13 Feb 2020 09:43:43 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Feb 2020 09:43:43 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 652C6180210 for ; Wed, 12 Feb 2020 23:58:05 -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=-0.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,MISSING_HEADERS, 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-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 23:58:04 -0800 (PST) Received: by mail-wm1-f44.google.com with SMTP id t23so5080256wmi.1 for ; Wed, 12 Feb 2020 23:58:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:cc:from:message-id; bh=k9hhtIK57thL1fUKwm9mEfFTIz7pbe2qD3R5yWGLydc=; b=OC2dZW9+wdYbx4VYGdMXz5QzyHujnHcTJKmFFb5kRMWH97QKXDHPknnP4anBq7cMVw hoE1GwvvzEBwzcuGriylX5PWlAnQBE+9fZDg1zyuazZ8XjyFomQkd/3Rs1rbewR9hQjb fTt6cjEihcpUBi3y4YK7koBuz/iF0QE2Ww6aGiHyTAN/O67+eW23PfZZLHCaZRRDF/+Z BmTQDgGYWxvx6Nn8TOnijqfL354l7f+qSH2bh2Nl1oW5WgXS430LupCVryAhTJ2phn2B fHzVKa1hUklAUosjglX0PuFCcP4mFCzpZ2wRJeDOeEYUMFK1t86Nv2R9HFRdQd+c9N3/ H+AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:cc:from:message-id; bh=k9hhtIK57thL1fUKwm9mEfFTIz7pbe2qD3R5yWGLydc=; b=WSq472pUMvEE+umEu0e3uxQ6aWrzkVjZ9J7LMRUMJXB9K3MIUeKl6TixlEAF+lpP/Y A7558PL284gNFIswMqj0kW6LgbTTkKYy9BX5ziL+ZiZ/LTaehamEqUfoU7IAzy1yhtcA 063Ac4ij/3gPCCJF+3t43hEWY1x1Xk9Q0rnHn3ak3xUVSPqGpns/eUFEqJ38EfWNerAb pByw7Fk4AhQ4vnp/zg0mIUX7oC9oo4lUgI5wblzOeh6yI3JOjeQxnq/7Lt2e7TTSxJEK rnv4Xv1Xzic3wgHa+i70KKjGB3KJ0U1N+kpw/dGCmt+Tvz5DxXf+BoLFqrKdJfbHJXjz IgXA== X-Gm-Message-State: APjAAAWqRS5qGKrQlCExhy1VsXBNS9FCCy+w8mLX6yQynDX9XHH8tJwe ACV65vHjLlf6U6ii9JT2MzNkew41 X-Google-Smtp-Source: APXvYqyV7JCIzlwgDdydZC0HcjGSM0xEMn+hyeIRVhWhh0J9lXtJ5fgCJsNc7lsXEfnTJfsYRFsKvw== X-Received: by 2002:a05:600c:2944:: with SMTP id n4mr4207003wmd.22.1581580683276; Wed, 12 Feb 2020 23:58:03 -0800 (PST) Received: from [192.168.0.12] (cpc84253-brig22-2-0-cust114.3-3.cable.virginm.net. [81.108.141.115]) by smtp.gmail.com with ESMTPSA id b10sm1790636wrw.61.2020.02.12.23.58.01 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Feb 2020 23:58:02 -0800 (PST) Date: Thu, 13 Feb 2020 07:57:56 +0000 User-Agent: K-9 Mail for Android In-Reply-To: References: <9829e5c9-9e32-9686-8ff2-ec7930dda709@gmail.com> <20d9da97-243a-a171-0412-7298b79e4dde@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable CC: PHP Internals List Message-ID: Subject: Re: [PHP-DEV] [RFC] From: rowan.collins@gmail.com (Rowan Tommins) On 12 February 2020 23:12:34 GMT+00:00, Manuel Canga wrote: >El mi=C3=A9=2E, 12 feb=2E 2020 23:01, Rowan Tommins >escribi=C3=B3: >In your example, you has the same options: > >> >1=2E Change import >2=2E Add namespace: > >['Acme\Global\I18N',\translate::function] There is no collision between 'Foo::translate()' and 'translate()', so the= re is no reason to change the import=2E That's true of executing the functi= ons, so it should remain be true of resolving them to strings=2E >Explain: > >When you do: [ class, method ] or [ $object, method ]=2E Method has not >namespace, you write it without namespace( like global functions ) I think this is where we are thinking differently=2E A method name is not = "like a global function", it's just a name; it doesn't belong in the same c= ategory=2E=20 You might have any number of classes that use the same method name, but wi= th completely different parameters and purpose, so "a method named foo" isn= 't a useful concept outside some specific class or interface=2E On the other hand, you can only have one function with a particular fully-= qualified name, and the proposed feature is a way of referencing that=2E >Other example: > >$class =3D \MyClass::class; >$method =3D \method::function; > >and=2E=2E=2E > >$class =3D '\MyClass'; >$method =3D 'method'; > >$obj =3D new $class(); >$obj->$method(); > >Both are the same, but first is more semantic=2E This isn't semantic at all - it works only because \method::function happe= ns to return the string you want, but so does \method::class; neither is ac= tually labelling it as what it is, which is a method within class \MyClass= =2E Importantly, it might not work at all, if ::function gives an error if the= function doesn't exist=2E=20 Regards, --=20 Rowan Tommins [IMSoP]