Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100898 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28365 invoked from network); 14 Oct 2017 10:41:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Oct 2017 10:41:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=michaeldoehler@me.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=michaeldoehler@me.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain me.com designates 17.36.66.14 as permitted sender) X-PHP-List-Original-Sender: michaeldoehler@me.com X-Host-Fingerprint: 17.36.66.14 st42p61im-zteg12050101.me.com Received: from [17.36.66.14] ([17.36.66.14:64218] helo=st42p61im-zteg12050101.me.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 44/F0-11059-4E9E1E95 for ; Sat, 14 Oct 2017 06:41:40 -0400 Received: from process-dkim-sign-daemon.st42p61im-zteg12050101.me.com by st42p61im-zteg12050101.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0OXT002006N4YZ00@st42p61im-zteg12050101.me.com> for internals@lists.php.net; Sat, 14 Oct 2017 10:41:37 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=04042017; t=1507977697; bh=nqDCE/P+yx6k+x7fl/7UUwXugSn1JMtrqRqhmXYYUfU=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=ErBsE3Qm6Su3eiUQlzIzijz2Nt1qvvtcZyvzL2DkDO0gAAiRJIfqGgLWVohzry+zw RuT26ked7hu9B07kRAQwReYUhBvpdT7use+wbj9O8dTQY+cu7gKq6wXNK9ZE92S6Yd n71EQ/lHe3oX7TEuwC2FuvQbjh1Be+1vKK97Rksp2WssmwWEktitSem+Q2k6mY1QtY il2syysQns5UcLvtmoUhBOpcu1tCX+ISZVCSJgzE/OqjJV2DUTEZZXtiEBlY2sdwH5 s4bLsOqgQlps9j0F4CdscjYGEfYMANQO6fbxHpBLNThOtyKzhYHOyJutdxytM+kpHo WKxBIEm/crJDg== Received: from icloud.com ([127.0.0.1]) by st42p61im-zteg12050101.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0OXT00OTD71B7800@st42p61im-zteg12050101.me.com>; Sat, 14 Oct 2017 10:41:37 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-13_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710140150 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (1.0) X-Mailer: iPhone Mail (14G60) In-reply-to: Date: Sat, 14 Oct 2017 12:41:35 +0200 Cc: internals@lists.php.net Content-transfer-encoding: quoted-printable Message-ID: References: To: Andrea Faulds Subject: Re: [PHP-DEV] Re: Suggestion Method Constant From: michaeldoehler@me.com (=?utf-8?Q?Michael_D=C3=B6hler?=) Hi, maybe the introduce of a complete new syntax for method references would sol= ve the issues? Maybe coming back to e.g. "#" ("@" is still used for supressi= ng errors,...)? As mentions before all kinds can be simplified or? See: MyClass#myMethod #function This should resolve in an object as mentioned before, in this object you hav= e further informations, e.g. $ref =3D MyClass#myMethod; $ref->isStatic(); ... I think an seperate solution for method/Funktion references is more realisti= c than changing core things... Greetings Michael=20 > Am 14.10.2017 um 03:02 schrieb Andrea Faulds : >=20 > Hi Mathias, >=20 > Mathias Grimm wrote: >> I would like to suggest a method constant that could be used the same way= >> we use the ::class one >>=20 >> I don't have a strong personal preference but it could be something like:= >>=20 >> MyController::myActionMethod::method, no sure about the internals but it >> would be consistent with the one for the class. >>=20 >> Cheers, >=20 > I've long wanted to make constant lookups fall back to a closure of the co= rrespondingly-named function, where one exists. so `strlen` would resolve to= a closure of strlen(). >=20 > Thing is that classes are weird. We sort of have three different things wi= th sometimes-similar syntax: constants, methods and properties. foo::bar is a= constant, foo::bar() is a function, $foo->bar() is a function, but $foo->ba= r is not a constant. So, if I want $foo->bar to resolve to a method, then $f= oo::$bar should too, even though that makes no sense. The PHP static propert= y syntax is the bane of my existence. >=20 > --=20 > Andrea Faulds > https://ajf.me/ >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20