Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10926 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43452 invoked by uid 1010); 6 Jul 2004 10:12:43 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 43349 invoked from network); 6 Jul 2004 10:12:42 -0000 Received: from unknown (HELO ctindustries.net) (216.117.147.250) by pb1.pair.com with SMTP; 6 Jul 2004 10:12:42 -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 i669Babx027539 for ; Tue, 6 Jul 2004 05:11:42 -0400 Message-ID: <01db01c46342$2ea393c0$f7dea8c0@cyberware.local> To: Date: Tue, 6 Jul 2004 06:15:31 -0400 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01D8_01C46320.A4034EC0" 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: extended objects with read_property and get_property_ptr_ptr From: rrichards@ctindustries.net ("Rob Richards") ------=_NextPart_000_01D8_01C46320.A4034EC0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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'] =3D '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? Thanks, Rob ------=_NextPart_000_01D8_01C46320.A4034EC0--