Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81045 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29032 invoked from network); 23 Jan 2015 14:37:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jan 2015 14:37:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.216 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.216 imap10-3.ox.privateemail.com Received: from [192.64.116.216] ([192.64.116.216:36711] helo=imap10-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 10/77-25368-BBC52C45 for ; Fri, 23 Jan 2015 09:37:47 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 18B0B2400C2; Fri, 23 Jan 2015 09:37:44 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap10.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap10.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Qti_bEnXlNfz; Fri, 23 Jan 2015 09:37:43 -0500 (EST) Received: from oa-res-26-240.wireless.abdn.ac.uk (oa-res-26-240.wireless.abdn.ac.uk [137.50.26.240]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 91A2C2400DE; Fri, 23 Jan 2015 09:37:42 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) In-Reply-To: Date: Fri, 23 Jan 2015 14:37:39 +0000 Cc: Marc Bennewitz , PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <54BEC072.5000507@mabe.berlin> To: Nikita Popov X-Mailer: Apple Mail (2.1993) Subject: Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls From: ajf@ajf.me (Andrea Faulds) Hey Nikita, > On 20 Jan 2015, at 21:46, Nikita Popov wrote: >=20 > On Tue, Jan 20, 2015 at 9:54 PM, Marc Bennewitz = wrote: >=20 >> valid for call_user_func[_array] and callable type-hint but invalid = for >> for direct variable calls: >> - string "MyClass::staticFunc" >> - string "self::staticFunc" >> - string "static::staticFunc" >> - string "parent::func" >> - string "parent::staticFunc" >>=20 >> see http://3v4l.org/1oSO3 >>=20 >> Thoughts ? >>=20 >=20 > I would prefer deprecating this alternative notation instead of adding = more > support for it. The [$class, $method] form is the canonical form we = support > everywhere and which is consistent with the [$obj, $method] callbacks. > There's no point supporting another alternative notation, especially = if it > was effectively unusable for a while now already. By the way, this notation is also used by constant() and defined(): $ php -r 'class Foo { const FOO =3D 3; } var_dump(constant("Foo::FOO"), = defined("Foo::FOO"));' int(3) bool(true) It=E2=80=99s also very intuitive compared to the function syntax. I see = no reason we shouldn=E2=80=99t support it more widely. -- Andrea Faulds http://ajf.me/