Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83662 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83161 invoked from network); 24 Feb 2015 13:52:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Feb 2015 13:52:29 -0000 Authentication-Results: pb1.pair.com header.from=pjsturgeon@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pjsturgeon@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.177 as permitted sender) X-PHP-List-Original-Sender: pjsturgeon@gmail.com X-Host-Fingerprint: 209.85.217.177 mail-lb0-f177.google.com Received: from [209.85.217.177] ([209.85.217.177:36321] helo=mail-lb0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FA/C0-10521-9128CE45 for ; Tue, 24 Feb 2015 08:52:26 -0500 Received: by lbvp9 with SMTP id p9so25047015lbv.3 for ; Tue, 24 Feb 2015 05:52:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=qUW5VE9dxyq6uwPbiZKJcoifH/Evav1pwL0s/icpzEw=; b=fzeBbF6GK39VQRS/Q+L6QU9vfCiguZVwOcri2KRec0SekWFoXfd3rR0WEb0V/kRCIw 3ebmZn3GPmqmTA/B75IwpEbYJXCTgSGa26M6xp9aVz9onLGcaT2X/LwxOnyu5k2gzQQ9 ikOWkTZT7s0jg6pJWzJJfd3u1GjIR3x/rpdwN4PtmgVlM2vVDe4WahiYNZ4l9GEcPwmJ 6ZudBFHbjYwACxERwzvtB58qjMv7nNsdTTflN6rjMXES2CAwbSF4/aJIaGhy4nwfsZnp q1kCXLyNbKJ7LO/GsX6BimuyAXRLAj0bPWsRjpbWnjmc91gyrAzZv0zWW02t8TauQxny Asqw== MIME-Version: 1.0 X-Received: by 10.112.85.165 with SMTP id i5mr7439060lbz.7.1424785942094; Tue, 24 Feb 2015 05:52:22 -0800 (PST) Received: by 10.114.26.34 with HTTP; Tue, 24 Feb 2015 05:52:21 -0800 (PST) Date: Tue, 24 Feb 2015 08:52:21 -0500 Message-ID: To: PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: [PHP-DEV] [RFC] Anonymous Classes From: pjsturgeon@gmail.com (Philip Sturgeon) Good day! https://wiki.php.net/rfc/anonymous_classes There's a little RFC + patch that Joe Watkins put together, and as before with the ArrayOf RFC, I'll be helping out. So, lets get this discussion rolling. It was declined for PHP 5 some time ago, and has returned now to try for PHP 7. The usage of anonymous classes to some will be instantly offensive, but really it comes down to the use case. The usage of anonymous functions compared to declared functions is pretty much the exact same thing as anonymous classes. Other than examples on the RFC, Fractal would certainly be happy to have them: http://fractal.thephpleague.com/transformers/ Defining a class properly is certainly still going to be the majority of uses of classes in PHP. That helps with the Optimizer, and helps code reuse. Sadly due to the way in which people have had ONE CLASS ONE FILE drilled into their head since PEAR and continuing through Zend and PSR-0, it can become a PITA to add some simple functionality if a small class is needed for one tiny thing. Anonymous functions alleviate that annoyance with a simple and consistent feature that just give people a nice simple option to get their jobs done, without hitting autoloaders and file systems to do it.