Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86170 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28747 invoked from network); 12 May 2015 16:08:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 May 2015 16:08:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=marchenko.alexandr@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=marchenko.alexandr@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.53 as permitted sender) X-PHP-List-Original-Sender: marchenko.alexandr@gmail.com X-Host-Fingerprint: 209.85.220.53 mail-pa0-f53.google.com Received: from [209.85.220.53] ([209.85.220.53:35054] helo=mail-pa0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 03/22-14268-B7522555 for ; Tue, 12 May 2015 12:08:27 -0400 Received: by pabtp1 with SMTP id tp1so17515176pab.2 for ; Tue, 12 May 2015 09:08:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:from:to:cc:references:in-reply-to:subject:date :mime-version:content-type:thread-index:content-language; bh=YlP2GabtTcr5LpNXV9nvjno7SSOdxjvbZPInuQRxoew=; b=j8nkCAQ1HMou0OsAw8dY/Ng4wgiezoEnybS3t+4Ux3/dHToRfwmBNI4RcspHEize3a HUlmjBEbEughREf4WCqygXAHIOXgL9RSTQOsX8eiE/F6U8LadTs7OyjEkaO+lsKUW5xV 3PSP2LCFZ4UhCdgl71ELbgwapilPJLLGAT7HROVYWbujssw9oQCrWBqZyIWyxy1MTuEW hUDVyk2NJ+WEhvcX1YL2QKwYHkltJhDnVw4HjM+rPA1k9SsAFv+No16EiyiZY4csBvZB Nx0TJMhN4/8H7Lyr5yW+rHqUk3ze0ZWa0aSnL9VO8P4BPi6rhHxyU6Si2+3cNXM0C/OE EX3g== X-Received: by 10.68.68.208 with SMTP id y16mr29253195pbt.34.1431446904521; Tue, 12 May 2015 09:08:24 -0700 (PDT) Received: from mail.hotmail.com (dub004-wss1s1.hotmail.com. [157.56.194.40]) by mx.google.com with ESMTPSA id vl9sm16640067pbc.73.2015.05.12.09.08.23 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 May 2015 09:08:23 -0700 (PDT) Received: from DUB403-EAS55 ([157.56.194.39]) by DUB004-WSS1S1.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Tue, 12 May 2015 09:08:21 -0700 X-TMN: [Isn8k3D+ZkAqArscYXarlk5aKOdKtBu2] Message-ID: To: CC: "'PHP internals'" References: In-Reply-To: Date: Tue, 12 May 2015 19:08:16 +0300 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_011D_01D08CE7.00AC4BD0" X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQABAgMElWKMJ8ZjxQdmGn65qMIgsqEXl6Hg Content-Language: uk X-OriginalArrivalTime: 12 May 2015 16:08:21.0034 (UTC) FILETIME=[DDC0F8A0:01D08CCD] Subject: RE: [PHP-DEV] nameof feature From: marchenko.alexandr@gmail.com (Alexandr Marchenko) ------=_NextPart_000_011D_01D08CE7.00AC4BD0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Bishop, =20 For your first example I do not know what will be the best way but = assume something like: =20 God::create(God::chicken); =20 In cases when you are giving strings to PHP (like in example with = $_REQUEST[=E2=80=98animal=E2=80=99]) all should work as is =20 Idea of nameof (at least in my understanding) is to reduce string usage = and replace them with =E2=80=9Cstrongly=E2=80=9D typed = =E2=80=9Cpointers=E2=80=9D which can give us feedback while script is = processed (like when you misstyped method name php will give you fatal = error). =20 You are right =E2=80=93 tools like ag = --php "'God'" will do = the work, but when it comes to rename method =E2=80=93 there might be = troubles, for example if I have code like: =20 class God { public function chicken() {} } $data =3D $_REQUEST[=E2=80=98chicken=E2=80=99]; calluser_func(God::class, =E2=80=98chicken=E2=80=99); =20 you cannot just rename word =E2=80=9Cchicken=E2=80=9D in your code. =20 Also while you are typing God::chi| - you can get autocomplete, which = will help you write less code and make less mistakes =20 ------=_NextPart_000_011D_01D08CE7.00AC4BD0--