Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38779 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20389 invoked from network); 5 Jul 2008 19:48:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jul 2008 19:48:03 -0000 Authentication-Results: pb1.pair.com smtp.mail=helly@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=helly@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 85.214.94.56 as permitted sender) X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 85.214.94.56 aixcept.net Linux 2.6 Received: from [85.214.94.56] ([85.214.94.56:60205] helo=h1149922.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 58/91-10299-2FFCF684 for ; Sat, 05 Jul 2008 15:48:03 -0400 Received: from MBOERGER-ZRH.corp.google.com (203-82.106-92.cust.bluewin.ch [92.106.82.203]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by h1149922.serverkompetenz.net (Postfix) with ESMTP id F1DA811F548; Sat, 5 Jul 2008 21:47:59 +0200 (CEST) Date: Sat, 5 Jul 2008 21:47:37 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <221789309.20080705214737@marcus-boerger.de> To: Stanislav Malyshev CC: Lars Strojny , Christian Seiler , Dmitry Stogov , php-dev List , Andi Gutmans In-Reply-To: <48680A9F.50504@zend.com> References: <4856A547.3080801@gmx.net> <485A35A0.9050602@zend.com> <485AF253.2070400@gmx.net> <485B908D.7000106@zend.com> <4863C299.1080002@gmx.net> <1214777090.11320.13.camel@localhost> <48680A9F.50504@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP From: helly@php.net (Marcus Boerger) Hello Stanislav, Monday, June 30, 2008, 12:20:15 AM, you wrote: > Hi! >> * Class::__invoke() to allow functors[1]. The class "Closure" in >> your proposal should also implement that method to make >> method_exists() and ext/reflection behave. >> * Change the behaviour how method calls are resolved. Method calls >> on invokable objects (closures or functors) should work. > And to close the circle, add __invoke to ReflectionFunctionAbstract and > implement it in Reflectionfunctiom and ReflectionMethod (here we might > have trouble with specifying object, so need to do some thinking on it - > maybe we'll need another class or augment ReflectionMethod somehow?) Actually a pretty good idea :-) Callable comes to mind if we really need more names. But a ReflectionMethod could be a static method as well as a static closure. So I think it should throw an exception in case an instance is missing, just as it would do for non static methods. marcus >> echo $view->escape(""); > If we use this syntax, and $view->escape is not defined, should we call > __call or __get? > -- > Stanislav Malyshev, Zend Software Architect > stas@zend.com http://www.zend.com/ > (408)253-8829 MSN: stas@zend.com Best regards, Marcus