Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39205 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43985 invoked from network); 22 Jul 2008 22:54:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jul 2008 22:54:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.163 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.163 il-gw1.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.163] ([212.25.124.163:43149] helo=il-gw1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/70-41758-13566884 for ; Tue, 22 Jul 2008 18:54:45 -0400 Received: from us-ex1.zend.com ([192.168.16.5]) by il-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 23 Jul 2008 01:55:14 +0300 Received: from [192.168.16.110] ([192.168.16.110]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 22 Jul 2008 15:54:48 -0700 Message-ID: <48866538.80101@zend.com> Date: Tue, 22 Jul 2008 15:54:48 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Marcus Boerger CC: Lars Strojny , Christian Seiler , Lukas Kahwe Smith , PHP Developers Mailing List , kalle@zesix.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> <17010401067.20080723004440@marcus-boerger.de> In-Reply-To: <17010401067.20080723004440@marcus-boerger.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 22 Jul 2008 22:54:48.0427 (UTC) FILETIME=[F14113B0:01C8EC4D] Subject: Re: [PHP-DEV] closures questions From: stas@zend.com (Stanislav Malyshev) Hi! > 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. That means you can't call the closure, and nothing alerts you of the problem. >> 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. Whenever someone sets a property to a closure what happens? Does it mean that every call to write_property argument would be checked for instanceof Closure? What about write_dimension or get_property_ptr_ptr? >> 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. __call doesn't work anymore if there's a property with the name that is equal to called function. That could be a big surprise for classes that use __call for routing. > Maybe. However this only applies to overloaded objects. Maybe those cannot > or should not hold closures. What do you mean by "overloaded objects"? Every object has get_property handler. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com