Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10978 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57873 invoked by uid 1010); 8 Jul 2004 11:39:46 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 56860 invoked from network); 8 Jul 2004 11:39:37 -0000 Received: from unknown (HELO ctindustries.net) (216.117.147.250) by pb1.pair.com with SMTP; 8 Jul 2004 11:39:37 -0000 Received: from ctdprimary (dsta-aa203.pivot.net [66.186.171.203]) (authenticated bits=0) by ctindustries.net (8.12.8/8.12.8) with ESMTP id i68AcGbx003732; Thu, 8 Jul 2004 06:38:40 -0400 Message-ID: <022701c464e0$aa402940$f7dea8c0@cyberware.local> To: "Zeev Suraski" Cc: "Marcus Boerger" , References: <01db01c46342$2ea393c0$f7dea8c0@cyberware.local> <11610112416.20040706204401@marcus-boerger.de> <5.1.0.14.2.20040707202714.05228788@localhost> <5.1.0.14.2.20040708001852.045ffe08@localhost> Date: Thu, 8 Jul 2004 07:42:13 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Subject: Re: [PHP-DEV] extended objects with read_property and get_property_ptr_ptr From: rrichards@ctindustries.net ("Rob Richards") From: Zeev Suraski > The correct solution, I think, would be adding a boolean function (or even > just a bit) to the handlers structure, that instructs the engine whether it > should use get_ptr_ptr for incdec or not, since it's an > optimization. Maybe we can just check whether we're dealing with PHP > objects and perform this optimization only then. I need to look into it. I dont see the problem as being with incdec. In my particular case at least, I dont want to implement get_ptr_ptr. The only reason it was needed was to support properties on an extended object which are not from the base class. All the properties of the base class want/need to be handled with the read/write_property handlers. If a property is not of the base class, then get_ptr_ptr is needed so that the standard get_ptr_ptr handler can be called for those properties, while all base class properties would return NULL from the get_ptr_ptr handler (thus in most cases defaulting to calling the read_property handler). zend_fetch_property_address_inner is the only function that does not fall back on the read_property if NULL is returned from get_ptr_ptr. Looking at the other bug mentioned (28444), standard objects also fall into a similar problem I hit when returning NULL from get_ptr_ptr. zend_std_get_property_ptr_ptr assumes that if it returns NULL, then it should try with the normal __get handler (which also errors out since zend_fetch_property_address_inner doesnt fall back to the other handler). If there is a problem with always forcing zend_fetch_property_address_inner to use the read_property handler when get_ptr_ptr returns NULL, it should at least allow it to fall back to the read_property handler when the object is not a standard object. In this case the developer knows they are returning NULL or a zval ** for a reason and are handling things in the read_property handler if needed, though it still leaves open the issue with standard objects. Rob