From: Andi Gutmans Date: Fri, 23 Apr 2004 21:53:46 +0000 (+0000) Subject: - Fixed bug #27923. foreach() without a key should not check if the key X-Git-Tag: php-5.0.0RC2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=399073f9d4c7e7fe5eb20e675aa5826cbd0fbad2;p=php - Fixed bug #27923. foreach() without a key should not check if the key - is a reference (Adam) --- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index c7d12b1cbb..23bb96b1e1 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3333,7 +3333,7 @@ void zend_do_foreach_cont(znode *value, znode *key, znode *as_token, znode *fore value = tmp; } - if (key->u.EA.type & ZEND_PARSED_REFERENCE_VARIABLE) { + if ((key->op_type != IS_UNUSED) && (key->u.EA.type & ZEND_PARSED_REFERENCE_VARIABLE)) { zend_error(E_COMPILE_ERROR, "Key element cannot be a reference"); }