cvs: ZendEngine2 / zend_execute.c
| From: | Sara Golemon | Date: | Wed, 23 Jun 2004 23:20:45 +0000 |
| Subject: | cvs: ZendEngine2 / zend_execute.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-2711@lists.php.net to get a copy of this message | ||
pollita Wed Jun 23 19:20:45 2004 EDT
Modified files:
/ZendEngine2 zend_execute.c
Log:
BugFix #28879 Inconsistent behavior between explicit and implicit array creation.
Changes:
Throw E_WARNING "Illegal offset type" when explicitly creating
array elements with objects, arrays, or resorces as indexes.
This matches implicit creation w/ obj/arr indices.
Throw E_WARNING "Resource ID#%ld used as offset, casting to integer (%ld)"
when implicitly creating array with resource as index. (BC)
http://cvs.php.net/diff.php/ZendEngine2/zend_execute.c?r1=1.649&r2=1.650&ty=u
Index: ZendEngine2/zend_execute.c
diff -u ZendEngine2/zend_execute.c:1.649 ZendEngine2/zend_execute.c:1.650
--- ZendEngine2/zend_execute.c:1.649 Fri Jun 18 14:33:46 2004
+++ ZendEngine2/zend_execute.c Wed Jun 23 19:20:44 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute.c,v 1.649 2004/06/18 18:33:46 pollita Exp $ */
+/* $Id: zend_execute.c,v 1.650 2004/06/23 23:20:44 pollita Exp $ */
#define ZEND_INTENSIVE_DEBUGGING 0
@@ -839,8 +839,10 @@
}
}
break;
- case IS_DOUBLE:
case IS_RESOURCE:
+ zend_error(E_WARNING, "Resource ID#%ld used as offset, casting to integer (%ld)",
dim->value.lval, dim->value.lval);
+ /* Fall Through */
+ case IS_DOUBLE:
case IS_BOOL:
case IS_LONG: {
long index;
@@ -3402,6 +3404,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;