Permalink
Browse files

Fixed bug #62931 & #62932

  • Loading branch information...
1 parent 35951d4 commit 7c60aeef857f288661a6f95cf3aa45d6a6feff9b @laruence laruence committed Aug 26, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 Zend/zend_compile.c
View
@@ -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");
@smalyshev

smalyshev Aug 26, 2012

Contributor

why capital K here? Also, please add a test for the bugfixes.

@nikic

nikic Aug 26, 2012

Owner

@smalyshev laruence already fixed the K and added more tests in 5ebbdec :)

+ }
}
if (value->EA & ZEND_PARSED_REFERENCE_VARIABLE) {

0 comments on commit 7c60aee

Please sign in to comment.