Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100886 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4448 invoked from network); 12 Oct 2017 18:33:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Oct 2017 18:33:28 -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.90 as permitted sender) X-PHP-List-Original-Sender: michaeldoehler@me.com X-Host-Fingerprint: 17.36.66.90 st42p61im-zteg12041301.me.com Received: from [17.36.66.90] ([17.36.66.90:35651] helo=st42p61im-zteg12041301.me.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C6/7B-49033-775BFD95 for ; Thu, 12 Oct 2017 14:33:28 -0400 Received: from process-dkim-sign-daemon.st42p61im-zteg12041301.me.com by st42p61im-zteg12041301.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0OXQ00L0036H8100@st42p61im-zteg12041301.me.com> for internals@lists.php.net; Thu, 12 Oct 2017 18:33:23 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=04042017; t=1507833203; bh=lcSOT2DuNzbvNHRGci2RZYB/+UWx+mmiRKJummlJRw8=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=ynNIuRA9dDXn0dEufoiP11KB2wwYlLmbpZM4m+MwTztuuaPnAHw79NHFTU5YgfA/P BunwBcb0iMb/Kva2WJzZtkr0dGPHBngi1vwqOveWCSGtBjxvZDVhbCP+WaFbco+yPg a4JpL2c3EH6qZLy2kwnTn6ffNXmgKHYiChmug//CQpzCyOD5zJbXPz9V0YsOIVaR6E xUYdosRtFlYjL6Mb99oARUSfU2qo8ZsLaMuFGaWvV2zalbnPpvIDn/bT7X9qokOrrU EQS/hTAc86vQPIQEuyt3z1riuZKHA/zS5vcnZ+3dzPDw0DpCinr2brJbN2hpTIl2rM +1BHWpNYX2NdQ== Received: from icloud.com ([127.0.0.1]) by st42p61im-zteg12041301.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0OXQ00B133JLT340@st42p61im-zteg12041301.me.com>; Thu, 12 Oct 2017 18:33:23 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-12_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710120266 Content-type: multipart/alternative; boundary=Apple-Mail-FE6355BA-2E5A-498D-9F61-C8DEDDF883C8 MIME-version: 1.0 (1.0) X-Mailer: iPhone Mail (14G60) In-reply-to: Date: Thu, 12 Oct 2017 20:33:20 +0200 Cc: "internals@lists.php.net" Content-transfer-encoding: 7bit Message-ID: References: To: Mathias Grimm Subject: Re: [PHP-DEV] Suggestion Method Constant From: michaeldoehler@me.com (=?utf-8?Q?Michael_D=C3=B6hler?=) --Apple-Mail-FE6355BA-2E5A-498D-9F61-C8DEDDF883C8 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, I am open for any approach, but maybe we have to differentiate between class= constants and method references?=20 Michael=20 > Am 12.10.2017 um 20:28 schrieb Mathias Grimm : >=20 > The only problem with the @ symbol is the lack of consistency with the oth= er constants class constants are also MyClass::MY_CONST, or MyClass::class, s= o I think it makes sense to also be MyClass::myMethod::method >=20 >> On 12 October 2017 at 20:24, Michael D=C3=B6hler w= rote: >> Hi, >>=20 >> Same i have in mind, for example: MyClass@myMethod >>=20 >> To make also some method call routing easier, e.g. in userland routers. >>=20 >> Transform the current approach: >>=20 >> $app->get("/foo", [MyClass::class, "myMethod"]); >>=20 >> To: >>=20 >> $app->get("/foo", MyClass@myMethod); >>=20 >> This will ease a lot, e.g. for refactoring, IDE usage and completes the c= ode as configuration approach for PHP. >>=20 >> Thanks >> Michael >>=20 >> > Am 12.10.2017 um 19:43 schrieb Mathias Grimm : >> > >> > I would like to suggest a method constant that could be used the same w= ay >> > we use the ::class one >> > >> > I don't have a strong personal preference but it could be something lik= e: >> > >> > MyController::myActionMethod::method, no sure about the internals but i= t >> > would be consistent with the one for the class. >> > >> > Cheers, >=20 --Apple-Mail-FE6355BA-2E5A-498D-9F61-C8DEDDF883C8--