Commit: 7c60aeef857f288661a6f95cf3aa45d6a6feff9b Author: Xinchen Hui <larue...@php.net> Sun, 26 Aug 2012 11:37:05 +0800 Parents: 35951d4be0bd27c85519995a95429bd0d0a76a00 Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7c60aeef857f288661a6f95cf3aa45d6a6feff9b Log: Fixed bug #62931 & #62932 Bugs: https://bugs.php.net/62931 https://bugs.php.net/62932 Changed paths: M Zend/zend_compile.c Diff: diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index b87b190..6efc1e1 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -6283,8 +6283,13 @@ void zend_do_foreach_cont(znode *foreach_token, const znode *open_brackets_token opline->extended_value |= ZEND_FE_FETCH_WITH_KEY; } - if ((key->op_type != IS_UNUSED) && (key->EA & ZEND_PARSED_REFERENCE_VARIABLE)) { + if ((key->op_type != IS_UNUSED)) { + if (key->EA & ZEND_PARSED_REFERENCE_VARIABLE) { zend_error(E_COMPILE_ERROR, "Key element cannot be a reference"); + } + if (key->EA & ZEND_PARSED_LIST_EXPR) { + zend_error(E_COMPILE_ERROR, "Cannot use list as Key element"); + } } if (value->EA & ZEND_PARSED_REFERENCE_VARIABLE) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php