Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10932 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85962 invoked by uid 1010); 6 Jul 2004 18:44:15 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 85916 invoked from network); 6 Jul 2004 18:44:14 -0000 Received: from unknown (HELO mx.thebrainroom.net) (69.55.226.195) by pb1.pair.com with SMTP; 6 Jul 2004 18:44:14 -0000 Received: by mx.thebrainroom.net (Postfix, from userid 517) id DA6B814880E0; Tue, 6 Jul 2004 11:44:13 -0700 (PDT) Received: from BAUMBART (pD95F821D.dip.t-dialin.net [217.95.130.29]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by mx.thebrainroom.net (Postfix) with ESMTP id 3783D14880DE; Tue, 6 Jul 2004 11:44:02 -0700 (PDT) Date: Tue, 6 Jul 2004 20:44:01 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <11610112416.20040706204401@marcus-boerger.de> To: Rob Richards Cc: internals@lists.php.net In-Reply-To: <01db01c46342$2ea393c0$f7dea8c0@cyberware.local> References: <01db01c46342$2ea393c0$f7dea8c0@cyberware.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on jc.thebrainroom.net X-Spam-Status: No, hits=0.8 required=5.0 tests=PRIORITY_NO_NAME autolearn=no version=2.63 X-Spam-Level: X-TBR-Filter: Virus scanned and defanged Subject: Re: [PHP-DEV] extended objects with read_property and get_property_ptr_ptr From: helly@php.net (Marcus Boerger) Hello Rob, Tuesday, July 6, 2004, 12:15:31 PM, you wrote: > I was playing around with Bug #28817 and seem to have run into an issue > when overriding the read_property handler with an extended object (this > case a DomDocument object). > In order to support standard properties correctly, such as > $obj->myprop['a'] = 'b', the internal object needs to support > get_property_ptr_ptr. As the internal object here overrides the > read_property handler, it would also need to override the > get_property_ptr_ptr handler to make that standard property work > correctly, which is where I have run into some problems. > At first, I implemented a get_property_ptr_ptr handler, but found that > for the base internal class properties, this method needs to return NULL > so that cases like zend_pre_incdec_property would fall back to the > read_property/write_property handling. Next was to return NULL for all > properties of the base internal class and return the result of the > standard get_property_ptr_ptr for non base class properties. This fixed > the standard properties, but returning NULL for the internal base > properties breaks calls like: > $document->documentElement->ownerDocument; > because zend_fetch_property_address_inner will not fall back to the > read_property handler if NULL is returned get_property_ptr_ptr. > Rather the error "Cannot access undefined property for object with > overloaded property access" is returned. > Is this is a pitfall of the engine or is there something I am > overlooking which would allow this to work across all cases? Sounds more like small oversight. Could you try to make a patch for that? Best regards, Marcus mailto:helly@php.net