Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75126 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74784 invoked from network); 28 Jun 2014 18:48:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jun 2014 18:48:05 -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.200 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.200 imap1-2.ox.privateemail.com Received: from [192.64.116.200] ([192.64.116.200:60029] helo=imap1-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 46/80-04906-3ED0FA35 for ; Sat, 28 Jun 2014 14:48:05 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 40E3BB0007B; Sat, 28 Jun 2014 14:48:00 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap1.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap1.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id IWr2u-ZmFfqA; Sat, 28 Jun 2014 14:48:00 -0400 (EDT) Received: from [192.168.0.15] (unknown [90.210.122.167]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 1FFBCB0007A; Sat, 28 Jun 2014 14:47:57 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) In-Reply-To: <20140628140221.69C912618E2@dd15934.kasserver.com> Date: Sat, 28 Jun 2014 19:47:55 +0100 Cc: internals@lists.php.net, sebastian@php.net Content-Transfer-Encoding: quoted-printable Message-ID: <036CE654-C909-4648-8D0F-D695DBC1D77B@ajf.me> References: <20140628140221.69C912618E2@dd15934.kasserver.com> To: Thomas Bley X-Mailer: Apple Mail (2.1878.2) Subject: Re: [PHP-DEV] Revisiting Anonymous Classes From: ajf@ajf.me (Andrea Faulds) On 28 Jun 2014, at 15:02, Thomas Bley wrote: > Hello Sebastian, >=20 > for syntax consistency with anonymous functions I would prefer a = longer Syntax: >=20 > $greet =3D function ($name) { > printf("Hello %s\r\n", $name); > }; > $greet('World'); >=20 > $log =3D class { > public function foo() {=85 > }; > $logObj =3D new $log(); I concur that I=92d prefer this syntax. I also think it is much more = obvious what it does; $x =3D new {} doesn=92t make much sense unless you = know of the feature, but $x =3D class {} isn=92t much of a leap from = class x {}. Furthermore, I think new {} could be better used for = something else. Also, we could still have the class be immediately instantiated like so: $foo =3D new class Bar {}; Or, if the parser wouldn=92t permit that: $foo =3D new (class Bar {}); Sebastian, do you agree with this? -- Andrea Faulds http://ajf.me/