Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:1683 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95904 invoked from network); 18 May 2003 21:52:32 -0000 Received: from unknown (HELO carmine.bestweb.net) (209.94.102.73) by pb1.pair.com with SMTP; 18 May 2003 21:52:32 -0000 Received: from [192.168.1.102] (ip216-179-71-153.cust.bestweb.net [216.179.71.153]) by carmine.bestweb.net (Postfix) with ESMTP id 6A9B125667 for ; Sun, 18 May 2003 16:52:32 -0500 (EST) To: internals@lists.php.net Content-Type: text/plain Organization: Message-ID: <1053289641.789.61.camel@hasele> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 18 May 2003 16:27:21 -0400 Content-Transfer-Encoding: 7bit Subject: get_property_ptr From: sterling@bumblebury.com (Sterling Hughes) hey, I'm working on simplexml (sources available in pecl), and I want it to work in a foreach() loop without requiring the use of a temporary variable, ie: books.xml The Grapes of Wrath John Steinbeck The Pearl John Steinbeck books.php book; // must assign to a temporary variable foreach ($booklist as $book) { echo "{$book->title}\n"; } ?> So I'm trying to figure out how to use the get_property_ptr callback. I've tried a few things: 1) zend_object_create_proxy. The docs say I can just return a proxy object, however, this causes a segfault for me: return zend_object_create_proxy(object, member TSRMLS_CC); 2) Adding indirection. I just call property_read, and then return a pointer to the result of the property_read call. This also yields a segfault. So, any insights on how I might be a smarter boy, and actually get this thingy to work? :) -Sterling -- "Whether you think you can or think you can't -- you are right." - Henry Ford