Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42438 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20100 invoked from network); 1 Jan 2009 16:23:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jan 2009 16:23:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=david.zuelke@bitextender.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=david.zuelke@bitextender.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain bitextender.com from 80.237.132.12 cause and error) X-PHP-List-Original-Sender: david.zuelke@bitextender.com X-Host-Fingerprint: 80.237.132.12 wp005.webpack.hosteurope.de Received: from [80.237.132.12] ([80.237.132.12:49363] helo=wp005.webpack.hosteurope.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9B/8A-62500-FEDEC594 for ; Thu, 01 Jan 2009 11:23:12 -0500 Received: from dslb-088-066-170-139.pools.arcor-ip.net ([88.66.170.139] helo=[192.168.0.101]); authenticated by wp005.webpack.hosteurope.de running ExIM using esmtpsa (TLSv1:RC4-SHA:128) id 1LIQKC-0000EH-MN; Thu, 01 Jan 2009 17:23:08 +0100 To: Marcus Boerger In-Reply-To: <533383914.20090101170623@marcus-boerger.de> X-Priority: 3 (Normal) References: <08AA10DA-2704-415C-8A8C-893C89990DC1@bitextender.com> <868073456.20081231173818@marcus-boerger.de> <1230746348.25966.3.camel@localhost> <8710064882.20081231201259@marcus-boerger.de> <7f3ed2c30812311133m708bcab1s746f9ca7c3129542@mail.gmail.com> <18322421.20090101160939@marcus-boerger.de> <533383914.20090101170623@marcus-boerger.de> Message-ID: <150CBF28-ADB6-4ED3-9201-4483518D6129@bitextender.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Date: Thu, 1 Jan 2009 17:23:08 +0100 Cc: "Hannes Magnusson" , "Lars Strojny" , "PHP Internals" X-Mailer: Apple Mail (2.930.3) X-bounce-key: webpack.hosteurope.de;david.zuelke@bitextender.com;1230826992;c96704e3; Subject: Re: [PHP-DEV] [RFC] Re: [PHP-DEV] __invoke() weirdness From: david.zuelke@bitextender.com (=?ISO-8859-1?Q?David_Z=FClke?=) Hi folks, first of all, thank you Marcus for implementing this. Very cool. As for the __get()/__getClosure() stuff, I don't think it's necessary or even an issue. One can never simply do $this- >getOverloadPropertyWithInvoke() anyway, because if the prop is not there, a fatal error would be the result. An __isset() call has to be made first along with an (instanceof Closure || method_exists('__invoke')) check in userspace code. Which brings me to the next question - will $method = 'something'; $bar->$method(); work? Not sure if it's necessary; just curious for the most part. - David On 01.01.2009, at 17:06, Marcus Boerger wrote: > Hello Hannes, > > as discussed online. At the moment we should not have any __get() > calls during method resolution. The newly updated patch does that > now. And I think we are now safe to submit. > > In the future we could think of adding __getClosure() which would be > called to resolve a dynamic closure. But for the moment we do not need > it badly and the patch with the increased consistency is good enough. > > marcus > > Thursday, January 1, 2009, 4:09:39 PM, you wrote: > >> Hello Hannes, > >> Wednesday, December 31, 2008, 8:33:43 PM, you wrote: > >>> On Wed, Dec 31, 2008 at 20:12, Marcus Boerger wrote: >>>> Hello Lars, >>>> >>>> Wednesday, December 31, 2008, 6:59:08 PM, you wrote: >>>> >>>>> Hi Markus, >>>> >>>>> have you measured the performance impact in a class with - say - >>>>> ten >>>>> methods? And what to do with __get() and __call()? How are the >>>>> prioritized in the method resolve order? >>>> >>>> Translated into user code we now have: >>>> >>>> public function __zend_call($name, $args) { >>>> // Added property lookup >>>> if (isset($this->$name)) { // may call __isset >>>> $callable = $this->$name; // may call __get > >>> Uhmm. I hope I got this wrong as: > >> Well yes, there are no __isset() calls unless you call isset() of >> course. > >> I have updated the patch and added a test to demonstrate it better >> (closure_036.phpt). I also added debug information to closures >> which makes >> development much easier. The next step is to fix an issue in the >> engine and >> then submit unless there is a bigger issue with this. > >>> class foo { >>> function __isset() { >>> return true; >>> } >>> function __get() { >>> return "hello world"; >>> } >>> function __call() { >>> } >>> } > >>> $foo = new foo; >>> $foo->foobar(); > >>> will first execute __isset(), then __get() and then __call()? That >>> is >>> a major backwards compatibility break, and increases the >>> inconsistency >>> and decreases readability 10times > >>> -Hannes > > > > >> Best regards, >> Marcus > > > > Best regards, > Marcus-- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php