Skip to content

Commit

Permalink
Fixed bug #62931 & #62932
Browse files Browse the repository at this point in the history
  • Loading branch information
laruence committed Aug 26, 2012
1 parent 35951d4 commit 7c60aee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Zend/zend_compile.c
Expand Up @@ -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; 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"); 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");

This comment has been minimized.

Copy link
@smalyshev

smalyshev Aug 26, 2012

Contributor

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

This comment has been minimized.

Copy link
@nikic

nikic Aug 26, 2012

Member

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

}
} }


if (value->EA & ZEND_PARSED_REFERENCE_VARIABLE) { if (value->EA & ZEND_PARSED_REFERENCE_VARIABLE) {
Expand Down

0 comments on commit 7c60aee

Please sign in to comment.