Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69264 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95424 invoked from network); 23 Sep 2013 09:00:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Sep 2013 09:00:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=mike.php.net@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mike.php.net@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.179 as permitted sender) X-PHP-List-Original-Sender: mike.php.net@gmail.com X-Host-Fingerprint: 209.85.217.179 mail-lb0-f179.google.com Received: from [209.85.217.179] ([209.85.217.179:51092] helo=mail-lb0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FE/71-22780-F3300425 for ; Mon, 23 Sep 2013 05:00:48 -0400 Received: by mail-lb0-f179.google.com with SMTP id x18so2522274lbi.10 for ; Mon, 23 Sep 2013 02:00:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=JxYBwh65zDQ7gxmcnaIB8WsFW4pLyTovM8hZHHb+nJg=; b=BO63bvra/BNrw29VaB6I/YI/sJvxL2Dnmc0Z+97ddDS7f2advWU2b3N+2Hfi4IxZ8m wuZZm6UwwVloheMz5+wGti3U4ubTX25nHo05HFvdE1zH1UntfxbP6ogrYpHIEituJnG9 3WzdkUHmAg2vZGALMVJ9fwdnSH2Lq7xtFeuOFq8XXKebPxetWgoSeAILX2nMW0WnXHN5 Y2lFKAQ+L4oIj18UOnwCdiFjoHCRGvLMCBClB2P9/+gfSi6blLd7ELgkJEaX47AfeG42 ZQppuZFZmajpf5zKtpbPmA7UGfPXoSitvhbRrNk1vGMHsgcgAgjKDIoDIEhiZ9HlVQOo itQw== MIME-Version: 1.0 X-Received: by 10.112.190.1 with SMTP id gm1mr1088118lbc.30.1379926843683; Mon, 23 Sep 2013 02:00:43 -0700 (PDT) Sender: mike.php.net@gmail.com Received: by 10.114.184.19 with HTTP; Mon, 23 Sep 2013 02:00:43 -0700 (PDT) In-Reply-To: <523FFE44.8030107@lerdorf.com> References: <523FFE44.8030107@lerdorf.com> Date: Mon, 23 Sep 2013 11:00:43 +0200 X-Google-Sender-Auth: Q3QXL-Vl8JrdACe-hyUSNLYLApc Message-ID: To: Rasmus Lerdorf Cc: Joe Watkins , PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] RFC: Anonymous Classes From: mike@php.net (Michael Wallner) On 23 September 2013 10:39, Rasmus Lerdorf wrote: > 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. It is a widely used pattern in object oriented programming: $subject->attach(new class implements SplObserver { function update(SplSubject $s) { printf("Got update from: %s\n" $subject); } ); I'd rather go for a `new BaseType` syntax, though: $subject->attach(new SplObserver() { function update(SplSubject $s) { printf("Got update from: %s\n" $subject); } ); -- Regards, Mike