Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69382 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26420 invoked from network); 27 Sep 2013 08:37:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Sep 2013 08:37:16 -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 74.125.82.49 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@gmail.com X-Host-Fingerprint: 74.125.82.49 mail-wg0-f49.google.com Received: from [74.125.82.49] ([74.125.82.49:62138] helo=mail-wg0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 61/A5-28456-AB345425 for ; Fri, 27 Sep 2013 04:37:15 -0400 Received: by mail-wg0-f49.google.com with SMTP id l18so2289241wgh.4 for ; Fri, 27 Sep 2013 01:37:11 -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=Er4XzvMasIQRp4BEaSluFTzU1A7/XVDIWk+Q14yRUx8=; b=MTV11J/WBAc8eVq8YFG9clIqx0AzsnzCnsRehEPdrYOBS4e6N+RC5bwzJCKjYmlziL AXf+9GJx4PymS3wkXQi1W/kVaMInswhPUk/OEZGxRWQiOekhQL5Byng5ShdiikGmaIi4 RBsbbkbsEPzWAmWaJim8DDCRs6n1hExyfVLMxCvHcXn61jJg3EkxAoIx+u2Aim9aHtCR tSwb1zMJD4DVeDcxn4hk1KgOy6u2sYciWfZSTWUSSD8sHqc5TjErt8BMZi+74Ht14hLl rcw6/41KHjz1MOLkNpEgcwVVTuLiP8m5qKgMphZswhH0q+igppie6hktn3dQ3rrvE1nD j5Ww== X-Received: by 10.180.37.164 with SMTP id z4mr1642788wij.30.1380271031721; Fri, 27 Sep 2013 01:37:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.5.9 with HTTP; Fri, 27 Sep 2013 01:36:31 -0700 (PDT) In-Reply-To: References: <5241F11C.5080707@php.net> <008301ceb967$b49ab190$1dd014b0$@tutteli.ch> <524205D8.8000608@php.net> <5242ADAE.2080007@php.net> <5242E88D.90407@php.net> <5244095F.3090005@php.net> Date: Fri, 27 Sep 2013 10:36:31 +0200 Message-ID: To: Michael Wallner Cc: Nicolas Grekas , Joe Watkins , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=e89a8f642bdc8a25be04e75964f6 Subject: Re: [PHP-DEV] RFC: Anonymous Classes From: krebs.seb@gmail.com (Sebastian Krebs) --e89a8f642bdc8a25be04e75964f6 Content-Type: text/plain; charset=ISO-8859-1 2013/9/27 Michael Wallner > On 27 September 2013 09:55, Nicolas Grekas > wrote: > > If you need access to the methods in AProxifier then why does the > anonymous > >> class extend A, you should extend AProxifier as you would with any other > >> class. > >> > > > > Because A has the behavior I want to extend? > > > > An other example: > > > > class A {...} > > class B {...} > > > > class Factory > > { > > protected function protectedMethod() {...} > > > > function getA() > > { > > return new class extends A {.. call Factory::protectedMethod()? > ..}; > > } > > > > function getB() > > { > > return new class extends B {.. call Factory::protectedMethod()? > ..}; > > } > > } > > > > This is possible and welcomed with closures. > > I see it as useful for anonymous classes than it is for anonymous > functions. > > What do others you think about it? > > -1 > > Just because a closure is an anonymous function does not mean that an > anonymous class has closure capabilites. > Just ... Isn't that something, we can simply keep out of _this_ RFC and create separate RFC(s) for it later? Like it was done with "$this in Closures"? > > -- > Regards, > Mike > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- github.com/KingCrunch --e89a8f642bdc8a25be04e75964f6--