summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2000-08-13 04:19:44 +0000
committerAndi Gutmans <andi@php.net>2000-08-13 04:19:44 +0000
commitcaa3b6c9b6d860c6efecbe146e79836f6ce84d01 (patch)
tree40bc354035369a20be86607d054f8fb992208902
parent4f4e553b6a8a952735311477ba7207499bfd0567 (diff)
downloadphp-git-caa3b6c9b6d860c6efecbe146e79836f6ce84d01.tar.gz
- Revert foreach() change which only allowed variables and array(...)
-rw-r--r--Zend/zend-parser.y8
1 files changed, 2 insertions, 6 deletions
diff --git a/Zend/zend-parser.y b/Zend/zend-parser.y
index 6d1b012b14..b1a31fa0f4 100644
--- a/Zend/zend-parser.y
+++ b/Zend/zend-parser.y
@@ -198,7 +198,7 @@ unticked_statement:
| T_USE use_filename ';' { zend_error(E_COMPILE_ERROR,"use: Not yet supported. Please use include_once() or require_once()"); zval_dtor(&$2.u.constant); }
| T_UNSET '(' unset_variables ')' ';'
| T_FOREACH '(' w_cvar T_AS { do_foreach_begin(&$1, &$3, &$2, &$4, 1 CLS_CC); } w_cvar foreach_optional_arg ')' { do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { do_foreach_end(&$1, &$2 CLS_CC); }
- | T_FOREACH '(' array_construct T_AS { do_foreach_begin(&$1, &$3, &$2, &$4, 0 CLS_CC); } w_cvar foreach_optional_arg ')' { do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { do_foreach_end(&$1, &$2 CLS_CC); }
+ | T_FOREACH '(' expr_without_variable T_AS { do_foreach_begin(&$1, &$3, &$2, &$4, 0 CLS_CC); } w_cvar foreach_optional_arg ')' { do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { do_foreach_end(&$1, &$2 CLS_CC); }
| T_DECLARE { do_declare_begin(CLS_C); } '(' declare_list ')' declare_statement { do_declare_end(CLS_C); }
| ';' /* empty statement */
;
@@ -479,15 +479,11 @@ expr_without_variable:
| T_EXIT exit_expr { do_exit(&$$, &$2 CLS_CC); }
| '@' { do_begin_silence(&$1 CLS_CC); } expr { do_end_silence(&$1 CLS_CC); $$ = $3; }
| scalar { $$ = $1; }
- | array_construct { $$ = $1; }
+ | T_ARRAY '(' array_pair_list ')' { $$ = $3; }
| '`' encaps_list '`' { do_shell_exec(&$$, &$2 CLS_CC); }
| T_PRINT expr { do_print(&$$, &$2 CLS_CC); }
;
-array_construct:
- T_ARRAY '(' array_pair_list ')' { $$ = $3; }
-;
-
function_call:
T_STRING '(' { $2.u.opline_num = do_begin_function_call(&$1 CLS_CC); }
function_call_parameter_list