Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10712 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24972 invoked by uid 1010); 22 Jun 2004 16:42:22 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 23240 invoked by uid 1007); 22 Jun 2004 16:42:09 -0000 Message-ID: <20040622164209.23239.qmail@pb1.pair.com> To: internals@lists.php.net Date: Tue, 22 Jun 2004 09:41:42 -0700 Lines: 38 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Posted-By: 169.229.135.175 Subject: Bug 28879: Populating arrays with resources and objects as offsets From: pollita@php.net ("Sara Golemon") http://bugs.php.net/28879 The fixes are really simple (and the ZE1 branch is no more complicated), but I just wanted to double check that this kind of behavior change should be done. On the one hand it makes things consistent (which is good), on the other hand the two "problems" it "solves" are fairly insipid to begin with. Would this raise a BC issue? Andi/Zeev? Index: Zend/zend_execute.c =================================================================== RCS file: /repository/ZendEngine2/zend_execute.c,v retrieving revision 1.649 diff -u -r1.649 zend_execute.c --- Zend/zend_execute.c 18 Jun 2004 18:33:46 -0000 1.649 +++ Zend/zend_execute.c 22 Jun 2004 16:38:27 -0000 @@ -3391,6 +3391,7 @@ case IS_DOUBLE: zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); break; + case IS_RESOURCE: case IS_LONG: case IS_BOOL: zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); @@ -3402,6 +3403,7 @@ zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: + zend_error(E_WARNING, "Illegal offset type"); zval_ptr_dtor(&expr_ptr); /* do nothing */ break;