From 4638f7b91407c48710007af82a68da0007c820f2 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 28 Jan 2015 07:43:28 +0300 Subject: Change "foreach" statement behavior (this is just a PoC yet) - "foreach by value" don't relay on internal array/object pointer and doesnt perform array duplication. It just locks it incrementing reference counter. If the original array is modified by some code, the copy on write is performed and "foreach" still work with the old copy. - it makes no difference if array given to "foreach by value" is reference itself - "foreach by reference" still use internal array/object pointer and should work similar to PHP-5. (This id not completely implemented) --- Zend/zend_compile.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'Zend/zend_compile.h') diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 7c82c67d6d..2d71ca2571 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -828,9 +828,6 @@ int zend_add_literal(zend_op_array *op_array, zval *zv); #define ZEND_FETCH_ARG_MASK 0x000fffff -#define ZEND_FE_FETCH_BYREF 1 -#define ZEND_FE_FETCH_WITH_KEY 2 - #define EXT_TYPE_FREE_ON_RETURN (1<<2) #define ZEND_MEMBER_FUNC_CALL 1<<0 -- cgit v1.2.1 From 15a23b1218b3e38630d677751a975907daa2cd54 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 29 Jan 2015 21:05:02 +0300 Subject: Reimplement iteration magic with HashTableIterators (see https://wiki.php.net/rfc/php7_foreach#implementation_details) --- Zend/zend_compile.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Zend/zend_compile.h') diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 2d71ca2571..5239f565b3 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -95,7 +95,8 @@ typedef union _znode_op { } znode_op; typedef struct _znode { /* used only during compilation */ - int op_type; + zend_uchar op_type; + zend_uchar flag; union { znode_op op; zval constant; /* replaced by literal/zv */ -- cgit v1.2.1