Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12698 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78893 invoked by uid 1010); 10 Sep 2004 05:58:23 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 78689 invoked from network); 10 Sep 2004 05:58:21 -0000 Received: from unknown (HELO smtp.unet.ru) (213.219.244.56) by pb1.pair.com with SMTP; 10 Sep 2004 05:58:21 -0000 Received: from host.phpclub.net by smtp.unet.ru (8.12.9/Unet) with ESMTP id i8A5wKMb098031 for ; Fri, 10 Sep 2004 09:58:20 +0400 (MSD) Received: from s17.hibet.ru by host.phpclub.net (8.12.6/Unet) with ESMTP id i8A5wKmo027210 for ; Fri, 10 Sep 2004 09:58:20 +0400 (MSD) Date: Fri, 10 Sep 2004 09:57:27 +0400 To: php-dev Message-ID: <20040910095727.7379c915.tony2001@phpclub.net> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Fri__10_Sep_2004_09_57_27_+0400_z=FlTytgHGnDbFn4" Subject: [patch] Zend/zend_object_handlers.c - bug #29378 (foreach() doesn't work with arrays returned by __get) From: tony2001@phpclub.net (Antony Dovgal) --Multipart=_Fri__10_Sep_2004_09_57_27_+0400_z=FlTytgHGnDbFn4 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Another one patch for ZE. This one fixes the bug #29378. It looks like this bug was done intentionally (I'm not sure, just an assumption), so zend_std_get_property_ptr_ptr() doesn't call __get. Please look at the patch fro details. -- Wbr, Antony Dovgal aka tony2001 tony2001@phpclub.net || antony@dovgal.com --Multipart=_Fri__10_Sep_2004_09_57_27_+0400_z=FlTytgHGnDbFn4 Content-Type: text/plain; name="bug29378.diff.txt" Content-Disposition: attachment; filename="bug29378.diff.txt" Content-Transfer-Encoding: 7bit Index: zend_object_handlers.c =================================================================== RCS file: /repository/ZendEngine2/zend_object_handlers.c,v retrieving revision 1.104 diff -u -r1.104 zend_object_handlers.c --- zend_object_handlers.c 22 Jul 2004 11:54:27 -0000 1.104 +++ zend_object_handlers.c 6 Sep 2004 05:28:17 -0000 @@ -474,8 +474,11 @@ new_zval->refcount++; zend_hash_quick_update(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, &new_zval, sizeof(zval *), (void **) &retval); } else { - /* we do have getter - fail and let it try again with usual get/set */ - retval = NULL; + zval *getter_retval = zend_std_call_getter(object, member TSRMLS_CC); + if (!getter_retval) { + getter_retval = &EG(uninitialized_zval); + } + retval = &getter_retval; } } if (member == &tmp_member) { --Multipart=_Fri__10_Sep_2004_09_57_27_+0400_z=FlTytgHGnDbFn4--