Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69379 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20121 invoked from network); 27 Sep 2013 07:55:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Sep 2013 07:55:44 -0000 Authentication-Results: pb1.pair.com smtp.mail=nicolas.grekas@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nicolas.grekas@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.54 as permitted sender) X-PHP-List-Original-Sender: nicolas.grekas@gmail.com X-Host-Fingerprint: 209.85.212.54 mail-vb0-f54.google.com Received: from [209.85.212.54] ([209.85.212.54:65026] helo=mail-vb0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B5/64-28456-FF935425 for ; Fri, 27 Sep 2013 03:55:43 -0400 Received: by mail-vb0-f54.google.com with SMTP id q14so1607175vbe.13 for ; Fri, 27 Sep 2013 00:55:40 -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:from:date:message-id :subject:to:cc:content-type; bh=nvFTfrnhZxapuHOtZHXwE6bjXN/uh8yM9YRNxyT4i58=; b=LSheiT9ZXdqFgwFh5bsWrzuqtoKDJ2PZkinAmuC9j0cUwNX+kXyiCu11VgKzsedE2a IHxfJsW+Rr44DebSOjHfwIj4r7glW6ZYvwhU3/itFYbXkTEhwCcPyhgD2pF/rdsinSaS Vub6LY+2pOa1b1QAkNwkZU4C4AG9COoaFG8xtw95AA9+kTygCfFRcsP7cQt5rGsD4p3C YS1S7856PaxdStoP1k/YfZqLwYZtNR2MD14D2GfUVssX9MJo/40Pp13n3SPLKru9QOZE /y4BHCMxITfXCFRP9R1c0a5WNQAMw4Iun2qBtRyFuWgOhuWPAjgPJVKEdmHINfZpO9Ya 3DGw== X-Received: by 10.52.98.131 with SMTP id ei3mr4258047vdb.4.1380268540343; Fri, 27 Sep 2013 00:55:40 -0700 (PDT) MIME-Version: 1.0 Sender: nicolas.grekas@gmail.com Received: by 10.52.249.80 with HTTP; Fri, 27 Sep 2013 00:55:20 -0700 (PDT) In-Reply-To: <5244095F.3090005@php.net> 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 09:55:20 +0200 X-Google-Sender-Auth: 7TkOs5ykp6WsVpoXpyuP2z3GMXo Message-ID: To: Joe Watkins Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=20cf307d03f40ac25204e758d017 Subject: Re: [PHP-DEV] RFC: Anonymous Classes From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --20cf307d03f40ac25204e758d017 Content-Type: text/plain; charset=ISO-8859-1 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? --20cf307d03f40ac25204e758d017--