Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38764 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44297 invoked from network); 4 Jul 2008 11:42:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jul 2008 11:42:09 -0000 Authentication-Results: pb1.pair.com header.from=johannes@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 83.243.58.163 as permitted sender) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 83.243.58.163 mail4.netbeat.de Received: from [83.243.58.163] ([83.243.58.163:45338] helo=mail4.netbeat.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9C/88-14155-09C0E684 for ; Fri, 04 Jul 2008 07:42:09 -0400 Received: (qmail 6960 invoked by uid 507); 4 Jul 2008 11:42:05 -0000 Received: from ppp-82-135-93-166.dynamic.mnet-online.de (HELO ?192.168.1.102?) (postmaster%schlueters.de@82.135.93.166) by mail4.netbeat.de with ESMTPA; 4 Jul 2008 11:42:05 -0000 To: Lars Strojny Cc: Dmitry Stogov , Andi Gutmans , Lukas Kahwe Smith , Christian Seiler , php-dev List In-Reply-To: <1215163906.8875.26.camel@localhost> References: <486B6960.4030705@gmx.net> <3F379336-B4DC-4495-AD76-3D52ED703E0E@pooteeweet.org> <486C7F5F.3080007@zend.com> <698DE66518E7CA45812BD18E807866CE01C3A902@us-ex1.zend.net> <486D1AD3.3080708@zend.com> <1215163088.32294.9.camel@goldfinger.johannes.nop> <1215163906.8875.26.camel@localhost> Content-Type: text/plain; charset=utf-8 Date: Fri, 04 Jul 2008 13:42:03 +0200 Message-ID: <1215171723.32294.20.camel@goldfinger.johannes.nop> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 (2.22.2-2.fc9) Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] Closures: updated proposal and patch From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Fri, 2008-07-04 at 11:31 +0200, Lars Strojny wrote: > Hi Johannes, > > Am Freitag, den 04.07.2008, 11:18 +0200 schrieb Johannes Schlüter: > > Now such a check isn't possible, all reflection information on the > > callback I can get is that it is an object of type Closure having a > > method __invoke() with zero required parameters. There's no further > > information on the function, so probably we need a ReflectionClosure > > class or something > > Couldn't ReflectionFunction play that role. Classes and instances with a > defined "__invoke" method can be reflected with ReflectionFunction? At the moment: not enough. $ php -r 'echo new ReflectionObject(function ($a, $b) use ($c) {});' Object of class [ final class Closure ] { - Constants [0] { } - Static properties [0] { } - Static methods [0] { } - Properties [0] { } - Dynamic properties [0] { } - Methods [1] { Method [ public method __invoke ] { } } } it's not mentioning the parameters or the used variable, and yes, it's a tiny issue which can, most likely, fixed within an hour or so but I guess we'll have many more of that kind: Tiny issues which end up in discussions about taste ("should we add a new class or simply add special treatment in ReflectionMethod for Closure::__invoke?") and all this stuff can delay things... That's the risk I'm seeing. johannes