summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2015-04-14 17:58:58 +0200
committerBob Weinand <bobwei9@hotmail.com>2015-04-14 17:58:58 +0200
commitf3e124d58dc4627eb89625a7c264cb009130f725 (patch)
treec256b36decc201ef6eb780b4ff80f5a97c7b5b42
parent4f07330e798a4e7b12bcc1811c3c71d17b71f22c (diff)
parentb4a142ab974747be2fd03d055b30c63286a687fd (diff)
downloadphp-git-f3e124d58dc4627eb89625a7c264cb009130f725.tar.gz
Merge branch 'coroutineDelegation' of https://github.com/bwoebi/php-src
-rw-r--r--Zend/tests/generators/basic_yield_from_exception_handling.phpt59
-rw-r--r--Zend/tests/generators/basic_yield_from_proxying.phpt42
-rw-r--r--Zend/tests/generators/multiple_yield_from_on_same_generator.phpt41
-rw-r--r--Zend/tests/generators/mutli_yield_from_with_exception.phpt50
-rw-r--r--Zend/tests/generators/recursive_yield_from.phpt34
-rw-r--r--Zend/tests/generators/yield_from_array.phpt22
-rw-r--r--Zend/tests/generators/yield_from_backtrace.phpt49
-rw-r--r--Zend/tests/generators/yield_from_deep_recursion.phpt26
-rw-r--r--Zend/tests/generators/yield_from_multi_tree.phpt332
-rw-r--r--Zend/tests/generators/yield_from_multi_tree_exception.phpt78
-rw-r--r--Zend/zend_ast.h1
-rw-r--r--Zend/zend_builtin_functions.c5
-rw-r--r--Zend/zend_compile.c39
-rw-r--r--Zend/zend_execute.c10
-rw-r--r--Zend/zend_generators.c481
-rw-r--r--Zend/zend_generators.h43
-rw-r--r--Zend/zend_hash.h9
-rw-r--r--Zend/zend_language_parser.y3
-rw-r--r--Zend/zend_language_scanner.c2007
-rw-r--r--Zend/zend_language_scanner.l4
-rw-r--r--Zend/zend_vm_def.h108
-rw-r--r--Zend/zend_vm_execute.h510
-rw-r--r--Zend/zend_vm_opcodes.c2
-rw-r--r--Zend/zend_vm_opcodes.h1
24 files changed, 2834 insertions, 1122 deletions
diff --git a/Zend/tests/generators/basic_yield_from_exception_handling.phpt b/Zend/tests/generators/basic_yield_from_exception_handling.phpt
new file mode 100644
index 0000000000..180cbee9dd
--- /dev/null
+++ b/Zend/tests/generators/basic_yield_from_exception_handling.phpt
@@ -0,0 +1,59 @@
+--TEST--
+Exceptions in linear yield from setup
+--FILE--
+<?php
+function from($off) {
+ try {
+ yield $off + 1;
+ } catch (Exception $e) { print "catch in from()\n$e\n"; }
+ yield $off + 2;
+}
+
+function gen() {
+ try {
+ yield "gen" => 0;
+ } catch (Exception $e) { print "catch in gen()\n$e\n"; }
+ try {
+ yield from from(0);
+ } catch (Exception $e) { print "catch in gen()\n$e\n"; }
+ yield from from(2);
+}
+
+$i = 0;
+try {
+ for ($gen = gen(); $gen->valid(); $gen->throw(new Exception((string) $i++))) {
+ var_dump($gen->current());
+ }
+} catch (Exception $e) { print "catch in {main}\n$e\n"; }
+
+var_dump($gen->valid());
+
+?>
+--EXPECTF--
+int(0)
+catch in gen()
+exception 'Exception' with message '0' in %s:%d
+Stack trace:
+#0 {main}
+int(1)
+catch in from()
+exception 'Exception' with message '1' in %s:%d
+Stack trace:
+#0 {main}
+int(2)
+catch in gen()
+exception 'Exception' with message '2' in %s:%d
+Stack trace:
+#0 {main}
+int(3)
+catch in from()
+exception 'Exception' with message '3' in %s:%d
+Stack trace:
+#0 {main}
+int(4)
+catch in {main}
+exception 'Exception' with message '4' in %s:%d
+Stack trace:
+#0 {main}
+bool(false)
+
diff --git a/Zend/tests/generators/basic_yield_from_proxying.phpt b/Zend/tests/generators/basic_yield_from_proxying.phpt
new file mode 100644
index 0000000000..74ffc5da80
--- /dev/null
+++ b/Zend/tests/generators/basic_yield_from_proxying.phpt
@@ -0,0 +1,42 @@
+--TEST--
+Basic test if yield from works
+--FILE--
+<?php
+function from() {
+ yield "from" => 1;
+ yield 2;
+}
+
+function gen() {
+ yield "gen" => 0;
+ yield from from();
+ yield 3;
+}
+
+/* foreach API */
+foreach (gen() as $k => $v) {
+ var_dump($k, $v);
+}
+
+/* iterator API */
+for ($gen = gen(); $gen->valid(); $gen->next()) {
+ var_dump($gen->key(), $gen->current());
+}
+?>
+--EXPECT--
+string(3) "gen"
+int(0)
+string(4) "from"
+int(1)
+int(0)
+int(2)
+int(0)
+int(3)
+string(3) "gen"
+int(0)
+string(4) "from"
+int(1)
+int(0)
+int(2)
+int(0)
+int(3)
diff --git a/Zend/tests/generators/multiple_yield_from_on_same_generator.phpt b/Zend/tests/generators/multiple_yield_from_on_same_generator.phpt
new file mode 100644
index 0000000000..198377f8a1
--- /dev/null
+++ b/Zend/tests/generators/multiple_yield_from_on_same_generator.phpt
@@ -0,0 +1,41 @@
+--TEST--
+Multiple yield from on a same Generator instance
+--FILE--
+<?php
+
+function gen($a = 0) {
+ yield 1 + $a;
+ if ($a < 1) {
+ var_dump(yield from gen($a + 1));
+ }
+ yield 3 + $a;
+ return 5 + $a;
+}
+
+function bar($gen) {
+ var_dump(yield from $gen);
+}
+
+/* Twice a Generator from bar() using yield from on $gen */
+$gen = gen();
+$gens[] = bar($gen);
+$gens[] = bar($gen);
+
+do {
+ foreach ($gens as $g) {
+ var_dump($g->current());
+ $g->next();
+ }
+} while($gens[0]->valid());
+var_dump($gens[1]->valid());
+
+?>
+--EXPECT--
+int(1)
+int(2)
+int(4)
+int(6)
+int(3)
+int(5)
+bool(false)
+
diff --git a/Zend/tests/generators/mutli_yield_from_with_exception.phpt b/Zend/tests/generators/mutli_yield_from_with_exception.phpt
new file mode 100644
index 0000000000..5180caa328
--- /dev/null
+++ b/Zend/tests/generators/mutli_yield_from_with_exception.phpt
@@ -0,0 +1,50 @@
+--TEST--
+Multiple yield from on a same Generator throwing an Exception
+--FILE--
+<?php
+function from() {
+ yield 1;
+ throw new Exception();
+}
+
+function gen($gen) {
+ try {
+ var_dump(yield from $gen);
+ } catch (Exception $e) { print "Caught exception!\n$e\n"; }
+}
+
+$gen = from();
+$gens[] = gen($gen);
+$gens[] = gen($gen);
+
+foreach ($gens as $g) {
+ $g->current(); // init.
+}
+
+do {
+ foreach ($gens as $i => $g) {
+ print "Generator $i\n";
+ var_dump($g->current());
+ $g->next();
+ }
+} while($gens[0]->valid());
+?>
+--EXPECTF--
+Generator 0
+int(1)
+Caught exception!
+exception 'Exception' in %s:%d
+Stack trace:
+#0 %s(%d): from()
+#1 [internal function]: gen(Object(Generator))
+#2 %s(%d): Generator->next()
+#3 {main}
+Generator 1
+
+Fatal error: Uncaught exception 'ClosedGeneratorException' with message 'Generator yielded from aborted, no return value available' in %s:%d
+Stack trace:
+#0 [internal function]: gen(Object(Generator))
+#1 %s(%d): Generator->current()
+#2 {main}
+ thrown in %s on line %d
+
diff --git a/Zend/tests/generators/recursive_yield_from.phpt b/Zend/tests/generators/recursive_yield_from.phpt
new file mode 100644
index 0000000000..dbf2c948ea
--- /dev/null
+++ b/Zend/tests/generators/recursive_yield_from.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Check if recursion with yield from works
+--FILE--
+<?php
+
+function from($a = 0) {
+ yield 1 + $a;
+ if ($a <= 3) {
+ yield from from($a + 3);
+ yield from from($a + 6);
+ }
+ yield 2 + $a;
+}
+
+function gen() {
+ yield from from();
+}
+
+foreach(gen() as $v) {
+ var_dump($v);
+}
+?>
+--EXPECT--
+int(1)
+int(4)
+int(7)
+int(8)
+int(10)
+int(11)
+int(5)
+int(7)
+int(8)
+int(2)
+
diff --git a/Zend/tests/generators/yield_from_array.phpt b/Zend/tests/generators/yield_from_array.phpt
new file mode 100644
index 0000000000..1652ab2236
--- /dev/null
+++ b/Zend/tests/generators/yield_from_array.phpt
@@ -0,0 +1,22 @@
+--TEST--
+yielding values from an array
+--FILE--
+<?php
+function from() {
+ yield 0;
+ yield from []; // must not yield anything
+ yield from [1,2];
+}
+
+function gen() {
+ yield from from();
+}
+
+foreach(gen() as $v) {
+ var_dump($v);
+}
+?>
+--EXPECT--
+int(0)
+int(1)
+int(2)
diff --git a/Zend/tests/generators/yield_from_backtrace.phpt b/Zend/tests/generators/yield_from_backtrace.phpt
new file mode 100644
index 0000000000..18781e7551
--- /dev/null
+++ b/Zend/tests/generators/yield_from_backtrace.phpt
@@ -0,0 +1,49 @@
+--TEST--
+Exceptions in linear yield from setup
+--FILE--
+<?php
+function from($off) {
+ debug_print_backtrace();
+ yield $off + 1;
+}
+
+function gen() {
+ yield 1;
+ debug_print_backtrace();
+ yield 2;
+ yield from from(2);
+ debug_print_backtrace();
+}
+
+print "\nImplicit foreach:\n";
+foreach (gen() as $v) {
+ var_dump($v);
+}
+
+print "\nExplicit iterator:\n";
+for ($gen = gen(); $gen->valid(); $gen->next()) {
+ var_dump($gen->current());
+}
+?>
+--EXPECTF--
+Implicit foreach:
+int(1)
+#0 gen() called at [%s:%d]
+int(2)
+#0 from(2) called at [%s:%d]
+#1 gen() called at [%s:%d]
+int(3)
+#0 gen() called at [%s:%d]
+
+Explicit iterator:
+int(1)
+#0 gen()
+#1 Generator->next() called at [%s:%d]
+int(2)
+#0 from(2) called at [%s:%d]
+#1 gen()
+#2 Generator->next() called at [%s:%d]
+int(3)
+#0 gen()
+#1 Generator->next() called at [%s:%d]
+
diff --git a/Zend/tests/generators/yield_from_deep_recursion.phpt b/Zend/tests/generators/yield_from_deep_recursion.phpt
new file mode 100644
index 0000000000..8ef3b89129
--- /dev/null
+++ b/Zend/tests/generators/yield_from_deep_recursion.phpt
@@ -0,0 +1,26 @@
+--TEST--
+Deep recursion with yield from
+--FILE--
+<?php
+ini_set("memory_limit", "512M");
+
+function from($i) {
+ yield $i;
+}
+
+function gen($i = 0) {
+ if ($i < 50000) {
+ yield from gen(++$i);
+ } else {
+ yield $i;
+ yield from from(++$i);
+ }
+}
+
+foreach (gen() as $v) {
+ var_dump($v);
+}
+?>
+--EXPECT--
+int(50000)
+int(50001)
diff --git a/Zend/tests/generators/yield_from_multi_tree.phpt b/Zend/tests/generators/yield_from_multi_tree.phpt
new file mode 100644
index 0000000000..91ae80e909
--- /dev/null
+++ b/Zend/tests/generators/yield_from_multi_tree.phpt
@@ -0,0 +1,332 @@
+--TEST--
+yield from on multiple trees needing merge
+--FILE--
+<?php
+
+function from($levels) {
+ foreach (range(0, 2 << $levels) as $v) {
+ yield $v;
+ }
+}
+
+function gen($gen, $level) {
+ if ($level % 2) {
+ yield $gen->current();
+ }
+ yield from $gen;
+}
+
+foreach (range(0, 6) as $levels) {
+ print "$levels level".($levels == 1 ? "" : "s")."\n\n";
+
+ $all = array();
+ $all[] = $gens[0][0] = from($levels);
+
+ for ($level = 1; $level < $levels; $level++) {
+ for ($i = 0; $i < (1 << $level); $i++) {
+ $all[] = $gens[$level][$i] = gen($gens[$level-1][$i >> 1], $level);
+ }
+ }
+
+ while (1) {
+ foreach ($all as $gen) {
+ var_dump($gen->current());
+ $gen->next();
+ if (!$gen->valid()) {
+ break 2;
+ }
+ }
+ }
+
+ print "\n\n";
+}
+?>
+--EXPECT--
+0 levels
+
+int(0)
+int(1)
+int(2)
+
+
+1 level
+
+int(0)
+int(1)
+int(2)
+int(3)
+int(4)
+
+
+2 levels
+
+int(0)
+int(1)
+int(2)
+int(3)
+int(4)
+int(5)
+int(6)
+int(7)
+int(8)
+
+
+3 levels
+
+int(0)
+int(1)
+int(2)
+int(3)
+int(4)
+int(5)
+int(6)
+int(7)
+int(8)
+int(9)
+int(10)
+int(11)
+int(12)
+int(13)
+int(14)
+int(15)
+int(16)
+
+
+4 levels
+
+int(0)
+int(1)
+int(2)
+int(3)
+int(4)
+int(5)
+int(6)
+int(7)
+int(8)
+int(9)
+int(10)
+int(11)
+int(12)
+int(13)
+int(14)
+int(15)
+int(16)
+int(17)
+int(18)
+int(19)
+int(20)
+int(21)
+int(22)
+int(23)
+int(24)
+int(25)
+int(26)
+int(27)
+int(28)
+int(29)
+int(30)
+int(31)
+int(32)
+
+
+5 levels
+
+int(0)
+int(1)
+int(2)
+int(3)
+int(4)
+int(5)
+int(6)
+int(7)
+int(8)
+int(9)
+int(10)
+int(11)
+int(12)
+int(13)
+int(14)
+int(15)
+int(16)
+int(17)
+int(18)
+int(19)
+int(20)
+int(21)
+int(22)
+int(23)
+int(24)
+int(25)
+int(26)
+int(27)
+int(28)
+int(29)
+int(30)
+int(31)
+int(32)
+int(33)
+int(34)
+int(35)
+int(36)
+int(37)
+int(38)
+int(39)
+int(40)
+int(41)
+int(42)
+int(43)
+int(44)
+int(45)
+int(46)
+int(47)
+int(48)
+int(49)
+int(50)
+int(51)
+int(52)
+int(53)
+int(54)
+int(55)
+int(56)
+int(57)
+int(58)
+int(59)
+int(60)
+int(61)
+int(62)
+int(63)
+int(64)
+
+
+6 levels
+
+int(0)
+int(1)
+int(2)
+int(3)
+int(4)
+int(5)
+int(6)
+int(7)
+int(8)
+int(9)
+int(10)
+int(11)
+int(12)
+int(13)
+int(14)
+int(15)
+int(16)
+int(17)
+int(18)
+int(19)
+int(20)
+int(21)
+int(22)
+int(23)
+int(24)
+int(25)
+int(26)
+int(27)
+int(28)
+int(29)
+int(30)
+int(31)
+int(32)
+int(33)
+int(34)
+int(35)
+int(36)
+int(37)
+int(38)
+int(39)
+int(40)
+int(41)
+int(42)
+int(43)
+int(44)
+int(45)
+int(46)
+int(47)
+int(48)
+int(49)
+int(50)
+int(51)
+int(52)
+int(53)
+int(54)
+int(55)
+int(56)
+int(57)
+int(58)
+int(59)
+int(60)
+int(61)
+int(62)
+int(63)
+int(64)
+int(65)
+int(66)
+int(67)
+int(68)
+int(69)
+int(70)
+int(71)
+int(72)
+int(73)
+int(74)
+int(75)
+int(76)
+int(77)
+int(78)
+int(79)
+int(80)
+int(81)
+int(82)
+int(83)
+int(84)
+int(85)
+int(86)
+int(87)
+int(88)
+int(89)
+int(90)
+int(91)
+int(92)
+int(93)
+int(94)
+int(95)
+int(96)
+int(97)
+int(98)
+int(99)
+int(100)
+int(101)
+int(102)
+int(103)
+int(104)
+int(105)
+int(106)
+int(107)
+int(108)
+int(109)
+int(110)
+int(111)
+int(112)
+int(113)
+int(114)
+int(115)
+int(116)
+int(117)
+int(118)
+int(119)
+int(120)
+int(121)
+int(122)
+int(123)
+int(124)
+int(125)
+int(126)
+int(127)
+int(128)
+
diff --git a/Zend/tests/generators/yield_from_multi_tree_exception.phpt b/Zend/tests/generators/yield_from_multi_tree_exception.phpt
new file mode 100644
index 0000000000..b250a744df
--- /dev/null
+++ b/Zend/tests/generators/yield_from_multi_tree_exception.phpt
@@ -0,0 +1,78 @@
+--TEST--
+yield from on multiple trees needing merge
+--FILE--
+<?php
+
+function from($levels) {
+ foreach (range(0, 2 << $levels) as $v) {
+ yield $v;
+ if ($v == (1 << ($levels - 1)) - 2) {
+ throw new Exception();
+ }
+ }
+}
+
+function gen($gen, $level) {
+ yield from $gen;
+}
+
+$levels = 5;
+
+print "$levels levels\n\n";
+
+$all = array();
+$all[] = $gens[0][0] = from($levels);
+
+for ($level = 1; $level < $levels; $level++) {
+ for ($i = 0; $i < (1 << $level); $i++) {
+ $all[] = $gens[$level][$i] = gen($gens[$level-1][$i >> 1], $level);
+ }
+}
+
+for ($i = 0; $i < 2; $i++) {
+ try {
+ foreach ($all as $gen) {
+ var_dump($gen->current());
+ $gen->next();
+ if (!$gen->valid()) {
+ break;
+ }
+ }
+ } catch(Exception $e) {
+ print "$e\n";
+ unset($all[array_search($gen, $all)]);
+ }
+}
+?>
+--EXPECTF--
+5 levels
+
+int(0)
+int(1)
+int(2)
+int(3)
+int(4)
+int(5)
+int(6)
+int(7)
+int(8)
+int(9)
+int(10)
+int(11)
+int(12)
+int(13)
+int(14)
+exception 'Exception' in %s:%d
+Stack trace:
+#0 %s(%d): from(5)
+#1 %s(%d): gen(Object(Generator), 1)
+#2 %s(%d): gen(Object(Generator), 2)
+#3 [internal function]: gen(Object(Generator), 3)
+#4 %s(%d): Generator->next()
+#5 {main}
+exception 'ClosedGeneratorException' with message 'Generator yielded from aborted, no return value available' in %s:%d
+Stack trace:
+#0 [internal function]: gen(Object(Generator), 1)
+#1 %s(%d): Generator->current()
+#2 {main}
+
diff --git a/Zend/zend_ast.h b/Zend/zend_ast.h
index 553578f848..33aa292fb7 100644
--- a/Zend/zend_ast.h
+++ b/Zend/zend_ast.h
@@ -84,6 +84,7 @@ enum _zend_ast_kind {
ZEND_AST_PRE_DEC,
ZEND_AST_POST_INC,
ZEND_AST_POST_DEC,
+ ZEND_AST_YIELD_FROM,
ZEND_AST_GLOBAL,
ZEND_AST_UNSET,
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index be6b11f6a8..996c11b24d 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -27,6 +27,7 @@
#include "zend_exceptions.h"
#include "zend_extensions.h"
#include "zend_closures.h"
+#include "zend_generators.h"
#undef ZEND_TEST_EXCEPTIONS
@@ -2269,6 +2270,8 @@ ZEND_FUNCTION(debug_print_backtrace)
call_type = NULL;
ZVAL_UNDEF(&arg_array);
+ ptr = zend_generator_check_placeholder_frame(ptr);
+
skip = ptr;
/* skip internal handler */
if ((!skip->func || !ZEND_USER_CODE(skip->func->common.type)) &&
@@ -2467,6 +2470,8 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
frameno++;
array_init(&stack_frame);
+ ptr = zend_generator_check_placeholder_frame(ptr);
+
skip = ptr;
/* skip internal handler */
if ((!skip->func || !ZEND_USER_CODE(skip->func->common.type)) &&
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index ac10a2ad74..ea9c900e3b 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -5861,16 +5861,8 @@ void zend_compile_exit(znode *result, zend_ast *ast) /* {{{ */
}
/* }}} */
-void zend_compile_yield(znode *result, zend_ast *ast) /* {{{ */
+static void zend_mark_function_as_generator() /* {{{ */
{
- zend_ast *value_ast = ast->child[0];
- zend_ast *key_ast = ast->child[1];
-
- znode value_node, key_node;
- znode *value_node_ptr = NULL, *key_node_ptr = NULL;
- zend_op *opline;
- zend_bool returns_by_ref = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
-
if (!CG(active_op_array)->function_name) {
zend_error_noreturn(E_COMPILE_ERROR,
"The \"yield\" expression can only be used inside a function");
@@ -5892,6 +5884,20 @@ void zend_compile_yield(znode *result, zend_ast *ast) /* {{{ */
}
CG(active_op_array)->fn_flags |= ZEND_ACC_GENERATOR;
+}
+/* }}} */
+
+void zend_compile_yield(znode *result, zend_ast *ast) /* {{{ */
+{
+ zend_ast *value_ast = ast->child[0];
+ zend_ast *key_ast = ast->child[1];
+
+ znode value_node, key_node;
+ znode *value_node_ptr = NULL, *key_node_ptr = NULL;
+ zend_op *opline;
+ zend_bool returns_by_ref = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
+
+ zend_mark_function_as_generator();
if (key_ast) {
zend_compile_expr(&key_node, key_ast);
@@ -5915,6 +5921,18 @@ void zend_compile_yield(znode *result, zend_ast *ast) /* {{{ */
}
/* }}} */
+void zend_compile_yield_from(znode *result, zend_ast *ast) /* {{{ */
+{
+ zend_ast *expr_ast = ast->child[0];
+ znode expr_node;
+
+ zend_mark_function_as_generator();
+
+ zend_compile_expr(&expr_node, expr_ast);
+ zend_emit_op_tmp(result, ZEND_YIELD_FROM, &expr_node, NULL);
+}
+/* }}} */
+
void zend_compile_instanceof(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *obj_ast = ast->child[0];
@@ -6829,6 +6847,9 @@ void zend_compile_expr(znode *result, zend_ast *ast) /* {{{ */
case ZEND_AST_YIELD:
zend_compile_yield(result, ast);
return;
+ case ZEND_AST_YIELD_FROM:
+ zend_compile_yield_from(result, ast);
+ return;
case ZEND_AST_INSTANCEOF:
zend_compile_instanceof(result, ast);
return;
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 92c9d23d5b..a0c01cfde2 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -2137,6 +2137,16 @@ static zend_always_inline void zend_vm_stack_extend_call_frame(zend_execute_data
}
/* }}} */
+static zend_always_inline zend_generator *zend_get_running_generator(zend_execute_data *execute_data) /* {{{ */
+{
+ /* The generator object is stored in EX(return_value) */
+ zend_generator *generator = (zend_generator *) EX(return_value);
+ /* However control may currently be delegated to another generator.
+ * That's the one we're interested in. */
+ return generator;
+}
+/* }}} */
+
#ifdef HAVE_GCC_GLOBAL_REGS
# if defined(__GNUC__) && ZEND_GCC_VERSION >= 4008 && defined(i386)
# define ZEND_VM_FP_GLOBAL_REG "%esi"
diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c
index bb9f0f07d3..8976a0fcc4 100644
--- a/Zend/zend_generators.c
+++ b/Zend/zend_generators.c
@@ -13,6 +13,7 @@
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Nikita Popov <nikic@php.net> |
+ | Bob Weinand <bobwei9@hotmail.com> |
+----------------------------------------------------------------------+
*/
@@ -25,6 +26,7 @@
#include "zend_generators.h"
ZEND_API zend_class_entry *zend_ce_generator;
+ZEND_API zend_class_entry *zend_ce_ClosedGeneratorException;
static zend_object_handlers zend_generator_handlers;
static zend_object *zend_generator_create(zend_class_entry *class_type);
@@ -94,6 +96,11 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
ZVAL_UNDEF(&generator->key);
}
+ if (Z_TYPE(generator->values) != IS_UNDEF) {
+ zval_ptr_dtor(&generator->values);
+ ZVAL_UNDEF(&generator->values);
+ }
+
if (generator->execute_data) {
zend_execute_data *execute_data = generator->execute_data;
zend_op_array *op_array = &execute_data->func->op_array;
@@ -185,7 +192,14 @@ static void zend_generator_free_storage(zend_object *object) /* {{{ */
zend_generator_close(generator, 0);
- zval_ptr_dtor(&generator->retval);
+ if (!Z_ISUNDEF(generator->retval)) {
+ zval_ptr_dtor(&generator->retval);
+ }
+
+ if (generator->node.children > 4) {
+ zend_hash_destroy(&generator->node.child.ht);
+ }
+
zend_object_std_dtor(&generator->std);
if (generator->iterator) {
@@ -205,6 +219,12 @@ static zend_object *zend_generator_create(zend_class_entry *class_type) /* {{{ *
generator->largest_used_integer_key = -1;
ZVAL_UNDEF(&generator->retval);
+ ZVAL_UNDEF(&generator->values);
+
+ /* By default we have a tree of only one node */
+ generator->node.parent = NULL;
+ generator->node.children = 0;
+ generator->node.ptr.root = generator;
zend_object_std_init(&generator->std, class_type);
generator->std.handlers = &zend_generator_handlers;
@@ -237,7 +257,6 @@ ZEND_API void zend_generator_create_zval(zend_execute_data *call, zend_op_array
/* Save execution context in generator object. */
generator = (zend_generator *) Z_OBJ_P(return_value);
- execute_data->prev_execute_data = NULL;
generator->execute_data = execute_data;
generator->stack = EG(vm_stack);
generator->stack->top = EG(vm_stack_top);
@@ -247,6 +266,9 @@ ZEND_API void zend_generator_create_zval(zend_execute_data *call, zend_op_array
/* EX(return_value) keeps pointer to zend_object (not a real zval) */
execute_data->return_value = (zval*)generator;
+
+ memset(&generator->execute_fake, 0, sizeof(zend_execute_data));
+ Z_OBJ(generator->execute_fake.This) = (zend_object *) generator;
}
/* }}} */
@@ -258,20 +280,369 @@ static zend_function *zend_generator_get_constructor(zend_object *object) /* {{{
}
/* }}} */
-ZEND_API void zend_generator_resume(zend_generator *generator) /* {{{ */
+ZEND_API zend_execute_data *zend_generator_check_placeholder_frame(zend_execute_data *ptr)
+{
+ if (!ptr->func && ptr->prev_execute_data && Z_OBJ(ptr->This)) {
+ if (Z_OBJCE(ptr->This) == zend_ce_generator) {
+ zend_generator *generator = (zend_generator *) Z_OBJ(ptr->This);
+ zend_generator *root = (generator->node.children < 1 ? generator : generator->node.ptr.leaf)->node.ptr.root;
+ zend_execute_data *prev = ptr->prev_execute_data;
+ if (generator->node.parent != root) {
+ do {
+ generator->execute_data->prev_execute_data = prev;
+ prev = generator->execute_data;
+ generator = generator->node.parent;
+ } while (generator->node.parent != root);
+ }
+ generator->execute_data->prev_execute_data = prev;
+ ptr = generator->execute_data;
+ }
+ }
+ return ptr;
+}
+
+static void zend_generator_throw_exception(zend_generator *generator, zval *exception)
+{
+ /* Throw the exception in the context of the generator */
+ zend_execute_data *original_execute_data = EG(current_execute_data);
+ EG(current_execute_data) = generator->execute_data;
+ if (exception) {
+ zend_throw_exception_object(exception);
+ } else {
+ zend_throw_exception_internal(NULL);
+ }
+ EG(current_execute_data) = original_execute_data;
+}
+
+static zend_generator *zend_generator_get_child(zend_generator_node *node, zend_generator *leaf)
+{
+ switch (node->children) {
+ case 0:
+ return NULL;
+ case 1:
+ return node->child.array[0].child;
+
+#define ZEND_GEN_GET_CHILD(x) \
+ if (node->child.array[x].leaf == leaf) { \
+ return node->child.array[x].child; \
+ }
+ case 4:
+ ZEND_GEN_GET_CHILD(3)
+ case 3:
+ ZEND_GEN_GET_CHILD(2)
+ case 2:
+ ZEND_GEN_GET_CHILD(1)
+ ZEND_GEN_GET_CHILD(0)
+ ZEND_ASSERT(0); // we never should have no matching child
+ }
+
+ return zend_hash_index_find_ptr(&node->child.ht, (zend_ulong) leaf);
+}
+
+static zend_generator_node *zend_generator_search_multi_children_node(zend_generator_node *node)
+{
+ while (node->children == 1) {
+ node = &node->child.array[0].child->node;
+ }
+ return node->children > 1 ? node : NULL;
+}
+
+static void zend_generator_add_single_child(zend_generator_node *node, zend_generator *child, zend_generator *leaf)
+{
+ if (node->children < 4) {
+ node->child.array[node->children].leaf = leaf;
+ node->child.array[node->children].child = child;
+ } else if (node->children > 4) {
+ zend_hash_index_add_ptr(&node->child.ht, (zend_ulong) leaf, child);
+ } else {
+ struct {
+ zend_generator *leaf;
+ zend_generator *child;
+ } array[4];
+ int i;
+
+ memcpy(&array, &node->child.array, sizeof(array));
+ zend_hash_init(&node->child.ht, 5, sigh, NULL, 0);
+ for (i = 0; i < 4; i++) {
+ zend_hash_index_add_ptr(&node->child.ht, (zend_ulong) array[i].leaf, array[i].child);
+ }
+ zend_hash_index_add_ptr(&node->child.ht, (zend_ulong) leaf, child);
+ }
+
+ node->children++;
+}
+
+static void zend_generator_merge_child_nodes(zend_generator_node *dest, zend_generator_node *src, zend_generator *child)
+{
+ if (src->children <= 4) {
+ int i = src->children;
+ while (i--) {
+ zend_generator_add_single_child(dest, child, src->child.array[i].leaf);
+ }
+ } else {
+ zend_ulong leaf;
+ ZEND_HASH_FOREACH_NUM_KEY(&src->child.ht, leaf) {
+ zend_generator_add_single_child(dest, child, (zend_generator *) leaf);
+ } ZEND_HASH_FOREACH_END();
+ }
+}
+
+static void zend_generator_add_child(zend_generator *generator, zend_generator *child)
+{
+ zend_generator *leaf = child->node.children ? child->node.ptr.leaf : child;
+ zend_generator_node *multi_children_node;
+ zend_bool was_leaf = generator->node.children == 0;
+
+ if (was_leaf) {
+ zend_generator *next = generator->node.parent;
+ leaf->node.ptr.root = generator->node.ptr.root;
+ generator->node.ptr.leaf = leaf;
+
+ while (next) {
+ if (next->node.children > 1) {
+ if (next->node.children > 4) {
+ zend_generator *child = zend_hash_index_find_ptr(&next->node.child.ht, (zend_ulong) generator);
+ zend_hash_index_del(&next->node.child.ht, (zend_ulong) generator);
+ zend_hash_index_add_ptr(&next->node.child.ht, (zend_ulong) leaf, child);
+ } else {
+ switch (next->node.children) {
+#define ZEND_GEN_UPDATE_CHILD(x) \
+ if (next->node.child.array[x].leaf == generator) { \
+ next->node.child.array[x].leaf = leaf; \
+ break; \
+ }
+ case 4:
+ ZEND_GEN_UPDATE_CHILD(3)
+ case 3:
+ ZEND_GEN_UPDATE_CHILD(2)
+ case 2:
+ ZEND_GEN_UPDATE_CHILD(1)
+ ZEND_GEN_UPDATE_CHILD(0)
+ ZEND_ASSERT(0); // we never should have no matching child
+ }
+ }
+ }
+
+ next->node.ptr.leaf = leaf;
+ next = next->node.parent;
+ }
+
+ zend_generator_add_single_child(&generator->node, child, leaf);
+ } else if (generator->node.children == 1) {
+ multi_children_node = zend_generator_search_multi_children_node(&generator->node);
+ if (multi_children_node) {
+ generator->node.children = 0;
+ zend_generator_merge_child_nodes(&generator->node, multi_children_node, generator->node.child.array[0].child);
+ }
+ }
+
+ if (!was_leaf) {
+ multi_children_node = zend_generator_search_multi_children_node(&child->node);
+ } else {
+ multi_children_node = (zend_generator_node *) 0x1;
+ }
+
+ {
+ zend_generator *parent = generator->node.parent, *cur = generator;
+
+ if (multi_children_node > (zend_generator_node *) 0x1) {
+ zend_generator_merge_child_nodes(&generator->node, multi_children_node, child);
+ } else {
+ zend_generator_add_single_child(&generator->node, child, leaf);
+ }
+ while (parent) {
+ if (parent->node.children > 1) {
+ if (multi_children_node == (zend_generator_node *) 0x1) {
+ multi_children_node = zend_generator_search_multi_children_node(&child->node);
+ }
+ if (multi_children_node) {
+ zend_generator_merge_child_nodes(&parent->node, multi_children_node, cur);
+ } else {
+ zend_generator_add_single_child(&parent->node, cur, leaf);
+ }
+ }
+ cur = parent;
+ parent = parent->node.parent;
+ }
+ }
+}
+
+void zend_generator_yield_from(zend_generator *this, zend_generator *from)
+{
+ zend_generator_add_child(from, this);
+
+ this->node.parent = from;
+}
+
+ZEND_API zend_generator *zend_generator_get_current(zend_generator *generator)
+{
+ zend_generator *leaf;
+ zend_generator *root;
+
+ if (generator->node.parent == NULL) {
+ /* we're not in yield from mode */
+ return generator;
+ }
+
+ leaf = generator->node.children ? generator->node.ptr.leaf : generator;
+ root = leaf->node.ptr.root;
+
+ if (root->execute_data && root->node.parent == NULL) {
+ /* generator still running */
+ return root;
+ }
+
+ while (!root->execute_data && root != generator) {
+ /* generator at the root had stopped */
+ root = zend_generator_get_child(&root->node, leaf);
+ }
+
+ if (root->node.parent) {
+ if (root->node.parent->execute_data == NULL) {
+ if (EXPECTED(EG(exception) == NULL)) {
+ zend_op *yield_from = (zend_op *) root->execute_data->opline - 1;
+
+ if (yield_from->opcode == ZEND_YIELD_FROM && !(yield_from->result_type & EXT_TYPE_UNUSED)) {
+ if (Z_ISUNDEF(root->node.parent->retval)) {
+ /* Throw the exception in the context of the generator */
+ zend_execute_data *original_execute_data = EG(current_execute_data);
+ EG(current_execute_data) = root->execute_data;
+
+ if (root == generator) {
+ root->execute_data->prev_execute_data = original_execute_data;
+ } else {
+ root->execute_data->prev_execute_data = &generator->execute_fake;
+ generator->execute_fake.prev_execute_data = original_execute_data;
+ }
+
+ zend_throw_exception(zend_ce_ClosedGeneratorException, "Generator yielded from aborted, no return value available", 0);
+
+ EG(current_execute_data) = original_execute_data;
+ } else {
+ ZVAL_COPY(ZEND_CALL_VAR(root->execute_data, yield_from->result.var), &root->node.parent->retval);
+ }
+ }
+ }
+
+ root->node.parent = NULL;
+ } else {
+ do {
+ root = root->node.parent;
+ } while (root->node.parent);
+ }
+ }
+
+ return leaf->node.ptr.root = root;
+}
+
+static int zend_generator_get_next_delegated_value(zend_generator *generator) /* {{{ */
+{
+ zval *value;
+ if (Z_TYPE(generator->values) == IS_ARRAY) {
+ HashTable *ht = Z_ARR(generator->values);
+ HashPosition pos = Z_FE_POS(generator->values);
+
+ Bucket *p;
+ do {
+ if (UNEXPECTED(pos >= ht->nNumUsed)) {
+ /* Reached end of array */
+ goto failure;
+ }
+
+ p = &ht->arData[pos];
+ value = &p->val;
+ if (Z_TYPE_P(value) == IS_INDIRECT) {
+ value = Z_INDIRECT_P(value);
+ }
+ pos++;
+ } while (Z_ISUNDEF_P(value));
+
+ zval_ptr_dtor(&generator->value);
+ ZVAL_COPY(&generator->value, value);
+
+ zval_ptr_dtor(&generator->key);
+ if (p->key) {
+ ZVAL_STR_COPY(&generator->key, p->key);
+ } else {
+ ZVAL_LONG(&generator->key, p->h);
+ }
+
+ Z_FE_POS(generator->values) = pos;
+ } else {
+ zend_object_iterator *iter = (zend_object_iterator *) Z_OBJ(generator->values);
+
+ if (++iter->index > 0) {
+ iter->funcs->move_forward(iter);
+ if (UNEXPECTED(EG(exception) != NULL)) {
+ goto failure;
+ }
+ }
+
+ if (iter->funcs->valid(iter) == FAILURE) {
+ /* reached end of iteration */
+ goto failure;
+ }
+
+ value = iter->funcs->get_current_data(iter);
+ if (UNEXPECTED(EG(exception) != NULL || !value)) {
+ goto failure;
+ }
+
+ zval_ptr_dtor(&generator->value);
+ ZVAL_COPY(&generator->value, value);
+
+ zval_ptr_dtor(&generator->key);
+ if (iter->funcs->get_current_key) {
+ iter->funcs->get_current_key(iter, &generator->key);
+ if (UNEXPECTED(EG(exception) != NULL)) {
+ ZVAL_UNDEF(&generator->key);
+ goto failure;
+ }
+ } else {
+ ZVAL_LONG(&generator->key, iter->index);
+ }
+ }
+ return SUCCESS;
+
+failure:
+ zval_ptr_dtor(&generator->values);
+ ZVAL_UNDEF(&generator->values);
+ return FAILURE;
+}
+/* }}} */
+
+ZEND_API void zend_generator_resume(zend_generator *orig_generator) /* {{{ */
{
+ zend_generator *generator;
+
/* The generator is already closed, thus can't resume */
- if (!generator->execute_data) {
+ if (!orig_generator->execute_data) {
return;
}
+ generator = zend_generator_get_current(orig_generator);
+
+try_again:
if (generator->flags & ZEND_GENERATOR_CURRENTLY_RUNNING) {
zend_error(E_EXCEPTION | E_ERROR, "Cannot resume an already running generator");
return;
}
+ if (!Z_ISUNDEF(generator->values)) {
+ if (zend_generator_get_next_delegated_value(generator) == SUCCESS) {
+ return;
+ }
+ /* If there are no more deletegated values, resume the generator
+ * after the "yield from" expression. */
+ }
+
+ if ((orig_generator->flags & ZEND_GENERATOR_DO_INIT) && !Z_ISUNDEF(generator->value)) {
+ /* We must not advance Generator if we yield from a Generator being currently run */
+ return;
+ }
+
/* Drop the AT_FIRST_YIELD flag */
- generator->flags &= ~ZEND_GENERATOR_AT_FIRST_YIELD;
+ orig_generator->flags &= ~ZEND_GENERATOR_AT_FIRST_YIELD;
{
/* Backup executor globals */
@@ -290,7 +661,14 @@ ZEND_API void zend_generator_resume(zend_generator *generator) /* {{{ */
/* We want the backtrace to look as if the generator function was
* called from whatever method we are current running (e.g. next()).
* So we have to link generator call frame with caller call frame. */
- generator->execute_data->prev_execute_data = original_execute_data;
+ if (generator == orig_generator) {
+ generator->execute_data->prev_execute_data = original_execute_data;
+ } else {
+ /* We need some execute_data placeholder in stacktrace to be replaced
+ * by the real stack trace when needed */
+ generator->execute_data->prev_execute_data = &orig_generator->execute_fake;
+ orig_generator->execute_fake.prev_execute_data = original_execute_data;
+ }
/* Resume execution */
generator->flags |= ZEND_GENERATOR_CURRENTLY_RUNNING;
@@ -301,7 +679,6 @@ ZEND_API void zend_generator_resume(zend_generator *generator) /* {{{ */
if (generator->execute_data) {
generator->stack = EG(vm_stack);
generator->stack->top = EG(vm_stack_top);
- generator->execute_data->prev_execute_data = NULL;
}
/* Restore executor globals */
@@ -312,9 +689,25 @@ ZEND_API void zend_generator_resume(zend_generator *generator) /* {{{ */
EG(vm_stack) = original_stack;
/* If an exception was thrown in the generator we have to internally
- * rethrow it in the parent scope. */
+ * rethrow it in the parent scope.
+ * In case we did yield from, the Exception must be rethrown into
+ * its calling frame (see above in if (check_yield_from). */
if (UNEXPECTED(EG(exception) != NULL)) {
- zend_throw_exception_internal(NULL);
+ zend_generator_close(generator, 0);
+
+ if (generator == orig_generator) {
+ zend_throw_exception_internal(NULL);
+ } else {
+ generator = zend_generator_get_current(orig_generator);
+ zend_generator_throw_exception(generator, NULL);
+ goto try_again;
+ }
+ }
+
+ /* yield from was used, try another resume. */
+ if ((generator != orig_generator && !Z_ISUNDEF(generator->retval)) || (generator->execute_data && (generator->execute_data->opline - 1)->opcode == ZEND_YIELD_FROM)) {
+ generator = zend_generator_get_current(orig_generator);
+ goto try_again;
}
}
}
@@ -322,8 +715,10 @@ ZEND_API void zend_generator_resume(zend_generator *generator) /* {{{ */
static void zend_generator_ensure_initialized(zend_generator *generator) /* {{{ */
{
- if (generator->execute_data && Z_TYPE(generator->value) == IS_UNDEF) {
+ if (generator->execute_data && Z_TYPE(generator->value) == IS_UNDEF && generator->node.parent == NULL) {
+ generator->flags |= ZEND_GENERATOR_DO_INIT;
zend_generator_resume(generator);
+ generator->flags &= ~ZEND_GENERATOR_DO_INIT;
generator->flags |= ZEND_GENERATOR_AT_FIRST_YIELD;
}
}
@@ -369,7 +764,9 @@ ZEND_METHOD(Generator, valid)
zend_generator_ensure_initialized(generator);
- RETURN_BOOL(Z_TYPE(generator->value) != IS_UNDEF);
+ zend_generator_get_current(generator);
+
+ RETURN_BOOL(Z_TYPE(generator->value) != IS_UNDEF || generator->node.parent != NULL);
}
/* }}} */
@@ -377,7 +774,7 @@ ZEND_METHOD(Generator, valid)
* Get the current value */
ZEND_METHOD(Generator, current)
{
- zend_generator *generator;
+ zend_generator *generator, *root;
if (zend_parse_parameters_none() == FAILURE) {
return;
@@ -387,8 +784,9 @@ ZEND_METHOD(Generator, current)
zend_generator_ensure_initialized(generator);
- if (Z_TYPE(generator->value) != IS_UNDEF) {
- RETURN_ZVAL_FAST(&generator->value);
+ root = zend_generator_get_current(generator);
+ if (Z_TYPE(root->value) != IS_UNDEF) {
+ RETURN_ZVAL_FAST(&root->value);
}
}
/* }}} */
@@ -397,7 +795,7 @@ ZEND_METHOD(Generator, current)
* Get the current key */
ZEND_METHOD(Generator, key)
{
- zend_generator *generator;
+ zend_generator *generator, *root;
if (zend_parse_parameters_none() == FAILURE) {
return;
@@ -407,8 +805,9 @@ ZEND_METHOD(Generator, key)
zend_generator_ensure_initialized(generator);
- if (Z_TYPE(generator->key) != IS_UNDEF) {
- RETURN_ZVAL_FAST(&generator->key);
+ root = zend_generator_get_current(generator);
+ if (Z_TYPE(root->key) != IS_UNDEF) {
+ RETURN_ZVAL_FAST(&root->key);
}
}
/* }}} */
@@ -436,7 +835,7 @@ ZEND_METHOD(Generator, next)
ZEND_METHOD(Generator, send)
{
zval *value;
- zend_generator *generator;
+ zend_generator *generator, *root;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
return;
@@ -451,16 +850,18 @@ ZEND_METHOD(Generator, send)
return;
}
+ root = zend_generator_get_current(generator);
/* Put sent value in the target VAR slot, if it is used */
- if (generator->send_target) {
- if (Z_REFCOUNTED_P(generator->send_target)) Z_DELREF_P(generator->send_target);
- ZVAL_COPY(generator->send_target, value);
+ if (root->send_target) {
+ if (Z_REFCOUNTED_P(root->send_target)) Z_DELREF_P(root->send_target);
+ ZVAL_COPY(root->send_target, value);
}
zend_generator_resume(generator);
- if (Z_TYPE(generator->value) != IS_UNDEF) {
- RETURN_ZVAL_FAST(&generator->value);
+ root = zend_generator_get_current(generator);
+ if (Z_TYPE(root->value) != IS_UNDEF) {
+ RETURN_ZVAL_FAST(&root->value);
}
}
/* }}} */
@@ -483,18 +884,15 @@ ZEND_METHOD(Generator, throw)
zend_generator_ensure_initialized(generator);
if (generator->execute_data) {
- /* Throw the exception in the context of the generator */
- zend_execute_data *current_execute_data = EG(current_execute_data);
- EG(current_execute_data) = generator->execute_data;
+ zend_generator *root = zend_generator_get_current(generator);
- zend_throw_exception_object(&exception_copy);
-
- EG(current_execute_data) = current_execute_data;
+ zend_generator_throw_exception(root, &exception_copy);
zend_generator_resume(generator);
- if (Z_TYPE(generator->value) != IS_UNDEF) {
- RETURN_ZVAL_FAST(&generator->value);
+ root = zend_generator_get_current(generator);
+ if (Z_TYPE(root->value) != IS_UNDEF) {
+ RETURN_ZVAL_FAST(&root->value);
}
} else {
/* If the generator is already closed throw the exception in the
@@ -565,28 +963,34 @@ static int zend_generator_iterator_valid(zend_object_iterator *iterator) /* {{{
zend_generator_ensure_initialized(generator);
- return Z_TYPE(generator->value) != IS_UNDEF ? SUCCESS : FAILURE;
+ zend_generator_get_current(generator);
+
+ return Z_TYPE(generator->value) != IS_UNDEF || generator->node.parent != NULL ? SUCCESS : FAILURE;
}
/* }}} */
static zval *zend_generator_iterator_get_data(zend_object_iterator *iterator) /* {{{ */
{
- zend_generator *generator = (zend_generator*)Z_OBJ(iterator->data);
+ zend_generator *generator = (zend_generator*)Z_OBJ(iterator->data), *root;
zend_generator_ensure_initialized(generator);
- return &generator->value;
+ root = zend_generator_get_current(generator);
+
+ return &root->value;
}
/* }}} */
static void zend_generator_iterator_get_key(zend_object_iterator *iterator, zval *key) /* {{{ */
{
- zend_generator *generator = (zend_generator*)Z_OBJ(iterator->data);
+ zend_generator *generator = (zend_generator*)Z_OBJ(iterator->data), *root;
zend_generator_ensure_initialized(generator);
- if (Z_TYPE(generator->key) != IS_UNDEF) {
- ZVAL_ZVAL(key, &generator->key, 1, 0);
+ root = zend_generator_get_current(generator);
+
+ if (Z_TYPE(root->key) != IS_UNDEF) {
+ ZVAL_ZVAL(key, &root->key, 1, 0);
} else {
ZVAL_NULL(key);
}
@@ -691,6 +1095,9 @@ void zend_register_generator_ce(void) /* {{{ */
zend_generator_handlers.dtor_obj = zend_generator_dtor_storage;
zend_generator_handlers.clone_obj = NULL;
zend_generator_handlers.get_constructor = zend_generator_get_constructor;
+
+ INIT_CLASS_ENTRY(ce, "ClosedGeneratorException", NULL);
+ zend_ce_ClosedGeneratorException = zend_register_internal_class_ex(&ce, zend_exception_get_default());
}
/* }}} */
diff --git a/Zend/zend_generators.h b/Zend/zend_generators.h
index 2e70bc5a2f..e63ab97063 100644
--- a/Zend/zend_generators.h
+++ b/Zend/zend_generators.h
@@ -13,6 +13,7 @@
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Nikita Popov <nikic@php.net> |
+ | Bob Weinand <bobwei9@hotmail.com> |
+----------------------------------------------------------------------+
*/
@@ -24,8 +25,28 @@
BEGIN_EXTERN_C()
extern ZEND_API zend_class_entry *zend_ce_generator;
+extern ZEND_API zend_class_entry *zend_ce_ClosedGeneratorException;
-typedef struct _zend_generator {
+typedef struct _zend_generator_node zend_generator_node;
+typedef struct _zend_generator zend_generator;
+
+struct _zend_generator_node {
+ zend_generator *parent; /* NULL for root */
+ uint32_t children;
+ union {
+ HashTable ht; /* if > 4 children */
+ struct {
+ zend_generator *leaf;
+ zend_generator *child;
+ } array[4]; /* if <= 4 children */
+ } child;
+ union {
+ zend_generator *leaf; /* if > 0 children */
+ zend_generator *root; /* if 0 children */
+ } ptr;
+};
+
+struct _zend_generator {
zend_object std;
zend_object_iterator *iterator;
@@ -47,19 +68,37 @@ typedef struct _zend_generator {
/* Largest used integer key for auto-incrementing keys */
zend_long largest_used_integer_key;
+ /* Values specified by "yield from" to yield from this generator.
+ * This is only used for arrays or non-generator Traversables.
+ * This zval also uses the u2 structure in the same way as
+ * by-value foreach. */
+ zval values;
+
+ /* Node of waiting generators when multiple "yield *" expressions
+ * are nested. */
+ zend_generator_node node;
+
+ /* Fake execute_data for stacktraces */
+ zend_execute_data execute_fake;
+
/* ZEND_GENERATOR_* flags */
zend_uchar flags;
-} zend_generator;
+};
static const zend_uchar ZEND_GENERATOR_CURRENTLY_RUNNING = 0x1;
static const zend_uchar ZEND_GENERATOR_FORCED_CLOSE = 0x2;
static const zend_uchar ZEND_GENERATOR_AT_FIRST_YIELD = 0x4;
+static const zend_uchar ZEND_GENERATOR_DO_INIT = 0x8;
void zend_register_generator_ce(void);
ZEND_API void zend_generator_create_zval(zend_execute_data *call, zend_op_array *op_array, zval *return_value);
ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished_execution);
ZEND_API void zend_generator_resume(zend_generator *generator);
+void zend_generator_yield_from(zend_generator *this, zend_generator *from);
+ZEND_API zend_generator *zend_generator_get_current(zend_generator *generator);
+ZEND_API zend_execute_data *zend_generator_check_placeholder_frame(zend_execute_data *ptr);
+
END_EXTERN_C()
#endif
diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h
index 3461925de6..9dec40d57a 100644
--- a/Zend/zend_hash.h
+++ b/Zend/zend_hash.h
@@ -578,6 +578,15 @@ static zend_always_inline void *zend_hash_str_update_mem(HashTable *ht, const ch
return zend_hash_str_update_ptr(ht, str, len, p);
}
+static zend_always_inline void *zend_hash_index_add_ptr(HashTable *ht, zend_ulong h, void *pData)
+{
+ zval tmp, *zv;
+
+ ZVAL_PTR(&tmp, pData);
+ zv = zend_hash_index_add(ht, h, &tmp);
+ return zv ? Z_PTR_P(zv) : NULL;
+}
+
static zend_always_inline void *zend_hash_index_update_ptr(HashTable *ht, zend_ulong h, void *pData)
{
zval tmp, *zv;
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index 8db3fb2f3d..0aba081218 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -67,6 +67,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
%right T_PRINT
%right T_YIELD
%right T_DOUBLE_ARROW
+%right T_YIELD_FROM
%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL T_POW_EQUAL
%left '?' ':'
%right T_COALESCE
@@ -112,6 +113,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
%token T_LOGICAL_AND "and (T_LOGICAL_AND)"
%token T_PRINT "print (T_PRINT)"
%token T_YIELD "yield (T_YIELD)"
+%token T_YIELD_FROM "yield from (T_YIELD_FROM)"
%token T_PLUS_EQUAL "+= (T_PLUS_EQUAL)"
%token T_MINUS_EQUAL "-= (T_MINUS_EQUAL)"
%token T_MUL_EQUAL "*= (T_MUL_EQUAL)"
@@ -907,6 +909,7 @@ expr_without_variable:
| T_YIELD { $$ = zend_ast_create(ZEND_AST_YIELD, NULL, NULL); }
| T_YIELD expr { $$ = zend_ast_create(ZEND_AST_YIELD, $2, NULL); }
| T_YIELD expr T_DOUBLE_ARROW expr { $$ = zend_ast_create(ZEND_AST_YIELD, $4, $2); }
+ | T_YIELD_FROM expr { $$ = zend_ast_create(ZEND_AST_YIELD_FROM, $2); }
| function returns_ref '(' parameter_list ')' lexical_vars return_type
backup_doc_comment '{' inner_statement_list '}'
{ $$ = zend_ast_create_decl(ZEND_AST_CLOSURE, $2, $1, $8,
diff --git a/Zend/zend_language_scanner.c b/Zend/zend_language_scanner.c
index 6f1bcd2f6d..37bfceef76 100644
--- a/Zend/zend_language_scanner.c
+++ b/Zend/zend_language_scanner.c
@@ -1136,7 +1136,7 @@ yyc_INITIAL:
yy3:
YYDEBUG(3, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1770 "Zend/zend_language_scanner.l"
+#line 1774 "Zend/zend_language_scanner.l"
{
if (YYCURSOR > YYLIMIT) {
return 0;
@@ -1199,7 +1199,7 @@ yy5:
yy6:
YYDEBUG(6, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1761 "Zend/zend_language_scanner.l"
+#line 1765 "Zend/zend_language_scanner.l"
{
if (CG(short_tags)) {
BEGIN(ST_IN_SCRIPTING);
@@ -1214,7 +1214,7 @@ yy7:
++YYCURSOR;
YYDEBUG(8, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1748 "Zend/zend_language_scanner.l"
+#line 1752 "Zend/zend_language_scanner.l"
{
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG_WITH_ECHO;
@@ -1250,7 +1250,7 @@ yy13:
yy14:
YYDEBUG(14, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1754 "Zend/zend_language_scanner.l"
+#line 1758 "Zend/zend_language_scanner.l"
{
HANDLE_NEWLINE(yytext[yyleng-1]);
BEGIN(ST_IN_SCRIPTING);
@@ -1326,7 +1326,7 @@ yyc_ST_BACKQUOTE:
yy19:
YYDEBUG(19, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2184 "Zend/zend_language_scanner.l"
+#line 2188 "Zend/zend_language_scanner.l"
{
if (YYCURSOR > YYLIMIT) {
return 0;
@@ -1380,7 +1380,7 @@ yy21:
++YYCURSOR;
YYDEBUG(22, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2126 "Zend/zend_language_scanner.l"
+#line 2130 "Zend/zend_language_scanner.l"
{
BEGIN(ST_IN_SCRIPTING);
return '`';
@@ -1395,7 +1395,7 @@ yy24:
++YYCURSOR;
YYDEBUG(25, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2113 "Zend/zend_language_scanner.l"
+#line 2117 "Zend/zend_language_scanner.l"
{
Z_LVAL_P(zendlval) = (zend_long) '{';
yy_push_state(ST_IN_SCRIPTING);
@@ -1418,7 +1418,7 @@ yy26:
yy28:
YYDEBUG(28, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1835 "Zend/zend_language_scanner.l"
+#line 1839 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
@@ -1429,7 +1429,7 @@ yy29:
++YYCURSOR;
YYDEBUG(30, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1556 "Zend/zend_language_scanner.l"
+#line 1560 "Zend/zend_language_scanner.l"
{
yy_push_state(ST_LOOKING_FOR_VARNAME);
return T_DOLLAR_OPEN_CURLY_BRACES;
@@ -1448,7 +1448,7 @@ yy33:
++YYCURSOR;
YYDEBUG(34, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1828 "Zend/zend_language_scanner.l"
+#line 1832 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
yy_push_state(ST_VAR_OFFSET);
@@ -1473,7 +1473,7 @@ yy36:
++YYCURSOR;
YYDEBUG(37, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1819 "Zend/zend_language_scanner.l"
+#line 1823 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 3);
yy_push_state(ST_LOOKING_FOR_PROPERTY);
@@ -1548,7 +1548,7 @@ yy40:
yy41:
YYDEBUG(41, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2132 "Zend/zend_language_scanner.l"
+#line 2136 "Zend/zend_language_scanner.l"
{
if (GET_DOUBLE_QUOTES_SCANNED_LENGTH()) {
YYCURSOR += GET_DOUBLE_QUOTES_SCANNED_LENGTH() - 1;
@@ -1610,7 +1610,7 @@ yy43:
++YYCURSOR;
YYDEBUG(44, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2121 "Zend/zend_language_scanner.l"
+#line 2125 "Zend/zend_language_scanner.l"
{
BEGIN(ST_IN_SCRIPTING);
return '"';
@@ -1625,7 +1625,7 @@ yy46:
++YYCURSOR;
YYDEBUG(47, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2113 "Zend/zend_language_scanner.l"
+#line 2117 "Zend/zend_language_scanner.l"
{
Z_LVAL_P(zendlval) = (zend_long) '{';
yy_push_state(ST_IN_SCRIPTING);
@@ -1648,7 +1648,7 @@ yy48:
yy50:
YYDEBUG(50, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1835 "Zend/zend_language_scanner.l"
+#line 1839 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
@@ -1659,7 +1659,7 @@ yy51:
++YYCURSOR;
YYDEBUG(52, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1556 "Zend/zend_language_scanner.l"
+#line 1560 "Zend/zend_language_scanner.l"
{
yy_push_state(ST_LOOKING_FOR_VARNAME);
return T_DOLLAR_OPEN_CURLY_BRACES;
@@ -1678,7 +1678,7 @@ yy55:
++YYCURSOR;
YYDEBUG(56, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1828 "Zend/zend_language_scanner.l"
+#line 1832 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
yy_push_state(ST_VAR_OFFSET);
@@ -1703,7 +1703,7 @@ yy58:
++YYCURSOR;
YYDEBUG(59, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1819 "Zend/zend_language_scanner.l"
+#line 1823 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 3);
yy_push_state(ST_LOOKING_FOR_PROPERTY);
@@ -1721,7 +1721,7 @@ yyc_ST_END_HEREDOC:
++YYCURSOR;
YYDEBUG(63, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2099 "Zend/zend_language_scanner.l"
+#line 2103 "Zend/zend_language_scanner.l"
{
zend_heredoc_label *heredoc_label = zend_ptr_stack_pop(&SCNG(heredoc_label_stack));
@@ -1796,7 +1796,7 @@ yy66:
yy67:
YYDEBUG(67, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2228 "Zend/zend_language_scanner.l"
+#line 2232 "Zend/zend_language_scanner.l"
{
int newline = 0;
@@ -1886,7 +1886,7 @@ yy70:
++YYCURSOR;
YYDEBUG(71, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2113 "Zend/zend_language_scanner.l"
+#line 2117 "Zend/zend_language_scanner.l"
{
Z_LVAL_P(zendlval) = (zend_long) '{';
yy_push_state(ST_IN_SCRIPTING);
@@ -1909,7 +1909,7 @@ yy72:
yy74:
YYDEBUG(74, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1835 "Zend/zend_language_scanner.l"
+#line 1839 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
@@ -1920,7 +1920,7 @@ yy75:
++YYCURSOR;
YYDEBUG(76, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1556 "Zend/zend_language_scanner.l"
+#line 1560 "Zend/zend_language_scanner.l"
{
yy_push_state(ST_LOOKING_FOR_VARNAME);
return T_DOLLAR_OPEN_CURLY_BRACES;
@@ -1939,7 +1939,7 @@ yy79:
++YYCURSOR;
YYDEBUG(80, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1828 "Zend/zend_language_scanner.l"
+#line 1832 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
yy_push_state(ST_VAR_OFFSET);
@@ -1964,7 +1964,7 @@ yy82:
++YYCURSOR;
YYDEBUG(83, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1819 "Zend/zend_language_scanner.l"
+#line 1823 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 3);
yy_push_state(ST_LOOKING_FOR_PROPERTY);
@@ -2138,23 +2138,23 @@ yy86:
YYDEBUG(-1, yych);
switch ((yych = *YYCURSOR)) {
case 'C':
- case 'c': goto yy697;
+ case 'c': goto yy704;
case 'L':
- case 'l': goto yy698;
+ case 'l': goto yy705;
case 'M':
- case 'm': goto yy699;
+ case 'm': goto yy706;
case 'N':
- case 'n': goto yy700;
+ case 'n': goto yy707;
case 'V':
- case 'v': goto yy701;
+ case 'v': goto yy708;
case 'X':
- case 'x': goto yy702;
+ case 'x': goto yy709;
default: goto yy150;
}
yy87:
YYDEBUG(87, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1858 "Zend/zend_language_scanner.l"
+#line 1862 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, yytext, yyleng);
return T_STRING;
@@ -2165,20 +2165,20 @@ yy88:
yych = *++YYCURSOR;
if (yych <= 'O') {
if (yych <= 'H') {
- if (yych == 'E') goto yy679;
+ if (yych == 'E') goto yy686;
goto yy150;
} else {
- if (yych <= 'I') goto yy680;
+ if (yych <= 'I') goto yy687;
if (yych <= 'N') goto yy150;
- goto yy681;
+ goto yy688;
}
} else {
if (yych <= 'h') {
- if (yych == 'e') goto yy679;
+ if (yych == 'e') goto yy686;
goto yy150;
} else {
- if (yych <= 'i') goto yy680;
- if (yych == 'o') goto yy681;
+ if (yych <= 'i') goto yy687;
+ if (yych == 'o') goto yy688;
goto yy150;
}
}
@@ -2187,20 +2187,20 @@ yy89:
yych = *++YYCURSOR;
if (yych <= 'U') {
if (yych <= 'N') {
- if (yych == 'I') goto yy655;
+ if (yych == 'I') goto yy662;
goto yy150;
} else {
- if (yych <= 'O') goto yy656;
+ if (yych <= 'O') goto yy663;
if (yych <= 'T') goto yy150;
- goto yy657;
+ goto yy664;
}
} else {
if (yych <= 'n') {
- if (yych == 'i') goto yy655;
+ if (yych == 'i') goto yy662;
goto yy150;
} else {
- if (yych <= 'o') goto yy656;
- if (yych == 'u') goto yy657;
+ if (yych <= 'o') goto yy663;
+ if (yych == 'u') goto yy664;
goto yy150;
}
}
@@ -2209,28 +2209,28 @@ yy90:
yych = *++YYCURSOR;
if (yych <= 'O') {
if (yych <= 'K') {
- if (yych == 'A') goto yy620;
+ if (yych == 'A') goto yy627;
goto yy150;
} else {
- if (yych <= 'L') goto yy621;
+ if (yych <= 'L') goto yy628;
if (yych <= 'N') goto yy150;
- goto yy622;
+ goto yy629;
}
} else {
if (yych <= 'k') {
- if (yych == 'a') goto yy620;
+ if (yych == 'a') goto yy627;
goto yy150;
} else {
- if (yych <= 'l') goto yy621;
- if (yych == 'o') goto yy622;
+ if (yych <= 'l') goto yy628;
+ if (yych == 'o') goto yy629;
goto yy150;
}
}
yy91:
YYDEBUG(91, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'E') goto yy602;
- if (yych == 'e') goto yy602;
+ if (yych == 'E') goto yy609;
+ if (yych == 'e') goto yy609;
goto yy150;
yy92:
YYDEBUG(92, *YYCURSOR);
@@ -2391,7 +2391,7 @@ yy101:
yy102:
YYDEBUG(102, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1545 "Zend/zend_language_scanner.l"
+#line 1549 "Zend/zend_language_scanner.l"
{
return yytext[0];
}
@@ -2404,7 +2404,7 @@ yy103:
yy104:
YYDEBUG(104, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1260 "Zend/zend_language_scanner.l"
+#line 1264 "Zend/zend_language_scanner.l"
{
HANDLE_NEWLINES(yytext, yyleng);
return T_WHITESPACE;
@@ -2420,7 +2420,7 @@ yy106:
++YYCURSOR;
YYDEBUG(107, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1285 "Zend/zend_language_scanner.l"
+#line 1289 "Zend/zend_language_scanner.l"
{
return T_NS_SEPARATOR;
}
@@ -2653,7 +2653,7 @@ yy131:
++YYCURSOR;
YYDEBUG(132, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1550 "Zend/zend_language_scanner.l"
+#line 1554 "Zend/zend_language_scanner.l"
{
yy_push_state(ST_IN_SCRIPTING);
return '{';
@@ -2664,7 +2664,7 @@ yy133:
++YYCURSOR;
YYDEBUG(134, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1562 "Zend/zend_language_scanner.l"
+#line 1566 "Zend/zend_language_scanner.l"
{
RESET_DOC_COMMENT();
if (!zend_stack_is_empty(&SCNG(state_stack))) {
@@ -2700,7 +2700,7 @@ yy135:
yy136:
YYDEBUG(136, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1615 "Zend/zend_language_scanner.l"
+#line 1619 "Zend/zend_language_scanner.l"
{
char *end;
if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */
@@ -2770,7 +2770,7 @@ yy139:
yy140:
YYDEBUG(140, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1864 "Zend/zend_language_scanner.l"
+#line 1868 "Zend/zend_language_scanner.l"
{
while (YYCURSOR < YYLIMIT) {
switch (*YYCURSOR++) {
@@ -2806,7 +2806,7 @@ yy141:
yy142:
YYDEBUG(142, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1932 "Zend/zend_language_scanner.l"
+#line 1936 "Zend/zend_language_scanner.l"
{
register char *s, *t;
char *end;
@@ -2881,7 +2881,7 @@ yy143:
yy144:
YYDEBUG(144, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2001 "Zend/zend_language_scanner.l"
+#line 2005 "Zend/zend_language_scanner.l"
{
int bprefix = (yytext[0] != '"') ? 1 : 0;
@@ -2930,7 +2930,7 @@ yy145:
++YYCURSOR;
YYDEBUG(146, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2093 "Zend/zend_language_scanner.l"
+#line 2097 "Zend/zend_language_scanner.l"
{
BEGIN(ST_BACKQUOTE);
return '`';
@@ -2941,7 +2941,7 @@ yy147:
++YYCURSOR;
YYDEBUG(148, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2361 "Zend/zend_language_scanner.l"
+#line 2365 "Zend/zend_language_scanner.l"
{
if (YYCURSOR > YYLIMIT) {
return 0;
@@ -2977,7 +2977,7 @@ yy151:
yy153:
YYDEBUG(153, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1706 "Zend/zend_language_scanner.l"
+#line 1710 "Zend/zend_language_scanner.l"
{
const char *end;
@@ -3018,7 +3018,7 @@ yy156:
yy157:
YYDEBUG(157, *YYCURSOR);
YYCURSOR = YYMARKER;
- if (yyaccept <= 2) {
+ if (yyaccept <= 3) {
if (yyaccept <= 1) {
if (yyaccept <= 0) {
goto yy87;
@@ -3026,17 +3026,21 @@ yy157:
goto yy102;
}
} else {
- goto yy136;
+ if (yyaccept <= 2) {
+ goto yy136;
+ } else {
+ goto yy153;
+ }
}
} else {
- if (yyaccept <= 4) {
- if (yyaccept <= 3) {
- goto yy153;
- } else {
+ if (yyaccept <= 5) {
+ if (yyaccept <= 4) {
goto yy190;
+ } else {
+ goto yy210;
}
} else {
- goto yy210;
+ goto yy601;
}
}
yy158:
@@ -3078,7 +3082,7 @@ yy163:
}
YYDEBUG(165, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1587 "Zend/zend_language_scanner.l"
+#line 1591 "Zend/zend_language_scanner.l"
{
char *bin = yytext + 2; /* Skip "0b" */
int len = yyleng - 2;
@@ -3106,7 +3110,7 @@ yy163:
return T_DNUMBER;
}
}
-#line 3110 "Zend/zend_language_scanner.c"
+#line 3114 "Zend/zend_language_scanner.c"
yy166:
YYDEBUG(166, *YYCURSOR);
++YYCURSOR;
@@ -3118,7 +3122,7 @@ yy166:
}
YYDEBUG(168, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1657 "Zend/zend_language_scanner.l"
+#line 1661 "Zend/zend_language_scanner.l"
{
char *hex = yytext + 2; /* Skip "0x" */
int len = yyleng - 2;
@@ -3146,7 +3150,7 @@ yy166:
return T_DNUMBER;
}
}
-#line 3150 "Zend/zend_language_scanner.c"
+#line 3154 "Zend/zend_language_scanner.c"
yy169:
YYDEBUG(169, *YYCURSOR);
++YYCURSOR;
@@ -3171,12 +3175,12 @@ yy169:
yy171:
YYDEBUG(171, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1835 "Zend/zend_language_scanner.l"
+#line 1839 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
}
-#line 3180 "Zend/zend_language_scanner.c"
+#line 3184 "Zend/zend_language_scanner.c"
yy172:
YYDEBUG(172, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3190,11 +3194,11 @@ yy173:
}
YYDEBUG(174, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1533 "Zend/zend_language_scanner.l"
+#line 1537 "Zend/zend_language_scanner.l"
{
return T_LOGICAL_XOR;
}
-#line 3198 "Zend/zend_language_scanner.c"
+#line 3202 "Zend/zend_language_scanner.c"
yy175:
YYDEBUG(175, *YYCURSOR);
++YYCURSOR;
@@ -3203,71 +3207,71 @@ yy175:
}
YYDEBUG(176, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1525 "Zend/zend_language_scanner.l"
+#line 1529 "Zend/zend_language_scanner.l"
{
return T_LOGICAL_OR;
}
-#line 3211 "Zend/zend_language_scanner.c"
+#line 3215 "Zend/zend_language_scanner.c"
yy177:
YYDEBUG(177, *YYCURSOR);
++YYCURSOR;
YYDEBUG(178, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1513 "Zend/zend_language_scanner.l"
+#line 1517 "Zend/zend_language_scanner.l"
{
return T_XOR_EQUAL;
}
-#line 3221 "Zend/zend_language_scanner.c"
+#line 3225 "Zend/zend_language_scanner.c"
yy179:
YYDEBUG(179, *YYCURSOR);
++YYCURSOR;
YYDEBUG(180, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1517 "Zend/zend_language_scanner.l"
+#line 1521 "Zend/zend_language_scanner.l"
{
return T_BOOLEAN_OR;
}
-#line 3231 "Zend/zend_language_scanner.c"
+#line 3235 "Zend/zend_language_scanner.c"
yy181:
YYDEBUG(181, *YYCURSOR);
++YYCURSOR;
YYDEBUG(182, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1509 "Zend/zend_language_scanner.l"
+#line 1513 "Zend/zend_language_scanner.l"
{
return T_OR_EQUAL;
}
-#line 3241 "Zend/zend_language_scanner.c"
+#line 3245 "Zend/zend_language_scanner.c"
yy183:
YYDEBUG(183, *YYCURSOR);
++YYCURSOR;
YYDEBUG(184, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1521 "Zend/zend_language_scanner.l"
+#line 1525 "Zend/zend_language_scanner.l"
{
return T_BOOLEAN_AND;
}
-#line 3251 "Zend/zend_language_scanner.c"
+#line 3255 "Zend/zend_language_scanner.c"
yy185:
YYDEBUG(185, *YYCURSOR);
++YYCURSOR;
YYDEBUG(186, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1505 "Zend/zend_language_scanner.l"
+#line 1509 "Zend/zend_language_scanner.l"
{
return T_AND_EQUAL;
}
-#line 3261 "Zend/zend_language_scanner.c"
+#line 3265 "Zend/zend_language_scanner.c"
yy187:
YYDEBUG(187, *YYCURSOR);
++YYCURSOR;
YYDEBUG(188, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1493 "Zend/zend_language_scanner.l"
+#line 1497 "Zend/zend_language_scanner.l"
{
return T_MOD_EQUAL;
}
-#line 3271 "Zend/zend_language_scanner.c"
+#line 3275 "Zend/zend_language_scanner.c"
yy189:
YYDEBUG(189, *YYCURSOR);
yyaccept = 4;
@@ -3276,7 +3280,7 @@ yy189:
yy190:
YYDEBUG(190, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1893 "Zend/zend_language_scanner.l"
+#line 1897 "Zend/zend_language_scanner.l"
{
int doc_com;
@@ -3309,7 +3313,7 @@ yy190:
return T_COMMENT;
}
-#line 3313 "Zend/zend_language_scanner.c"
+#line 3317 "Zend/zend_language_scanner.c"
yy191:
YYDEBUG(191, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3319,11 +3323,11 @@ yy192:
++YYCURSOR;
YYDEBUG(193, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1485 "Zend/zend_language_scanner.l"
+#line 1489 "Zend/zend_language_scanner.l"
{
return T_DIV_EQUAL;
}
-#line 3327 "Zend/zend_language_scanner.c"
+#line 3331 "Zend/zend_language_scanner.c"
yy194:
YYDEBUG(194, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3347,62 +3351,62 @@ yy197:
if ((yych = *YYCURSOR) == '=') goto yy201;
YYDEBUG(198, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1477 "Zend/zend_language_scanner.l"
+#line 1481 "Zend/zend_language_scanner.l"
{
return T_POW;
}
-#line 3355 "Zend/zend_language_scanner.c"
+#line 3359 "Zend/zend_language_scanner.c"
yy199:
YYDEBUG(199, *YYCURSOR);
++YYCURSOR;
YYDEBUG(200, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1473 "Zend/zend_language_scanner.l"
+#line 1477 "Zend/zend_language_scanner.l"
{
return T_MUL_EQUAL;
}
-#line 3365 "Zend/zend_language_scanner.c"
+#line 3369 "Zend/zend_language_scanner.c"
yy201:
YYDEBUG(201, *YYCURSOR);
++YYCURSOR;
YYDEBUG(202, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1481 "Zend/zend_language_scanner.l"
+#line 1485 "Zend/zend_language_scanner.l"
{
return T_POW_EQUAL;
}
-#line 3375 "Zend/zend_language_scanner.c"
+#line 3379 "Zend/zend_language_scanner.c"
yy203:
YYDEBUG(203, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) == '=') goto yy207;
YYDEBUG(204, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1541 "Zend/zend_language_scanner.l"
+#line 1545 "Zend/zend_language_scanner.l"
{
return T_SR;
}
-#line 3386 "Zend/zend_language_scanner.c"
+#line 3390 "Zend/zend_language_scanner.c"
yy205:
YYDEBUG(205, *YYCURSOR);
++YYCURSOR;
YYDEBUG(206, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1461 "Zend/zend_language_scanner.l"
+#line 1465 "Zend/zend_language_scanner.l"
{
return T_IS_GREATER_OR_EQUAL;
}
-#line 3396 "Zend/zend_language_scanner.c"
+#line 3400 "Zend/zend_language_scanner.c"
yy207:
YYDEBUG(207, *YYCURSOR);
++YYCURSOR;
YYDEBUG(208, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1501 "Zend/zend_language_scanner.l"
+#line 1505 "Zend/zend_language_scanner.l"
{
return T_SR_EQUAL;
}
-#line 3406 "Zend/zend_language_scanner.c"
+#line 3410 "Zend/zend_language_scanner.c"
yy209:
YYDEBUG(209, *YYCURSOR);
yyaccept = 5;
@@ -3413,53 +3417,53 @@ yy209:
yy210:
YYDEBUG(210, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1537 "Zend/zend_language_scanner.l"
+#line 1541 "Zend/zend_language_scanner.l"
{
return T_SL;
}
-#line 3421 "Zend/zend_language_scanner.c"
+#line 3425 "Zend/zend_language_scanner.c"
yy211:
YYDEBUG(211, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) == '>') goto yy215;
YYDEBUG(212, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1457 "Zend/zend_language_scanner.l"
+#line 1461 "Zend/zend_language_scanner.l"
{
return T_IS_SMALLER_OR_EQUAL;
}
-#line 3432 "Zend/zend_language_scanner.c"
+#line 3436 "Zend/zend_language_scanner.c"
yy213:
YYDEBUG(213, *YYCURSOR);
++YYCURSOR;
yy214:
YYDEBUG(214, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1449 "Zend/zend_language_scanner.l"
+#line 1453 "Zend/zend_language_scanner.l"
{
return T_IS_NOT_EQUAL;
}
-#line 3443 "Zend/zend_language_scanner.c"
+#line 3447 "Zend/zend_language_scanner.c"
yy215:
YYDEBUG(215, *YYCURSOR);
++YYCURSOR;
YYDEBUG(216, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1453 "Zend/zend_language_scanner.l"
+#line 1457 "Zend/zend_language_scanner.l"
{
return T_SPACESHIP;
}
-#line 3453 "Zend/zend_language_scanner.c"
+#line 3457 "Zend/zend_language_scanner.c"
yy217:
YYDEBUG(217, *YYCURSOR);
++YYCURSOR;
YYDEBUG(218, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1497 "Zend/zend_language_scanner.l"
+#line 1501 "Zend/zend_language_scanner.l"
{
return T_SL_EQUAL;
}
-#line 3463 "Zend/zend_language_scanner.c"
+#line 3467 "Zend/zend_language_scanner.c"
yy219:
YYDEBUG(219, *YYCURSOR);
++YYCURSOR;
@@ -3564,7 +3568,7 @@ yy228:
yy229:
YYDEBUG(229, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2045 "Zend/zend_language_scanner.l"
+#line 2049 "Zend/zend_language_scanner.l"
{
char *s;
int bprefix = (yytext[0] != '<') ? 1 : 0;
@@ -3611,7 +3615,7 @@ yy229:
return T_START_HEREDOC;
}
-#line 3615 "Zend/zend_language_scanner.c"
+#line 3619 "Zend/zend_language_scanner.c"
yy230:
YYDEBUG(230, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3651,31 +3655,31 @@ yy233:
++YYCURSOR;
YYDEBUG(235, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1441 "Zend/zend_language_scanner.l"
+#line 1445 "Zend/zend_language_scanner.l"
{
return T_IS_NOT_IDENTICAL;
}
-#line 3659 "Zend/zend_language_scanner.c"
+#line 3663 "Zend/zend_language_scanner.c"
yy236:
YYDEBUG(236, *YYCURSOR);
++YYCURSOR;
YYDEBUG(237, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1465 "Zend/zend_language_scanner.l"
+#line 1469 "Zend/zend_language_scanner.l"
{
return T_PLUS_EQUAL;
}
-#line 3669 "Zend/zend_language_scanner.c"
+#line 3673 "Zend/zend_language_scanner.c"
yy238:
YYDEBUG(238, *YYCURSOR);
++YYCURSOR;
YYDEBUG(239, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1429 "Zend/zend_language_scanner.l"
+#line 1433 "Zend/zend_language_scanner.l"
{
return T_INC;
}
-#line 3679 "Zend/zend_language_scanner.c"
+#line 3683 "Zend/zend_language_scanner.c"
yy240:
YYDEBUG(240, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3694,42 +3698,42 @@ yy242:
}
YYDEBUG(243, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1417 "Zend/zend_language_scanner.l"
+#line 1421 "Zend/zend_language_scanner.l"
{
return T_LIST;
}
-#line 3702 "Zend/zend_language_scanner.c"
+#line 3706 "Zend/zend_language_scanner.c"
yy244:
YYDEBUG(244, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) == '=') goto yy248;
YYDEBUG(245, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1445 "Zend/zend_language_scanner.l"
+#line 1449 "Zend/zend_language_scanner.l"
{
return T_IS_EQUAL;
}
-#line 3713 "Zend/zend_language_scanner.c"
+#line 3717 "Zend/zend_language_scanner.c"
yy246:
YYDEBUG(246, *YYCURSOR);
++YYCURSOR;
YYDEBUG(247, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1413 "Zend/zend_language_scanner.l"
+#line 1417 "Zend/zend_language_scanner.l"
{
return T_DOUBLE_ARROW;
}
-#line 3723 "Zend/zend_language_scanner.c"
+#line 3727 "Zend/zend_language_scanner.c"
yy248:
YYDEBUG(248, *YYCURSOR);
++YYCURSOR;
YYDEBUG(249, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1437 "Zend/zend_language_scanner.l"
+#line 1441 "Zend/zend_language_scanner.l"
{
return T_IS_IDENTICAL;
}
-#line 3733 "Zend/zend_language_scanner.c"
+#line 3737 "Zend/zend_language_scanner.c"
yy250:
YYDEBUG(250, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3859,11 +3863,11 @@ yy266:
}
YYDEBUG(269, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1743 "Zend/zend_language_scanner.l"
+#line 1747 "Zend/zend_language_scanner.l"
{
return T_NS_C;
}
-#line 3867 "Zend/zend_language_scanner.c"
+#line 3871 "Zend/zend_language_scanner.c"
yy270:
YYDEBUG(270, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3883,11 +3887,11 @@ yy271:
}
YYDEBUG(274, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1739 "Zend/zend_language_scanner.l"
+#line 1743 "Zend/zend_language_scanner.l"
{
return T_DIR;
}
-#line 3891 "Zend/zend_language_scanner.c"
+#line 3895 "Zend/zend_language_scanner.c"
yy275:
YYDEBUG(275, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3912,11 +3916,11 @@ yy277:
}
YYDEBUG(280, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1731 "Zend/zend_language_scanner.l"
+#line 1735 "Zend/zend_language_scanner.l"
{
return T_LINE;
}
-#line 3920 "Zend/zend_language_scanner.c"
+#line 3924 "Zend/zend_language_scanner.c"
yy281:
YYDEBUG(281, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3951,11 +3955,11 @@ yy285:
}
YYDEBUG(288, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1727 "Zend/zend_language_scanner.l"
+#line 1731 "Zend/zend_language_scanner.l"
{
return T_METHOD_C;
}
-#line 3959 "Zend/zend_language_scanner.c"
+#line 3963 "Zend/zend_language_scanner.c"
yy289:
YYDEBUG(289, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4006,11 +4010,11 @@ yy296:
}
YYDEBUG(299, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1723 "Zend/zend_language_scanner.l"
+#line 1727 "Zend/zend_language_scanner.l"
{
return T_FUNC_C;
}
-#line 4014 "Zend/zend_language_scanner.c"
+#line 4018 "Zend/zend_language_scanner.c"
yy300:
YYDEBUG(300, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4030,11 +4034,11 @@ yy301:
}
YYDEBUG(304, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1735 "Zend/zend_language_scanner.l"
+#line 1739 "Zend/zend_language_scanner.l"
{
return T_FILE;
}
-#line 4038 "Zend/zend_language_scanner.c"
+#line 4042 "Zend/zend_language_scanner.c"
yy305:
YYDEBUG(305, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4064,11 +4068,11 @@ yy308:
}
YYDEBUG(311, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1719 "Zend/zend_language_scanner.l"
+#line 1723 "Zend/zend_language_scanner.l"
{
return T_TRAIT_C;
}
-#line 4072 "Zend/zend_language_scanner.c"
+#line 4076 "Zend/zend_language_scanner.c"
yy312:
YYDEBUG(312, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4098,11 +4102,11 @@ yy315:
}
YYDEBUG(318, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1715 "Zend/zend_language_scanner.l"
+#line 1719 "Zend/zend_language_scanner.l"
{
return T_CLASS_C;
}
-#line 4106 "Zend/zend_language_scanner.c"
+#line 4110 "Zend/zend_language_scanner.c"
yy319:
YYDEBUG(319, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4164,11 +4168,11 @@ yy330:
}
YYDEBUG(331, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1381 "Zend/zend_language_scanner.l"
+#line 1385 "Zend/zend_language_scanner.l"
{
return T_HALT_COMPILER;
}
-#line 4172 "Zend/zend_language_scanner.c"
+#line 4176 "Zend/zend_language_scanner.c"
yy332:
YYDEBUG(332, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4188,11 +4192,11 @@ yy334:
}
YYDEBUG(335, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1361 "Zend/zend_language_scanner.l"
+#line 1365 "Zend/zend_language_scanner.l"
{
return T_USE;
}
-#line 4196 "Zend/zend_language_scanner.c"
+#line 4200 "Zend/zend_language_scanner.c"
yy336:
YYDEBUG(336, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4211,11 +4215,11 @@ yy338:
}
YYDEBUG(339, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1409 "Zend/zend_language_scanner.l"
+#line 1413 "Zend/zend_language_scanner.l"
{
return T_UNSET;
}
-#line 4219 "Zend/zend_language_scanner.c"
+#line 4223 "Zend/zend_language_scanner.c"
yy340:
YYDEBUG(340, *YYCURSOR);
++YYCURSOR;
@@ -4387,11 +4391,11 @@ yy355:
++YYCURSOR;
YYDEBUG(357, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1309 "Zend/zend_language_scanner.l"
+#line 1313 "Zend/zend_language_scanner.l"
{
return T_INT_CAST;
}
-#line 4395 "Zend/zend_language_scanner.c"
+#line 4399 "Zend/zend_language_scanner.c"
yy358:
YYDEBUG(358, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4435,11 +4439,11 @@ yy363:
++YYCURSOR;
YYDEBUG(366, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1313 "Zend/zend_language_scanner.l"
+#line 1317 "Zend/zend_language_scanner.l"
{
return T_DOUBLE_CAST;
}
-#line 4443 "Zend/zend_language_scanner.c"
+#line 4447 "Zend/zend_language_scanner.c"
yy367:
YYDEBUG(367, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4509,11 +4513,11 @@ yy377:
++YYCURSOR;
YYDEBUG(380, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1317 "Zend/zend_language_scanner.l"
+#line 1321 "Zend/zend_language_scanner.l"
{
return T_STRING_CAST;
}
-#line 4517 "Zend/zend_language_scanner.c"
+#line 4521 "Zend/zend_language_scanner.c"
yy381:
YYDEBUG(381, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4546,11 +4550,11 @@ yy384:
++YYCURSOR;
YYDEBUG(387, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1321 "Zend/zend_language_scanner.l"
+#line 1325 "Zend/zend_language_scanner.l"
{
return T_ARRAY_CAST;
}
-#line 4554 "Zend/zend_language_scanner.c"
+#line 4558 "Zend/zend_language_scanner.c"
yy388:
YYDEBUG(388, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4588,11 +4592,11 @@ yy392:
++YYCURSOR;
YYDEBUG(395, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1325 "Zend/zend_language_scanner.l"
+#line 1329 "Zend/zend_language_scanner.l"
{
return T_OBJECT_CAST;
}
-#line 4596 "Zend/zend_language_scanner.c"
+#line 4600 "Zend/zend_language_scanner.c"
yy396:
YYDEBUG(396, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4633,11 +4637,11 @@ yy401:
++YYCURSOR;
YYDEBUG(403, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1329 "Zend/zend_language_scanner.l"
+#line 1333 "Zend/zend_language_scanner.l"
{
return T_BOOL_CAST;
}
-#line 4641 "Zend/zend_language_scanner.c"
+#line 4645 "Zend/zend_language_scanner.c"
yy404:
YYDEBUG(404, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4697,11 +4701,11 @@ yy412:
++YYCURSOR;
YYDEBUG(415, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1333 "Zend/zend_language_scanner.l"
+#line 1337 "Zend/zend_language_scanner.l"
{
return T_UNSET_CAST;
}
-#line 4705 "Zend/zend_language_scanner.c"
+#line 4709 "Zend/zend_language_scanner.c"
yy416:
YYDEBUG(416, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4715,11 +4719,11 @@ yy417:
}
YYDEBUG(418, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1305 "Zend/zend_language_scanner.l"
+#line 1309 "Zend/zend_language_scanner.l"
{
return T_VAR;
}
-#line 4723 "Zend/zend_language_scanner.c"
+#line 4727 "Zend/zend_language_scanner.c"
yy419:
YYDEBUG(419, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4739,11 +4743,11 @@ yy421:
}
YYDEBUG(422, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1297 "Zend/zend_language_scanner.l"
+#line 1301 "Zend/zend_language_scanner.l"
{
return T_NEW;
}
-#line 4747 "Zend/zend_language_scanner.c"
+#line 4751 "Zend/zend_language_scanner.c"
yy423:
YYDEBUG(423, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4782,11 +4786,11 @@ yy429:
}
YYDEBUG(430, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1357 "Zend/zend_language_scanner.l"
+#line 1361 "Zend/zend_language_scanner.l"
{
return T_NAMESPACE;
}
-#line 4790 "Zend/zend_language_scanner.c"
+#line 4794 "Zend/zend_language_scanner.c"
yy431:
YYDEBUG(431, *YYCURSOR);
++YYCURSOR;
@@ -4795,22 +4799,22 @@ yy431:
yy432:
YYDEBUG(432, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1926 "Zend/zend_language_scanner.l"
+#line 1930 "Zend/zend_language_scanner.l"
{
BEGIN(INITIAL);
return T_CLOSE_TAG; /* implicit ';' at php-end tag */
}
-#line 4804 "Zend/zend_language_scanner.c"
+#line 4808 "Zend/zend_language_scanner.c"
yy433:
YYDEBUG(433, *YYCURSOR);
++YYCURSOR;
YYDEBUG(434, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1293 "Zend/zend_language_scanner.l"
+#line 1297 "Zend/zend_language_scanner.l"
{
return T_COALESCE;
}
-#line 4814 "Zend/zend_language_scanner.c"
+#line 4818 "Zend/zend_language_scanner.c"
yy435:
YYDEBUG(435, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4841,11 +4845,11 @@ yy439:
++YYCURSOR;
YYDEBUG(440, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1489 "Zend/zend_language_scanner.l"
+#line 1493 "Zend/zend_language_scanner.l"
{
return T_CONCAT_EQUAL;
}
-#line 4849 "Zend/zend_language_scanner.c"
+#line 4853 "Zend/zend_language_scanner.c"
yy441:
YYDEBUG(441, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4854,21 +4858,21 @@ yy441:
++YYCURSOR;
YYDEBUG(443, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1289 "Zend/zend_language_scanner.l"
+#line 1293 "Zend/zend_language_scanner.l"
{
return T_ELLIPSIS;
}
-#line 4862 "Zend/zend_language_scanner.c"
+#line 4866 "Zend/zend_language_scanner.c"
yy444:
YYDEBUG(444, *YYCURSOR);
++YYCURSOR;
YYDEBUG(445, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1281 "Zend/zend_language_scanner.l"
+#line 1285 "Zend/zend_language_scanner.l"
{
return T_PAAMAYIM_NEKUDOTAYIM;
}
-#line 4872 "Zend/zend_language_scanner.c"
+#line 4876 "Zend/zend_language_scanner.c"
yy446:
YYDEBUG(446, *YYCURSOR);
++YYCURSOR;
@@ -4890,32 +4894,32 @@ yy448:
++YYCURSOR;
YYDEBUG(449, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1469 "Zend/zend_language_scanner.l"
+#line 1473 "Zend/zend_language_scanner.l"
{
return T_MINUS_EQUAL;
}
-#line 4898 "Zend/zend_language_scanner.c"
+#line 4902 "Zend/zend_language_scanner.c"
yy450:
YYDEBUG(450, *YYCURSOR);
++YYCURSOR;
YYDEBUG(451, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1433 "Zend/zend_language_scanner.l"
+#line 1437 "Zend/zend_language_scanner.l"
{
return T_DEC;
}
-#line 4908 "Zend/zend_language_scanner.c"
+#line 4912 "Zend/zend_language_scanner.c"
yy452:
YYDEBUG(452, *YYCURSOR);
++YYCURSOR;
YYDEBUG(453, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1255 "Zend/zend_language_scanner.l"
+#line 1259 "Zend/zend_language_scanner.l"
{
yy_push_state(ST_LOOKING_FOR_PROPERTY);
return T_OBJECT_OPERATOR;
}
-#line 4919 "Zend/zend_language_scanner.c"
+#line 4923 "Zend/zend_language_scanner.c"
yy454:
YYDEBUG(454, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4960,11 +4964,11 @@ yy459:
}
YYDEBUG(460, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1405 "Zend/zend_language_scanner.l"
+#line 1409 "Zend/zend_language_scanner.l"
{
return T_PUBLIC;
}
-#line 4968 "Zend/zend_language_scanner.c"
+#line 4972 "Zend/zend_language_scanner.c"
yy461:
YYDEBUG(461, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5019,11 +5023,11 @@ yy468:
}
YYDEBUG(469, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1401 "Zend/zend_language_scanner.l"
+#line 1405 "Zend/zend_language_scanner.l"
{
return T_PROTECTED;
}
-#line 5027 "Zend/zend_language_scanner.c"
+#line 5031 "Zend/zend_language_scanner.c"
yy470:
YYDEBUG(470, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5053,11 +5057,11 @@ yy474:
}
YYDEBUG(475, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1397 "Zend/zend_language_scanner.l"
+#line 1401 "Zend/zend_language_scanner.l"
{
return T_PRIVATE;
}
-#line 5061 "Zend/zend_language_scanner.c"
+#line 5065 "Zend/zend_language_scanner.c"
yy476:
YYDEBUG(476, *YYCURSOR);
++YYCURSOR;
@@ -5066,11 +5070,11 @@ yy476:
}
YYDEBUG(477, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1231 "Zend/zend_language_scanner.l"
+#line 1235 "Zend/zend_language_scanner.l"
{
return T_PRINT;
}
-#line 5074 "Zend/zend_language_scanner.c"
+#line 5078 "Zend/zend_language_scanner.c"
yy478:
YYDEBUG(478, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5095,11 +5099,11 @@ yy481:
}
YYDEBUG(482, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1223 "Zend/zend_language_scanner.l"
+#line 1227 "Zend/zend_language_scanner.l"
{
return T_GOTO;
}
-#line 5103 "Zend/zend_language_scanner.c"
+#line 5107 "Zend/zend_language_scanner.c"
yy483:
YYDEBUG(483, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5123,11 +5127,11 @@ yy486:
}
YYDEBUG(487, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1369 "Zend/zend_language_scanner.l"
+#line 1373 "Zend/zend_language_scanner.l"
{
return T_GLOBAL;
}
-#line 5131 "Zend/zend_language_scanner.c"
+#line 5135 "Zend/zend_language_scanner.c"
yy488:
YYDEBUG(488, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5164,11 +5168,11 @@ yy494:
}
YYDEBUG(495, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1215 "Zend/zend_language_scanner.l"
+#line 1219 "Zend/zend_language_scanner.l"
{
return T_BREAK;
}
-#line 5172 "Zend/zend_language_scanner.c"
+#line 5176 "Zend/zend_language_scanner.c"
yy496:
YYDEBUG(496, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5208,11 +5212,11 @@ yy502:
}
YYDEBUG(503, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1199 "Zend/zend_language_scanner.l"
+#line 1203 "Zend/zend_language_scanner.l"
{
return T_SWITCH;
}
-#line 5216 "Zend/zend_language_scanner.c"
+#line 5220 "Zend/zend_language_scanner.c"
yy504:
YYDEBUG(504, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5236,11 +5240,11 @@ yy507:
}
YYDEBUG(508, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1385 "Zend/zend_language_scanner.l"
+#line 1389 "Zend/zend_language_scanner.l"
{
return T_STATIC;
}
-#line 5244 "Zend/zend_language_scanner.c"
+#line 5248 "Zend/zend_language_scanner.c"
yy509:
YYDEBUG(509, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5267,11 +5271,11 @@ yy512:
}
YYDEBUG(513, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1195 "Zend/zend_language_scanner.l"
+#line 1199 "Zend/zend_language_scanner.l"
{
return T_AS;
}
-#line 5275 "Zend/zend_language_scanner.c"
+#line 5279 "Zend/zend_language_scanner.c"
yy514:
YYDEBUG(514, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5290,11 +5294,11 @@ yy516:
}
YYDEBUG(517, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1421 "Zend/zend_language_scanner.l"
+#line 1425 "Zend/zend_language_scanner.l"
{
return T_ARRAY;
}
-#line 5298 "Zend/zend_language_scanner.c"
+#line 5302 "Zend/zend_language_scanner.c"
yy518:
YYDEBUG(518, *YYCURSOR);
++YYCURSOR;
@@ -5303,11 +5307,11 @@ yy518:
}
YYDEBUG(519, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1529 "Zend/zend_language_scanner.l"
+#line 1533 "Zend/zend_language_scanner.l"
{
return T_LOGICAL_AND;
}
-#line 5311 "Zend/zend_language_scanner.c"
+#line 5315 "Zend/zend_language_scanner.c"
yy520:
YYDEBUG(520, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5341,11 +5345,11 @@ yy525:
}
YYDEBUG(526, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1389 "Zend/zend_language_scanner.l"
+#line 1393 "Zend/zend_language_scanner.l"
{
return T_ABSTRACT;
}
-#line 5349 "Zend/zend_language_scanner.c"
+#line 5353 "Zend/zend_language_scanner.c"
yy527:
YYDEBUG(527, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5369,11 +5373,11 @@ yy530:
}
YYDEBUG(531, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1155 "Zend/zend_language_scanner.l"
+#line 1159 "Zend/zend_language_scanner.l"
{
return T_WHILE;
}
-#line 5377 "Zend/zend_language_scanner.c"
+#line 5381 "Zend/zend_language_scanner.c"
yy532:
YYDEBUG(532, *YYCURSOR);
++YYCURSOR;
@@ -5382,11 +5386,11 @@ yy532:
}
YYDEBUG(533, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1139 "Zend/zend_language_scanner.l"
+#line 1143 "Zend/zend_language_scanner.l"
{
return T_IF;
}
-#line 5390 "Zend/zend_language_scanner.c"
+#line 5394 "Zend/zend_language_scanner.c"
yy534:
YYDEBUG(534, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5438,11 +5442,11 @@ yy539:
}
YYDEBUG(540, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1373 "Zend/zend_language_scanner.l"
+#line 1377 "Zend/zend_language_scanner.l"
{
return T_ISSET;
}
-#line 5446 "Zend/zend_language_scanner.c"
+#line 5450 "Zend/zend_language_scanner.c"
yy541:
YYDEBUG(541, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5496,11 +5500,11 @@ yy547:
yy548:
YYDEBUG(548, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1341 "Zend/zend_language_scanner.l"
+#line 1345 "Zend/zend_language_scanner.l"
{
return T_INCLUDE;
}
-#line 5504 "Zend/zend_language_scanner.c"
+#line 5508 "Zend/zend_language_scanner.c"
yy549:
YYDEBUG(549, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5529,11 +5533,11 @@ yy553:
}
YYDEBUG(554, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1345 "Zend/zend_language_scanner.l"
+#line 1349 "Zend/zend_language_scanner.l"
{
return T_INCLUDE_ONCE;
}
-#line 5537 "Zend/zend_language_scanner.c"
+#line 5541 "Zend/zend_language_scanner.c"
yy555:
YYDEBUG(555, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5567,11 +5571,11 @@ yy560:
}
YYDEBUG(561, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1239 "Zend/zend_language_scanner.l"
+#line 1243 "Zend/zend_language_scanner.l"
{
return T_INTERFACE;
}
-#line 5575 "Zend/zend_language_scanner.c"
+#line 5579 "Zend/zend_language_scanner.c"
yy562:
YYDEBUG(562, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5621,11 +5625,11 @@ yy568:
}
YYDEBUG(569, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1365 "Zend/zend_language_scanner.l"
+#line 1369 "Zend/zend_language_scanner.l"
{
return T_INSTEADOF;
}
-#line 5629 "Zend/zend_language_scanner.c"
+#line 5633 "Zend/zend_language_scanner.c"
yy570:
YYDEBUG(570, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5654,11 +5658,11 @@ yy574:
}
YYDEBUG(575, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1191 "Zend/zend_language_scanner.l"
+#line 1195 "Zend/zend_language_scanner.l"
{
return T_INSTANCEOF;
}
-#line 5662 "Zend/zend_language_scanner.c"
+#line 5666 "Zend/zend_language_scanner.c"
yy576:
YYDEBUG(576, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5702,11 +5706,11 @@ yy583:
}
YYDEBUG(584, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1251 "Zend/zend_language_scanner.l"
+#line 1255 "Zend/zend_language_scanner.l"
{
return T_IMPLEMENTS;
}
-#line 5710 "Zend/zend_language_scanner.c"
+#line 5714 "Zend/zend_language_scanner.c"
yy585:
YYDEBUG(585, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5734,11 +5738,11 @@ yy586:
}
YYDEBUG(588, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1123 "Zend/zend_language_scanner.l"
+#line 1127 "Zend/zend_language_scanner.l"
{
return T_TRY;
}
-#line 5742 "Zend/zend_language_scanner.c"
+#line 5746 "Zend/zend_language_scanner.c"
yy589:
YYDEBUG(589, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5757,11 +5761,11 @@ yy591:
}
YYDEBUG(592, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1243 "Zend/zend_language_scanner.l"
+#line 1247 "Zend/zend_language_scanner.l"
{
return T_TRAIT;
}
-#line 5765 "Zend/zend_language_scanner.c"
+#line 5769 "Zend/zend_language_scanner.c"
yy593:
YYDEBUG(593, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5780,11 +5784,11 @@ yy595:
}
YYDEBUG(596, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1135 "Zend/zend_language_scanner.l"
+#line 1139 "Zend/zend_language_scanner.l"
{
return T_THROW;
}
-#line 5788 "Zend/zend_language_scanner.c"
+#line 5792 "Zend/zend_language_scanner.c"
yy597:
YYDEBUG(597, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5802,1081 +5806,1136 @@ yy599:
if (yych != 'd') goto yy150;
yy600:
YYDEBUG(600, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yybm[0+yych] & 4) {
goto yy149;
}
+ if (yych <= '\f') {
+ if (yych <= 0x08) goto yy601;
+ if (yych <= '\n') goto yy602;
+ } else {
+ if (yych <= '\r') goto yy602;
+ if (yych == ' ') goto yy602;
+ }
+yy601:
YYDEBUG(601, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1119 "Zend/zend_language_scanner.l"
+#line 1123 "Zend/zend_language_scanner.l"
{
return T_YIELD;
}
-#line 5816 "Zend/zend_language_scanner.c"
+#line 5829 "Zend/zend_language_scanner.c"
yy602:
YYDEBUG(602, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(4);
+ yych = *YYCURSOR;
+ YYDEBUG(603, *YYCURSOR);
+ if (yych <= 0x1F) {
+ if (yych <= '\n') {
+ if (yych <= 0x08) goto yy157;
+ goto yy602;
+ } else {
+ if (yych == '\r') goto yy602;
+ goto yy157;
+ }
+ } else {
+ if (yych <= 'F') {
+ if (yych <= ' ') goto yy602;
+ if (yych <= 'E') goto yy157;
+ } else {
+ if (yych != 'f') goto yy157;
+ }
+ }
+ YYDEBUG(604, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy605;
+ if (yych != 'r') goto yy157;
+yy605:
+ YYDEBUG(605, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'O') goto yy606;
+ if (yych != 'o') goto yy157;
+yy606:
+ YYDEBUG(606, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'M') goto yy607;
+ if (yych != 'm') goto yy157;
+yy607:
+ YYDEBUG(607, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(608, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1119 "Zend/zend_language_scanner.l"
+ {
+ return T_YIELD_FROM;
+}
+#line 5875 "Zend/zend_language_scanner.c"
+yy609:
+ YYDEBUG(609, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'T') {
- if (yych == 'Q') goto yy604;
+ if (yych == 'Q') goto yy611;
if (yych <= 'S') goto yy150;
} else {
if (yych <= 'q') {
if (yych <= 'p') goto yy150;
- goto yy604;
+ goto yy611;
} else {
if (yych != 't') goto yy150;
}
}
- YYDEBUG(603, *YYCURSOR);
+ YYDEBUG(610, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'U') goto yy616;
- if (yych == 'u') goto yy616;
+ if (yych == 'U') goto yy623;
+ if (yych == 'u') goto yy623;
goto yy150;
-yy604:
- YYDEBUG(604, *YYCURSOR);
+yy611:
+ YYDEBUG(611, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'U') goto yy605;
+ if (yych == 'U') goto yy612;
if (yych != 'u') goto yy150;
-yy605:
- YYDEBUG(605, *YYCURSOR);
+yy612:
+ YYDEBUG(612, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'I') goto yy606;
+ if (yych == 'I') goto yy613;
if (yych != 'i') goto yy150;
-yy606:
- YYDEBUG(606, *YYCURSOR);
+yy613:
+ YYDEBUG(613, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'R') goto yy607;
+ if (yych == 'R') goto yy614;
if (yych != 'r') goto yy150;
-yy607:
- YYDEBUG(607, *YYCURSOR);
+yy614:
+ YYDEBUG(614, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'E') goto yy608;
+ if (yych == 'E') goto yy615;
if (yych != 'e') goto yy150;
-yy608:
- YYDEBUG(608, *YYCURSOR);
+yy615:
+ YYDEBUG(615, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) <= '^') {
if (yych <= '9') {
if (yych >= '0') goto yy149;
} else {
- if (yych <= '@') goto yy609;
+ if (yych <= '@') goto yy616;
if (yych <= 'Z') goto yy149;
}
} else {
if (yych <= '`') {
- if (yych <= '_') goto yy610;
+ if (yych <= '_') goto yy617;
} else {
if (yych <= 'z') goto yy149;
if (yych >= 0x7F) goto yy149;
}
}
-yy609:
- YYDEBUG(609, *YYCURSOR);
+yy616:
+ YYDEBUG(616, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1349 "Zend/zend_language_scanner.l"
+#line 1353 "Zend/zend_language_scanner.l"
{
return T_REQUIRE;
}
-#line 5881 "Zend/zend_language_scanner.c"
-yy610:
- YYDEBUG(610, *YYCURSOR);
+#line 5940 "Zend/zend_language_scanner.c"
+yy617:
+ YYDEBUG(617, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'O') goto yy611;
+ if (yych == 'O') goto yy618;
if (yych != 'o') goto yy150;
-yy611:
- YYDEBUG(611, *YYCURSOR);
+yy618:
+ YYDEBUG(618, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'N') goto yy612;
+ if (yych == 'N') goto yy619;
if (yych != 'n') goto yy150;
-yy612:
- YYDEBUG(612, *YYCURSOR);
+yy619:
+ YYDEBUG(619, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'C') goto yy613;
+ if (yych == 'C') goto yy620;
if (yych != 'c') goto yy150;
-yy613:
- YYDEBUG(613, *YYCURSOR);
+yy620:
+ YYDEBUG(620, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'E') goto yy614;
+ if (yych == 'E') goto yy621;
if (yych != 'e') goto yy150;
-yy614:
- YYDEBUG(614, *YYCURSOR);
+yy621:
+ YYDEBUG(621, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(615, *YYCURSOR);
+ YYDEBUG(622, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1353 "Zend/zend_language_scanner.l"
+#line 1357 "Zend/zend_language_scanner.l"
{
return T_REQUIRE_ONCE;
}
-#line 5914 "Zend/zend_language_scanner.c"
-yy616:
- YYDEBUG(616, *YYCURSOR);
+#line 5973 "Zend/zend_language_scanner.c"
+yy623:
+ YYDEBUG(623, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'R') goto yy617;
+ if (yych == 'R') goto yy624;
if (yych != 'r') goto yy150;
-yy617:
- YYDEBUG(617, *YYCURSOR);
+yy624:
+ YYDEBUG(624, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'N') goto yy618;
+ if (yych == 'N') goto yy625;
if (yych != 'n') goto yy150;
-yy618:
- YYDEBUG(618, *YYCURSOR);
+yy625:
+ YYDEBUG(625, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(619, *YYCURSOR);
+ YYDEBUG(626, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1115 "Zend/zend_language_scanner.l"
{
return T_RETURN;
}
-#line 5937 "Zend/zend_language_scanner.c"
-yy620:
- YYDEBUG(620, *YYCURSOR);
+#line 5996 "Zend/zend_language_scanner.c"
+yy627:
+ YYDEBUG(627, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'T') {
if (yych <= 'L') {
if (yych <= 'K') goto yy150;
- goto yy643;
+ goto yy650;
} else {
if (yych <= 'R') goto yy150;
- if (yych <= 'S') goto yy642;
- goto yy641;
+ if (yych <= 'S') goto yy649;
+ goto yy648;
}
} else {
if (yych <= 'r') {
- if (yych == 'l') goto yy643;
+ if (yych == 'l') goto yy650;
goto yy150;
} else {
- if (yych <= 's') goto yy642;
- if (yych <= 't') goto yy641;
+ if (yych <= 's') goto yy649;
+ if (yych <= 't') goto yy648;
goto yy150;
}
}
-yy621:
- YYDEBUG(621, *YYCURSOR);
+yy628:
+ YYDEBUG(628, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'O') {
- if (yych == 'A') goto yy633;
+ if (yych == 'A') goto yy640;
if (yych <= 'N') goto yy150;
- goto yy634;
+ goto yy641;
} else {
if (yych <= 'a') {
if (yych <= '`') goto yy150;
- goto yy633;
+ goto yy640;
} else {
- if (yych == 'o') goto yy634;
+ if (yych == 'o') goto yy641;
goto yy150;
}
}
-yy622:
- YYDEBUG(622, *YYCURSOR);
+yy629:
+ YYDEBUG(629, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'N') goto yy623;
+ if (yych == 'N') goto yy630;
if (yych != 'n') goto yy150;
-yy623:
- YYDEBUG(623, *YYCURSOR);
+yy630:
+ YYDEBUG(630, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'T') {
if (yych <= 'R') goto yy150;
- if (yych >= 'T') goto yy625;
+ if (yych >= 'T') goto yy632;
} else {
if (yych <= 'r') goto yy150;
- if (yych <= 's') goto yy624;
- if (yych <= 't') goto yy625;
+ if (yych <= 's') goto yy631;
+ if (yych <= 't') goto yy632;
goto yy150;
}
-yy624:
- YYDEBUG(624, *YYCURSOR);
+yy631:
+ YYDEBUG(631, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'T') goto yy631;
- if (yych == 't') goto yy631;
+ if (yych == 'T') goto yy638;
+ if (yych == 't') goto yy638;
goto yy150;
-yy625:
- YYDEBUG(625, *YYCURSOR);
+yy632:
+ YYDEBUG(632, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'I') goto yy626;
+ if (yych == 'I') goto yy633;
if (yych != 'i') goto yy150;
-yy626:
- YYDEBUG(626, *YYCURSOR);
+yy633:
+ YYDEBUG(633, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'N') goto yy627;
+ if (yych == 'N') goto yy634;
if (yych != 'n') goto yy150;
-yy627:
- YYDEBUG(627, *YYCURSOR);
+yy634:
+ YYDEBUG(634, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'U') goto yy628;
+ if (yych == 'U') goto yy635;
if (yych != 'u') goto yy150;
-yy628:
- YYDEBUG(628, *YYCURSOR);
+yy635:
+ YYDEBUG(635, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'E') goto yy629;
+ if (yych == 'E') goto yy636;
if (yych != 'e') goto yy150;
-yy629:
- YYDEBUG(629, *YYCURSOR);
+yy636:
+ YYDEBUG(636, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(630, *YYCURSOR);
+ YYDEBUG(637, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1219 "Zend/zend_language_scanner.l"
+#line 1223 "Zend/zend_language_scanner.l"
{
return T_CONTINUE;
}
-#line 6031 "Zend/zend_language_scanner.c"
-yy631:
- YYDEBUG(631, *YYCURSOR);
+#line 6090 "Zend/zend_language_scanner.c"
+yy638:
+ YYDEBUG(638, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(632, *YYCURSOR);
+ YYDEBUG(639, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1111 "Zend/zend_language_scanner.l"
{
return T_CONST;
}
-#line 6044 "Zend/zend_language_scanner.c"
-yy633:
- YYDEBUG(633, *YYCURSOR);
+#line 6103 "Zend/zend_language_scanner.c"
+yy640:
+ YYDEBUG(640, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'S') goto yy638;
- if (yych == 's') goto yy638;
+ if (yych == 'S') goto yy645;
+ if (yych == 's') goto yy645;
goto yy150;
-yy634:
- YYDEBUG(634, *YYCURSOR);
+yy641:
+ YYDEBUG(641, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'N') goto yy635;
+ if (yych == 'N') goto yy642;
if (yych != 'n') goto yy150;
-yy635:
- YYDEBUG(635, *YYCURSOR);
+yy642:
+ YYDEBUG(642, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'E') goto yy636;
+ if (yych == 'E') goto yy643;
if (yych != 'e') goto yy150;
-yy636:
- YYDEBUG(636, *YYCURSOR);
+yy643:
+ YYDEBUG(643, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(637, *YYCURSOR);
+ YYDEBUG(644, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1301 "Zend/zend_language_scanner.l"
+#line 1305 "Zend/zend_language_scanner.l"
{
return T_CLONE;
}
-#line 6073 "Zend/zend_language_scanner.c"
-yy638:
- YYDEBUG(638, *YYCURSOR);
+#line 6132 "Zend/zend_language_scanner.c"
+yy645:
+ YYDEBUG(645, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'S') goto yy639;
+ if (yych == 'S') goto yy646;
if (yych != 's') goto yy150;
-yy639:
- YYDEBUG(639, *YYCURSOR);
+yy646:
+ YYDEBUG(646, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(640, *YYCURSOR);
+ YYDEBUG(647, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1235 "Zend/zend_language_scanner.l"
+#line 1239 "Zend/zend_language_scanner.l"
{
return T_CLASS;
}
-#line 6091 "Zend/zend_language_scanner.c"
-yy641:
- YYDEBUG(641, *YYCURSOR);
+#line 6150 "Zend/zend_language_scanner.c"
+yy648:
+ YYDEBUG(648, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'C') goto yy652;
- if (yych == 'c') goto yy652;
+ if (yych == 'C') goto yy659;
+ if (yych == 'c') goto yy659;
goto yy150;
-yy642:
- YYDEBUG(642, *YYCURSOR);
+yy649:
+ YYDEBUG(649, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'E') goto yy650;
- if (yych == 'e') goto yy650;
+ if (yych == 'E') goto yy657;
+ if (yych == 'e') goto yy657;
goto yy150;
-yy643:
- YYDEBUG(643, *YYCURSOR);
+yy650:
+ YYDEBUG(650, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'L') goto yy644;
+ if (yych == 'L') goto yy651;
if (yych != 'l') goto yy150;
-yy644:
- YYDEBUG(644, *YYCURSOR);
+yy651:
+ YYDEBUG(651, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'A') goto yy645;
+ if (yych == 'A') goto yy652;
if (yych != 'a') goto yy150;
-yy645:
- YYDEBUG(645, *YYCURSOR);
+yy652:
+ YYDEBUG(652, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'B') goto yy646;
+ if (yych == 'B') goto yy653;
if (yych != 'b') goto yy150;
-yy646:
- YYDEBUG(646, *YYCURSOR);
+yy653:
+ YYDEBUG(653, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'L') goto yy647;
+ if (yych == 'L') goto yy654;
if (yych != 'l') goto yy150;
-yy647:
- YYDEBUG(647, *YYCURSOR);
+yy654:
+ YYDEBUG(654, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'E') goto yy648;
+ if (yych == 'E') goto yy655;
if (yych != 'e') goto yy150;
-yy648:
- YYDEBUG(648, *YYCURSOR);
+yy655:
+ YYDEBUG(655, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(649, *YYCURSOR);
+ YYDEBUG(656, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1425 "Zend/zend_language_scanner.l"
+#line 1429 "Zend/zend_language_scanner.l"
{
return T_CALLABLE;
}
-#line 6141 "Zend/zend_language_scanner.c"
-yy650:
- YYDEBUG(650, *YYCURSOR);
+#line 6200 "Zend/zend_language_scanner.c"
+yy657:
+ YYDEBUG(657, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(651, *YYCURSOR);
+ YYDEBUG(658, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1207 "Zend/zend_language_scanner.l"
+#line 1211 "Zend/zend_language_scanner.l"
{
return T_CASE;
}
-#line 6154 "Zend/zend_language_scanner.c"
-yy652:
- YYDEBUG(652, *YYCURSOR);
+#line 6213 "Zend/zend_language_scanner.c"
+yy659:
+ YYDEBUG(659, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'H') goto yy653;
+ if (yych == 'H') goto yy660;
if (yych != 'h') goto yy150;
-yy653:
- YYDEBUG(653, *YYCURSOR);
+yy660:
+ YYDEBUG(660, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(654, *YYCURSOR);
+ YYDEBUG(661, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1127 "Zend/zend_language_scanner.l"
+#line 1131 "Zend/zend_language_scanner.l"
{
return T_CATCH;
}
-#line 6172 "Zend/zend_language_scanner.c"
-yy655:
- YYDEBUG(655, *YYCURSOR);
+#line 6231 "Zend/zend_language_scanner.c"
+yy662:
+ YYDEBUG(662, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'N') goto yy672;
- if (yych == 'n') goto yy672;
+ if (yych == 'N') goto yy679;
+ if (yych == 'n') goto yy679;
goto yy150;
-yy656:
- YYDEBUG(656, *YYCURSOR);
+yy663:
+ YYDEBUG(663, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'R') goto yy665;
- if (yych == 'r') goto yy665;
+ if (yych == 'R') goto yy672;
+ if (yych == 'r') goto yy672;
goto yy150;
-yy657:
- YYDEBUG(657, *YYCURSOR);
+yy664:
+ YYDEBUG(664, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'N') goto yy658;
+ if (yych == 'N') goto yy665;
if (yych != 'n') goto yy150;
-yy658:
- YYDEBUG(658, *YYCURSOR);
+yy665:
+ YYDEBUG(665, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'C') goto yy659;
+ if (yych == 'C') goto yy666;
if (yych != 'c') goto yy150;
-yy659:
- YYDEBUG(659, *YYCURSOR);
+yy666:
+ YYDEBUG(666, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'T') goto yy660;
+ if (yych == 'T') goto yy667;
if (yych != 't') goto yy150;
-yy660:
- YYDEBUG(660, *YYCURSOR);
+yy667:
+ YYDEBUG(667, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'I') goto yy661;
+ if (yych == 'I') goto yy668;
if (yych != 'i') goto yy150;
-yy661:
- YYDEBUG(661, *YYCURSOR);
+yy668:
+ YYDEBUG(668, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'O') goto yy662;
+ if (yych == 'O') goto yy669;
if (yych != 'o') goto yy150;
-yy662:
- YYDEBUG(662, *YYCURSOR);
+yy669:
+ YYDEBUG(669, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'N') goto yy663;
+ if (yych == 'N') goto yy670;
if (yych != 'n') goto yy150;
-yy663:
- YYDEBUG(663, *YYCURSOR);
+yy670:
+ YYDEBUG(670, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(664, *YYCURSOR);
+ YYDEBUG(671, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1107 "Zend/zend_language_scanner.l"
{
return T_FUNCTION;
}
-#line 6227 "Zend/zend_language_scanner.c"
-yy665:
- YYDEBUG(665, *YYCURSOR);
+#line 6286 "Zend/zend_language_scanner.c"
+yy672:
+ YYDEBUG(672, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) <= '^') {
if (yych <= '@') {
- if (yych <= '/') goto yy666;
+ if (yych <= '/') goto yy673;
if (yych <= '9') goto yy149;
} else {
- if (yych == 'E') goto yy667;
+ if (yych == 'E') goto yy674;
if (yych <= 'Z') goto yy149;
}
} else {
if (yych <= 'd') {
if (yych != '`') goto yy149;
} else {
- if (yych <= 'e') goto yy667;
+ if (yych <= 'e') goto yy674;
if (yych <= 'z') goto yy149;
if (yych >= 0x7F) goto yy149;
}
}
-yy666:
- YYDEBUG(666, *YYCURSOR);
+yy673:
+ YYDEBUG(673, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1167 "Zend/zend_language_scanner.l"
+#line 1171 "Zend/zend_language_scanner.l"
{
return T_FOR;
}
-#line 6255 "Zend/zend_language_scanner.c"
-yy667:
- YYDEBUG(667, *YYCURSOR);
+#line 6314 "Zend/zend_language_scanner.c"
+yy674:
+ YYDEBUG(674, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'A') goto yy668;
+ if (yych == 'A') goto yy675;
if (yych != 'a') goto yy150;
-yy668:
- YYDEBUG(668, *YYCURSOR);
+yy675:
+ YYDEBUG(675, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'C') goto yy669;
+ if (yych == 'C') goto yy676;
if (yych != 'c') goto yy150;
-yy669:
- YYDEBUG(669, *YYCURSOR);
+yy676:
+ YYDEBUG(676, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'H') goto yy670;
+ if (yych == 'H') goto yy677;
if (yych != 'h') goto yy150;
-yy670:
- YYDEBUG(670, *YYCURSOR);
+yy677:
+ YYDEBUG(677, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(671, *YYCURSOR);
+ YYDEBUG(678, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1175 "Zend/zend_language_scanner.l"
+#line 1179 "Zend/zend_language_scanner.l"
{
return T_FOREACH;
}
-#line 6283 "Zend/zend_language_scanner.c"
-yy672:
- YYDEBUG(672, *YYCURSOR);
+#line 6342 "Zend/zend_language_scanner.c"
+yy679:
+ YYDEBUG(679, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'A') goto yy673;
+ if (yych == 'A') goto yy680;
if (yych != 'a') goto yy150;
-yy673:
- YYDEBUG(673, *YYCURSOR);
+yy680:
+ YYDEBUG(680, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'L') goto yy674;
+ if (yych == 'L') goto yy681;
if (yych != 'l') goto yy150;
-yy674:
- YYDEBUG(674, *YYCURSOR);
+yy681:
+ YYDEBUG(681, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) <= '^') {
if (yych <= '@') {
- if (yych <= '/') goto yy675;
+ if (yych <= '/') goto yy682;
if (yych <= '9') goto yy149;
} else {
- if (yych == 'L') goto yy676;
+ if (yych == 'L') goto yy683;
if (yych <= 'Z') goto yy149;
}
} else {
if (yych <= 'k') {
if (yych != '`') goto yy149;
} else {
- if (yych <= 'l') goto yy676;
+ if (yych <= 'l') goto yy683;
if (yych <= 'z') goto yy149;
if (yych >= 0x7F) goto yy149;
}
}
-yy675:
- YYDEBUG(675, *YYCURSOR);
+yy682:
+ YYDEBUG(682, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1393 "Zend/zend_language_scanner.l"
+#line 1397 "Zend/zend_language_scanner.l"
{
return T_FINAL;
}
-#line 6321 "Zend/zend_language_scanner.c"
-yy676:
- YYDEBUG(676, *YYCURSOR);
+#line 6380 "Zend/zend_language_scanner.c"
+yy683:
+ YYDEBUG(683, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'Y') goto yy677;
+ if (yych == 'Y') goto yy684;
if (yych != 'y') goto yy150;
-yy677:
- YYDEBUG(677, *YYCURSOR);
+yy684:
+ YYDEBUG(684, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(678, *YYCURSOR);
+ YYDEBUG(685, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1131 "Zend/zend_language_scanner.l"
+#line 1135 "Zend/zend_language_scanner.l"
{
return T_FINALLY;
}
-#line 6339 "Zend/zend_language_scanner.c"
-yy679:
- YYDEBUG(679, *YYCURSOR);
+#line 6398 "Zend/zend_language_scanner.c"
+yy686:
+ YYDEBUG(686, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'F') {
- if (yych == 'C') goto yy685;
+ if (yych == 'C') goto yy692;
if (yych <= 'E') goto yy150;
- goto yy686;
+ goto yy693;
} else {
if (yych <= 'c') {
if (yych <= 'b') goto yy150;
- goto yy685;
+ goto yy692;
} else {
- if (yych == 'f') goto yy686;
+ if (yych == 'f') goto yy693;
goto yy150;
}
}
-yy680:
- YYDEBUG(680, *YYCURSOR);
+yy687:
+ YYDEBUG(687, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'E') goto yy683;
- if (yych == 'e') goto yy683;
+ if (yych == 'E') goto yy690;
+ if (yych == 'e') goto yy690;
goto yy150;
-yy681:
- YYDEBUG(681, *YYCURSOR);
+yy688:
+ YYDEBUG(688, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(682, *YYCURSOR);
+ YYDEBUG(689, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1163 "Zend/zend_language_scanner.l"
+#line 1167 "Zend/zend_language_scanner.l"
{
return T_DO;
}
-#line 6374 "Zend/zend_language_scanner.c"
-yy683:
- YYDEBUG(683, *YYCURSOR);
+#line 6433 "Zend/zend_language_scanner.c"
+yy690:
+ YYDEBUG(690, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(684, *YYCURSOR);
+ YYDEBUG(691, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1103 "Zend/zend_language_scanner.l"
{
return T_EXIT;
}
-#line 6387 "Zend/zend_language_scanner.c"
-yy685:
- YYDEBUG(685, *YYCURSOR);
+#line 6446 "Zend/zend_language_scanner.c"
+yy692:
+ YYDEBUG(692, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'L') goto yy692;
- if (yych == 'l') goto yy692;
+ if (yych == 'L') goto yy699;
+ if (yych == 'l') goto yy699;
goto yy150;
-yy686:
- YYDEBUG(686, *YYCURSOR);
+yy693:
+ YYDEBUG(693, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'A') goto yy687;
+ if (yych == 'A') goto yy694;
if (yych != 'a') goto yy150;
-yy687:
- YYDEBUG(687, *YYCURSOR);
+yy694:
+ YYDEBUG(694, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'U') goto yy688;
+ if (yych == 'U') goto yy695;
if (yych != 'u') goto yy150;
-yy688:
- YYDEBUG(688, *YYCURSOR);
+yy695:
+ YYDEBUG(695, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'L') goto yy689;
+ if (yych == 'L') goto yy696;
if (yych != 'l') goto yy150;
-yy689:
- YYDEBUG(689, *YYCURSOR);
+yy696:
+ YYDEBUG(696, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'T') goto yy690;
+ if (yych == 'T') goto yy697;
if (yych != 't') goto yy150;
-yy690:
- YYDEBUG(690, *YYCURSOR);
+yy697:
+ YYDEBUG(697, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(691, *YYCURSOR);
+ YYDEBUG(698, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1211 "Zend/zend_language_scanner.l"
+#line 1215 "Zend/zend_language_scanner.l"
{
return T_DEFAULT;
}
-#line 6426 "Zend/zend_language_scanner.c"
-yy692:
- YYDEBUG(692, *YYCURSOR);
+#line 6485 "Zend/zend_language_scanner.c"
+yy699:
+ YYDEBUG(699, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'A') goto yy693;
+ if (yych == 'A') goto yy700;
if (yych != 'a') goto yy150;
-yy693:
- YYDEBUG(693, *YYCURSOR);
+yy700:
+ YYDEBUG(700, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'R') goto yy694;
+ if (yych == 'R') goto yy701;
if (yych != 'r') goto yy150;
-yy694:
- YYDEBUG(694, *YYCURSOR);
+yy701:
+ YYDEBUG(701, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'E') goto yy695;
+ if (yych == 'E') goto yy702;
if (yych != 'e') goto yy150;
-yy695:
- YYDEBUG(695, *YYCURSOR);
+yy702:
+ YYDEBUG(702, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(696, *YYCURSOR);
+ YYDEBUG(703, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1183 "Zend/zend_language_scanner.l"
+#line 1187 "Zend/zend_language_scanner.l"
{
return T_DECLARE;
}
-#line 6454 "Zend/zend_language_scanner.c"
-yy697:
- YYDEBUG(697, *YYCURSOR);
+#line 6513 "Zend/zend_language_scanner.c"
+yy704:
+ YYDEBUG(704, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'H') goto yy759;
- if (yych == 'h') goto yy759;
+ if (yych == 'H') goto yy766;
+ if (yych == 'h') goto yy766;
goto yy150;
-yy698:
- YYDEBUG(698, *YYCURSOR);
+yy705:
+ YYDEBUG(705, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'S') goto yy753;
- if (yych == 's') goto yy753;
+ if (yych == 'S') goto yy760;
+ if (yych == 's') goto yy760;
goto yy150;
-yy699:
- YYDEBUG(699, *YYCURSOR);
+yy706:
+ YYDEBUG(706, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'P') goto yy749;
- if (yych == 'p') goto yy749;
+ if (yych == 'P') goto yy756;
+ if (yych == 'p') goto yy756;
goto yy150;
-yy700:
- YYDEBUG(700, *YYCURSOR);
+yy707:
+ YYDEBUG(707, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'D') goto yy715;
- if (yych == 'd') goto yy715;
+ if (yych == 'D') goto yy722;
+ if (yych == 'd') goto yy722;
goto yy150;
-yy701:
- YYDEBUG(701, *YYCURSOR);
+yy708:
+ YYDEBUG(708, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'A') goto yy712;
- if (yych == 'a') goto yy712;
+ if (yych == 'A') goto yy719;
+ if (yych == 'a') goto yy719;
goto yy150;
-yy702:
- YYDEBUG(702, *YYCURSOR);
+yy709:
+ YYDEBUG(709, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'T') {
- if (yych == 'I') goto yy703;
+ if (yych == 'I') goto yy710;
if (yych <= 'S') goto yy150;
- goto yy704;
+ goto yy711;
} else {
if (yych <= 'i') {
if (yych <= 'h') goto yy150;
} else {
- if (yych == 't') goto yy704;
+ if (yych == 't') goto yy711;
goto yy150;
}
}
-yy703:
- YYDEBUG(703, *YYCURSOR);
+yy710:
+ YYDEBUG(710, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'T') goto yy710;
- if (yych == 't') goto yy710;
+ if (yych == 'T') goto yy717;
+ if (yych == 't') goto yy717;
goto yy150;
-yy704:
- YYDEBUG(704, *YYCURSOR);
+yy711:
+ YYDEBUG(711, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'E') goto yy705;
+ if (yych == 'E') goto yy712;
if (yych != 'e') goto yy150;
-yy705:
- YYDEBUG(705, *YYCURSOR);
+yy712:
+ YYDEBUG(712, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'N') goto yy706;
+ if (yych == 'N') goto yy713;
if (yych != 'n') goto yy150;
-yy706:
- YYDEBUG(706, *YYCURSOR);
+yy713:
+ YYDEBUG(713, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'D') goto yy707;
+ if (yych == 'D') goto yy714;
if (yych != 'd') goto yy150;
-yy707:
- YYDEBUG(707, *YYCURSOR);
+yy714:
+ YYDEBUG(714, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'S') goto yy708;
+ if (yych == 'S') goto yy715;
if (yych != 's') goto yy150;
-yy708:
- YYDEBUG(708, *YYCURSOR);
+yy715:
+ YYDEBUG(715, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(709, *YYCURSOR);
+ YYDEBUG(716, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1247 "Zend/zend_language_scanner.l"
+#line 1251 "Zend/zend_language_scanner.l"
{
return T_EXTENDS;
}
-#line 6538 "Zend/zend_language_scanner.c"
-yy710:
- YYDEBUG(710, *YYCURSOR);
+#line 6597 "Zend/zend_language_scanner.c"
+yy717:
+ YYDEBUG(717, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(711, *YYCURSOR);
+ YYDEBUG(718, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 1099 "Zend/zend_language_scanner.l"
{
return T_EXIT;
}
-#line 6551 "Zend/zend_language_scanner.c"
-yy712:
- YYDEBUG(712, *YYCURSOR);
+#line 6610 "Zend/zend_language_scanner.c"
+yy719:
+ YYDEBUG(719, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'L') goto yy713;
+ if (yych == 'L') goto yy720;
if (yych != 'l') goto yy150;
-yy713:
- YYDEBUG(713, *YYCURSOR);
+yy720:
+ YYDEBUG(720, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(714, *YYCURSOR);
+ YYDEBUG(721, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1337 "Zend/zend_language_scanner.l"
+#line 1341 "Zend/zend_language_scanner.l"
{
return T_EVAL;
}
-#line 6569 "Zend/zend_language_scanner.c"
-yy715:
- YYDEBUG(715, *YYCURSOR);
+#line 6628 "Zend/zend_language_scanner.c"
+yy722:
+ YYDEBUG(722, *YYCURSOR);
yych = *++YYCURSOR;
YYDEBUG(-1, yych);
switch (yych) {
case 'D':
- case 'd': goto yy716;
+ case 'd': goto yy723;
case 'F':
- case 'f': goto yy717;
+ case 'f': goto yy724;
case 'I':
- case 'i': goto yy718;
+ case 'i': goto yy725;
case 'S':
- case 's': goto yy719;
+ case 's': goto yy726;
case 'W':
- case 'w': goto yy720;
+ case 'w': goto yy727;
default: goto yy150;
}
-yy716:
- YYDEBUG(716, *YYCURSOR);
+yy723:
+ YYDEBUG(723, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'E') goto yy742;
- if (yych == 'e') goto yy742;
+ if (yych == 'E') goto yy749;
+ if (yych == 'e') goto yy749;
goto yy150;
-yy717:
- YYDEBUG(717, *YYCURSOR);
+yy724:
+ YYDEBUG(724, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'O') goto yy734;
- if (yych == 'o') goto yy734;
+ if (yych == 'O') goto yy741;
+ if (yych == 'o') goto yy741;
goto yy150;
-yy718:
- YYDEBUG(718, *YYCURSOR);
+yy725:
+ YYDEBUG(725, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'F') goto yy732;
- if (yych == 'f') goto yy732;
+ if (yych == 'F') goto yy739;
+ if (yych == 'f') goto yy739;
goto yy150;
-yy719:
- YYDEBUG(719, *YYCURSOR);
+yy726:
+ YYDEBUG(726, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'W') goto yy726;
- if (yych == 'w') goto yy726;
+ if (yych == 'W') goto yy733;
+ if (yych == 'w') goto yy733;
goto yy150;
-yy720:
- YYDEBUG(720, *YYCURSOR);
+yy727:
+ YYDEBUG(727, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'H') goto yy721;
+ if (yych == 'H') goto yy728;
if (yych != 'h') goto yy150;
-yy721:
- YYDEBUG(721, *YYCURSOR);
+yy728:
+ YYDEBUG(728, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'I') goto yy722;
+ if (yych == 'I') goto yy729;
if (yych != 'i') goto yy150;
-yy722:
- YYDEBUG(722, *YYCURSOR);
+yy729:
+ YYDEBUG(729, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'L') goto yy723;
+ if (yych == 'L') goto yy730;
if (yych != 'l') goto yy150;
-yy723:
- YYDEBUG(723, *YYCURSOR);
+yy730:
+ YYDEBUG(730, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'E') goto yy724;
+ if (yych == 'E') goto yy731;
if (yych != 'e') goto yy150;
-yy724:
- YYDEBUG(724, *YYCURSOR);
+yy731:
+ YYDEBUG(731, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(725, *YYCURSOR);
+ YYDEBUG(732, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1159 "Zend/zend_language_scanner.l"
+#line 1163 "Zend/zend_language_scanner.l"
{
return T_ENDWHILE;
}
-#line 6643 "Zend/zend_language_scanner.c"
-yy726:
- YYDEBUG(726, *YYCURSOR);
+#line 6702 "Zend/zend_language_scanner.c"
+yy733:
+ YYDEBUG(733, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'I') goto yy727;
+ if (yych == 'I') goto yy734;
if (yych != 'i') goto yy150;
-yy727:
- YYDEBUG(727, *YYCURSOR);
+yy734:
+ YYDEBUG(734, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'T') goto yy728;
+ if (yych == 'T') goto yy735;
if (yych != 't') goto yy150;
-yy728:
- YYDEBUG(728, *YYCURSOR);
+yy735:
+ YYDEBUG(735, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'C') goto yy729;
+ if (yych == 'C') goto yy736;
if (yych != 'c') goto yy150;
-yy729:
- YYDEBUG(729, *YYCURSOR);
+yy736:
+ YYDEBUG(736, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'H') goto yy730;
+ if (yych == 'H') goto yy737;
if (yych != 'h') goto yy150;
-yy730:
- YYDEBUG(730, *YYCURSOR);
+yy737:
+ YYDEBUG(737, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(731, *YYCURSOR);
+ YYDEBUG(738, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1203 "Zend/zend_language_scanner.l"
+#line 1207 "Zend/zend_language_scanner.l"
{
return T_ENDSWITCH;
}
-#line 6676 "Zend/zend_language_scanner.c"
-yy732:
- YYDEBUG(732, *YYCURSOR);
+#line 6735 "Zend/zend_language_scanner.c"
+yy739:
+ YYDEBUG(739, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(733, *YYCURSOR);
+ YYDEBUG(740, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1147 "Zend/zend_language_scanner.l"
+#line 1151 "Zend/zend_language_scanner.l"
{
return T_ENDIF;
}
-#line 6689 "Zend/zend_language_scanner.c"
-yy734:
- YYDEBUG(734, *YYCURSOR);
+#line 6748 "Zend/zend_language_scanner.c"
+yy741:
+ YYDEBUG(741, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'R') goto yy735;
+ if (yych == 'R') goto yy742;
if (yych != 'r') goto yy150;
-yy735:
- YYDEBUG(735, *YYCURSOR);
+yy742:
+ YYDEBUG(742, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) <= '^') {
if (yych <= '@') {
- if (yych <= '/') goto yy736;
+ if (yych <= '/') goto yy743;
if (yych <= '9') goto yy149;
} else {
- if (yych == 'E') goto yy737;
+ if (yych == 'E') goto yy744;
if (yych <= 'Z') goto yy149;
}
} else {
if (yych <= 'd') {
if (yych != '`') goto yy149;
} else {
- if (yych <= 'e') goto yy737;
+ if (yych <= 'e') goto yy744;
if (yych <= 'z') goto yy149;
if (yych >= 0x7F) goto yy149;
}
}
-yy736:
- YYDEBUG(736, *YYCURSOR);
+yy743:
+ YYDEBUG(743, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1171 "Zend/zend_language_scanner.l"
+#line 1175 "Zend/zend_language_scanner.l"
{
return T_ENDFOR;
}
-#line 6722 "Zend/zend_language_scanner.c"
-yy737:
- YYDEBUG(737, *YYCURSOR);
+#line 6781 "Zend/zend_language_scanner.c"
+yy744:
+ YYDEBUG(744, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'A') goto yy738;
+ if (yych == 'A') goto yy745;
if (yych != 'a') goto yy150;
-yy738:
- YYDEBUG(738, *YYCURSOR);
+yy745:
+ YYDEBUG(745, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'C') goto yy739;
+ if (yych == 'C') goto yy746;
if (yych != 'c') goto yy150;
-yy739:
- YYDEBUG(739, *YYCURSOR);
+yy746:
+ YYDEBUG(746, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'H') goto yy740;
+ if (yych == 'H') goto yy747;
if (yych != 'h') goto yy150;
-yy740:
- YYDEBUG(740, *YYCURSOR);
+yy747:
+ YYDEBUG(747, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(741, *YYCURSOR);
+ YYDEBUG(748, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1179 "Zend/zend_language_scanner.l"
+#line 1183 "Zend/zend_language_scanner.l"
{
return T_ENDFOREACH;
}
-#line 6750 "Zend/zend_language_scanner.c"
-yy742:
- YYDEBUG(742, *YYCURSOR);
+#line 6809 "Zend/zend_language_scanner.c"
+yy749:
+ YYDEBUG(749, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'C') goto yy743;
+ if (yych == 'C') goto yy750;
if (yych != 'c') goto yy150;
-yy743:
- YYDEBUG(743, *YYCURSOR);
+yy750:
+ YYDEBUG(750, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'L') goto yy744;
+ if (yych == 'L') goto yy751;
if (yych != 'l') goto yy150;
-yy744:
- YYDEBUG(744, *YYCURSOR);
+yy751:
+ YYDEBUG(751, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'A') goto yy745;
+ if (yych == 'A') goto yy752;
if (yych != 'a') goto yy150;
-yy745:
- YYDEBUG(745, *YYCURSOR);
+yy752:
+ YYDEBUG(752, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'R') goto yy746;
+ if (yych == 'R') goto yy753;
if (yych != 'r') goto yy150;
-yy746:
- YYDEBUG(746, *YYCURSOR);
+yy753:
+ YYDEBUG(753, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'E') goto yy747;
+ if (yych == 'E') goto yy754;
if (yych != 'e') goto yy150;
-yy747:
- YYDEBUG(747, *YYCURSOR);
+yy754:
+ YYDEBUG(754, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(748, *YYCURSOR);
+ YYDEBUG(755, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1187 "Zend/zend_language_scanner.l"
+#line 1191 "Zend/zend_language_scanner.l"
{
return T_ENDDECLARE;
}
-#line 6788 "Zend/zend_language_scanner.c"
-yy749:
- YYDEBUG(749, *YYCURSOR);
+#line 6847 "Zend/zend_language_scanner.c"
+yy756:
+ YYDEBUG(756, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'T') goto yy750;
+ if (yych == 'T') goto yy757;
if (yych != 't') goto yy150;
-yy750:
- YYDEBUG(750, *YYCURSOR);
+yy757:
+ YYDEBUG(757, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'Y') goto yy751;
+ if (yych == 'Y') goto yy758;
if (yych != 'y') goto yy150;
-yy751:
- YYDEBUG(751, *YYCURSOR);
+yy758:
+ YYDEBUG(758, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(752, *YYCURSOR);
+ YYDEBUG(759, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1377 "Zend/zend_language_scanner.l"
+#line 1381 "Zend/zend_language_scanner.l"
{
return T_EMPTY;
}
-#line 6811 "Zend/zend_language_scanner.c"
-yy753:
- YYDEBUG(753, *YYCURSOR);
+#line 6870 "Zend/zend_language_scanner.c"
+yy760:
+ YYDEBUG(760, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'E') goto yy754;
+ if (yych == 'E') goto yy761;
if (yych != 'e') goto yy150;
-yy754:
- YYDEBUG(754, *YYCURSOR);
+yy761:
+ YYDEBUG(761, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) <= '^') {
if (yych <= '@') {
- if (yych <= '/') goto yy755;
+ if (yych <= '/') goto yy762;
if (yych <= '9') goto yy149;
} else {
- if (yych == 'I') goto yy756;
+ if (yych == 'I') goto yy763;
if (yych <= 'Z') goto yy149;
}
} else {
if (yych <= 'h') {
if (yych != '`') goto yy149;
} else {
- if (yych <= 'i') goto yy756;
+ if (yych <= 'i') goto yy763;
if (yych <= 'z') goto yy149;
if (yych >= 0x7F) goto yy149;
}
}
-yy755:
- YYDEBUG(755, *YYCURSOR);
+yy762:
+ YYDEBUG(762, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1151 "Zend/zend_language_scanner.l"
+#line 1155 "Zend/zend_language_scanner.l"
{
return T_ELSE;
}
-#line 6844 "Zend/zend_language_scanner.c"
-yy756:
- YYDEBUG(756, *YYCURSOR);
+#line 6903 "Zend/zend_language_scanner.c"
+yy763:
+ YYDEBUG(763, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'F') goto yy757;
+ if (yych == 'F') goto yy764;
if (yych != 'f') goto yy150;
-yy757:
- YYDEBUG(757, *YYCURSOR);
+yy764:
+ YYDEBUG(764, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(758, *YYCURSOR);
+ YYDEBUG(765, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1143 "Zend/zend_language_scanner.l"
+#line 1147 "Zend/zend_language_scanner.l"
{
return T_ELSEIF;
}
-#line 6862 "Zend/zend_language_scanner.c"
-yy759:
- YYDEBUG(759, *YYCURSOR);
+#line 6921 "Zend/zend_language_scanner.c"
+yy766:
+ YYDEBUG(766, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'O') goto yy760;
+ if (yych == 'O') goto yy767;
if (yych != 'o') goto yy150;
-yy760:
- YYDEBUG(760, *YYCURSOR);
+yy767:
+ YYDEBUG(767, *YYCURSOR);
++YYCURSOR;
if (yybm[0+(yych = *YYCURSOR)] & 4) {
goto yy149;
}
- YYDEBUG(761, *YYCURSOR);
+ YYDEBUG(768, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1227 "Zend/zend_language_scanner.l"
+#line 1231 "Zend/zend_language_scanner.l"
{
return T_ECHO;
}
-#line 6880 "Zend/zend_language_scanner.c"
+#line 6939 "Zend/zend_language_scanner.c"
}
/* *********************************** */
yyc_ST_LOOKING_FOR_PROPERTY:
@@ -6915,111 +6974,111 @@ yyc_ST_LOOKING_FOR_PROPERTY:
64, 64, 64, 64, 64, 64, 64, 64,
64, 64, 64, 64, 64, 64, 64, 64,
};
- YYDEBUG(762, *YYCURSOR);
+ YYDEBUG(769, *YYCURSOR);
YYFILL(2);
yych = *YYCURSOR;
if (yych <= '-') {
if (yych <= '\r') {
- if (yych <= 0x08) goto yy770;
- if (yych <= '\n') goto yy764;
- if (yych <= '\f') goto yy770;
+ if (yych <= 0x08) goto yy777;
+ if (yych <= '\n') goto yy771;
+ if (yych <= '\f') goto yy777;
} else {
- if (yych == ' ') goto yy764;
- if (yych <= ',') goto yy770;
- goto yy766;
+ if (yych == ' ') goto yy771;
+ if (yych <= ',') goto yy777;
+ goto yy773;
}
} else {
if (yych <= '_') {
- if (yych <= '@') goto yy770;
- if (yych <= 'Z') goto yy768;
- if (yych <= '^') goto yy770;
- goto yy768;
+ if (yych <= '@') goto yy777;
+ if (yych <= 'Z') goto yy775;
+ if (yych <= '^') goto yy777;
+ goto yy775;
} else {
- if (yych <= '`') goto yy770;
- if (yych <= 'z') goto yy768;
- if (yych <= '~') goto yy770;
- goto yy768;
+ if (yych <= '`') goto yy777;
+ if (yych <= 'z') goto yy775;
+ if (yych <= '~') goto yy777;
+ goto yy775;
}
}
-yy764:
- YYDEBUG(764, *YYCURSOR);
+yy771:
+ YYDEBUG(771, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
- goto yy776;
-yy765:
- YYDEBUG(765, *YYCURSOR);
+ goto yy783;
+yy772:
+ YYDEBUG(772, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1260 "Zend/zend_language_scanner.l"
+#line 1264 "Zend/zend_language_scanner.l"
{
HANDLE_NEWLINES(yytext, yyleng);
return T_WHITESPACE;
}
-#line 6958 "Zend/zend_language_scanner.c"
-yy766:
- YYDEBUG(766, *YYCURSOR);
+#line 7017 "Zend/zend_language_scanner.c"
+yy773:
+ YYDEBUG(773, *YYCURSOR);
++YYCURSOR;
- if ((yych = *YYCURSOR) == '>') goto yy773;
-yy767:
- YYDEBUG(767, *YYCURSOR);
+ if ((yych = *YYCURSOR) == '>') goto yy780;
+yy774:
+ YYDEBUG(774, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1275 "Zend/zend_language_scanner.l"
+#line 1279 "Zend/zend_language_scanner.l"
{
yyless(0);
yy_pop_state();
goto restart;
}
-#line 6972 "Zend/zend_language_scanner.c"
-yy768:
- YYDEBUG(768, *YYCURSOR);
+#line 7031 "Zend/zend_language_scanner.c"
+yy775:
+ YYDEBUG(775, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
- goto yy772;
-yy769:
- YYDEBUG(769, *YYCURSOR);
+ goto yy779;
+yy776:
+ YYDEBUG(776, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1269 "Zend/zend_language_scanner.l"
+#line 1273 "Zend/zend_language_scanner.l"
{
yy_pop_state();
zend_copy_value(zendlval, yytext, yyleng);
return T_STRING;
}
-#line 6987 "Zend/zend_language_scanner.c"
-yy770:
- YYDEBUG(770, *YYCURSOR);
+#line 7046 "Zend/zend_language_scanner.c"
+yy777:
+ YYDEBUG(777, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy767;
-yy771:
- YYDEBUG(771, *YYCURSOR);
+ goto yy774;
+yy778:
+ YYDEBUG(778, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy772:
- YYDEBUG(772, *YYCURSOR);
+yy779:
+ YYDEBUG(779, *YYCURSOR);
if (yybm[0+yych] & 64) {
- goto yy771;
+ goto yy778;
}
- goto yy769;
-yy773:
- YYDEBUG(773, *YYCURSOR);
+ goto yy776;
+yy780:
+ YYDEBUG(780, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(774, *YYCURSOR);
+ YYDEBUG(781, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1265 "Zend/zend_language_scanner.l"
+#line 1269 "Zend/zend_language_scanner.l"
{
return T_OBJECT_OPERATOR;
}
-#line 7012 "Zend/zend_language_scanner.c"
-yy775:
- YYDEBUG(775, *YYCURSOR);
+#line 7071 "Zend/zend_language_scanner.c"
+yy782:
+ YYDEBUG(782, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy776:
- YYDEBUG(776, *YYCURSOR);
+yy783:
+ YYDEBUG(783, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy775;
+ goto yy782;
}
- goto yy765;
+ goto yy772;
}
/* *********************************** */
yyc_ST_LOOKING_FOR_VARNAME:
@@ -7058,74 +7117,74 @@ yyc_ST_LOOKING_FOR_VARNAME:
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
};
- YYDEBUG(777, *YYCURSOR);
+ YYDEBUG(784, *YYCURSOR);
YYFILL(2);
yych = *YYCURSOR;
if (yych <= '_') {
- if (yych <= '@') goto yy781;
- if (yych <= 'Z') goto yy779;
- if (yych <= '^') goto yy781;
+ if (yych <= '@') goto yy788;
+ if (yych <= 'Z') goto yy786;
+ if (yych <= '^') goto yy788;
} else {
- if (yych <= '`') goto yy781;
- if (yych <= 'z') goto yy779;
- if (yych <= '~') goto yy781;
+ if (yych <= '`') goto yy788;
+ if (yych <= 'z') goto yy786;
+ if (yych <= '~') goto yy788;
}
-yy779:
- YYDEBUG(779, *YYCURSOR);
+yy786:
+ YYDEBUG(786, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '_') {
if (yych <= '@') {
- if (yych <= '/') goto yy780;
- if (yych <= '9') goto yy783;
+ if (yych <= '/') goto yy787;
+ if (yych <= '9') goto yy790;
} else {
- if (yych <= '[') goto yy783;
- if (yych >= '_') goto yy783;
+ if (yych <= '[') goto yy790;
+ if (yych >= '_') goto yy790;
}
} else {
if (yych <= '|') {
- if (yych <= '`') goto yy780;
- if (yych <= 'z') goto yy783;
+ if (yych <= '`') goto yy787;
+ if (yych <= 'z') goto yy790;
} else {
- if (yych != '~') goto yy783;
+ if (yych != '~') goto yy790;
}
}
-yy780:
- YYDEBUG(780, *YYCURSOR);
+yy787:
+ YYDEBUG(787, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1580 "Zend/zend_language_scanner.l"
+#line 1584 "Zend/zend_language_scanner.l"
{
yyless(0);
yy_pop_state();
yy_push_state(ST_IN_SCRIPTING);
goto restart;
}
-#line 7104 "Zend/zend_language_scanner.c"
-yy781:
- YYDEBUG(781, *YYCURSOR);
+#line 7163 "Zend/zend_language_scanner.c"
+yy788:
+ YYDEBUG(788, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy780;
-yy782:
- YYDEBUG(782, *YYCURSOR);
+ goto yy787;
+yy789:
+ YYDEBUG(789, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy783:
- YYDEBUG(783, *YYCURSOR);
+yy790:
+ YYDEBUG(790, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy782;
+ goto yy789;
}
- if (yych == '[') goto yy785;
- if (yych == '}') goto yy785;
- YYDEBUG(784, *YYCURSOR);
+ if (yych == '[') goto yy792;
+ if (yych == '}') goto yy792;
+ YYDEBUG(791, *YYCURSOR);
YYCURSOR = YYMARKER;
- goto yy780;
-yy785:
- YYDEBUG(785, *YYCURSOR);
+ goto yy787;
+yy792:
+ YYDEBUG(792, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(786, *YYCURSOR);
+ YYDEBUG(793, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1571 "Zend/zend_language_scanner.l"
+#line 1575 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
zend_copy_value(zendlval, yytext, yyleng);
@@ -7133,18 +7192,18 @@ yy785:
yy_push_state(ST_IN_SCRIPTING);
return T_STRING_VARNAME;
}
-#line 7137 "Zend/zend_language_scanner.c"
+#line 7196 "Zend/zend_language_scanner.c"
}
/* *********************************** */
yyc_ST_NOWDOC:
- YYDEBUG(787, *YYCURSOR);
+ YYDEBUG(794, *YYCURSOR);
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(789, *YYCURSOR);
+ YYDEBUG(796, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(790, *YYCURSOR);
+ YYDEBUG(797, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2304 "Zend/zend_language_scanner.l"
+#line 2308 "Zend/zend_language_scanner.l"
{
int newline = 0;
@@ -7200,7 +7259,7 @@ nowdoc_scan_done:
HANDLE_NEWLINES(yytext, yyleng - newline);
return T_ENCAPSED_AND_WHITESPACE;
}
-#line 7204 "Zend/zend_language_scanner.c"
+#line 7263 "Zend/zend_language_scanner.c"
/* *********************************** */
yyc_ST_VAR_OFFSET:
{
@@ -7238,76 +7297,76 @@ yyc_ST_VAR_OFFSET:
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16,
};
- YYDEBUG(791, *YYCURSOR);
+ YYDEBUG(798, *YYCURSOR);
YYFILL(3);
yych = *YYCURSOR;
if (yych <= '/') {
if (yych <= ' ') {
if (yych <= '\f') {
- if (yych <= 0x08) goto yy805;
- if (yych <= '\n') goto yy801;
- goto yy805;
+ if (yych <= 0x08) goto yy812;
+ if (yych <= '\n') goto yy808;
+ goto yy812;
} else {
- if (yych <= '\r') goto yy801;
- if (yych <= 0x1F) goto yy805;
- goto yy801;
+ if (yych <= '\r') goto yy808;
+ if (yych <= 0x1F) goto yy812;
+ goto yy808;
}
} else {
if (yych <= '$') {
- if (yych <= '"') goto yy800;
- if (yych <= '#') goto yy801;
- goto yy796;
+ if (yych <= '"') goto yy807;
+ if (yych <= '#') goto yy808;
+ goto yy803;
} else {
- if (yych == '\'') goto yy801;
- goto yy800;
+ if (yych == '\'') goto yy808;
+ goto yy807;
}
}
} else {
if (yych <= '\\') {
if (yych <= '@') {
- if (yych <= '0') goto yy793;
- if (yych <= '9') goto yy795;
- goto yy800;
+ if (yych <= '0') goto yy800;
+ if (yych <= '9') goto yy802;
+ goto yy807;
} else {
- if (yych <= 'Z') goto yy803;
- if (yych <= '[') goto yy800;
- goto yy801;
+ if (yych <= 'Z') goto yy810;
+ if (yych <= '[') goto yy807;
+ goto yy808;
}
} else {
if (yych <= '_') {
- if (yych <= ']') goto yy798;
- if (yych <= '^') goto yy800;
- goto yy803;
+ if (yych <= ']') goto yy805;
+ if (yych <= '^') goto yy807;
+ goto yy810;
} else {
- if (yych <= '`') goto yy800;
- if (yych <= 'z') goto yy803;
- if (yych <= '~') goto yy800;
- goto yy803;
+ if (yych <= '`') goto yy807;
+ if (yych <= 'z') goto yy810;
+ if (yych <= '~') goto yy807;
+ goto yy810;
}
}
}
-yy793:
- YYDEBUG(793, *YYCURSOR);
+yy800:
+ YYDEBUG(800, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= 'W') {
if (yych <= '9') {
- if (yych >= '0') goto yy817;
+ if (yych >= '0') goto yy824;
} else {
- if (yych == 'B') goto yy814;
+ if (yych == 'B') goto yy821;
}
} else {
if (yych <= 'b') {
- if (yych <= 'X') goto yy816;
- if (yych >= 'b') goto yy814;
+ if (yych <= 'X') goto yy823;
+ if (yych >= 'b') goto yy821;
} else {
- if (yych == 'x') goto yy816;
+ if (yych == 'x') goto yy823;
}
}
-yy794:
- YYDEBUG(794, *YYCURSOR);
+yy801:
+ YYDEBUG(801, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1685 "Zend/zend_language_scanner.l"
+#line 1689 "Zend/zend_language_scanner.l"
{ /* Offset could be treated as a long */
if (yyleng < MAX_LENGTH_OF_LONG - 1 || (yyleng == MAX_LENGTH_OF_LONG - 1 && strcmp(yytext, long_min_digits) < 0)) {
char *end;
@@ -7323,53 +7382,53 @@ string:
}
return T_NUM_STRING;
}
-#line 7327 "Zend/zend_language_scanner.c"
-yy795:
- YYDEBUG(795, *YYCURSOR);
+#line 7386 "Zend/zend_language_scanner.c"
+yy802:
+ YYDEBUG(802, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy813;
-yy796:
- YYDEBUG(796, *YYCURSOR);
+ goto yy820;
+yy803:
+ YYDEBUG(803, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) <= '_') {
- if (yych <= '@') goto yy797;
- if (yych <= 'Z') goto yy809;
- if (yych >= '_') goto yy809;
+ if (yych <= '@') goto yy804;
+ if (yych <= 'Z') goto yy816;
+ if (yych >= '_') goto yy816;
} else {
- if (yych <= '`') goto yy797;
- if (yych <= 'z') goto yy809;
- if (yych >= 0x7F) goto yy809;
+ if (yych <= '`') goto yy804;
+ if (yych <= 'z') goto yy816;
+ if (yych >= 0x7F) goto yy816;
}
-yy797:
- YYDEBUG(797, *YYCURSOR);
+yy804:
+ YYDEBUG(804, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1845 "Zend/zend_language_scanner.l"
+#line 1849 "Zend/zend_language_scanner.l"
{
/* Only '[' can be valid, but returning other tokens will allow a more explicit parse error */
return yytext[0];
}
-#line 7352 "Zend/zend_language_scanner.c"
-yy798:
- YYDEBUG(798, *YYCURSOR);
+#line 7411 "Zend/zend_language_scanner.c"
+yy805:
+ YYDEBUG(805, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(799, *YYCURSOR);
+ YYDEBUG(806, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1840 "Zend/zend_language_scanner.l"
+#line 1844 "Zend/zend_language_scanner.l"
{
yy_pop_state();
return ']';
}
-#line 7363 "Zend/zend_language_scanner.c"
-yy800:
- YYDEBUG(800, *YYCURSOR);
+#line 7422 "Zend/zend_language_scanner.c"
+yy807:
+ YYDEBUG(807, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy797;
-yy801:
- YYDEBUG(801, *YYCURSOR);
+ goto yy804;
+yy808:
+ YYDEBUG(808, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(802, *YYCURSOR);
+ YYDEBUG(809, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1850 "Zend/zend_language_scanner.l"
+#line 1854 "Zend/zend_language_scanner.l"
{
/* Invalid rule to return a more explicit parse error with proper line number */
yyless(0);
@@ -7377,27 +7436,27 @@ yy801:
ZVAL_NULL(zendlval);
return T_ENCAPSED_AND_WHITESPACE;
}
-#line 7381 "Zend/zend_language_scanner.c"
-yy803:
- YYDEBUG(803, *YYCURSOR);
+#line 7440 "Zend/zend_language_scanner.c"
+yy810:
+ YYDEBUG(810, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
- goto yy808;
-yy804:
- YYDEBUG(804, *YYCURSOR);
+ goto yy815;
+yy811:
+ YYDEBUG(811, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1858 "Zend/zend_language_scanner.l"
+#line 1862 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, yytext, yyleng);
return T_STRING;
}
-#line 7395 "Zend/zend_language_scanner.c"
-yy805:
- YYDEBUG(805, *YYCURSOR);
+#line 7454 "Zend/zend_language_scanner.c"
+yy812:
+ YYDEBUG(812, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(806, *YYCURSOR);
+ YYDEBUG(813, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2361 "Zend/zend_language_scanner.l"
+#line 2365 "Zend/zend_language_scanner.l"
{
if (YYCURSOR > YYLIMIT) {
return 0;
@@ -7406,115 +7465,115 @@ yy805:
zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
goto restart;
}
-#line 7410 "Zend/zend_language_scanner.c"
-yy807:
- YYDEBUG(807, *YYCURSOR);
+#line 7469 "Zend/zend_language_scanner.c"
+yy814:
+ YYDEBUG(814, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy808:
- YYDEBUG(808, *YYCURSOR);
+yy815:
+ YYDEBUG(815, *YYCURSOR);
if (yybm[0+yych] & 16) {
- goto yy807;
+ goto yy814;
}
- goto yy804;
-yy809:
- YYDEBUG(809, *YYCURSOR);
+ goto yy811;
+yy816:
+ YYDEBUG(816, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(810, *YYCURSOR);
+ YYDEBUG(817, *YYCURSOR);
if (yych <= '^') {
if (yych <= '9') {
- if (yych >= '0') goto yy809;
+ if (yych >= '0') goto yy816;
} else {
- if (yych <= '@') goto yy811;
- if (yych <= 'Z') goto yy809;
+ if (yych <= '@') goto yy818;
+ if (yych <= 'Z') goto yy816;
}
} else {
if (yych <= '`') {
- if (yych <= '_') goto yy809;
+ if (yych <= '_') goto yy816;
} else {
- if (yych <= 'z') goto yy809;
- if (yych >= 0x7F) goto yy809;
+ if (yych <= 'z') goto yy816;
+ if (yych >= 0x7F) goto yy816;
}
}
-yy811:
- YYDEBUG(811, *YYCURSOR);
+yy818:
+ YYDEBUG(818, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1835 "Zend/zend_language_scanner.l"
+#line 1839 "Zend/zend_language_scanner.l"
{
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
}
-#line 7451 "Zend/zend_language_scanner.c"
-yy812:
- YYDEBUG(812, *YYCURSOR);
+#line 7510 "Zend/zend_language_scanner.c"
+yy819:
+ YYDEBUG(819, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy813:
- YYDEBUG(813, *YYCURSOR);
+yy820:
+ YYDEBUG(820, *YYCURSOR);
if (yybm[0+yych] & 32) {
- goto yy812;
+ goto yy819;
}
- goto yy794;
-yy814:
- YYDEBUG(814, *YYCURSOR);
+ goto yy801;
+yy821:
+ YYDEBUG(821, *YYCURSOR);
yych = *++YYCURSOR;
if (yybm[0+yych] & 128) {
- goto yy822;
+ goto yy829;
}
-yy815:
- YYDEBUG(815, *YYCURSOR);
+yy822:
+ YYDEBUG(822, *YYCURSOR);
YYCURSOR = YYMARKER;
- goto yy794;
-yy816:
- YYDEBUG(816, *YYCURSOR);
+ goto yy801;
+yy823:
+ YYDEBUG(823, *YYCURSOR);
yych = *++YYCURSOR;
if (yybm[0+yych] & 64) {
- goto yy820;
+ goto yy827;
}
- goto yy815;
-yy817:
- YYDEBUG(817, *YYCURSOR);
+ goto yy822;
+yy824:
+ YYDEBUG(824, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(818, *YYCURSOR);
- if (yych <= '/') goto yy819;
- if (yych <= '9') goto yy817;
-yy819:
- YYDEBUG(819, *YYCURSOR);
+ YYDEBUG(825, *YYCURSOR);
+ if (yych <= '/') goto yy826;
+ if (yych <= '9') goto yy824;
+yy826:
+ YYDEBUG(826, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1701 "Zend/zend_language_scanner.l"
+#line 1705 "Zend/zend_language_scanner.l"
{ /* Offset must be treated as a string */
ZVAL_STRINGL(zendlval, yytext, yyleng);
return T_NUM_STRING;
}
-#line 7496 "Zend/zend_language_scanner.c"
-yy820:
- YYDEBUG(820, *YYCURSOR);
+#line 7555 "Zend/zend_language_scanner.c"
+yy827:
+ YYDEBUG(827, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(821, *YYCURSOR);
+ YYDEBUG(828, *YYCURSOR);
if (yybm[0+yych] & 64) {
- goto yy820;
+ goto yy827;
}
- goto yy819;
-yy822:
- YYDEBUG(822, *YYCURSOR);
+ goto yy826;
+yy829:
+ YYDEBUG(829, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(823, *YYCURSOR);
+ YYDEBUG(830, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy822;
+ goto yy829;
}
- goto yy819;
+ goto yy826;
}
}
-#line 2370 "Zend/zend_language_scanner.l"
+#line 2374 "Zend/zend_language_scanner.l"
}
diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l
index 5e46d5142a..205eef1b3a 100644
--- a/Zend/zend_language_scanner.l
+++ b/Zend/zend_language_scanner.l
@@ -1116,6 +1116,10 @@ NEWLINE ("\r"|"\n"|"\r\n")
return T_RETURN;
}
+<ST_IN_SCRIPTING>"yield"{WHITESPACE}"from" {
+ return T_YIELD_FROM;
+}
+
<ST_IN_SCRIPTING>"yield" {
return T_YIELD;
}
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 2d39662701..27c9084e30 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -3892,8 +3892,7 @@ ZEND_VM_HANDLER(161, ZEND_GENERATOR_RETURN, CONST|TMP|VAR|CV, ANY)
zval *retval;
zend_free_op free_op1;
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
retval = GET_OP1_ZVAL_PTR(BP_VAR_R);
@@ -7027,8 +7026,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[catch_op_num]);
ZEND_VM_CONTINUE();
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
zend_generator_close(generator, 1);
ZEND_VM_RETURN();
} else {
@@ -7061,8 +7059,7 @@ ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY)
ZEND_VM_CONTINUE();
case ZEND_USER_OPCODE_RETURN:
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
zend_generator_close(generator, 1);
ZEND_VM_RETURN();
} else {
@@ -7162,8 +7159,7 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -7297,6 +7293,99 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE
ZEND_VM_RETURN();
}
+ZEND_VM_HANDLER(142, ZEND_YIELD_FROM, CONST|TMP|VAR|CV, ANY)
+{
+ USE_OPLINE
+
+ /* The generator object is stored in EX(return_value) */
+ zend_generator *generator = (zend_generator *) EX(return_value);
+
+ zval *val;
+ zend_free_op free_op1;
+
+ SAVE_OPLINE();
+ val = GET_OP1_ZVAL_PTR_DEREF(BP_VAR_R);
+ if (Z_TYPE_P(val) == IS_ARRAY) {
+ ZVAL_COPY_VALUE(&generator->values, val);
+ if (OP1_TYPE != IS_TMP_VAR && Z_OPT_REFCOUNTED_P(val)) {
+ Z_ADDREF_P(val);
+ }
+ Z_FE_POS(generator->values) = 0;
+
+ FREE_OP1_IF_VAR();
+ } else if (OP1_TYPE != IS_CONST && Z_TYPE_P(val) == IS_OBJECT && Z_OBJCE_P(val)->get_iterator) {
+ zend_class_entry *ce = Z_OBJCE_P(val);
+ if (ce == zend_ce_generator) {
+ zend_generator *new_gen = (zend_generator *) Z_OBJ_P(val);
+
+ if (OP1_TYPE != IS_TMP_VAR) {
+ Z_ADDREF_P(val);
+ }
+ FREE_OP1_IF_VAR();
+
+ if (Z_ISUNDEF(new_gen->retval)) {
+ zend_generator_yield_from(generator, new_gen);
+ } else if (new_gen->execute_data == NULL) {
+ // TODO: Should be an engine exception
+ zend_error(E_RECOVERABLE_ERROR, "Generator passed to yield from was aborted without proper return and is unable to continue");
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+ } else {
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_COPY(EX_VAR(opline->result.var), &new_gen->retval);
+ }
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+ }
+ } else {
+ zend_object_iterator *iter = ce->get_iterator(ce, val, 0);
+ FREE_OP1();
+
+ if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) {
+ if (!EG(exception)) {
+ zend_throw_exception_ex(NULL, 0,
+ "Object of type %s did not create an Iterator", ce->name->val);
+ }
+ zend_throw_exception_internal(NULL);
+ HANDLE_EXCEPTION();
+ }
+
+ iter->index = 0;
+ if (iter->funcs->rewind) {
+ iter->funcs->rewind(iter);
+ if (UNEXPECTED(EG(exception) != NULL)) {
+ OBJ_RELEASE(&iter->std);
+ HANDLE_EXCEPTION();
+ }
+ }
+
+ ZVAL_OBJ(&generator->values, &iter->std);
+ }
+ } else {
+ // TODO: Should be an engine exception
+ zend_throw_exception(NULL, "Can use \"yield from\" only with arrays and Traversables", 0);
+ HANDLE_EXCEPTION();
+ }
+
+ /* This is the default return value
+ * when the expression is a Generator, it will be overwritten in zend_generator_resume() */
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_NULL(EX_VAR(opline->result.var));
+ }
+
+ /* We increment to the next op, so we are at the correct position when the
+ * generator is resumed. */
+ ZEND_VM_INC_OPCODE();
+
+ /* The GOTO VM uses a local opline variable. We need to set the opline
+ * variable in execute_data so we don't resume at an old position. */
+ SAVE_OPLINE();
+
+ ZEND_VM_RETURN();
+}
+
ZEND_VM_HANDLER(159, ZEND_DISCARD_EXCEPTION, ANY, ANY)
{
USE_OPLINE
@@ -7358,8 +7447,7 @@ ZEND_VM_HANDLER(163, ZEND_FAST_RET, ANY, ANY)
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE();
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
zend_generator_close(generator, 1);
ZEND_VM_RETURN();
} else {
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 122463396a..9b686775c4 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -1620,8 +1620,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[catch_op_num]);
ZEND_VM_CONTINUE();
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
zend_generator_close(generator, 1);
ZEND_VM_RETURN();
} else {
@@ -1654,8 +1653,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_
ZEND_VM_CONTINUE();
case ZEND_USER_OPCODE_RETURN:
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
zend_generator_close(generator, 1);
ZEND_VM_RETURN();
} else {
@@ -1733,8 +1731,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_RET_SPEC_HANDLER(ZEND_OPC
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE();
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
zend_generator_close(generator, 1);
ZEND_VM_RETURN();
} else {
@@ -3075,8 +3072,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_CONST_HA
zval *retval;
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
retval = EX_CONSTANT(opline->op1);
@@ -3966,6 +3962,96 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_CONST_HANDLER(Z
ZEND_VM_NEXT_OPCODE();
}
+static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+
+ /* The generator object is stored in EX(return_value) */
+ zend_generator *generator = (zend_generator *) EX(return_value);
+
+ zval *val;
+
+
+ SAVE_OPLINE();
+ val = EX_CONSTANT(opline->op1);
+ if (Z_TYPE_P(val) == IS_ARRAY) {
+ ZVAL_COPY_VALUE(&generator->values, val);
+ if (IS_CONST != IS_TMP_VAR && Z_OPT_REFCOUNTED_P(val)) {
+ Z_ADDREF_P(val);
+ }
+ Z_FE_POS(generator->values) = 0;
+
+ } else if (IS_CONST != IS_CONST && Z_TYPE_P(val) == IS_OBJECT && Z_OBJCE_P(val)->get_iterator) {
+ zend_class_entry *ce = Z_OBJCE_P(val);
+ if (ce == zend_ce_generator) {
+ zend_generator *new_gen = (zend_generator *) Z_OBJ_P(val);
+
+ if (IS_CONST != IS_TMP_VAR) {
+ Z_ADDREF_P(val);
+ }
+
+ if (Z_ISUNDEF(new_gen->retval)) {
+ zend_generator_yield_from(generator, new_gen);
+ } else if (new_gen->execute_data == NULL) {
+ // TODO: Should be an engine exception
+ zend_error(E_RECOVERABLE_ERROR, "Generator passed to yield from was aborted without proper return and is unable to continue");
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+ } else {
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_COPY(EX_VAR(opline->result.var), &new_gen->retval);
+ }
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+ }
+ } else {
+ zend_object_iterator *iter = ce->get_iterator(ce, val, 0);
+
+ if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) {
+ if (!EG(exception)) {
+ zend_throw_exception_ex(NULL, 0,
+ "Object of type %s did not create an Iterator", ce->name->val);
+ }
+ zend_throw_exception_internal(NULL);
+ HANDLE_EXCEPTION();
+ }
+
+ iter->index = 0;
+ if (iter->funcs->rewind) {
+ iter->funcs->rewind(iter);
+ if (UNEXPECTED(EG(exception) != NULL)) {
+ OBJ_RELEASE(&iter->std);
+ HANDLE_EXCEPTION();
+ }
+ }
+
+ ZVAL_OBJ(&generator->values, &iter->std);
+ }
+ } else {
+ // TODO: Should be an engine exception
+ zend_throw_exception(NULL, "Can use \"yield from\" only with arrays and Traversables", 0);
+ HANDLE_EXCEPTION();
+ }
+
+ /* This is the default return value
+ * when the expression is a Generator, it will be overwritten in zend_generator_resume() */
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_NULL(EX_VAR(opline->result.var));
+ }
+
+ /* We increment to the next op, so we are at the correct position when the
+ * generator is resumed. */
+ ZEND_VM_INC_OPCODE();
+
+ /* The GOTO VM uses a local opline variable. We need to set the opline
+ * variable in execute_data so we don't resume at an old position. */
+ SAVE_OPLINE();
+
+ ZEND_VM_RETURN();
+}
+
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_STRLEN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -6024,8 +6110,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -6208,8 +6293,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(Z
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -6738,8 +6822,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(Z
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -7615,8 +7698,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLE
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -9218,8 +9300,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZE
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -10879,8 +10960,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_TMP_HAND
zval *retval;
zend_free_op free_op1;
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
retval = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
@@ -11476,6 +11556,97 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_TMP_HANDLER(ZEN
ZEND_VM_NEXT_OPCODE();
}
+static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+
+ /* The generator object is stored in EX(return_value) */
+ zend_generator *generator = (zend_generator *) EX(return_value);
+
+ zval *val;
+ zend_free_op free_op1;
+
+ SAVE_OPLINE();
+ val = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
+ if (Z_TYPE_P(val) == IS_ARRAY) {
+ ZVAL_COPY_VALUE(&generator->values, val);
+ if (IS_TMP_VAR != IS_TMP_VAR && Z_OPT_REFCOUNTED_P(val)) {
+ Z_ADDREF_P(val);
+ }
+ Z_FE_POS(generator->values) = 0;
+
+ } else if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(val) == IS_OBJECT && Z_OBJCE_P(val)->get_iterator) {
+ zend_class_entry *ce = Z_OBJCE_P(val);
+ if (ce == zend_ce_generator) {
+ zend_generator *new_gen = (zend_generator *) Z_OBJ_P(val);
+
+ if (IS_TMP_VAR != IS_TMP_VAR) {
+ Z_ADDREF_P(val);
+ }
+
+ if (Z_ISUNDEF(new_gen->retval)) {
+ zend_generator_yield_from(generator, new_gen);
+ } else if (new_gen->execute_data == NULL) {
+ // TODO: Should be an engine exception
+ zend_error(E_RECOVERABLE_ERROR, "Generator passed to yield from was aborted without proper return and is unable to continue");
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+ } else {
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_COPY(EX_VAR(opline->result.var), &new_gen->retval);
+ }
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+ }
+ } else {
+ zend_object_iterator *iter = ce->get_iterator(ce, val, 0);
+ zval_ptr_dtor_nogc(free_op1);
+
+ if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) {
+ if (!EG(exception)) {
+ zend_throw_exception_ex(NULL, 0,
+ "Object of type %s did not create an Iterator", ce->name->val);
+ }
+ zend_throw_exception_internal(NULL);
+ HANDLE_EXCEPTION();
+ }
+
+ iter->index = 0;
+ if (iter->funcs->rewind) {
+ iter->funcs->rewind(iter);
+ if (UNEXPECTED(EG(exception) != NULL)) {
+ OBJ_RELEASE(&iter->std);
+ HANDLE_EXCEPTION();
+ }
+ }
+
+ ZVAL_OBJ(&generator->values, &iter->std);
+ }
+ } else {
+ // TODO: Should be an engine exception
+ zend_throw_exception(NULL, "Can use \"yield from\" only with arrays and Traversables", 0);
+ HANDLE_EXCEPTION();
+ }
+
+ /* This is the default return value
+ * when the expression is a Generator, it will be overwritten in zend_generator_resume() */
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_NULL(EX_VAR(opline->result.var));
+ }
+
+ /* We increment to the next op, so we are at the correct position when the
+ * generator is resumed. */
+ ZEND_VM_INC_OPCODE();
+
+ /* The GOTO VM uses a local opline variable. We need to set the opline
+ * variable in execute_data so we don't resume at an old position. */
+ SAVE_OPLINE();
+
+ ZEND_VM_RETURN();
+}
+
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -11911,8 +12082,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(Z
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -12080,8 +12250,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEN
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -12249,8 +12418,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEN
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -12614,8 +12782,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -13136,8 +13303,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -13912,8 +14078,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_VAR_HAND
zval *retval;
zend_free_op free_op1;
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
retval = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
@@ -15052,6 +15217,99 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_VAR_HANDLER(ZEN
ZEND_VM_NEXT_OPCODE();
}
+static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+
+ /* The generator object is stored in EX(return_value) */
+ zend_generator *generator = (zend_generator *) EX(return_value);
+
+ zval *val;
+ zend_free_op free_op1;
+
+ SAVE_OPLINE();
+ val = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
+ if (Z_TYPE_P(val) == IS_ARRAY) {
+ ZVAL_COPY_VALUE(&generator->values, val);
+ if (IS_VAR != IS_TMP_VAR && Z_OPT_REFCOUNTED_P(val)) {
+ Z_ADDREF_P(val);
+ }
+ Z_FE_POS(generator->values) = 0;
+
+ zval_ptr_dtor_nogc(free_op1);
+ } else if (IS_VAR != IS_CONST && Z_TYPE_P(val) == IS_OBJECT && Z_OBJCE_P(val)->get_iterator) {
+ zend_class_entry *ce = Z_OBJCE_P(val);
+ if (ce == zend_ce_generator) {
+ zend_generator *new_gen = (zend_generator *) Z_OBJ_P(val);
+
+ if (IS_VAR != IS_TMP_VAR) {
+ Z_ADDREF_P(val);
+ }
+ zval_ptr_dtor_nogc(free_op1);
+
+ if (Z_ISUNDEF(new_gen->retval)) {
+ zend_generator_yield_from(generator, new_gen);
+ } else if (new_gen->execute_data == NULL) {
+ // TODO: Should be an engine exception
+ zend_error(E_RECOVERABLE_ERROR, "Generator passed to yield from was aborted without proper return and is unable to continue");
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+ } else {
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_COPY(EX_VAR(opline->result.var), &new_gen->retval);
+ }
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+ }
+ } else {
+ zend_object_iterator *iter = ce->get_iterator(ce, val, 0);
+ zval_ptr_dtor_nogc(free_op1);
+
+ if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) {
+ if (!EG(exception)) {
+ zend_throw_exception_ex(NULL, 0,
+ "Object of type %s did not create an Iterator", ce->name->val);
+ }
+ zend_throw_exception_internal(NULL);
+ HANDLE_EXCEPTION();
+ }
+
+ iter->index = 0;
+ if (iter->funcs->rewind) {
+ iter->funcs->rewind(iter);
+ if (UNEXPECTED(EG(exception) != NULL)) {
+ OBJ_RELEASE(&iter->std);
+ HANDLE_EXCEPTION();
+ }
+ }
+
+ ZVAL_OBJ(&generator->values, &iter->std);
+ }
+ } else {
+ // TODO: Should be an engine exception
+ zend_throw_exception(NULL, "Can use \"yield from\" only with arrays and Traversables", 0);
+ HANDLE_EXCEPTION();
+ }
+
+ /* This is the default return value
+ * when the expression is a Generator, it will be overwritten in zend_generator_resume() */
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_NULL(EX_VAR(opline->result.var));
+ }
+
+ /* We increment to the next op, so we are at the correct position when the
+ * generator is resumed. */
+ ZEND_VM_INC_OPCODE();
+
+ /* The GOTO VM uses a local opline variable. We need to set the opline
+ * variable in execute_data so we don't resume at an old position. */
+ SAVE_OPLINE();
+
+ ZEND_VM_RETURN();
+}
+
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -16756,8 +17014,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(Z
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -16960,8 +17217,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEN
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -17223,8 +17479,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEN
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -18183,8 +18438,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -19938,8 +20192,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -23162,8 +23415,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLE
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -23300,8 +23552,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER(
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -23438,8 +23689,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -23951,8 +24201,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDL
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -25455,8 +25704,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(Z
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -27505,8 +27753,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_CV_HANDL
zval *retval;
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
retval = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
@@ -28495,6 +28742,96 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_CV_HANDLER(ZEND
ZEND_VM_NEXT_OPCODE();
}
+static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+
+ /* The generator object is stored in EX(return_value) */
+ zend_generator *generator = (zend_generator *) EX(return_value);
+
+ zval *val;
+
+
+ SAVE_OPLINE();
+ val = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var);
+ if (Z_TYPE_P(val) == IS_ARRAY) {
+ ZVAL_COPY_VALUE(&generator->values, val);
+ if (IS_CV != IS_TMP_VAR && Z_OPT_REFCOUNTED_P(val)) {
+ Z_ADDREF_P(val);
+ }
+ Z_FE_POS(generator->values) = 0;
+
+ } else if (IS_CV != IS_CONST && Z_TYPE_P(val) == IS_OBJECT && Z_OBJCE_P(val)->get_iterator) {
+ zend_class_entry *ce = Z_OBJCE_P(val);
+ if (ce == zend_ce_generator) {
+ zend_generator *new_gen = (zend_generator *) Z_OBJ_P(val);
+
+ if (IS_CV != IS_TMP_VAR) {
+ Z_ADDREF_P(val);
+ }
+
+ if (Z_ISUNDEF(new_gen->retval)) {
+ zend_generator_yield_from(generator, new_gen);
+ } else if (new_gen->execute_data == NULL) {
+ // TODO: Should be an engine exception
+ zend_error(E_RECOVERABLE_ERROR, "Generator passed to yield from was aborted without proper return and is unable to continue");
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+ } else {
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_COPY(EX_VAR(opline->result.var), &new_gen->retval);
+ }
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+ }
+ } else {
+ zend_object_iterator *iter = ce->get_iterator(ce, val, 0);
+
+ if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) {
+ if (!EG(exception)) {
+ zend_throw_exception_ex(NULL, 0,
+ "Object of type %s did not create an Iterator", ce->name->val);
+ }
+ zend_throw_exception_internal(NULL);
+ HANDLE_EXCEPTION();
+ }
+
+ iter->index = 0;
+ if (iter->funcs->rewind) {
+ iter->funcs->rewind(iter);
+ if (UNEXPECTED(EG(exception) != NULL)) {
+ OBJ_RELEASE(&iter->std);
+ HANDLE_EXCEPTION();
+ }
+ }
+
+ ZVAL_OBJ(&generator->values, &iter->std);
+ }
+ } else {
+ // TODO: Should be an engine exception
+ zend_throw_exception(NULL, "Can use \"yield from\" only with arrays and Traversables", 0);
+ HANDLE_EXCEPTION();
+ }
+
+ /* This is the default return value
+ * when the expression is a Generator, it will be overwritten in zend_generator_resume() */
+ if (RETURN_VALUE_USED(opline)) {
+ ZVAL_NULL(EX_VAR(opline->result.var));
+ }
+
+ /* We increment to the next op, so we are at the correct position when the
+ * generator is resumed. */
+ ZEND_VM_INC_OPCODE();
+
+ /* The GOTO VM uses a local opline variable. We need to set the opline
+ * variable in execute_data so we don't resume at an old position. */
+ SAVE_OPLINE();
+
+ ZEND_VM_RETURN();
+}
+
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_STRLEN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -31453,8 +31790,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZE
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -31727,8 +32063,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -32392,8 +32727,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -33566,8 +33900,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(Z
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -36192,8 +36525,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_
{
USE_OPLINE
- /* The generator object is stored in EX(return_value) */
- zend_generator *generator = (zend_generator *) EX(return_value);
+ zend_generator *generator = zend_get_running_generator(execute_data);
SAVE_OPLINE();
if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) {
@@ -47148,31 +47480,31 @@ void zend_init_opcodes_handlers(void)
ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
ZEND_DECLARE_FUNCTION_SPEC_HANDLER,
ZEND_DECLARE_FUNCTION_SPEC_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_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_NULL_HANDLER,
- ZEND_NULL_HANDLER,
- ZEND_NULL_HANDLER,
- ZEND_NULL_HANDLER,
- ZEND_NULL_HANDLER,
- ZEND_NULL_HANDLER,
- ZEND_NULL_HANDLER,
+ ZEND_YIELD_FROM_SPEC_CONST_HANDLER,
+ ZEND_YIELD_FROM_SPEC_CONST_HANDLER,
+ ZEND_YIELD_FROM_SPEC_CONST_HANDLER,
+ ZEND_YIELD_FROM_SPEC_CONST_HANDLER,
+ ZEND_YIELD_FROM_SPEC_CONST_HANDLER,
+ ZEND_YIELD_FROM_SPEC_TMP_HANDLER,
+ ZEND_YIELD_FROM_SPEC_TMP_HANDLER,
+ ZEND_YIELD_FROM_SPEC_TMP_HANDLER,
+ ZEND_YIELD_FROM_SPEC_TMP_HANDLER,
+ ZEND_YIELD_FROM_SPEC_TMP_HANDLER,
+ ZEND_YIELD_FROM_SPEC_VAR_HANDLER,
+ ZEND_YIELD_FROM_SPEC_VAR_HANDLER,
+ ZEND_YIELD_FROM_SPEC_VAR_HANDLER,
+ ZEND_YIELD_FROM_SPEC_VAR_HANDLER,
+ ZEND_YIELD_FROM_SPEC_VAR_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_YIELD_FROM_SPEC_CV_HANDLER,
+ ZEND_YIELD_FROM_SPEC_CV_HANDLER,
+ ZEND_YIELD_FROM_SPEC_CV_HANDLER,
+ ZEND_YIELD_FROM_SPEC_CV_HANDLER,
+ ZEND_YIELD_FROM_SPEC_CV_HANDLER,
ZEND_DECLARE_CONST_SPEC_CONST_CONST_HANDLER,
ZEND_NULL_HANDLER,
ZEND_NULL_HANDLER,
diff --git a/Zend/zend_vm_opcodes.c b/Zend/zend_vm_opcodes.c
index 2214cd9dc4..ff986d1855 100644
--- a/Zend/zend_vm_opcodes.c
+++ b/Zend/zend_vm_opcodes.c
@@ -164,7 +164,7 @@ const char *zend_vm_opcodes_map[171] = {
"ZEND_DECLARE_CLASS",
"ZEND_DECLARE_INHERITED_CLASS",
"ZEND_DECLARE_FUNCTION",
- NULL,
+ "ZEND_YIELD_FROM",
"ZEND_DECLARE_CONST",
"ZEND_ADD_INTERFACE",
"ZEND_DECLARE_INHERITED_CLASS_DELAYED",
diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h
index 8b9321a991..edee61f6c9 100644
--- a/Zend/zend_vm_opcodes.h
+++ b/Zend/zend_vm_opcodes.h
@@ -173,6 +173,7 @@ END_EXTERN_C()
#define ZEND_DECLARE_CLASS 139
#define ZEND_DECLARE_INHERITED_CLASS 140
#define ZEND_DECLARE_FUNCTION 141
+#define ZEND_YIELD_FROM 142
#define ZEND_DECLARE_CONST 143
#define ZEND_ADD_INTERFACE 144
#define ZEND_DECLARE_INHERITED_CLASS_DELAYED 145