Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39204 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42515 invoked from network); 22 Jul 2008 22:53:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jul 2008 22:53:27 -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:49669] helo=h1149922.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F3/20-41758-3E466884 for ; Tue, 22 Jul 2008 18:53:26 -0400 Received: from MBOERGER-ZRH (ip131.fa1-0-1.occ.iinet.com [198.145.32.131]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by h1149922.serverkompetenz.net (Postfix) with ESMTP id 5AFD211DB71; Wed, 23 Jul 2008 00:44:58 +0200 (CEST) Date: Wed, 23 Jul 2008 00:44:40 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <17010401067.20080723004440@marcus-boerger.de> To: Stanislav Malyshev CC: Lars Strojny , Christian Seiler , Lukas Kahwe Smith , PHP Developers Mailing List , In-Reply-To: <48864C2E.5020208@zend.com> References: <8A5D4032-1FC4-44BB-90F3-61B802F10159@pooteeweet.org> <6BD46F4A-2733-4160-9A3E-AD49F3002865@pooteeweet.org> <4885CF6B.5060600@gmx.net> <1216731965.16085.8.camel@localhost> <48863E7C.8040900@zend.com> <1216757703.17574.3.camel@localhost> <48864C2E.5020208@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] closures questions From: helly@php.net (Marcus Boerger) Hello Stanislav, Tuesday, July 22, 2008, 11:07:58 PM, you wrote: > Hi! >> Can't we change zend_std_get_method() to return a zend_internal_function >> struct in case of a closure on a property? The only thing that needs to > That means that: > 1. We can't have properties named same as functions anymore Nope. It means if you have a function named foo and a property foo that sores a closure and then call foo(), then obviously the function is called rather than the closure. > 2. We'd have to check properties every time method name was not found We could add a flag for this to make it faster. That is whenever someone sets a property to a closure. > 3. __call will be broken - now should we check properties or go to > __call when method is not defined? How is it broken? __call does not get called if there is something callable already. > 4. zend_std_get_method should be calling __get too, in case this > property is not a direct property! Maybe. However this only applies to overloaded objects. Maybe those cannot or should not hold closures. > I don't think it's going to work out. Using __invoke is much easier. > -- > Stanislav Malyshev, Zend Software Architect > stas@zend.com http://www.zend.com/ > (408)253-8829 MSN: stas@zend.com Best regards, Marcus