Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69261 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90649 invoked from network); 23 Sep 2013 08:45:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Sep 2013 08:45:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=krebs.seb@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=krebs.seb@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.169 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@gmail.com X-Host-Fingerprint: 209.85.212.169 mail-wi0-f169.google.com Received: from [209.85.212.169] ([209.85.212.169:44574] helo=mail-wi0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F1/70-22780-AAFFF325 for ; Mon, 23 Sep 2013 04:45:31 -0400 Received: by mail-wi0-f169.google.com with SMTP id hj3so1952802wib.4 for ; Mon, 23 Sep 2013 01:45:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=IxS3u4FOEslyOFNaRK1NJYYJ6Sr2o4WAc2Rew9fFjdk=; b=cKPmdCR1Sv64A0jz1P1NwIMWaJvuP5E5wBrieitQTTzBZt+z9sDvRCHMGo6Mte+L2Q WGlJBY+rwzMoPacp/HRiolKD9SeG7evdBLWXIbfPO9HGDmx/if6BRAS07qGz6jjvuOxK +5b3itGWvoWG6Qp7W45zkWNpScJQ1xOixTpVqAb+ZePQr1S2mlmqnhgQvN1E/mrJw9nJ O5BFEmLWpDe/CeCaXoIvaRMkv151KrNiyZFBH4j/u/Y0Ywp2ZfHx0bdxiYH4ehkS/4Qo pMyV1bJjsGVeJBdr9ZKUdHGaoAHqwI1+PpIzSsbH2cgoFO0BJtEytOeQzVZpC1pCXLBI KokA== X-Received: by 10.194.250.6 with SMTP id yy6mr16422858wjc.13.1379925928113; Mon, 23 Sep 2013 01:45:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.5.9 with HTTP; Mon, 23 Sep 2013 01:44:47 -0700 (PDT) In-Reply-To: <523FFE44.8030107@lerdorf.com> References: <523FFE44.8030107@lerdorf.com> Date: Mon, 23 Sep 2013 10:44:47 +0200 Message-ID: To: Rasmus Lerdorf Cc: Joe Watkins , PHP internals list Content-Type: multipart/alternative; boundary=001a11c1ba4ac2fe7404e7090ae4 Subject: Re: [PHP-DEV] RFC: Anonymous Classes From: krebs.seb@gmail.com (Sebastian Krebs) --001a11c1ba4ac2fe7404e7090ae4 Content-Type: text/plain; charset=ISO-8859-1 2013/9/23 Rasmus Lerdorf > On 09/22/2013 11:39 PM, Joe Watkins wrote: > > https://wiki.php.net/rfc/anonymous_classes > > > > I'd like to hear thoughts regarding the addition of anonymous > > classes, patch included. > > I am having a hard time picturing a real-world use-case for this. > The use case is one-time usage of an "implementation", where you currently probably pass callbacks into a "Callback*"-class like $x = new CallbackFoo(function() { /* do something */ }); vs. $x = new Foo () { public function doSometing() { /* do something */ } }); Imagine you have several abstract methods in one interface/class, which would need several callbacks passed to the constructor. Also '$this' is mapped to the right objects. Regards, Sebastian > > -Rasmus > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- github.com/KingCrunch --001a11c1ba4ac2fe7404e7090ae4--