Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39208 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52066 invoked from network); 22 Jul 2008 23:20:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jul 2008 23:20:32 -0000 Authentication-Results: pb1.pair.com header.from=helly@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=helly@php.net; spf=unknown; 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:58615] helo=h1149922.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 63/22-41758-04B66884 for ; Tue, 22 Jul 2008 19:20:32 -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 92F0D11DCB4; Wed, 23 Jul 2008 01:20:27 +0200 (CEST) Date: Wed, 23 Jul 2008 01:20:24 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1915350579.20080723012024@marcus-boerger.de> To: Stanislav Malyshev CC: Marcus Boerger , Lars Strojny , Christian Seiler , Lukas Kahwe Smith , PHP Developers Mailing List , In-Reply-To: <48866538.80101@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> <17010401067.20080723004440@marcus-boerger.de> <48866538.80101@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, Wednesday, July 23, 2008, 12:54:48 AM, you wrote: > 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. Hmmmm, the amount of problems is pretty long. So even though it might sound cool to do it. It is the better deceision to not allow it. Also you've shown several paths where it would slow general execution down. Yet I hate not being able to easily make it work. Best regards, Marcus