From f8576f84dcc5c7054e3cbcdd84a4275c7be072d9 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 10 Mar 2006 08:29:43 +0000 Subject: [PATCH] Implemented "jump label" operator (limited "goto") --- NEWS | 1 + Zend/tests/jump01.phpt | 14 ++++ Zend/tests/jump02.phpt | 16 +++++ Zend/tests/jump03.phpt | 18 +++++ Zend/tests/jump04.phpt | 24 +++++++ Zend/tests/jump05.phpt | 26 +++++++ Zend/tests/jump06.phpt | 8 +++ Zend/tests/jump07.phpt | 11 +++ Zend/tests/jump08.phpt | 11 +++ Zend/tests/jump09.phpt | 13 ++++ Zend/tests/jump10.phpt | 13 ++++ Zend/zend_compile.c | 110 +++++++++++++++++++++++++++++ Zend/zend_compile.h | 9 +++ Zend/zend_execute_API.c | 7 ++ Zend/zend_globals.h | 3 + Zend/zend_language_parser.y | 3 + Zend/zend_language_scanner.l | 6 ++ Zend/zend_opcode.c | 5 ++ Zend/zend_vm_def.h | 21 ++++++ Zend/zend_vm_execute.h | 31 +++++++-- Zend/zend_vm_opcodes.h | 1 + ext/tokenizer/tests/002.phpt | 112 +++++++++++++++--------------- ext/tokenizer/tests/bug26463.phpt | 18 ++--- 23 files changed, 411 insertions(+), 70 deletions(-) create mode 100755 Zend/tests/jump01.phpt create mode 100755 Zend/tests/jump02.phpt create mode 100755 Zend/tests/jump03.phpt create mode 100755 Zend/tests/jump04.phpt create mode 100755 Zend/tests/jump05.phpt create mode 100755 Zend/tests/jump06.phpt create mode 100755 Zend/tests/jump07.phpt create mode 100755 Zend/tests/jump08.phpt create mode 100755 Zend/tests/jump09.phpt create mode 100755 Zend/tests/jump10.phpt diff --git a/NEWS b/NEWS index 74d3e08520..20e6153184 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,7 @@ PHP NEWS for more details. (Dmitry) - Removed support for "continue" and "break" operators with non-constant operands. (Dmitry) +- Implemented "jump label" operator (limited "goto"). (Dmitry, Sara) - Changed __toString() behavior to call it in all necessary places (Marcus, Dmitry) - Changed "instanceof" and "catch" operators, is_a() and is_subclass_of() diff --git a/Zend/tests/jump01.phpt b/Zend/tests/jump01.phpt new file mode 100755 index 0000000000..90897cda96 --- /dev/null +++ b/Zend/tests/jump01.phpt @@ -0,0 +1,14 @@ +--TEST-- +jump 01: jump backward +--FILE-- + +--EXPECT-- +1: ok +2: ok +3: ok diff --git a/Zend/tests/jump02.phpt b/Zend/tests/jump02.phpt new file mode 100755 index 0000000000..80a9fa22ed --- /dev/null +++ b/Zend/tests/jump02.phpt @@ -0,0 +1,16 @@ +--TEST-- +jump 02: jump forward +--FILE-- + 3) jump L2; +echo "$n: ok\n"; +$n++; +jump L1; +L2: +?> +--EXPECT-- +1: ok +2: ok +3: ok diff --git a/Zend/tests/jump03.phpt b/Zend/tests/jump03.phpt new file mode 100755 index 0000000000..e07acb49e8 --- /dev/null +++ b/Zend/tests/jump03.phpt @@ -0,0 +1,18 @@ +--TEST-- +jump 03: jump inside control structures +--FILE-- + +--EXPECT-- +1: ok +2: ok diff --git a/Zend/tests/jump04.phpt b/Zend/tests/jump04.phpt new file mode 100755 index 0000000000..27462d1032 --- /dev/null +++ b/Zend/tests/jump04.phpt @@ -0,0 +1,24 @@ +--TEST-- +jump 04: jump from loop (backward) +--FILE-- + +--EXPECT-- +1: ok +2: ok +3: ok +4: ok diff --git a/Zend/tests/jump05.phpt b/Zend/tests/jump05.phpt new file mode 100755 index 0000000000..59758122e4 --- /dev/null +++ b/Zend/tests/jump05.phpt @@ -0,0 +1,26 @@ +--TEST-- +jump 05: jump from loop (forward) +--FILE-- + +--EXPECT-- +1: ok +2: ok +3: ok diff --git a/Zend/tests/jump06.phpt b/Zend/tests/jump06.phpt new file mode 100755 index 0000000000..0492fe7757 --- /dev/null +++ b/Zend/tests/jump06.phpt @@ -0,0 +1,8 @@ +--TEST-- +jump 06: jump to undefined label +--FILE-- + +--EXPECTF-- +Fatal error: 'jump' to undefined label 'L1' in %sjump06.php on line 2 diff --git a/Zend/tests/jump07.phpt b/Zend/tests/jump07.phpt new file mode 100755 index 0000000000..f5cc9af6b8 --- /dev/null +++ b/Zend/tests/jump07.phpt @@ -0,0 +1,11 @@ +--TEST-- +jump 07: jump into loop (backward) +--FILE-- + +--EXPECTF-- +Fatal error: 'jump' into loop or switch statement is disallowed in %sjump07.php on line 5 diff --git a/Zend/tests/jump08.phpt b/Zend/tests/jump08.phpt new file mode 100755 index 0000000000..d864d61267 --- /dev/null +++ b/Zend/tests/jump08.phpt @@ -0,0 +1,11 @@ +--TEST-- +jump 08: jump into loop (forward) +--FILE-- + +--EXPECTF-- +Fatal error: 'jump' into loop or switch statement is disallowed in %sjump08.php on line 2 diff --git a/Zend/tests/jump09.phpt b/Zend/tests/jump09.phpt new file mode 100755 index 0000000000..81bd5c9a5d --- /dev/null +++ b/Zend/tests/jump09.phpt @@ -0,0 +1,13 @@ +--TEST-- +jump 09: jump into switch (backward) +--FILE-- + +--EXPECTF-- +Fatal error: 'jump' into loop or switch statement is disallowed in %sjump09.php on line 7 diff --git a/Zend/tests/jump10.phpt b/Zend/tests/jump10.phpt new file mode 100755 index 0000000000..3b4be15469 --- /dev/null +++ b/Zend/tests/jump10.phpt @@ -0,0 +1,13 @@ +--TEST-- +jump 10: jump into switch (forward) +--FILE-- + +--EXPECTF-- +Fatal error: 'jump' into loop or switch statement is disallowed in %sjump10.php on line 2 diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 6d6f3c3769..8c54192d97 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -148,6 +148,8 @@ void zend_init_compiler_data_structures(TSRMLS_D) CG(start_lineno) = 0; init_compiler_declarables(TSRMLS_C); zend_hash_apply(CG(auto_globals), (apply_func_t) zend_auto_global_arm TSRMLS_CC); + zend_stack_init(&CG(labels_stack)); + CG(labels) = NULL; } @@ -174,6 +176,7 @@ void shutdown_compiler(TSRMLS_D) zend_hash_destroy(&CG(script_encodings_table)); zend_hash_destroy(&CG(filenames_table)); zend_llist_destroy(&CG(open_files)); + zend_stack_destroy(&CG(labels_stack)); } @@ -1241,6 +1244,9 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n CG(doc_comment) = NULL; CG(doc_comment_len) = 0; } + + zend_stack_push(&CG(labels_stack), (void *) &CG(labels), sizeof(HashTable*)); + CG(labels) = NULL; } void zend_do_handle_exception(TSRMLS_D) @@ -1266,6 +1272,8 @@ void zend_do_end_function_declaration(znode *function_token TSRMLS_DC) pass_two(CG(active_op_array) TSRMLS_CC); + zend_release_labels(TSRMLS_C); + if (CG(active_class_entry)) { zend_check_magic_method_implementation(CG(active_class_entry), (zend_function*)CG(active_op_array), E_COMPILE_ERROR TSRMLS_CC); } else { @@ -4315,6 +4323,108 @@ void zend_do_normalization(znode *result, znode *str TSRMLS_DC) *result = opline->result; } +void zend_do_label(znode *label TSRMLS_DC) +{ + zend_op_array *oparray = CG(active_op_array); + zend_label dest; + + if (!CG(labels)) { + ALLOC_HASHTABLE(CG(labels)); + zend_hash_init(CG(labels), 4, NULL, NULL, 0); + } + + dest.brk_cont = oparray->current_brk_cont; + dest.opline_num = get_next_op_number(oparray); + + if (zend_u_hash_add(CG(labels), Z_TYPE(label->u.constant), Z_UNIVAL(label->u.constant), + Z_UNILEN(label->u.constant) + 1, (void**)&dest, sizeof(zend_label), NULL) == FAILURE) { + zend_error(E_COMPILE_ERROR, "Label '%R' already defined", Z_TYPE(label->u.constant), Z_UNIVAL(label->u.constant)); + } + + /* Done with label now */ + zval_dtor(&label->u.constant); +} + +void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2 TSRMLS_DC) +{ + zend_label *dest; + long current, distance; + + if (CG(labels) == NULL || + zend_u_hash_find(CG(labels), Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant)+1, (void**)&dest) == FAILURE) { + + if (pass2) { + CG(in_compilation) = 1; + CG(active_op_array) = op_array; + CG(zend_lineno) = opline->lineno; + zend_error(E_COMPILE_ERROR, "'jump' to undefined label '%R'", Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant)); + } else { + /* Label is not defined. Delay to pass 2. */ + INC_BPC(op_array); + return; + } + } + + opline->op1.u.opline_num = dest->opline_num; + zval_dtor(&opline->op2.u.constant); + + /* Check that we are not moving into loop or switch */ + current = opline->extended_value; + for (distance = 0; current != dest->brk_cont; distance++) { + if (current == -1) { + if (pass2) { + CG(in_compilation) = 1; + CG(active_op_array) = op_array; + CG(zend_lineno) = opline->lineno; + } + zend_error(E_COMPILE_ERROR, "'jump' into loop or switch statement is disallowed"); + } + current = op_array->brk_cont_array[current].parent; + } + + if (distance == 0) { + /* Nothing to break out of, optimize to ZEND_JMP */ + opline->opcode = ZEND_JMP; + opline->extended_value = 0; + SET_UNUSED(opline->op2); + } else { + /* Set real break distance */ + ZVAL_LONG(&opline->op2.u.constant, distance); + } + + if (pass2) { + DEC_BPC(op_array); + } +} + +void zend_do_goto(znode *label TSRMLS_DC) +{ + zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); + + opline->opcode = ZEND_GOTO; + opline->extended_value = CG(active_op_array)->current_brk_cont; + SET_UNUSED(opline->op1); + opline->op2 = *label; + zend_resolve_goto_label(CG(active_op_array), opline, 0 TSRMLS_CC); +} + +void zend_release_labels(TSRMLS_D) +{ + if (CG(labels)) { + zend_hash_destroy(CG(labels)); + FREE_HASHTABLE(CG(labels)); + } + if (!zend_stack_is_empty(&CG(labels_stack))) { + HashTable **pht; + + zend_stack_top(&CG(labels_stack), (void**)&pht); + CG(labels) = *pht; + zend_stack_del_top(&CG(labels_stack)); + } else { + CG(labels) = NULL; + } +} + /* * Local variables: * tab-width: 4 diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index cb5d5bf9c2..6a6bc40c4d 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -94,6 +94,10 @@ typedef struct _zend_brk_cont_element { int parent; } zend_brk_cont_element; +typedef struct _zend_label { + int brk_cont; + zend_uint opline_num; +} zend_label; typedef struct _zend_try_catch_element { zend_uint try_op; @@ -513,6 +517,11 @@ ZEND_API void function_add_ref(zend_function *function TSRMLS_DC); void zend_do_normalization(znode *result, znode *str TSRMLS_DC); +void zend_do_label(znode *label TSRMLS_DC); +void zend_do_goto(znode *label TSRMLS_DC); +void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2 TSRMLS_DC); +void zend_release_labels(TSRMLS_D); + #define INITIAL_OP_ARRAY_SIZE 64 diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index efedd49e35..3c6b728748 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1293,6 +1293,11 @@ void execute_new_code(TSRMLS_D) opline->op2.u.constant.refcount = 2; } switch (opline->opcode) { + case ZEND_GOTO: + if (Z_TYPE(opline->op2.u.constant) != IS_LONG) { + zend_resolve_goto_label(CG(active_op_array), opline, 1 TSRMLS_CC); + } + /* break omitted intentionally */ case ZEND_JMP: opline->op1.u.jmp_addr = &CG(active_op_array)->opcodes[opline->op1.u.opline_num]; break; @@ -1307,6 +1312,8 @@ void execute_new_code(TSRMLS_D) opline++; } + zend_release_labels(TSRMLS_C); + EG(return_value_ptr_ptr) = &local_retval; EG(active_op_array) = CG(active_op_array); zend_execute(CG(active_op_array) TSRMLS_CC); diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index 6af32473b1..1de7535685 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -136,6 +136,9 @@ struct _zend_compiler_globals { HashTable script_encodings_table; char *script_encoding; + HashTable *labels; + zend_stack labels_stack; + #ifdef ZTS HashTable **static_members; int last_static_member; diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index a0addb86dc..7414657081 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -107,6 +107,7 @@ %token T_DEFAULT %token T_BREAK %token T_CONTINUE +%token T_GOTO %token T_FUNCTION %token T_CONST %token T_RETURN @@ -184,6 +185,7 @@ inner_statement: statement: unticked_statement { zend_do_ticks(TSRMLS_C); } + | T_STRING ':' { zend_do_label(&$1 TSRMLS_CC); } ; unticked_statement: @@ -233,6 +235,7 @@ unticked_statement: '{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); } additional_catches { zend_do_mark_last_catch(&$7, &$18 TSRMLS_CC); } | T_THROW expr ';' { zend_do_throw(&$2 TSRMLS_CC); } + | T_GOTO T_STRING ';' { zend_do_goto(&$2 TSRMLS_CC); } ; diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index dc7e3fac81..2c1586e79f 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -821,6 +821,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR CG(active_op_array) = original_active_op_array; if (compilation_successful) { pass_two(op_array TSRMLS_CC); + zend_release_labels(TSRMLS_C); } else { efree(op_array); retval = NULL; @@ -963,6 +964,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC) zend_do_handle_exception(TSRMLS_C); CG(active_op_array) = original_active_op_array; pass_two(op_array TSRMLS_CC); + zend_release_labels(TSRMLS_C); retval = op_array; } zend_restore_lexical_state(&original_lex_state TSRMLS_CC); @@ -1520,6 +1522,10 @@ NEWLINE ("\r"|"\n"|"\r\n") return T_CONTINUE; } +"jump" { + return T_GOTO; +} + "echo" { return T_ECHO; } diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index a5fffc0773..4fb2a6fa04 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -375,6 +375,11 @@ int pass_two(zend_op_array *op_array TSRMLS_DC) opline->op2.u.constant.refcount = 2; } switch (opline->opcode) { + case ZEND_GOTO: + if (Z_TYPE(opline->op2.u.constant) != IS_LONG) { + zend_resolve_goto_label(op_array, opline, 1 TSRMLS_CC); + } + /* break omitted intentionally */ case ZEND_JMP: opline->op1.u.jmp_addr = &op_array->opcodes[opline->op1.u.opline_num]; break; diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 9a64464663..1dcfbdf3db 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2395,6 +2395,27 @@ ZEND_VM_HANDLER(51, ZEND_CONT, ANY, CONST) ZEND_VM_JMP(EX(op_array)->opcodes + el->cont); } +ZEND_VM_HANDLER(69, ZEND_GOTO, ANY, CONST) +{ + zend_op *opline = EX(opline); + zend_brk_cont_element *el; + + el = zend_brk_cont(Z_LVAL(opline->op2.u.constant), opline->extended_value, + EX(op_array), EX(Ts) TSRMLS_CC); + + zend_op *brk_opline = EX(op_array)->opcodes + el->brk; + + switch (brk_opline->opcode) { + case ZEND_SWITCH_FREE: + zend_switch_free(brk_opline, EX(Ts) TSRMLS_CC); + break; + case ZEND_FREE: + zendi_zval_dtor(EX_T(brk_opline->op1.u.var).tmp_var); + break; + } + ZEND_VM_JMP(opline->op1.u.jmp_addr); +} + ZEND_VM_HANDLER(48, ZEND_CASE, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) { zend_op *opline = EX(opline); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index d2ff23115b..b84358e9e4 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -800,6 +800,27 @@ static int ZEND_CONT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) ZEND_VM_JMP(EX(op_array)->opcodes + el->cont); } +static int ZEND_GOTO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zend_op *opline = EX(opline); + zend_brk_cont_element *el; + + el = zend_brk_cont(Z_LVAL(opline->op2.u.constant), opline->extended_value, + EX(op_array), EX(Ts) TSRMLS_CC); + + zend_op *brk_opline = EX(op_array)->opcodes + el->brk; + + switch (brk_opline->opcode) { + case ZEND_SWITCH_FREE: + zend_switch_free(brk_opline, EX(Ts) TSRMLS_CC); + break; + case ZEND_FREE: + zendi_zval_dtor(EX_T(brk_opline->op1.u.var).tmp_var); + break; + } + ZEND_VM_JMP(opline->op1.u.jmp_addr); +} + static int ZEND_FETCH_CLASS_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { zend_op *opline = EX(opline); @@ -28577,27 +28598,27 @@ void zend_init_opcodes_handlers() ZEND_NEW_SPEC_HANDLER, ZEND_NEW_SPEC_HANDLER, ZEND_NEW_SPEC_HANDLER, + ZEND_GOTO_SPEC_CONST_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, + ZEND_GOTO_SPEC_CONST_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, + ZEND_GOTO_SPEC_CONST_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, + ZEND_GOTO_SPEC_CONST_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, + ZEND_GOTO_SPEC_CONST_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h index 9c85e09e34..1bd52773d8 100644 --- a/Zend/zend_vm_opcodes.h +++ b/Zend/zend_vm_opcodes.h @@ -87,6 +87,7 @@ #define ZEND_SEND_VAR 66 #define ZEND_SEND_REF 67 #define ZEND_NEW 68 +#define ZEND_GOTO 69 #define ZEND_FREE 70 #define ZEND_INIT_ARRAY 71 #define ZEND_ADD_ARRAY_ELEMENT 72 diff --git a/ext/tokenizer/tests/002.phpt b/ext/tokenizer/tests/002.phpt index a5db16254d..15769ecabb 100644 --- a/ext/tokenizer/tests/002.phpt +++ b/ext/tokenizer/tests/002.phpt @@ -19,19 +19,19 @@ foreach ($strings as $s) { echo "Done\n"; ?> ---EXPECT-- +--EXPECT-- array(49) { [0]=> array(2) { [0]=> - int(368) + int(369) [1]=> string(2) " array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -45,7 +45,7 @@ array(49) { [3]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -61,7 +61,7 @@ array(49) { [6]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -75,7 +75,7 @@ array(49) { [8]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -84,7 +84,7 @@ array(49) { [10]=> array(2) { [0]=> - int(350) + int(351) [1]=> string(5) "isset" } @@ -104,7 +104,7 @@ array(49) { [15]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -118,7 +118,7 @@ array(49) { [17]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -143,7 +143,7 @@ array(49) { [22]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -166,7 +166,7 @@ array(49) { [26]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -189,7 +189,7 @@ array(49) { [30]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -203,7 +203,7 @@ array(49) { [32]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -217,7 +217,7 @@ array(49) { [34]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -233,7 +233,7 @@ array(49) { [37]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -247,7 +247,7 @@ array(49) { [39]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -261,7 +261,7 @@ array(49) { [41]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -277,7 +277,7 @@ array(49) { [44]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -293,14 +293,14 @@ array(49) { [47]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } [48]=> array(2) { [0]=> - int(370) + int(371) [1]=> string(2) "?>" } @@ -309,7 +309,7 @@ array(37) { [0]=> array(2) { [0]=> - int(368) + int(369) [1]=> string(6) " array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -343,7 +343,7 @@ array(37) { [7]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -357,7 +357,7 @@ array(37) { [9]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -373,7 +373,7 @@ array(37) { [12]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -389,7 +389,7 @@ array(37) { [15]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -405,7 +405,7 @@ array(37) { [18]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -421,7 +421,7 @@ array(37) { [21]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -430,7 +430,7 @@ array(37) { [23]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -455,7 +455,7 @@ array(37) { [28]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -464,7 +464,7 @@ array(37) { [30]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -480,7 +480,7 @@ array(37) { [33]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -489,14 +489,14 @@ array(37) { [35]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } [36]=> array(2) { [0]=> - int(370) + int(371) [1]=> string(2) "?>" } @@ -505,28 +505,28 @@ array(48) { [0]=> array(2) { [0]=> - int(368) + int(369) [1]=> string(2) " array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } [2]=> array(2) { [0]=> - int(366) + int(367) [1]=> string(13) "/* comment */" } [3]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -540,7 +540,7 @@ array(48) { [5]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -556,7 +556,7 @@ array(48) { [8]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -570,7 +570,7 @@ array(48) { [10]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -586,7 +586,7 @@ array(48) { [13]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -595,7 +595,7 @@ array(48) { [15]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -604,7 +604,7 @@ array(48) { [17]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -618,7 +618,7 @@ array(48) { [19]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -627,7 +627,7 @@ array(48) { [21]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -641,7 +641,7 @@ array(48) { [23]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -650,7 +650,7 @@ array(48) { [25]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -666,7 +666,7 @@ array(48) { [28]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -680,7 +680,7 @@ array(48) { [30]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -689,7 +689,7 @@ array(48) { [32]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -714,7 +714,7 @@ array(48) { [37]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -728,7 +728,7 @@ array(48) { [39]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -737,7 +737,7 @@ array(48) { [41]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } @@ -762,14 +762,14 @@ array(48) { [46]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " } [47]=> array(2) { [0]=> - int(370) + int(371) [1]=> string(2) "?>" } diff --git a/ext/tokenizer/tests/bug26463.phpt b/ext/tokenizer/tests/bug26463.phpt index a290a6e418..598fa7d122 100644 --- a/ext/tokenizer/tests/bug26463.phpt +++ b/ext/tokenizer/tests/bug26463.phpt @@ -20,7 +20,7 @@ array(19) { [0]=> array(2) { [0]=> - int(368) + int(369) [1]=> string(6) " array(2) { [0]=> - int(372) + int(373) [1]=> string(6) "<<
array(2) { [0]=> - int(373) + int(374) [1]=> string(2) "DD" } [6]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " @@ -79,7 +79,7 @@ array(19) { [10]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " @@ -96,7 +96,7 @@ array(19) { [13]=> array(2) { [0]=> - int(372) + int(373) [1]=> string(8) "<< array(2) { [0]=> - int(373) + int(374) [1]=> string(4) "DDDD" } @@ -121,7 +121,7 @@ array(19) { [17]=> array(2) { [0]=> - int(371) + int(372) [1]=> string(1) " " @@ -129,7 +129,7 @@ array(19) { [18]=> array(2) { [0]=> - int(370) + int(371) [1]=> string(2) "?>" } -- 2.40.0