summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
Diffstat (limited to 'Zend')
-rw-r--r--Zend/Makefile.am2
-rw-r--r--Zend/RFCs/003.txt6
-rw-r--r--Zend/Zend.dsp8
-rw-r--r--Zend/ZendTS.dsp4
-rw-r--r--Zend/acinclude.m427
-rw-r--r--Zend/tests/67468.phpt11
-rw-r--r--Zend/tests/arg_unpack/basic.phpt110
-rw-r--r--Zend/tests/arg_unpack/by_ref.phpt145
-rw-r--r--Zend/tests/arg_unpack/dynamic.phpt37
-rw-r--r--Zend/tests/arg_unpack/internal.phpt43
-rw-r--r--Zend/tests/arg_unpack/invalid_type.phpt59
-rw-r--r--Zend/tests/arg_unpack/many_args.phpt15
-rw-r--r--Zend/tests/arg_unpack/method.phpt32
-rw-r--r--Zend/tests/arg_unpack/new.phpt35
-rw-r--r--Zend/tests/arg_unpack/positional_arg_after_unpack_error.phpt10
-rw-r--r--Zend/tests/arg_unpack/string_keys.phpt20
-rw-r--r--Zend/tests/arg_unpack/traversable_throwing_exception.phpt33
-rw-r--r--Zend/tests/arg_unpack/traversable_with_by_ref_parameters.phpt31
-rw-r--r--Zend/tests/bug30820.phpt1
-rw-r--r--Zend/tests/bug65784.phpt2
-rw-r--r--Zend/tests/bug66015.phpt30
-rw-r--r--Zend/tests/bug66252.phpt14
-rw-r--r--Zend/tests/bug66660.phpt13
-rw-r--r--Zend/tests/bug67169.phpt26
-rw-r--r--Zend/tests/bug67368.phpt12
-rw-r--r--Zend/tests/bug67436/bug67436_nohandler.phpt2
-rw-r--r--Zend/tests/bug67938.phpt27
-rw-r--r--Zend/tests/bug68446.phpt36
-rw-r--r--Zend/tests/bug69599.phpt21
-rw-r--r--Zend/tests/class_properties_dynamic.phpt13
-rw-r--r--Zend/tests/class_properties_static.phpt20
-rw-r--r--Zend/tests/closure_018.phpt5
-rw-r--r--Zend/tests/closure_019.phpt3
-rw-r--r--Zend/tests/constant_expressions.phpt96
-rw-r--r--Zend/tests/constant_expressions_arrays.phpt66
-rw-r--r--Zend/tests/constant_expressions_classes.phpt43
-rw-r--r--Zend/tests/constant_expressions_dynamic.phpt11
-rw-r--r--Zend/tests/constant_expressions_self_referencing_array.phpt13
-rw-r--r--Zend/tests/debug_info-error-0.0.phpt19
-rw-r--r--Zend/tests/debug_info-error-0.phpt19
-rw-r--r--Zend/tests/debug_info-error-1.0.phpt19
-rw-r--r--Zend/tests/debug_info-error-1.phpt19
-rw-r--r--Zend/tests/debug_info-error-empty_str.phpt19
-rw-r--r--Zend/tests/debug_info-error-false.phpt19
-rw-r--r--Zend/tests/debug_info-error-object.phpt19
-rw-r--r--Zend/tests/debug_info-error-resource.phpt19
-rw-r--r--Zend/tests/debug_info-error-str.phpt19
-rw-r--r--Zend/tests/debug_info-error-true.phpt19
-rw-r--r--Zend/tests/debug_info.phpt39
-rw-r--r--Zend/tests/dereference_002.phpt2
-rw-r--r--Zend/tests/errmsg_040.phpt12
-rw-r--r--Zend/tests/finally_goto_001.phpt14
-rw-r--r--Zend/tests/finally_goto_002.phpt14
-rw-r--r--Zend/tests/finally_goto_003.phpt15
-rw-r--r--Zend/tests/finally_goto_004.phpt14
-rw-r--r--Zend/tests/function_arguments_003.phpt17
-rw-r--r--Zend/tests/incompat_ctx_user.phpt20
-rw-r--r--Zend/tests/ns_059.phpt7
-rw-r--r--Zend/tests/static_variable.phpt29
-rw-r--r--Zend/tests/use_const/alias.phpt26
-rw-r--r--Zend/tests/use_const/basic.phpt22
-rw-r--r--Zend/tests/use_const/case_sensivity.phpt12
-rw-r--r--Zend/tests/use_const/conflicting_use.phpt21
-rw-r--r--Zend/tests/use_const/conflicting_use_alias.phpt18
-rw-r--r--Zend/tests/use_const/define_imported.phpt14
-rw-r--r--Zend/tests/use_const/define_imported_before.phpt18
-rw-r--r--Zend/tests/use_const/includes/foo_bar.php5
-rw-r--r--Zend/tests/use_const/includes/foo_php_version.php5
-rw-r--r--Zend/tests/use_const/includes/global_bar.php3
-rw-r--r--Zend/tests/use_const/includes/global_baz.php3
-rw-r--r--Zend/tests/use_const/no_global_fallback.phpt14
-rw-r--r--Zend/tests/use_const/self_parent.phpt12
-rw-r--r--Zend/tests/use_const/shadow_core.phpt16
-rw-r--r--Zend/tests/use_const/shadow_global.phpt25
-rw-r--r--Zend/tests/use_function/alias.phpt30
-rw-r--r--Zend/tests/use_function/basic.phpt26
-rw-r--r--Zend/tests/use_function/case_insensivity.phpt13
-rw-r--r--Zend/tests/use_function/conditional_function_declaration.phpt17
-rw-r--r--Zend/tests/use_function/conflicting_use.phpt25
-rw-r--r--Zend/tests/use_function/conflicting_use_alias.phpt20
-rw-r--r--Zend/tests/use_function/conflicting_use_const_alias.phpt23
-rw-r--r--Zend/tests/use_function/define_imported.phpt14
-rw-r--r--Zend/tests/use_function/define_imported_before.phpt18
-rw-r--r--Zend/tests/use_function/ignore_constants.phpt23
-rw-r--r--Zend/tests/use_function/includes/foo_bar.php7
-rw-r--r--Zend/tests/use_function/includes/foo_strlen.php7
-rw-r--r--Zend/tests/use_function/includes/global_bar.php5
-rw-r--r--Zend/tests/use_function/includes/global_baz.php4
-rw-r--r--Zend/tests/use_function/no_global_fallback.phpt13
-rw-r--r--Zend/tests/use_function/no_global_fallback2.phpt18
-rw-r--r--Zend/tests/use_function/self_parent.phpt12
-rw-r--r--Zend/tests/use_function/shadow_core.phpt16
-rw-r--r--Zend/tests/use_function/shadow_global.phpt25
-rw-r--r--Zend/tests/variadic/adding_additional_optional_parameter.phpt17
-rw-r--r--Zend/tests/variadic/adding_additional_optional_parameter_error.phpt16
-rw-r--r--Zend/tests/variadic/basic.phpt57
-rw-r--r--Zend/tests/variadic/by_ref.phpt24
-rw-r--r--Zend/tests/variadic/by_ref_error.phpt12
-rw-r--r--Zend/tests/variadic/no_default_error.phpt10
-rw-r--r--Zend/tests/variadic/non_variadic_implements_variadic_error.phpt16
-rw-r--r--Zend/tests/variadic/only_last_error.phpt10
-rw-r--r--Zend/tests/variadic/optional_params.phpt49
-rw-r--r--Zend/tests/variadic/removing_parameter_error.phpt20
-rw-r--r--Zend/tests/variadic/typehint_error.phpt36
-rw-r--r--Zend/tests/variadic/typehint_suppressed_error.phpt33
-rw-r--r--Zend/tests/variadic/variadic_changed_byref_error.phpt16
-rw-r--r--Zend/tests/variadic/variadic_changed_typehint_error.phpt16
-rw-r--r--Zend/tests/variadic/variadic_implements_non_variadic.phpt17
-rw-r--r--Zend/tests/zend_signed_multiply-32bit.phpt14
-rw-r--r--Zend/tests/zend_signed_multiply-64bit.phpt14
-rw-r--r--Zend/zend.c22
-rw-r--r--Zend/zend.h37
-rw-r--r--Zend/zend_API.c128
-rw-r--r--Zend/zend_API.h53
-rw-r--r--Zend/zend_ast.c385
-rw-r--r--Zend/zend_ast.h64
-rw-r--r--Zend/zend_builtin_functions.c46
-rw-r--r--Zend/zend_closures.c10
-rw-r--r--Zend/zend_compile.c1028
-rw-r--r--Zend/zend_compile.h76
-rw-r--r--Zend/zend_constants.c98
-rw-r--r--Zend/zend_constants.h8
-rw-r--r--Zend/zend_execute.c263
-rw-r--r--Zend/zend_execute.h36
-rw-r--r--Zend/zend_execute_API.c149
-rw-r--r--Zend/zend_extensions.h4
-rw-r--r--Zend/zend_generators.c10
-rw-r--r--Zend/zend_globals.h9
-rw-r--r--Zend/zend_hash.c516
-rw-r--r--Zend/zend_hash.h17
-rw-r--r--Zend/zend_highlight.c4
-rw-r--r--Zend/zend_indent.c2
-rw-r--r--Zend/zend_ini_parser.y6
-rw-r--r--Zend/zend_ini_scanner.c4080
-rw-r--r--Zend/zend_ini_scanner.h1
-rw-r--r--Zend/zend_ini_scanner.l61
-rw-r--r--Zend/zend_ini_scanner_defs.h26
-rw-r--r--Zend/zend_language_parser.y218
-rw-r--r--Zend/zend_language_scanner.c15751
-rw-r--r--Zend/zend_language_scanner.l270
-rw-r--r--Zend/zend_language_scanner_defs.h30
-rw-r--r--Zend/zend_modules.h2
-rw-r--r--Zend/zend_multibyte.c2
-rw-r--r--Zend/zend_object_handlers.c54
-rw-r--r--Zend/zend_object_handlers.h5
-rw-r--r--Zend/zend_opcode.c17
-rw-r--r--Zend/zend_operators.c335
-rw-r--r--Zend/zend_operators.h30
-rw-r--r--Zend/zend_signal.c8
-rw-r--r--Zend/zend_string.c2
-rw-r--r--Zend/zend_string.h27
-rw-r--r--Zend/zend_ts_hash.c8
-rw-r--r--Zend/zend_ts_hash.h8
-rw-r--r--Zend/zend_variables.c17
-rw-r--r--Zend/zend_virtual_cwd.c2005
-rw-r--r--Zend/zend_virtual_cwd.h340
-rw-r--r--Zend/zend_vm_def.h619
-rw-r--r--Zend/zend_vm_execute.h3539
-rw-r--r--Zend/zend_vm_gen.php45
-rw-r--r--Zend/zend_vm_opcodes.c6
-rw-r--r--Zend/zend_vm_opcodes.h4
161 files changed, 19722 insertions, 13121 deletions
diff --git a/Zend/Makefile.am b/Zend/Makefile.am
index cea5c17fa2..65c4113497 100644
--- a/Zend/Makefile.am
+++ b/Zend/Makefile.am
@@ -18,7 +18,7 @@ libZend_la_SOURCES=\
zend_default_classes.c \
zend_iterators.c zend_interfaces.c zend_exceptions.c \
zend_strtod.c zend_closures.c zend_float.c zend_string.c zend_signal.c \
- zend_generators.c
+ zend_generators.c zend_virtual_cwd.c zend_ast.c
libZend_la_LDFLAGS =
libZend_la_LIBADD = @ZEND_EXTRA_LIBS@
diff --git a/Zend/RFCs/003.txt b/Zend/RFCs/003.txt
index 30fb4cec49..ac042183d4 100644
--- a/Zend/RFCs/003.txt
+++ b/Zend/RFCs/003.txt
@@ -9,11 +9,11 @@ Modified: 2001-09-17
1. Background/Need
==================
-Many internal function of PHP will reject parameters because of their
+Many internal functions of PHP will reject parameters because of their
type (the array and variable function come to mind). For userland
this is not an easy task as there is no uniform way to do it. An
addition to the engine for requiring loose types would allow
-delevopers to know that the data passed to their functions is of the
+developers to know that the data passed to their functions are of the
correct type and reduce the need for duplicating the same code in
every function to check for the type of data.
@@ -57,7 +57,7 @@ function foo (array $var){
===========
Mis-matches in type should be reported as fatal errors and should halt
-the execution of a script as that function can not be run and code
+the execution of a script as that function cannot be run and code
following could not reliably run.
diff --git a/Zend/Zend.dsp b/Zend/Zend.dsp
index 61bdab0875..98d368fb16 100644
--- a/Zend/Zend.dsp
+++ b/Zend/Zend.dsp
@@ -119,6 +119,10 @@ SOURCE=.\zend_API.c
# End Source File
# Begin Source File
+SOURCE=.\zend_ast.c
+# End Source File
+# Begin Source File
+
SOURCE=.\zend_builtin_functions.c
# End Source File
# Begin Source File
@@ -265,6 +269,10 @@ SOURCE=.\zend_variables.c
SOURCE=.\zend_vm_opcodes.c
# End Source File
+# Begin Source File
+
+SOURCE=.\zend_virtual_cwd.c
+# End Source File
# End Group
# Begin Group "Header Files"
diff --git a/Zend/ZendTS.dsp b/Zend/ZendTS.dsp
index 0292fda667..21210f1087 100644
--- a/Zend/ZendTS.dsp
+++ b/Zend/ZendTS.dsp
@@ -140,6 +140,10 @@ SOURCE=.\zend_alloc.c
# End Source File
# Begin Source File
+SOURCE=.\zend_ast.c
+# End Source File
+# Begin Source File
+
SOURCE=.\zend_API.c
# End Source File
# Begin Source File
diff --git a/Zend/acinclude.m4 b/Zend/acinclude.m4
index 5a521dc98c..7fa8c99940 100644
--- a/Zend/acinclude.m4
+++ b/Zend/acinclude.m4
@@ -3,8 +3,13 @@ dnl
dnl This file contains local autoconf functions.
AC_DEFUN([LIBZEND_BISON_CHECK],[
- # we only support certain bison versions
- bison_version_list="2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.7"
+ # we only support certain bison versions;
+ # min: 2.4 (i.e. 204, major * 100 + minor for easier comparison)
+ bison_version_min="204"
+ # non-working versions, e.g. "3.0 3.2";
+ # remove "none" when introducing the first incompatible bison version an
+ # separate any following additions by spaces
+ bison_version_exclude="3.0"
# for standalone build of Zend Engine
test -z "$SED" && SED=sed
@@ -17,18 +22,22 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[
if test -n "$bison_version_vars"; then
set $bison_version_vars
bison_version="${1}.${2}"
- for bison_check_version in $bison_version_list; do
- if test "$bison_version" = "$bison_check_version"; then
- php_cv_bison_version="$bison_check_version (ok)"
- break
- fi
- done
+ bison_version_num="`expr ${1} \* 100 + ${2}`"
+ if test $bison_version_num -ge $bison_version_min; then
+ php_cv_bison_version="$bison_version (ok)"
+ for bison_check_version in $bison_version_exclude; do
+ if test "$bison_version" = "$bison_check_version"; then
+ php_cv_bison_version=invalid
+ break
+ fi
+ done
+ fi
fi
])
fi
case $php_cv_bison_version in
""|invalid[)]
- bison_msg="bison versions supported for regeneration of the Zend/PHP parsers: $bison_version_list (found: $bison_version)."
+ bison_msg="This bison version is not supported for regeneration of the Zend/PHP parsers (found: $bison_version, min: $bison_version_min, excluded: $bison_version_exclude)."
AC_MSG_WARN([$bison_msg])
YACC="exit 0;"
;;
diff --git a/Zend/tests/67468.phpt b/Zend/tests/67468.phpt
new file mode 100644
index 0000000000..767217644a
--- /dev/null
+++ b/Zend/tests/67468.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Bug #67468 (Segfault in highlight_file()/highlight_string())
+--SKIPIF--
+<?php if(!function_exists("leak")) print "skip only for debug builds"; ?>
+--FILE--
+<?php
+highlight_string("<?php __CLASS__;", true);
+echo "done";
+?>
+--EXPECT--
+done
diff --git a/Zend/tests/arg_unpack/basic.phpt b/Zend/tests/arg_unpack/basic.phpt
new file mode 100644
index 0000000000..f8bd019378
--- /dev/null
+++ b/Zend/tests/arg_unpack/basic.phpt
@@ -0,0 +1,110 @@
+--TEST--
+Basic argument unpacking
+--FILE--
+<?php
+
+function test(...$args) {
+ var_dump($args);
+}
+
+function test2($arg1, $arg2, $arg3 = null) {
+ var_dump($arg1, $arg2, $arg3);
+}
+
+function getArray($array) {
+ return $array;
+}
+
+function arrayGen($array) {
+ foreach ($array as $element) {
+ yield $element;
+ }
+}
+
+$array = [1, 2, 3];
+
+test(...[]);
+test(...[1, 2, 3]);
+test(...$array);
+test(...getArray([1, 2, 3]));
+test(...arrayGen([]));
+test(...arrayGen([1, 2, 3]));
+
+test(1, ...[2, 3], ...[4, 5]);
+test(1, ...getArray([2, 3]), ...arrayGen([4, 5]));
+
+test2(...[1, 2]);
+test2(...[1, 2, 3]);
+test2(...[1], ...[], ...[], ...[2, 3], ...[4, 5]);
+
+?>
+--EXPECT--
+array(0) {
+}
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
+array(0) {
+}
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
+array(5) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+}
+array(5) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+}
+int(1)
+int(2)
+NULL
+int(1)
+int(2)
+int(3)
+int(1)
+int(2)
+int(3)
diff --git a/Zend/tests/arg_unpack/by_ref.phpt b/Zend/tests/arg_unpack/by_ref.phpt
new file mode 100644
index 0000000000..7c8a86be48
--- /dev/null
+++ b/Zend/tests/arg_unpack/by_ref.phpt
@@ -0,0 +1,145 @@
+--TEST--
+Argument unpacking with by-ref arguments
+--FILE--
+<?php
+
+error_reporting(E_ALL);
+
+function test1(&...$args) {
+ foreach ($args as &$arg) {
+ $arg++;
+ }
+}
+
+test1(...[1, 2, 3]);
+
+$array = [1, 2, 3];
+test1(...$array);
+var_dump($array);
+
+$array1 = [1, 2]; $array2 = [3, 4];
+test1(...$array1, ...$array2);
+var_dump($array1, $array2);
+
+function test2($val1, &$ref1, $val2, &$ref2) {
+ $ref1++;
+ $ref2++;
+}
+
+$array = [0, 0, 0, 0];
+test2(...$array);
+var_dump($array);
+
+$array1 = [1, 2]; $array2 = [4, 5];
+test1(...$array1, ...$array2);
+var_dump($array1, $array2);
+
+$a = $b = $c = $d = 0;
+$array = [0, 0, 0, 0];
+
+test2($a, ...$array);
+var_dump($a, $array);
+
+test2($a, $b, ...$array);
+var_dump($a, $b, $array);
+
+test2($a, $b, $c, ...$array);
+var_dump($a, $b, $c, $array);
+
+test2($a, $b, $c, $d, ...$array);
+var_dump($a, $b, $c, $d, $array);
+
+?>
+--EXPECTF--
+array(3) {
+ [0]=>
+ int(2)
+ [1]=>
+ int(3)
+ [2]=>
+ int(4)
+}
+array(2) {
+ [0]=>
+ int(2)
+ [1]=>
+ int(3)
+}
+array(2) {
+ [0]=>
+ int(4)
+ [1]=>
+ int(5)
+}
+array(4) {
+ [0]=>
+ int(0)
+ [1]=>
+ int(1)
+ [2]=>
+ int(0)
+ [3]=>
+ int(1)
+}
+array(2) {
+ [0]=>
+ int(2)
+ [1]=>
+ int(3)
+}
+array(2) {
+ [0]=>
+ int(5)
+ [1]=>
+ int(6)
+}
+int(0)
+array(4) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(0)
+ [2]=>
+ int(1)
+ [3]=>
+ int(0)
+}
+int(0)
+int(1)
+array(4) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(1)
+ [2]=>
+ int(1)
+ [3]=>
+ int(0)
+}
+int(0)
+int(2)
+int(0)
+array(4) {
+ [0]=>
+ int(2)
+ [1]=>
+ int(1)
+ [2]=>
+ int(1)
+ [3]=>
+ int(0)
+}
+int(0)
+int(3)
+int(0)
+int(1)
+array(4) {
+ [0]=>
+ int(2)
+ [1]=>
+ int(1)
+ [2]=>
+ int(1)
+ [3]=>
+ int(0)
+}
diff --git a/Zend/tests/arg_unpack/dynamic.phpt b/Zend/tests/arg_unpack/dynamic.phpt
new file mode 100644
index 0000000000..8f129f85a6
--- /dev/null
+++ b/Zend/tests/arg_unpack/dynamic.phpt
@@ -0,0 +1,37 @@
+--TEST--
+Unpack arguments for dynamic call
+--FILE--
+<?php
+
+$fn = function(...$args) {
+ var_dump($args);
+};
+
+$fn(...[]);
+$fn(...[1, 2, 3]);
+$fn(1, ...[2, 3], ...[], ...[4, 5]);
+
+?>
+--EXPECT--
+array(0) {
+}
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
+array(5) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+}
diff --git a/Zend/tests/arg_unpack/internal.phpt b/Zend/tests/arg_unpack/internal.phpt
new file mode 100644
index 0000000000..adc985d940
--- /dev/null
+++ b/Zend/tests/arg_unpack/internal.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Argument unpacking with internal functions
+--FILE--
+<?php
+
+$arrays = [
+ [1, 2, 3],
+ [4, 5, 6],
+ [7, 8, 9],
+];
+var_dump(array_map(null, ...$arrays));
+
+?>
+--EXPECT--
+array(3) {
+ [0]=>
+ array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(4)
+ [2]=>
+ int(7)
+ }
+ [1]=>
+ array(3) {
+ [0]=>
+ int(2)
+ [1]=>
+ int(5)
+ [2]=>
+ int(8)
+ }
+ [2]=>
+ array(3) {
+ [0]=>
+ int(3)
+ [1]=>
+ int(6)
+ [2]=>
+ int(9)
+ }
+}
diff --git a/Zend/tests/arg_unpack/invalid_type.phpt b/Zend/tests/arg_unpack/invalid_type.phpt
new file mode 100644
index 0000000000..1ef545558c
--- /dev/null
+++ b/Zend/tests/arg_unpack/invalid_type.phpt
@@ -0,0 +1,59 @@
+--TEST--
+Only arrays and Traversables can be unpacked
+--FILE--
+<?php
+
+function test(...$args) {
+ var_dump($args);
+}
+
+test(...null);
+test(...42);
+test(...new stdClass);
+
+test(1, 2, 3, ..."foo", ...[4, 5]);
+test(1, 2, 3, ...new StdClass, ...3.14, ...[4, 5]);
+
+?>
+--EXPECTF--
+Warning: Only arrays and Traversables can be unpacked in %s on line %d
+array(0) {
+}
+
+Warning: Only arrays and Traversables can be unpacked in %s on line %d
+array(0) {
+}
+
+Warning: Only arrays and Traversables can be unpacked in %s on line %d
+array(0) {
+}
+
+Warning: Only arrays and Traversables can be unpacked in %s on line %d
+array(5) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+}
+
+Warning: Only arrays and Traversables can be unpacked in %s on line %d
+
+Warning: Only arrays and Traversables can be unpacked in %s on line %d
+array(5) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+}
diff --git a/Zend/tests/arg_unpack/many_args.phpt b/Zend/tests/arg_unpack/many_args.phpt
new file mode 100644
index 0000000000..0ef5a30d6d
--- /dev/null
+++ b/Zend/tests/arg_unpack/many_args.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Argument unpacking with many arguments
+--FILE--
+<?php
+
+function fn(...$args) {
+ var_dump(count($args));
+}
+
+$array = array_fill(0, 10000, 42);
+fn(...$array, ...$array);
+
+?>
+--EXPECT--
+int(20000)
diff --git a/Zend/tests/arg_unpack/method.phpt b/Zend/tests/arg_unpack/method.phpt
new file mode 100644
index 0000000000..fb9ace8378
--- /dev/null
+++ b/Zend/tests/arg_unpack/method.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Unpack arguments for method calls
+--FILE--
+<?php
+
+class Foo {
+ public function test(...$args) {
+ var_dump($args);
+ }
+
+ public static function test2(...$args) {
+ var_dump($args);
+ }
+}
+
+$foo = new Foo;
+Foo::test2(1, 2, ...[3, 4], ...[], ...[5]);
+
+?>
+--EXPECT--
+array(5) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+}
diff --git a/Zend/tests/arg_unpack/new.phpt b/Zend/tests/arg_unpack/new.phpt
new file mode 100644
index 0000000000..7a0968e2c9
--- /dev/null
+++ b/Zend/tests/arg_unpack/new.phpt
@@ -0,0 +1,35 @@
+--TEST--
+Unpack arguments for new expression
+--FILE--
+<?php
+
+class Foo {
+ public function __construct(...$args) {
+ var_dump($args);
+ }
+}
+
+new Foo(...[]);
+new Foo(...[1, 2, 3]);
+new Foo(...[1], ...[], ...[2, 3]);
+
+?>
+--EXPECT--
+array(0) {
+}
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
diff --git a/Zend/tests/arg_unpack/positional_arg_after_unpack_error.phpt b/Zend/tests/arg_unpack/positional_arg_after_unpack_error.phpt
new file mode 100644
index 0000000000..30e13e3d10
--- /dev/null
+++ b/Zend/tests/arg_unpack/positional_arg_after_unpack_error.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Positional arguments cannot be used after argument unpacking
+--FILE--
+<?php
+
+var_dump(...[1, 2, 3], 4);
+
+?>
+--EXPECTF--
+Fatal error: Cannot use positional argument after argument unpacking in %s on line %d
diff --git a/Zend/tests/arg_unpack/string_keys.phpt b/Zend/tests/arg_unpack/string_keys.phpt
new file mode 100644
index 0000000000..443a882941
--- /dev/null
+++ b/Zend/tests/arg_unpack/string_keys.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Argument unpacking does not work with string keys (forward compatibility for named args)
+--FILE--
+<?php
+
+set_error_handler(function($errno, $errstr) {
+ var_dump($errstr);
+});
+
+var_dump(...[1, 2, "foo" => 3, 4]);
+var_dump(...new ArrayIterator([1, 2, "foo" => 3, 4]));
+
+?>
+--EXPECTF--
+string(36) "Cannot unpack array with string keys"
+int(1)
+int(2)
+string(42) "Cannot unpack Traversable with string keys"
+int(1)
+int(2)
diff --git a/Zend/tests/arg_unpack/traversable_throwing_exception.phpt b/Zend/tests/arg_unpack/traversable_throwing_exception.phpt
new file mode 100644
index 0000000000..abbf537587
--- /dev/null
+++ b/Zend/tests/arg_unpack/traversable_throwing_exception.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Traversables that throw exceptions are properly handled during argument unpack
+--FILE--
+<?php
+
+function test(...$args) {
+ var_dump($args);
+}
+
+class Foo implements IteratorAggregate {
+ public function getIterator() {
+ throw new Exception('getIterator');
+ }
+}
+
+function gen() {
+ yield 1;
+ yield 2;
+ throw new Exception('gen');
+}
+
+try {
+ test(1, 2, ...new Foo, ...[3, 4]);
+} catch (Exception $e) { var_dump($e->getMessage()); }
+
+try {
+ test(1, 2, ...gen(), ...[3, 4]);
+} catch (Exception $e) { var_dump($e->getMessage()); }
+
+?>
+--EXPECT--
+string(11) "getIterator"
+string(3) "gen"
diff --git a/Zend/tests/arg_unpack/traversable_with_by_ref_parameters.phpt b/Zend/tests/arg_unpack/traversable_with_by_ref_parameters.phpt
new file mode 100644
index 0000000000..711287eded
--- /dev/null
+++ b/Zend/tests/arg_unpack/traversable_with_by_ref_parameters.phpt
@@ -0,0 +1,31 @@
+--TEST--
+Traversables cannot be unpacked into by-reference parameters
+--FILE--
+<?php
+
+function test($val1, $val2, $val3, &$ref) {
+ $ref = 42;
+}
+
+function gen($array) {
+ foreach ($array as $element) {
+ yield $element;
+ }
+}
+
+test(1, 2, 3, $b, ...gen([4, 5, 6]));
+var_dump($b);
+
+test(...gen([1, 2, 3, 4]));
+test(1, 2, ...gen([3, 4]));
+test(...gen([1, 2]), ...gen([3, 4]));
+
+?>
+--EXPECTF--
+int(42)
+
+Warning: Cannot pass by-reference argument 4 of test() by unpacking a Traversable, passing by-value instead in %s on line %d
+
+Warning: Cannot pass by-reference argument 4 of test() by unpacking a Traversable, passing by-value instead in %s on line %d
+
+Warning: Cannot pass by-reference argument 4 of test() by unpacking a Traversable, passing by-value instead in %s on line %d
diff --git a/Zend/tests/bug30820.phpt b/Zend/tests/bug30820.phpt
index 97e46e9287..a0f71e72a7 100644
--- a/Zend/tests/bug30820.phpt
+++ b/Zend/tests/bug30820.phpt
@@ -2,6 +2,7 @@
Bug #30820 (static member conflict with $this->member silently ignored)
--INI--
error_reporting=4095
+opcache.optimization_level=0
--FILE--
<?php
class Blah {
diff --git a/Zend/tests/bug65784.phpt b/Zend/tests/bug65784.phpt
index adc34113a5..29f086b5e3 100644
--- a/Zend/tests/bug65784.phpt
+++ b/Zend/tests/bug65784.phpt
@@ -1,7 +1,5 @@
--TEST--
Fixed Bug #65784 (Segfault with finally)
---XFAIL--
-This bug is not fixed in 5.5 due to ABI BC
--FILE--
<?php
function foo1() {
diff --git a/Zend/tests/bug66015.phpt b/Zend/tests/bug66015.phpt
new file mode 100644
index 0000000000..4f6d51e0dd
--- /dev/null
+++ b/Zend/tests/bug66015.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Bug #66015 (wrong array indexing in class's static property)
+--FILE--
+<?php
+class Test
+{
+ const FIRST = 1;
+ const SECOND = 2;
+ const THIRD = 3;
+
+ protected static $array = [
+ self::FIRST => 'first',
+ 'second',
+ 'third'
+ ];
+
+ public function __construct()
+ {
+ var_export(self::$array);
+ }
+}
+
+$test = new Test();
+?>
+--EXPECTF--
+array (
+ 1 => 'first',
+ 2 => 'second',
+ 3 => 'third',
+)
diff --git a/Zend/tests/bug66252.phpt b/Zend/tests/bug66252.phpt
new file mode 100644
index 0000000000..e692a8e706
--- /dev/null
+++ b/Zend/tests/bug66252.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Bug #66252 (Problems in AST evaluation invalidating valid parent:: reference)
+--FILE--
+<?php
+class A {
+ const HW = "this is A";
+}
+class B extends A {
+ const BHW = parent::HW . " extended by B";
+}
+const C = B::BHW;
+echo C, "\n";
+--EXPECT--
+this is A extended by B
diff --git a/Zend/tests/bug66660.phpt b/Zend/tests/bug66660.phpt
new file mode 100644
index 0000000000..9ae8a27336
--- /dev/null
+++ b/Zend/tests/bug66660.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Bug #66660 (Composer.phar install/update fails)
+--STDIN--
+<?php __CLASS__ ?>
+--FILE--
+<?php
+file_put_contents(__DIR__."/bug66660.tmp.php", "<?php __CLASS__ ?>");
+echo php_strip_whitespace(__DIR__."/bug66660.tmp.php");
+?>
+--CLEAN--
+<?php unlink(__DIR__."/bug66660.tmp.php"); ?>
+--EXPECT--
+<?php __CLASS__ ?>
diff --git a/Zend/tests/bug67169.phpt b/Zend/tests/bug67169.phpt
new file mode 100644
index 0000000000..8aa6aaf24a
--- /dev/null
+++ b/Zend/tests/bug67169.phpt
@@ -0,0 +1,26 @@
+--TEST--
+Bug #67169: array_splice all elements, then []= gives wrong index
+--FILE--
+<?php
+
+$array = array('a', 'b');
+array_splice($array, 0, 2);
+$array[] = 'c';
+var_dump($array);
+
+$array = array('a', 'b');
+array_shift($array);
+array_shift($array);
+$array[] = 'c';
+var_dump($array);
+
+?>
+--EXPECT--
+array(1) {
+ [0]=>
+ string(1) "c"
+}
+array(1) {
+ [0]=>
+ string(1) "c"
+}
diff --git a/Zend/tests/bug67368.phpt b/Zend/tests/bug67368.phpt
new file mode 100644
index 0000000000..c92e994b94
--- /dev/null
+++ b/Zend/tests/bug67368.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #67368 (Memory leak with immediately dereferenced array in class constant)
+--INI--
+report_memleaks=1
+--FILE--
+<?php
+class FooBar {
+ const bar = ["bar" => 3]["bar"];
+}
+echo "okey";
+--EXPECTF--
+okey
diff --git a/Zend/tests/bug67436/bug67436_nohandler.phpt b/Zend/tests/bug67436/bug67436_nohandler.phpt
index 142b08f405..21ce8e6122 100644
--- a/Zend/tests/bug67436/bug67436_nohandler.phpt
+++ b/Zend/tests/bug67436/bug67436_nohandler.phpt
@@ -19,6 +19,6 @@ $b = new b();
$b->test();
--EXPECTF--
-Strict Standards: Declaration of b::test() should be compatible with a::test($arg = c::TESTCONSTANT) in %s/bug67436/b.php on line %d
+Strict Standards: Declaration of b::test() should be compatible with a::test($arg = c::TESTCONSTANT) in %s%ebug67436%eb.php on line %d
b::test()
a::test(c::TESTCONSTANT)
diff --git a/Zend/tests/bug67938.phpt b/Zend/tests/bug67938.phpt
new file mode 100644
index 0000000000..6597c4895f
--- /dev/null
+++ b/Zend/tests/bug67938.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Bug #67938: Segfault when extending interface method with variadic
+--FILE--
+<?php
+
+interface TestInterface {
+ public function foo();
+ public function bar(array $bar);
+}
+
+class Test implements TestInterface {
+ public function foo(...$args) {
+ echo __METHOD__, "\n";
+ }
+ public function bar(array $bar, ...$args) {
+ echo __METHOD__, "\n";
+ }
+}
+
+$obj = new Test;
+$obj->foo();
+$obj->bar([]);
+
+?>
+--EXPECT--
+Test::foo
+Test::bar
diff --git a/Zend/tests/bug68446.phpt b/Zend/tests/bug68446.phpt
new file mode 100644
index 0000000000..48e6f52f1c
--- /dev/null
+++ b/Zend/tests/bug68446.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Bug #68446 (Array constant not accepted for array parameter default)
+--FILE--
+<?php
+const FOO = [1];
+const BAR = null;
+
+function a(array $a = FOO) {
+ var_dump($a);
+}
+
+function b(array $b = BAR) {
+ var_dump($b);
+}
+
+b(null);
+b([]);
+b();
+a([]);
+a();
+a(null);
+?>
+--EXPECTF--
+NULL
+array(0) {
+}
+NULL
+array(0) {
+}
+array(1) {
+ [0]=>
+ int(1)
+}
+
+Catchable fatal error: Argument 1 passed to a() must be of the type array, null given, called in %s on line %d and defined in %s on line %d
+
diff --git a/Zend/tests/bug69599.phpt b/Zend/tests/bug69599.phpt
new file mode 100644
index 0000000000..fa8eaa3db4
--- /dev/null
+++ b/Zend/tests/bug69599.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #69599: Strange generator+exception+variadic crash
+--FILE--
+<?php
+
+function crash() {
+ sin(...[0]);
+ throw new \Exception();
+ yield;
+}
+
+iterator_to_array(crash());
+
+?>
+--EXPECTF--
+Fatal error: Uncaught exception 'Exception' in %s:%d
+Stack trace:
+#0 [internal function]: crash()
+#1 %s(%d): iterator_to_array(Object(Generator))
+#2 {main}
+ thrown in %s on line %d
diff --git a/Zend/tests/class_properties_dynamic.phpt b/Zend/tests/class_properties_dynamic.phpt
new file mode 100644
index 0000000000..8a1fc6f029
--- /dev/null
+++ b/Zend/tests/class_properties_dynamic.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Class Property Expressions
+--FILE--
+<?php
+class Foo {
+ const BAR = 1 << 0;
+ const BAZ = 1 << 1;
+ public $bar = self::BAR | self::BAZ;
+}
+echo (new Foo)->bar;
+?>
+--EXPECTF--
+3
diff --git a/Zend/tests/class_properties_static.phpt b/Zend/tests/class_properties_static.phpt
new file mode 100644
index 0000000000..9a56466340
--- /dev/null
+++ b/Zend/tests/class_properties_static.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Static Class Property Expressions
+--FILE--
+<?php
+class Foo {
+ public $b1 = 1 + 1;
+ public $b2 = 1 << 2;
+ public $b3 = "foo " . " bar " . " baz";
+}
+$f = new Foo;
+var_dump(
+ $f->b1,
+ $f->b2,
+ $f->b3
+);
+?>
+--EXPECT--
+int(2)
+int(4)
+string(13) "foo bar baz"
diff --git a/Zend/tests/closure_018.phpt b/Zend/tests/closure_018.phpt
index d98c78aeac..2dcf15c6aa 100644
--- a/Zend/tests/closure_018.phpt
+++ b/Zend/tests/closure_018.phpt
@@ -21,8 +21,11 @@ var_dump($x = $test->test($y));
var_dump($y, $x);
?>
---EXPECT--
+--EXPECTF--
+Notice: Only variable references should be returned by reference in %sclosure_018.php on line 7
int(4)
+
+Notice: Only variable references should be returned by reference in %sclosure_018.php on line 7
int(16)
int(16)
int(16)
diff --git a/Zend/tests/closure_019.phpt b/Zend/tests/closure_019.phpt
index 0c4c34e163..57aa2dec17 100644
--- a/Zend/tests/closure_019.phpt
+++ b/Zend/tests/closure_019.phpt
@@ -20,7 +20,10 @@ test();
?>
--EXPECTF--
+Notice: Only variable references should be returned by reference in %sclosure_019.php on line 4
int(9)
+
+Notice: Only variable references should be returned by reference in %sclosure_019.php on line 4
int(81)
Fatal error: Cannot pass parameter 1 by reference in %s on line %d
diff --git a/Zend/tests/constant_expressions.phpt b/Zend/tests/constant_expressions.phpt
new file mode 100644
index 0000000000..cf6474bd63
--- /dev/null
+++ b/Zend/tests/constant_expressions.phpt
@@ -0,0 +1,96 @@
+--TEST--
+Constant Expressions
+--FILE--
+<?php
+const T_1 = 1 << 1;
+const T_2 = 1 / 2;
+const T_3 = 1.5 + 1.5;
+const T_4 = "foo" . "bar";
+const T_5 = (1.5 + 1.5) * 2;
+const T_6 = "foo" . 2 . 3 . 4.0;
+const T_7 = __LINE__;
+const T_8 = <<<ENDOFSTRING
+This is a test string
+ENDOFSTRING;
+const T_9 = ~-1;
+const T_10 = (-1?:1) + (0?2:3);
+const T_11 = 1 && 0;
+const T_12 = 1 and 1;
+const T_13 = 0 || 0;
+const T_14 = 1 or 0;
+const T_15 = 1 xor 1;
+const T_16 = 1 xor 0;
+const T_17 = 1 < 0;
+const T_18 = 0 <= 0;
+const T_19 = 1 > 0;
+const T_20 = 1 >= 0;
+const T_21 = 1 === 1;
+const T_22 = 1 !== 1;
+const T_23 = 0 != "0";
+const T_24 = 1 == "1";
+
+// Test order of operations
+const T_25 = 1 + 2 * 3;
+
+// Test for memory leaks
+const T_26 = "1" + 2 + "3";
+
+// Allow T_POW
+const T_27 = 2 ** 3;
+
+var_dump(T_1);
+var_dump(T_2);
+var_dump(T_3);
+var_dump(T_4);
+var_dump(T_5);
+var_dump(T_6);
+var_dump(T_7);
+var_dump(T_8);
+var_dump(T_9);
+var_dump(T_10);
+var_dump(T_11);
+var_dump(T_12);
+var_dump(T_13);
+var_dump(T_14);
+var_dump(T_15);
+var_dump(T_16);
+var_dump(T_17);
+var_dump(T_18);
+var_dump(T_19);
+var_dump(T_20);
+var_dump(T_21);
+var_dump(T_22);
+var_dump(T_23);
+var_dump(T_24);
+var_dump(T_25);
+var_dump(T_26);
+var_dump(T_27);
+?>
+--EXPECT--
+int(2)
+float(0.5)
+float(3)
+string(6) "foobar"
+float(6)
+string(6) "foo234"
+int(8)
+string(21) "This is a test string"
+int(0)
+int(2)
+bool(false)
+bool(true)
+bool(false)
+bool(true)
+bool(false)
+bool(true)
+bool(false)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(false)
+bool(false)
+bool(true)
+int(7)
+int(6)
+int(8)
diff --git a/Zend/tests/constant_expressions_arrays.phpt b/Zend/tests/constant_expressions_arrays.phpt
new file mode 100644
index 0000000000..2ab03453de
--- /dev/null
+++ b/Zend/tests/constant_expressions_arrays.phpt
@@ -0,0 +1,66 @@
+--TEST--
+Constant expressions with arrays
+--FILE--
+<?php
+const a = [1,2,[3,[4]]];
+const b = a[0];
+const c = a[2][0];
+const d = a[2];
+const e = ["string" => [1]]["string"][0];
+
+var_dump(b, c, e);
+
+function test ($a = d[1][0]) {
+ var_dump($a);
+}
+
+test();
+
+class foo {
+ const bar = [1][0];
+}
+
+var_dump(foo::bar);
+
+var_dump(a, a[0], a[2], a[2][1], a[3]);
+
+?>
+--EXPECTF--
+int(1)
+int(3)
+int(1)
+int(4)
+int(1)
+
+Notice: Undefined offset: 3 in %s on line %d
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ array(2) {
+ [0]=>
+ int(3)
+ [1]=>
+ array(1) {
+ [0]=>
+ int(4)
+ }
+ }
+}
+int(1)
+array(2) {
+ [0]=>
+ int(3)
+ [1]=>
+ array(1) {
+ [0]=>
+ int(4)
+ }
+}
+array(1) {
+ [0]=>
+ int(4)
+}
+NULL
diff --git a/Zend/tests/constant_expressions_classes.phpt b/Zend/tests/constant_expressions_classes.phpt
new file mode 100644
index 0000000000..6298ff66d6
--- /dev/null
+++ b/Zend/tests/constant_expressions_classes.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Constant scalar expressions with autoloading and classes
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+--SKIPIF--
+<?php if (!extension_loaded('Zend OPcache') || php_sapi_name() != "cli") die("skip CLI only"); ?>
+--FILE--
+<?php
+
+# This test validates that autoloading works for common const expression (AST) use cases
+$classlist = [
+ 'A'=> 'class A { const HW = "this is A"; }',
+ 'B'=> 'class B extends A { const HW = parent::HW." extended by B"; }',
+ 'space1\C' => 'namespace space1; class C { const HW = "this is space1\C"; }',
+ 'D' => 'class D { const HW = \space1\C::HW." extented by D"; }',
+ 'trE' => 'trait trE { public static function getHW() { return parent::HW; } }',
+ 'E' => 'class E extends B { use trE; }',
+ 'F' => 'class F { const XX = "this is F"; }',
+ 'G' => 'class G extends F { const XX = parent::XX." extended by G"; public static function get_me($x = "got ".self::XX) { return $x; } }',
+];
+
+spl_autoload_register(function ($class) use ($classlist) {
+ if (isset($classlist[$class])) {
+ eval($classlist[$class]);
+ } else {
+ die("Cannot autoload $class\n");
+ }
+});
+
+printf("B::HW = %s\n", B::HW);
+printf("D::HW = %s\n", D::HW);
+
+printf("E::getHW() = %s\n", E::getHW());
+printf("G::get_me() = %s\n", G::get_me());
+
+?>
+--EXPECT--
+B::HW = this is A extended by B
+D::HW = this is space1\C extented by D
+E::getHW() = this is A extended by B
+G::get_me() = got this is F extended by G
diff --git a/Zend/tests/constant_expressions_dynamic.phpt b/Zend/tests/constant_expressions_dynamic.phpt
new file mode 100644
index 0000000000..21c9216cc1
--- /dev/null
+++ b/Zend/tests/constant_expressions_dynamic.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Dynamic Constant Expressions
+--FILE--
+<?php
+const FOO = 1;
+const BAR = FOO | 2;
+
+echo BAR;
+?>
+--EXPECTF--
+3
diff --git a/Zend/tests/constant_expressions_self_referencing_array.phpt b/Zend/tests/constant_expressions_self_referencing_array.phpt
new file mode 100644
index 0000000000..ae76a08602
--- /dev/null
+++ b/Zend/tests/constant_expressions_self_referencing_array.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Self-referencing constant expression (part of a constant AST)
+--FILE--
+<?php
+class A {
+ const FOO = [self::BAR];
+ const BAR = [self::FOO];
+}
+var_dump(A::FOO);
+?>
+--EXPECTF--
+Fatal error: Cannot declare self-referencing constant 'self::FOO' in %s on line %d
+
diff --git a/Zend/tests/debug_info-error-0.0.phpt b/Zend/tests/debug_info-error-0.0.phpt
new file mode 100644
index 0000000000..1c8dfc8853
--- /dev/null
+++ b/Zend/tests/debug_info-error-0.0.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Testing __debugInfo() magic method with bad returns ZERO (float)
+--FILE--
+<?php
+
+class C {
+ public $val;
+ public function __debugInfo() {
+ return $this->val;
+ }
+ public function __construct($val) {
+ $this->val = $val;
+ }
+}
+
+$c = new C(0.0);
+var_dump($c);
+--EXPECTF--
+Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-0.0.php on line %d
diff --git a/Zend/tests/debug_info-error-0.phpt b/Zend/tests/debug_info-error-0.phpt
new file mode 100644
index 0000000000..868ac2f75f
--- /dev/null
+++ b/Zend/tests/debug_info-error-0.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Testing __debugInfo() magic method with bad returns ZERO
+--FILE--
+<?php
+
+class C {
+ public $val;
+ public function __debugInfo() {
+ return $this->val;
+ }
+ public function __construct($val) {
+ $this->val = $val;
+ }
+}
+
+$c = new C(0);
+var_dump($c);
+--EXPECTF--
+Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-0.php on line %d
diff --git a/Zend/tests/debug_info-error-1.0.phpt b/Zend/tests/debug_info-error-1.0.phpt
new file mode 100644
index 0000000000..27611237bb
--- /dev/null
+++ b/Zend/tests/debug_info-error-1.0.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Testing __debugInfo() magic method with bad returns ONE (float)
+--FILE--
+<?php
+
+class C {
+ public $val;
+ public function __debugInfo() {
+ return $this->val;
+ }
+ public function __construct($val) {
+ $this->val = $val;
+ }
+}
+
+$c = new C(1.0);
+var_dump($c);
+--EXPECTF--
+Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-1.0.php on line %d
diff --git a/Zend/tests/debug_info-error-1.phpt b/Zend/tests/debug_info-error-1.phpt
new file mode 100644
index 0000000000..e2e9823ed4
--- /dev/null
+++ b/Zend/tests/debug_info-error-1.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Testing __debugInfo() magic method with bad returns ONE
+--FILE--
+<?php
+
+class C {
+ public $val;
+ public function __debugInfo() {
+ return $this->val;
+ }
+ public function __construct($val) {
+ $this->val = $val;
+ }
+}
+
+$c = new C(1);
+var_dump($c);
+--EXPECTF--
+Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-1.php on line %d
diff --git a/Zend/tests/debug_info-error-empty_str.phpt b/Zend/tests/debug_info-error-empty_str.phpt
new file mode 100644
index 0000000000..72ab85d7d8
--- /dev/null
+++ b/Zend/tests/debug_info-error-empty_str.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Testing __debugInfo() magic method with bad returns EMPTY STRING
+--FILE--
+<?php
+
+class C {
+ public $val;
+ public function __debugInfo() {
+ return $this->val;
+ }
+ public function __construct($val) {
+ $this->val = $val;
+ }
+}
+
+$c = new C("");
+var_dump($c);
+--EXPECTF--
+Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-empty_str.php on line %d
diff --git a/Zend/tests/debug_info-error-false.phpt b/Zend/tests/debug_info-error-false.phpt
new file mode 100644
index 0000000000..d6e19938af
--- /dev/null
+++ b/Zend/tests/debug_info-error-false.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Testing __debugInfo() magic method with bad returns FALSE
+--FILE--
+<?php
+
+class C {
+ public $val;
+ public function __debugInfo() {
+ return $this->val;
+ }
+ public function __construct($val) {
+ $this->val = $val;
+ }
+}
+
+$c = new C(false);
+var_dump($c);
+--EXPECTF--
+Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-false.php on line %d
diff --git a/Zend/tests/debug_info-error-object.phpt b/Zend/tests/debug_info-error-object.phpt
new file mode 100644
index 0000000000..40737db2b6
--- /dev/null
+++ b/Zend/tests/debug_info-error-object.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Testing __debugInfo() magic method with bad returns OBJECT
+--FILE--
+<?php
+
+class C {
+ public $val;
+ public function __debugInfo() {
+ return $this->val;
+ }
+ public function __construct($val) {
+ $this->val = $val;
+ }
+}
+
+$c = new C(new stdClass);
+var_dump($c);
+--EXPECTF--
+Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-object.php on line %d
diff --git a/Zend/tests/debug_info-error-resource.phpt b/Zend/tests/debug_info-error-resource.phpt
new file mode 100644
index 0000000000..ebdc37e534
--- /dev/null
+++ b/Zend/tests/debug_info-error-resource.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Testing __debugInfo() magic method with bad returns RESOURCE
+--FILE--
+<?php
+
+class C {
+ public $val;
+ public function __debugInfo() {
+ return $this->val;
+ }
+ public function __construct($val) {
+ $this->val = $val;
+ }
+}
+
+$c = new C(fopen("data:text/plain,Foo", 'r'));
+var_dump($c);
+--EXPECTF--
+Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-resource.php on line %d
diff --git a/Zend/tests/debug_info-error-str.phpt b/Zend/tests/debug_info-error-str.phpt
new file mode 100644
index 0000000000..aa16d5bf7c
--- /dev/null
+++ b/Zend/tests/debug_info-error-str.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Testing __debugInfo() magic method with bad returns STRING
+--FILE--
+<?php
+
+class C {
+ public $val;
+ public function __debugInfo() {
+ return $this->val;
+ }
+ public function __construct($val) {
+ $this->val = $val;
+ }
+}
+
+$c = new C("foo");
+var_dump($c);
+--EXPECTF--
+Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-str.php on line %d
diff --git a/Zend/tests/debug_info-error-true.phpt b/Zend/tests/debug_info-error-true.phpt
new file mode 100644
index 0000000000..2501e8a412
--- /dev/null
+++ b/Zend/tests/debug_info-error-true.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Testing __debugInfo() magic method with bad returns TRUE
+--FILE--
+<?php
+
+class C {
+ public $val;
+ public function __debugInfo() {
+ return $this->val;
+ }
+ public function __construct($val) {
+ $this->val = $val;
+ }
+}
+
+$c = new C(true);
+var_dump($c);
+--EXPECTF--
+Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-true.php on line %d
diff --git a/Zend/tests/debug_info.phpt b/Zend/tests/debug_info.phpt
new file mode 100644
index 0000000000..c82ddb2143
--- /dev/null
+++ b/Zend/tests/debug_info.phpt
@@ -0,0 +1,39 @@
+--TEST--
+Testing __debugInfo() magic method
+--FILE--
+<?php
+
+class Foo {
+ public $d = 4;
+ protected $e = 5;
+ private $f = 6;
+
+ public function __debugInfo() {
+ return ['a'=>1, "\0*\0b"=>2, "\0Foo\0c"=>3];
+ }
+}
+
+class Bar {
+ public $val = 123;
+
+ public function __debugInfo() {
+ return null;
+ }
+}
+
+$f = new Foo;
+var_dump($f);
+
+$b = new Bar;
+var_dump($b);
+--EXPECTF--
+object(Foo)#%d (3) {
+ ["a"]=>
+ int(1)
+ ["b":protected]=>
+ int(2)
+ ["c":"Foo":private]=>
+ int(3)
+}
+object(Bar)#%d (0) {
+}
diff --git a/Zend/tests/dereference_002.phpt b/Zend/tests/dereference_002.phpt
index 022ff370d2..da13decc39 100644
--- a/Zend/tests/dereference_002.phpt
+++ b/Zend/tests/dereference_002.phpt
@@ -76,4 +76,4 @@ NULL
Notice: Undefined offset: 3 in %s on line %d
-Fatal error: Call to a member function bar() on a non-object in %s on line %d
+Fatal error: Call to a member function bar() on null in %s on line %d
diff --git a/Zend/tests/errmsg_040.phpt b/Zend/tests/errmsg_040.phpt
index f3d0afcf0a..cda8d4c76a 100644
--- a/Zend/tests/errmsg_040.phpt
+++ b/Zend/tests/errmsg_040.phpt
@@ -7,7 +7,17 @@ class test {
const TEST = array(1,2,3);
}
+var_dump(test::TEST);
+
echo "Done\n";
?>
--EXPECTF--
-Fatal error: Arrays are not allowed in class constants in %s on line %d
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
+Done
diff --git a/Zend/tests/finally_goto_001.phpt b/Zend/tests/finally_goto_001.phpt
new file mode 100644
index 0000000000..990f78d4c7
--- /dev/null
+++ b/Zend/tests/finally_goto_001.phpt
@@ -0,0 +1,14 @@
+--TEST--
+jmp into a finally block 01
+--FILE--
+<?php
+function foo() {
+ goto test;
+ try {
+ } finally {
+test:
+ }
+}
+?>
+--EXPECTF--
+Fatal error: jump into a finally block is disallowed in %sfinally_goto_001.php on line %d
diff --git a/Zend/tests/finally_goto_002.phpt b/Zend/tests/finally_goto_002.phpt
new file mode 100644
index 0000000000..a6bd9e307f
--- /dev/null
+++ b/Zend/tests/finally_goto_002.phpt
@@ -0,0 +1,14 @@
+--TEST--
+jmp into a finally block 02
+--FILE--
+<?php
+function foo() {
+ try {
+ goto test;
+ } finally {
+test:
+ }
+}
+?>
+--EXPECTF--
+Fatal error: jump into a finally block is disallowed in %sfinally_goto_002.php on line %d
diff --git a/Zend/tests/finally_goto_003.phpt b/Zend/tests/finally_goto_003.phpt
new file mode 100644
index 0000000000..8529ff7865
--- /dev/null
+++ b/Zend/tests/finally_goto_003.phpt
@@ -0,0 +1,15 @@
+--TEST--
+jmp into a finally block 03
+--FILE--
+<?php
+function foo() {
+ try {
+ } finally {
+ goto test;
+test:
+ }
+}
+echo "okey";
+?>
+--EXPECTF--
+okey
diff --git a/Zend/tests/finally_goto_004.phpt b/Zend/tests/finally_goto_004.phpt
new file mode 100644
index 0000000000..d88ceedf52
--- /dev/null
+++ b/Zend/tests/finally_goto_004.phpt
@@ -0,0 +1,14 @@
+--TEST--
+jmp into a finally block 03
+--FILE--
+<?php
+function foo() {
+ try {
+ } finally {
+test:
+ }
+ goto test;
+}
+?>
+--EXPECTF--
+Fatal error: jump into a finally block is disallowed in %sfinally_goto_004.php on line %d
diff --git a/Zend/tests/function_arguments_003.phpt b/Zend/tests/function_arguments_003.phpt
new file mode 100644
index 0000000000..b882476d1d
--- /dev/null
+++ b/Zend/tests/function_arguments_003.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Function Argument Parsing #003
+--FILE--
+<?php
+const a = 10;
+
+function t1($a = 1 + 1, $b = 1 << 2, $c = "foo" . "bar", $d = a * 10) {
+ var_dump($a, $b, $c, $d);
+}
+
+t1();
+?>
+--EXPECT--
+int(2)
+int(4)
+string(6) "foobar"
+int(100)
diff --git a/Zend/tests/incompat_ctx_user.phpt b/Zend/tests/incompat_ctx_user.phpt
new file mode 100644
index 0000000000..2d9b59c1e8
--- /dev/null
+++ b/Zend/tests/incompat_ctx_user.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Incompatible context call (non-internal function)
+--INI--
+error_reporting=E_ALL
+--FILE--
+<?php
+
+class A {
+ function foo() { var_dump(get_class($this)); }
+}
+class B {
+ function bar() { A::foo(); }
+}
+$b = new B;
+$b->bar();
+
+?>
+--EXPECTF--
+Deprecated: Non-static method A::foo() should not be called statically, assuming $this from incompatible context in %s on line %d
+string(1) "B"
diff --git a/Zend/tests/ns_059.phpt b/Zend/tests/ns_059.phpt
index ea66037b43..701e448812 100644
--- a/Zend/tests/ns_059.phpt
+++ b/Zend/tests/ns_059.phpt
@@ -3,6 +3,9 @@
--FILE--
<?php
const C = array();
---EXPECTF--
-Fatal error: Arrays are not allowed as constants in %sns_059.php on line 2
+var_dump(C);
+?>
+--EXPECTF--
+array(0) {
+}
diff --git a/Zend/tests/static_variable.phpt b/Zend/tests/static_variable.phpt
new file mode 100644
index 0000000000..62ca565ffe
--- /dev/null
+++ b/Zend/tests/static_variable.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Static Variable Expressions
+--FILE--
+<?php
+const bar = 2, baz = bar + 1;
+
+function foo() {
+ static $a = 1 + 1;
+ static $b = [bar => 1 + 1, baz * 2 => 1 << 2];
+ static $c = [1 => bar, 3 => baz];
+ var_dump($a, $b, $c);
+}
+
+foo();
+?>
+--EXPECT--
+int(2)
+array(2) {
+ [2]=>
+ int(2)
+ [6]=>
+ int(4)
+}
+array(2) {
+ [1]=>
+ int(2)
+ [3]=>
+ int(3)
+}
diff --git a/Zend/tests/use_const/alias.phpt b/Zend/tests/use_const/alias.phpt
new file mode 100644
index 0000000000..f179393006
--- /dev/null
+++ b/Zend/tests/use_const/alias.phpt
@@ -0,0 +1,26 @@
+--TEST--
+aliasing imported constants to resolve naming conflicts
+--FILE--
+<?php
+
+namespace foo {
+ const baz = 42;
+}
+
+namespace bar {
+ const baz = 43;
+}
+
+namespace {
+ use const foo\baz as foo_baz,
+ bar\baz as bar_baz;
+ var_dump(foo_baz);
+ var_dump(bar_baz);
+ echo "Done\n";
+}
+
+?>
+--EXPECT--
+int(42)
+int(43)
+Done
diff --git a/Zend/tests/use_const/basic.phpt b/Zend/tests/use_const/basic.phpt
new file mode 100644
index 0000000000..6eaed7f27d
--- /dev/null
+++ b/Zend/tests/use_const/basic.phpt
@@ -0,0 +1,22 @@
+--TEST--
+import namespaced constant
+--FILE--
+<?php
+
+namespace foo\bar {
+ const baz = 42;
+ const qux = 43;
+}
+
+namespace {
+ use const foo\bar\baz, foo\bar\qux;
+ var_dump(baz);
+ var_dump(qux);
+ echo "Done\n";
+}
+
+?>
+--EXPECT--
+int(42)
+int(43)
+Done
diff --git a/Zend/tests/use_const/case_sensivity.phpt b/Zend/tests/use_const/case_sensivity.phpt
new file mode 100644
index 0000000000..1977daa93b
--- /dev/null
+++ b/Zend/tests/use_const/case_sensivity.phpt
@@ -0,0 +1,12 @@
+--TEST--
+importing const with same name but different case
+--FILE--
+<?php
+
+namespace {
+ use const foo\bar;
+ use const foo\BAR;
+}
+
+?>
+--EXPECT--
diff --git a/Zend/tests/use_const/conflicting_use.phpt b/Zend/tests/use_const/conflicting_use.phpt
new file mode 100644
index 0000000000..3b3c4b3262
--- /dev/null
+++ b/Zend/tests/use_const/conflicting_use.phpt
@@ -0,0 +1,21 @@
+--TEST--
+use const statements with conflicting names
+--FILE--
+<?php
+
+namespace foo {
+ const baz = 42;
+}
+
+namespace bar {
+ const baz = 42;
+}
+
+namespace {
+ use const foo\baz, bar\baz;
+ echo "Done\n";
+}
+
+?>
+--EXPECTF--
+Fatal error: Cannot use const bar\baz as baz because the name is already in use in %s on line %d
diff --git a/Zend/tests/use_const/conflicting_use_alias.phpt b/Zend/tests/use_const/conflicting_use_alias.phpt
new file mode 100644
index 0000000000..8b563a4ca9
--- /dev/null
+++ b/Zend/tests/use_const/conflicting_use_alias.phpt
@@ -0,0 +1,18 @@
+--TEST--
+use and use const with the same alias
+--FILE--
+<?php
+
+namespace {
+ const foo = 'foo';
+}
+
+namespace x {
+ use foo as bar;
+ use const foo as bar;
+ var_dump(bar);
+}
+
+?>
+--EXPECT--
+string(3) "foo"
diff --git a/Zend/tests/use_const/define_imported.phpt b/Zend/tests/use_const/define_imported.phpt
new file mode 100644
index 0000000000..5eb44be64a
--- /dev/null
+++ b/Zend/tests/use_const/define_imported.phpt
@@ -0,0 +1,14 @@
+--TEST--
+defining const with same name as imported should fail
+--FILE--
+<?php
+
+namespace {
+ use const foo\bar;
+
+ const bar = 42;
+}
+
+?>
+--EXPECTF--
+Fatal error: Cannot declare const bar because the name is already in use in %s on line %d
diff --git a/Zend/tests/use_const/define_imported_before.phpt b/Zend/tests/use_const/define_imported_before.phpt
new file mode 100644
index 0000000000..f674ce81e8
--- /dev/null
+++ b/Zend/tests/use_const/define_imported_before.phpt
@@ -0,0 +1,18 @@
+--TEST--
+using const with same name as defined should fail
+--FILE--
+<?php
+
+namespace {
+ const bar = 42;
+
+ use const foo\bar;
+}
+
+namespace {
+ echo "Done";
+}
+
+?>
+--EXPECTF--
+Fatal error: Cannot use const foo\bar as bar because the name is already in use in %s on line %d
diff --git a/Zend/tests/use_const/includes/foo_bar.php b/Zend/tests/use_const/includes/foo_bar.php
new file mode 100644
index 0000000000..90ed451f36
--- /dev/null
+++ b/Zend/tests/use_const/includes/foo_bar.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace foo;
+
+const bar = 'local bar';
diff --git a/Zend/tests/use_const/includes/foo_php_version.php b/Zend/tests/use_const/includes/foo_php_version.php
new file mode 100644
index 0000000000..08f9fd150e
--- /dev/null
+++ b/Zend/tests/use_const/includes/foo_php_version.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace foo;
+
+const PHP_VERSION = 42;
diff --git a/Zend/tests/use_const/includes/global_bar.php b/Zend/tests/use_const/includes/global_bar.php
new file mode 100644
index 0000000000..609d17b7b5
--- /dev/null
+++ b/Zend/tests/use_const/includes/global_bar.php
@@ -0,0 +1,3 @@
+<?php
+
+const bar = 'global bar';
diff --git a/Zend/tests/use_const/includes/global_baz.php b/Zend/tests/use_const/includes/global_baz.php
new file mode 100644
index 0000000000..8b6fba97b3
--- /dev/null
+++ b/Zend/tests/use_const/includes/global_baz.php
@@ -0,0 +1,3 @@
+<?php
+
+const baz = NULL;
diff --git a/Zend/tests/use_const/no_global_fallback.phpt b/Zend/tests/use_const/no_global_fallback.phpt
new file mode 100644
index 0000000000..a128f353ed
--- /dev/null
+++ b/Zend/tests/use_const/no_global_fallback.phpt
@@ -0,0 +1,14 @@
+--TEST--
+non-existent imported constants should not be looked up in the global table
+--FILE--
+<?php
+
+require 'includes/global_baz.php';
+
+use const foo\bar\baz;
+var_dump(baz);
+
+?>
+--EXPECTF--
+Notice: Use of undefined constant baz - assumed 'baz' in %s on line %d
+string(3) "baz"
diff --git a/Zend/tests/use_const/self_parent.phpt b/Zend/tests/use_const/self_parent.phpt
new file mode 100644
index 0000000000..b71f2ecc81
--- /dev/null
+++ b/Zend/tests/use_const/self_parent.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Allow self and parent in use const statement
+--FILE--
+<?php
+
+namespace {
+ use const self as foo;
+ use const parent as bar;
+}
+
+?>
+--EXPECT--
diff --git a/Zend/tests/use_const/shadow_core.phpt b/Zend/tests/use_const/shadow_core.phpt
new file mode 100644
index 0000000000..7d8bcbd189
--- /dev/null
+++ b/Zend/tests/use_const/shadow_core.phpt
@@ -0,0 +1,16 @@
+--TEST--
+shadowing a global core constant with a local version
+--FILE--
+<?php
+
+require 'includes/foo_php_version.php';
+
+use const foo\PHP_VERSION;
+
+var_dump(PHP_VERSION);
+echo "Done\n";
+
+?>
+--EXPECTF--
+int(42)
+Done
diff --git a/Zend/tests/use_const/shadow_global.phpt b/Zend/tests/use_const/shadow_global.phpt
new file mode 100644
index 0000000000..930cc9f0b8
--- /dev/null
+++ b/Zend/tests/use_const/shadow_global.phpt
@@ -0,0 +1,25 @@
+--TEST--
+shadowing a global constant with a local version
+--FILE--
+<?php
+
+namespace {
+ require 'includes/global_bar.php';
+ require 'includes/foo_bar.php';
+}
+
+namespace {
+ var_dump(bar);
+}
+
+namespace {
+ use const foo\bar;
+ var_dump(bar);
+ echo "Done\n";
+}
+
+?>
+--EXPECT--
+string(10) "global bar"
+string(9) "local bar"
+Done
diff --git a/Zend/tests/use_function/alias.phpt b/Zend/tests/use_function/alias.phpt
new file mode 100644
index 0000000000..5f7e97fff8
--- /dev/null
+++ b/Zend/tests/use_function/alias.phpt
@@ -0,0 +1,30 @@
+--TEST--
+aliasing imported functions to resolve naming conflicts
+--FILE--
+<?php
+
+namespace foo {
+ function baz() {
+ return 'foo.baz';
+ }
+}
+
+namespace bar {
+ function baz() {
+ return 'bar.baz';
+ }
+}
+
+namespace {
+ use function foo\baz as foo_baz,
+ bar\baz as bar_baz;
+ var_dump(foo_baz());
+ var_dump(bar_baz());
+ echo "Done\n";
+}
+
+?>
+--EXPECT--
+string(7) "foo.baz"
+string(7) "bar.baz"
+Done
diff --git a/Zend/tests/use_function/basic.phpt b/Zend/tests/use_function/basic.phpt
new file mode 100644
index 0000000000..513a96620c
--- /dev/null
+++ b/Zend/tests/use_function/basic.phpt
@@ -0,0 +1,26 @@
+--TEST--
+import namespaced function
+--FILE--
+<?php
+
+namespace foo\bar {
+ function baz() {
+ return 'foo.bar.baz';
+ }
+ function qux() {
+ return baz();
+ }
+}
+
+namespace {
+ use function foo\bar\baz, foo\bar\qux;
+ var_dump(baz());
+ var_dump(qux());
+ echo "Done\n";
+}
+
+?>
+--EXPECT--
+string(11) "foo.bar.baz"
+string(11) "foo.bar.baz"
+Done
diff --git a/Zend/tests/use_function/case_insensivity.phpt b/Zend/tests/use_function/case_insensivity.phpt
new file mode 100644
index 0000000000..ba6e3a7e4b
--- /dev/null
+++ b/Zend/tests/use_function/case_insensivity.phpt
@@ -0,0 +1,13 @@
+--TEST--
+importing function with same name but different case should fail
+--FILE--
+<?php
+
+namespace {
+ use function foo\bar;
+ use function foo\BAR;
+}
+
+?>
+--EXPECTF--
+Fatal error: Cannot use function foo\BAR as BAR because the name is already in use in %s on line %d
diff --git a/Zend/tests/use_function/conditional_function_declaration.phpt b/Zend/tests/use_function/conditional_function_declaration.phpt
new file mode 100644
index 0000000000..ccfb96103a
--- /dev/null
+++ b/Zend/tests/use_function/conditional_function_declaration.phpt
@@ -0,0 +1,17 @@
+--TEST--
+function that is conditionally defined at runtime should not cause compiler error
+--FILE--
+<?php
+
+if (0) {
+ function foo() {
+ }
+}
+
+use function bar\foo;
+
+echo "Done";
+
+?>
+--EXPECT--
+Done
diff --git a/Zend/tests/use_function/conflicting_use.phpt b/Zend/tests/use_function/conflicting_use.phpt
new file mode 100644
index 0000000000..0221fbdebb
--- /dev/null
+++ b/Zend/tests/use_function/conflicting_use.phpt
@@ -0,0 +1,25 @@
+--TEST--
+use function statements with conflicting names
+--FILE--
+<?php
+
+namespace foo {
+ function baz() {
+ return 'foo.baz';
+ }
+}
+
+namespace bar {
+ function baz() {
+ return 'bar.baz';
+ }
+}
+
+namespace {
+ use function foo\baz, bar\baz;
+ echo "Done\n";
+}
+
+?>
+--EXPECTF--
+Fatal error: Cannot use function bar\baz as baz because the name is already in use in %s on line %d
diff --git a/Zend/tests/use_function/conflicting_use_alias.phpt b/Zend/tests/use_function/conflicting_use_alias.phpt
new file mode 100644
index 0000000000..2870512014
--- /dev/null
+++ b/Zend/tests/use_function/conflicting_use_alias.phpt
@@ -0,0 +1,20 @@
+--TEST--
+use and use function with the same alias
+--FILE--
+<?php
+
+namespace {
+ function foo() {
+ return 'foo';
+ }
+}
+
+namespace x {
+ use foo as bar;
+ use function foo as bar;
+ var_dump(bar());
+}
+
+?>
+--EXPECT--
+string(3) "foo"
diff --git a/Zend/tests/use_function/conflicting_use_const_alias.phpt b/Zend/tests/use_function/conflicting_use_const_alias.phpt
new file mode 100644
index 0000000000..2e0faf0da2
--- /dev/null
+++ b/Zend/tests/use_function/conflicting_use_const_alias.phpt
@@ -0,0 +1,23 @@
+--TEST--
+use const and use function with the same alias
+--FILE--
+<?php
+
+namespace {
+ const foo = 'foo.const';
+ function foo() {
+ return 'foo.function';
+ }
+}
+
+namespace x {
+ use const foo as bar;
+ use function foo as bar;
+ var_dump(bar);
+ var_dump(bar());
+}
+
+?>
+--EXPECT--
+string(9) "foo.const"
+string(12) "foo.function"
diff --git a/Zend/tests/use_function/define_imported.phpt b/Zend/tests/use_function/define_imported.phpt
new file mode 100644
index 0000000000..c542a4d549
--- /dev/null
+++ b/Zend/tests/use_function/define_imported.phpt
@@ -0,0 +1,14 @@
+--TEST--
+defining function with same name as imported should fail
+--FILE--
+<?php
+
+namespace {
+ use function foo\bar;
+
+ function bar() {}
+}
+
+?>
+--EXPECTF--
+Fatal error: Cannot declare function bar because the name is already in use in %s on line %d
diff --git a/Zend/tests/use_function/define_imported_before.phpt b/Zend/tests/use_function/define_imported_before.phpt
new file mode 100644
index 0000000000..91974e0783
--- /dev/null
+++ b/Zend/tests/use_function/define_imported_before.phpt
@@ -0,0 +1,18 @@
+--TEST--
+using function with same name as defined should fail
+--FILE--
+<?php
+
+namespace {
+ function bar() {}
+
+ use function foo\bar;
+}
+
+namespace {
+ echo "Done";
+}
+
+?>
+--EXPECTF--
+Fatal error: Cannot use function foo\bar as bar because the name is already in use in %s on line %d
diff --git a/Zend/tests/use_function/ignore_constants.phpt b/Zend/tests/use_function/ignore_constants.phpt
new file mode 100644
index 0000000000..c50ff7357a
--- /dev/null
+++ b/Zend/tests/use_function/ignore_constants.phpt
@@ -0,0 +1,23 @@
+--TEST--
+use function should ignore namespaced constants
+--FILE--
+<?php
+
+namespace foo {
+ const bar = 42;
+}
+
+namespace {
+ const bar = 43;
+}
+
+namespace {
+ use function foo\bar;
+ var_dump(bar);
+ echo "Done\n";
+}
+
+?>
+--EXPECT--
+int(43)
+Done
diff --git a/Zend/tests/use_function/includes/foo_bar.php b/Zend/tests/use_function/includes/foo_bar.php
new file mode 100644
index 0000000000..6d2f8cab45
--- /dev/null
+++ b/Zend/tests/use_function/includes/foo_bar.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace foo;
+
+function bar() {
+ return 'local bar';
+}
diff --git a/Zend/tests/use_function/includes/foo_strlen.php b/Zend/tests/use_function/includes/foo_strlen.php
new file mode 100644
index 0000000000..d2df2aa2b4
--- /dev/null
+++ b/Zend/tests/use_function/includes/foo_strlen.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace foo;
+
+function strlen($str) {
+ return 4;
+}
diff --git a/Zend/tests/use_function/includes/global_bar.php b/Zend/tests/use_function/includes/global_bar.php
new file mode 100644
index 0000000000..6d7d91f805
--- /dev/null
+++ b/Zend/tests/use_function/includes/global_bar.php
@@ -0,0 +1,5 @@
+<?php
+
+function bar() {
+ return 'global bar';
+}
diff --git a/Zend/tests/use_function/includes/global_baz.php b/Zend/tests/use_function/includes/global_baz.php
new file mode 100644
index 0000000000..6383b9dd38
--- /dev/null
+++ b/Zend/tests/use_function/includes/global_baz.php
@@ -0,0 +1,4 @@
+<?php
+
+function baz() {
+}
diff --git a/Zend/tests/use_function/no_global_fallback.phpt b/Zend/tests/use_function/no_global_fallback.phpt
new file mode 100644
index 0000000000..6597d0d301
--- /dev/null
+++ b/Zend/tests/use_function/no_global_fallback.phpt
@@ -0,0 +1,13 @@
+--TEST--
+non-existent imported functions should not be looked up in the global table
+--FILE--
+<?php
+
+require 'includes/global_baz.php';
+
+use function foo\bar\baz;
+var_dump(baz());
+
+?>
+--EXPECTF--
+Fatal error: Call to undefined function foo\bar\baz() in %s on line %d
diff --git a/Zend/tests/use_function/no_global_fallback2.phpt b/Zend/tests/use_function/no_global_fallback2.phpt
new file mode 100644
index 0000000000..5d012c10e5
--- /dev/null
+++ b/Zend/tests/use_function/no_global_fallback2.phpt
@@ -0,0 +1,18 @@
+--TEST--
+non-existent imported functions should not be looked up in the global table
+--FILE--
+<?php
+
+namespace {
+ function test() {
+ echo "NO!";
+ }
+}
+namespace foo {
+ use function bar\test;
+ test();
+}
+
+?>
+--EXPECTF--
+Fatal error: Call to undefined function bar\test() in %s on line %d
diff --git a/Zend/tests/use_function/self_parent.phpt b/Zend/tests/use_function/self_parent.phpt
new file mode 100644
index 0000000000..f1e1fa84f1
--- /dev/null
+++ b/Zend/tests/use_function/self_parent.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Allow self and parent in use function statement
+--FILE--
+<?php
+
+namespace {
+ use function self as foo;
+ use function parent as bar;
+}
+
+?>
+--EXPECT--
diff --git a/Zend/tests/use_function/shadow_core.phpt b/Zend/tests/use_function/shadow_core.phpt
new file mode 100644
index 0000000000..8f92ff1e1b
--- /dev/null
+++ b/Zend/tests/use_function/shadow_core.phpt
@@ -0,0 +1,16 @@
+--TEST--
+shadowing a global core function with a local version
+--FILE--
+<?php
+
+require 'includes/foo_strlen.php';
+
+use function foo\strlen;
+
+var_dump(strlen('foo bar baz'));
+echo "Done\n";
+
+?>
+--EXPECT--
+int(4)
+Done
diff --git a/Zend/tests/use_function/shadow_global.phpt b/Zend/tests/use_function/shadow_global.phpt
new file mode 100644
index 0000000000..791bcdf4d5
--- /dev/null
+++ b/Zend/tests/use_function/shadow_global.phpt
@@ -0,0 +1,25 @@
+--TEST--
+shadowing a global function with a local version
+--FILE--
+<?php
+
+namespace {
+ require 'includes/global_bar.php';
+ require 'includes/foo_bar.php';
+}
+
+namespace {
+ var_dump(bar());
+}
+
+namespace {
+ use function foo\bar;
+ var_dump(bar());
+ echo "Done\n";
+}
+
+?>
+--EXPECT--
+string(10) "global bar"
+string(9) "local bar"
+Done
diff --git a/Zend/tests/variadic/adding_additional_optional_parameter.phpt b/Zend/tests/variadic/adding_additional_optional_parameter.phpt
new file mode 100644
index 0000000000..b4e797803d
--- /dev/null
+++ b/Zend/tests/variadic/adding_additional_optional_parameter.phpt
@@ -0,0 +1,17 @@
+--TEST--
+It's possible to add additional optional arguments with matching signature
+--FILE--
+<?php
+
+interface DB {
+ public function query($query, string ...$params);
+}
+
+class MySQL implements DB {
+ public function query($query, string $extraParam = null, string ...$params) { }
+}
+
+?>
+===DONE===
+--EXPECT--
+===DONE===
diff --git a/Zend/tests/variadic/adding_additional_optional_parameter_error.phpt b/Zend/tests/variadic/adding_additional_optional_parameter_error.phpt
new file mode 100644
index 0000000000..2f31d47dc6
--- /dev/null
+++ b/Zend/tests/variadic/adding_additional_optional_parameter_error.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Additional optional parameters must have a matching prototype
+--FILE--
+<?php
+
+interface DB {
+ public function query($query, string ...$params);
+}
+
+class MySQL implements DB {
+ public function query($query, int $extraParam = null, string ...$params) { }
+}
+
+?>
+--EXPECTF--
+Fatal error: Declaration of MySQL::query() must be compatible with DB::query($query, string ...$params) in %s on line %d
diff --git a/Zend/tests/variadic/basic.phpt b/Zend/tests/variadic/basic.phpt
new file mode 100644
index 0000000000..810d4756aa
--- /dev/null
+++ b/Zend/tests/variadic/basic.phpt
@@ -0,0 +1,57 @@
+--TEST--
+Basic variadic function
+--FILE--
+<?php
+
+function test1(... $args) {
+ var_dump($args);
+}
+
+test1();
+test1(1);
+test1(1, 2, 3);
+
+function test2($arg1, $arg2, ...$args) {
+ var_dump($arg1, $arg2, $args);
+}
+
+test2(1, 2);
+test2(1, 2, 3);
+test2(1, 2, 3, 4, 5);
+
+?>
+--EXPECT--
+array(0) {
+}
+array(1) {
+ [0]=>
+ int(1)
+}
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
+int(1)
+int(2)
+array(0) {
+}
+int(1)
+int(2)
+array(1) {
+ [0]=>
+ int(3)
+}
+int(1)
+int(2)
+array(3) {
+ [0]=>
+ int(3)
+ [1]=>
+ int(4)
+ [2]=>
+ int(5)
+}
diff --git a/Zend/tests/variadic/by_ref.phpt b/Zend/tests/variadic/by_ref.phpt
new file mode 100644
index 0000000000..e1635f4ecf
--- /dev/null
+++ b/Zend/tests/variadic/by_ref.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Variadic arguments with by-reference passing
+--FILE--
+<?php
+
+function test(&... $args) {
+ $i = 0;
+ foreach ($args as &$arg) {
+ $arg = $i++;
+ }
+}
+
+test();
+test($a);
+var_dump($a);
+test($b, $c, $d);
+var_dump($b, $c, $d);
+
+?>
+--EXPECT--
+int(0)
+int(0)
+int(1)
+int(2)
diff --git a/Zend/tests/variadic/by_ref_error.phpt b/Zend/tests/variadic/by_ref_error.phpt
new file mode 100644
index 0000000000..7f21014146
--- /dev/null
+++ b/Zend/tests/variadic/by_ref_error.phpt
@@ -0,0 +1,12 @@
+--TEST--
+By-ref variadics enforce the reference
+--FILE--
+<?php
+
+function test(&... $args) { }
+
+test(1);
+
+?>
+--EXPECTF--
+Fatal error: Only variables can be passed by reference in %s on line %d
diff --git a/Zend/tests/variadic/no_default_error.phpt b/Zend/tests/variadic/no_default_error.phpt
new file mode 100644
index 0000000000..427ebed028
--- /dev/null
+++ b/Zend/tests/variadic/no_default_error.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Variadic argument cannot have a default value
+--FILE--
+<?php
+
+function test(...$args = 123) {}
+
+?>
+--EXPECTF--
+Fatal error: Variadic parameter cannot have a default value in %s on line %d
diff --git a/Zend/tests/variadic/non_variadic_implements_variadic_error.phpt b/Zend/tests/variadic/non_variadic_implements_variadic_error.phpt
new file mode 100644
index 0000000000..f447837ca4
--- /dev/null
+++ b/Zend/tests/variadic/non_variadic_implements_variadic_error.phpt
@@ -0,0 +1,16 @@
+--TEST--
+It's not possible to turn a variadic function into a non-variadic one
+--FILE--
+<?php
+
+interface DB {
+ public function query($query, ...$params);
+}
+
+class MySQL implements DB {
+ public function query($query, $params) { }
+}
+
+?>
+--EXPECTF--
+Fatal error: Declaration of MySQL::query() must be compatible with DB::query($query, ...$params) in %s on line %d
diff --git a/Zend/tests/variadic/only_last_error.phpt b/Zend/tests/variadic/only_last_error.phpt
new file mode 100644
index 0000000000..ee6ff3f777
--- /dev/null
+++ b/Zend/tests/variadic/only_last_error.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Only the last argument can be variadic
+--FILE--
+<?php
+
+function test($foo, ...$bar, $baz) {}
+
+?>
+--EXPECTF--
+Fatal error: Only the last parameter can be variadic in %s on line %d
diff --git a/Zend/tests/variadic/optional_params.phpt b/Zend/tests/variadic/optional_params.phpt
new file mode 100644
index 0000000000..ba965e538c
--- /dev/null
+++ b/Zend/tests/variadic/optional_params.phpt
@@ -0,0 +1,49 @@
+--TEST--
+Optional parameter before variadic parameter
+--FILE--
+<?php
+
+function fn($reqParam, $optParam = null, ...$params) {
+ var_dump($reqParam, $optParam, $params);
+}
+
+fn(1);
+fn(1, 2);
+fn(1, 2, 3);
+fn(1, 2, 3, 4);
+fn(1, 2, 3, 4, 5);
+
+?>
+--EXPECT--
+int(1)
+NULL
+array(0) {
+}
+int(1)
+int(2)
+array(0) {
+}
+int(1)
+int(2)
+array(1) {
+ [0]=>
+ int(3)
+}
+int(1)
+int(2)
+array(2) {
+ [0]=>
+ int(3)
+ [1]=>
+ int(4)
+}
+int(1)
+int(2)
+array(3) {
+ [0]=>
+ int(3)
+ [1]=>
+ int(4)
+ [2]=>
+ int(5)
+}
diff --git a/Zend/tests/variadic/removing_parameter_error.phpt b/Zend/tests/variadic/removing_parameter_error.phpt
new file mode 100644
index 0000000000..a189e5cf09
--- /dev/null
+++ b/Zend/tests/variadic/removing_parameter_error.phpt
@@ -0,0 +1,20 @@
+--TEST--
+It's not possible to remove required parameter before a variadic parameter
+--FILE--
+<?php
+
+/* Theoretically this should be valid because it weakens the constraint, but
+ * PHP does not allow this (for non-variadics), so I'm not allowing it here, too,
+ * to stay consistent. */
+
+interface DB {
+ public function query($query, ...$params);
+}
+
+class MySQL implements DB {
+ public function query(...$params) { }
+}
+
+?>
+--EXPECTF--
+Fatal error: Declaration of MySQL::query() must be compatible with DB::query($query, ...$params) in %s on line %d
diff --git a/Zend/tests/variadic/typehint_error.phpt b/Zend/tests/variadic/typehint_error.phpt
new file mode 100644
index 0000000000..3006b99957
--- /dev/null
+++ b/Zend/tests/variadic/typehint_error.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Variadic arguments enforce typehints
+--FILE--
+<?php
+
+function test(array... $args) {
+ var_dump($args);
+}
+
+test();
+test([0], [1], [2]);
+test([0], [1], 2);
+
+?>
+--EXPECTF--
+array(0) {
+}
+array(3) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(0)
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ int(1)
+ }
+ [2]=>
+ array(1) {
+ [0]=>
+ int(2)
+ }
+}
+
+Catchable fatal error: Argument 3 passed to test() must be of the type array, integer given, called in %s on line %d
diff --git a/Zend/tests/variadic/typehint_suppressed_error.phpt b/Zend/tests/variadic/typehint_suppressed_error.phpt
new file mode 100644
index 0000000000..5048e1c1bb
--- /dev/null
+++ b/Zend/tests/variadic/typehint_suppressed_error.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Error suppression for typehints on variadic arguments works
+--FILE--
+<?php
+
+function test(array... $args) {
+ var_dump($args);
+}
+
+set_error_handler(function($errno, $errstr) {
+ var_dump($errstr);
+ return true;
+});
+
+test([0], [1], 2);
+
+?>
+--EXPECTF--
+string(%d) "Argument 3 passed to test() must be of the type array, integer given, called in %s on line %d and defined"
+array(3) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(0)
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ int(1)
+ }
+ [2]=>
+ int(2)
+}
diff --git a/Zend/tests/variadic/variadic_changed_byref_error.phpt b/Zend/tests/variadic/variadic_changed_byref_error.phpt
new file mode 100644
index 0000000000..14fb6ae5eb
--- /dev/null
+++ b/Zend/tests/variadic/variadic_changed_byref_error.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Variadic arguments must have compatible passing modes
+--FILE--
+<?php
+
+interface DB {
+ public function query($query, &...$params);
+}
+
+class MySQL implements DB {
+ public function query($query, ...$params) { }
+}
+
+?>
+--EXPECTF--
+Fatal error: Declaration of MySQL::query() must be compatible with DB::query($query, &...$params) in %s on line %d
diff --git a/Zend/tests/variadic/variadic_changed_typehint_error.phpt b/Zend/tests/variadic/variadic_changed_typehint_error.phpt
new file mode 100644
index 0000000000..00df33a042
--- /dev/null
+++ b/Zend/tests/variadic/variadic_changed_typehint_error.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Typehints for variadic arguments have to be compatible
+--FILE--
+<?php
+
+interface DB {
+ public function query($query, string ...$params);
+}
+
+class MySQL implements DB {
+ public function query($query, int ...$params) { }
+}
+
+?>
+--EXPECTF--
+Fatal error: Declaration of MySQL::query() must be compatible with DB::query($query, string ...$params) in %s on line %d
diff --git a/Zend/tests/variadic/variadic_implements_non_variadic.phpt b/Zend/tests/variadic/variadic_implements_non_variadic.phpt
new file mode 100644
index 0000000000..a66ec280b8
--- /dev/null
+++ b/Zend/tests/variadic/variadic_implements_non_variadic.phpt
@@ -0,0 +1,17 @@
+--TEST--
+A non-variadic function can be turned into a variadic one
+--FILE--
+<?php
+
+interface DB {
+ public function query($query);
+}
+
+class MySQL implements DB {
+ public function query($query, ...$params) { }
+}
+
+?>
+===DONE===
+--EXPECT--
+===DONE===
diff --git a/Zend/tests/zend_signed_multiply-32bit.phpt b/Zend/tests/zend_signed_multiply-32bit.phpt
new file mode 100644
index 0000000000..3f37cbac19
--- /dev/null
+++ b/Zend/tests/zend_signed_multiply-32bit.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Zend signed multiply 32-bit
+--SKIPIF--
+<?php if ((1 << 31) > 0) print "skip Running on 64-bit target"; ?>
+--FILE--
+<?php
+var_dump(0x8000 * -0xffff);
+var_dump(0x8001 * 0xfffe);
+var_dump(0x8001 * -0xffff);
+?>
+--EXPECTF--
+int(-2147450880)
+int(2147483646)
+float(-2147516415)
diff --git a/Zend/tests/zend_signed_multiply-64bit.phpt b/Zend/tests/zend_signed_multiply-64bit.phpt
new file mode 100644
index 0000000000..94a6e035fa
--- /dev/null
+++ b/Zend/tests/zend_signed_multiply-64bit.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Zend signed multiply 64-bit
+--SKIPIF--
+<?php if ((1 << 31) < 0) print "skip Running on 32-bit target"; ?>
+--FILE--
+<?php
+var_dump(0x80000000 * -0xffffffff);
+var_dump(0x80000001 * 0xfffffffe);
+var_dump(0x80000001 * -0xffffffff);
+?>
+--EXPECTF--
+int(-9223372034707292160)
+int(9223372036854775806)
+float(-9.2233720390023E+18)
diff --git a/Zend/zend.c b/Zend/zend.c
index 5b6fd3e714..ef4ad79748 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -30,6 +30,7 @@
#include "zend_ini.h"
#include "zend_vm.h"
#include "zend_dtrace.h"
+#include "zend_virtual_cwd.h"
#ifdef ZTS
# define GLOBAL_FUNCTION_TABLE global_function_table
@@ -648,6 +649,8 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions TS
start_memory_manager(TSRMLS_C);
+ virtual_cwd_startup(); /* Could use shutdown to free the main cwd but it would just slow it down for CGI */
+
#if defined(__FreeBSD__) || defined(__DragonFly__)
/* FreeBSD and DragonFly floating point precision fix */
fpsetmask(0);
@@ -798,9 +801,14 @@ void zend_post_startup(TSRMLS_D) /* {{{ */
compiler_globals_ctor(compiler_globals, tsrm_ls);
}
free(EG(zend_constants));
+
+ virtual_cwd_deactivate(TSRMLS_C);
+
executor_globals_ctor(executor_globals, tsrm_ls);
global_persistent_list = &EG(persistent_list);
zend_copy_ini_directives(TSRMLS_C);
+#else
+ virtual_cwd_deactivate(TSRMLS_C);
#endif
}
/* }}} */
@@ -827,6 +835,9 @@ void zend_shutdown(TSRMLS_D) /* {{{ */
zend_destroy_modules();
+ virtual_cwd_deactivate(TSRMLS_C);
+ virtual_cwd_shutdown();
+
zend_hash_destroy(GLOBAL_FUNCTION_TABLE);
zend_hash_destroy(GLOBAL_CLASS_TABLE);
@@ -887,7 +898,7 @@ ZEND_API void _zend_bailout(char *filename, uint lineno) /* {{{ */
/* }}} */
END_EXTERN_C()
-void zend_append_version_info(const zend_extension *extension) /* {{{ */
+ZEND_API void zend_append_version_info(const zend_extension *extension) /* {{{ */
{
char *new_info;
uint new_info_length;
@@ -915,8 +926,11 @@ ZEND_API char *get_zend_version(void) /* {{{ */
}
/* }}} */
-void zend_activate(TSRMLS_D) /* {{{ */
+ZEND_API void zend_activate(TSRMLS_D) /* {{{ */
{
+#ifdef ZTS
+ virtual_cwd_activate(TSRMLS_C);
+#endif
gc_reset(TSRMLS_C);
init_compiler(TSRMLS_C);
init_executor(TSRMLS_C);
@@ -932,7 +946,7 @@ void zend_call_destructors(TSRMLS_D) /* {{{ */
}
/* }}} */
-void zend_deactivate(TSRMLS_D) /* {{{ */
+ZEND_API void zend_deactivate(TSRMLS_D) /* {{{ */
{
/* we're no longer executing anything */
EG(opline_ptr) = NULL;
@@ -951,7 +965,7 @@ void zend_deactivate(TSRMLS_D) /* {{{ */
zend_destroy_rsrc_list(&EG(regular_list) TSRMLS_CC);
-#ifdef ZEND_DEBUG
+#if ZEND_DEBUG
if (GC_G(gc_enabled) && !CG(unclean_shutdown)) {
gc_collect_cycles(TSRMLS_C);
}
diff --git a/Zend/zend.h b/Zend/zend.h
index 3003cb0939..1d2b3fb4ac 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -22,7 +22,7 @@
#ifndef ZEND_H
#define ZEND_H
-#define ZEND_VERSION "2.5.0"
+#define ZEND_VERSION "2.6.0"
#define ZEND_ENGINE_2
@@ -193,7 +193,7 @@ char *alloca ();
#endif
#define restrict __restrict__
-#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(ZEND_WIN32)) && !(defined(ZTS) && defined(NETWARE)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN)
+#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(NETWARE)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN)
# define ZEND_ALLOCA_MAX_SIZE (32 * 1024)
# define ALLOCA_FLAG(name) \
zend_bool name;
@@ -317,6 +317,7 @@ typedef struct _zend_object {
} zend_object;
#include "zend_object_handlers.h"
+#include "zend_ast.h"
typedef union _zvalue_value {
long lval; /* long value */
@@ -327,6 +328,7 @@ typedef union _zvalue_value {
} str;
HashTable *ht; /* hash table value */
zend_object_value obj;
+ zend_ast *ast;
} zvalue_value;
struct _zval_struct {
@@ -500,6 +502,7 @@ struct _zend_class_entry {
union _zend_function *__call;
union _zend_function *__callstatic;
union _zend_function *__tostring;
+ union _zend_function *__debugInfo;
union _zend_function *serialize_func;
union _zend_function *unserialize_func;
@@ -586,17 +589,17 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length);
#define IS_STRING 6
#define IS_RESOURCE 7
#define IS_CONSTANT 8
-#define IS_CONSTANT_ARRAY 9
+#define IS_CONSTANT_AST 9
#define IS_CALLABLE 10
-/* Ugly hack to support constants as static array indices */
#define IS_CONSTANT_TYPE_MASK 0x00f
#define IS_CONSTANT_UNQUALIFIED 0x010
-#define IS_CONSTANT_INDEX 0x080
#define IS_LEXICAL_VAR 0x020
#define IS_LEXICAL_REF 0x040
#define IS_CONSTANT_IN_NAMESPACE 0x100
+#define IS_CONSTANT_TYPE(type) (((type) & IS_CONSTANT_TYPE_MASK) >= IS_CONSTANT && ((type) & IS_CONSTANT_TYPE_MASK) <= IS_CONSTANT_AST)
+
/* overloaded elements data types */
#define OE_IS_ARRAY (1<<0)
#define OE_IS_OBJECT (1<<1)
@@ -651,12 +654,14 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
ZEND_API void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
END_EXTERN_C()
-void zend_activate(TSRMLS_D);
-void zend_deactivate(TSRMLS_D);
-void zend_call_destructors(TSRMLS_D);
-void zend_activate_modules(TSRMLS_D);
-void zend_deactivate_modules(TSRMLS_D);
-void zend_post_deactivate_modules(TSRMLS_D);
+BEGIN_EXTERN_C()
+ZEND_API void zend_activate(TSRMLS_D);
+ZEND_API void zend_deactivate(TSRMLS_D);
+ZEND_API void zend_call_destructors(TSRMLS_D);
+ZEND_API void zend_activate_modules(TSRMLS_D);
+ZEND_API void zend_deactivate_modules(TSRMLS_D);
+ZEND_API void zend_post_deactivate_modules(TSRMLS_D);
+END_EXTERN_C()
#if ZEND_DEBUG
#define Z_DBG(expr) (expr)
@@ -670,10 +675,14 @@ END_EXTERN_C()
/* FIXME: Check if we can save if (ptr) too */
-#define STR_FREE(ptr) if (ptr && !IS_INTERNED(ptr)) { efree(ptr); }
-#define STR_FREE_REL(ptr) if (ptr && !IS_INTERNED(ptr)) { efree_rel(ptr); }
+#define STR_FREE(ptr) if (ptr) { str_efree(ptr); }
+#define STR_FREE_REL(ptr) if (ptr) { str_efree_rel(ptr); }
+#ifndef ZTS
+#define STR_EMPTY_ALLOC() CG(interned_empty_string)? CG(interned_empty_string) : estrndup("", sizeof("")-1)
+#else
#define STR_EMPTY_ALLOC() estrndup("", sizeof("")-1)
+#endif
#define STR_REALLOC(ptr, size) \
ptr = (char *) erealloc(ptr, size);
@@ -683,7 +692,7 @@ END_EXTERN_C()
#define ZEND_WRITE_EX(str, str_len) write_func((str), (str_len))
#define ZEND_PUTS(str) zend_write((str), strlen((str)))
#define ZEND_PUTS_EX(str) write_func((str), strlen((str)))
-#define ZEND_PUTC(c) zend_write(&(c), 1), (c)
+#define ZEND_PUTC(c) zend_write(&(c), 1)
BEGIN_EXTERN_C()
extern ZEND_API int (*zend_printf)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index b45ec192c6..ed56fefbe3 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -1010,7 +1010,7 @@ ZEND_API int _array_init(zval *arg, uint size ZEND_FILE_LINE_DC) /* {{{ */
{
ALLOC_HASHTABLE_REL(Z_ARRVAL_P(arg));
- _zend_hash_init(Z_ARRVAL_P(arg), size, NULL, ZVAL_PTR_DTOR, 0 ZEND_FILE_LINE_RELAY_CC);
+ _zend_hash_init(Z_ARRVAL_P(arg), size, ZVAL_PTR_DTOR, 0 ZEND_FILE_LINE_RELAY_CC);
Z_TYPE_P(arg) = IS_ARRAY;
return SUCCESS;
}
@@ -1053,8 +1053,7 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties, int destro
static int zval_update_class_constant(zval **pp, int is_static, int offset TSRMLS_DC) /* {{{ */
{
- if ((Z_TYPE_PP(pp) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT ||
- (Z_TYPE_PP(pp) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT_ARRAY) {
+ if (IS_CONSTANT_TYPE(Z_TYPE_PP(pp))) {
zend_class_entry **scope = EG(in_execution)?&EG(scope):&CG(active_class_entry);
if ((*scope)->parent) {
@@ -1071,16 +1070,16 @@ static int zval_update_class_constant(zval **pp, int is_static, int offset TSRML
int ret;
zend_class_entry *old_scope = *scope;
*scope = prop_info->ce;
- ret = zval_update_constant(pp, (void*)1 TSRMLS_CC);
+ ret = zval_update_constant(pp, 1 TSRMLS_CC);
*scope = old_scope;
return ret;
}
}
ce = ce->parent;
} while (ce);
-
+
}
- return zval_update_constant(pp, (void*)1 TSRMLS_CC);
+ return zval_update_constant(pp, 1 TSRMLS_CC);
}
return 0;
}
@@ -1094,7 +1093,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
int i;
*scope = class_type;
- zend_hash_apply_with_argument(&class_type->constants_table, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC);
+ zend_hash_apply_with_argument(&class_type->constants_table, (apply_func_arg_t) zval_update_constant, (void *)1 TSRMLS_CC);
for (i = 0; i < class_type->default_properties_count; i++) {
if (class_type->default_properties_table[i]) {
@@ -1973,35 +1972,35 @@ ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce,
zend_str_tolower_copy(lcname, fptr->common.function_name, MIN(name_len, sizeof(lcname)-1));
lcname[sizeof(lcname)-1] = '\0'; /* zend_str_tolower_copy won't necessarily set the zero byte */
- if (name_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_DESTRUCTOR_FUNC_NAME, sizeof(ZEND_DESTRUCTOR_FUNC_NAME)) && fptr->common.num_args != 0) {
+ if (name_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_DESTRUCTOR_FUNC_NAME, sizeof(ZEND_DESTRUCTOR_FUNC_NAME) - 1) && fptr->common.num_args != 0) {
zend_error(error_type, "Destructor %s::%s() cannot take arguments", ce->name, ZEND_DESTRUCTOR_FUNC_NAME);
- } else if (name_len == sizeof(ZEND_CLONE_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME)) && fptr->common.num_args != 0) {
+ } else if (name_len == sizeof(ZEND_CLONE_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME) - 1) && fptr->common.num_args != 0) {
zend_error(error_type, "Method %s::%s() cannot accept any arguments", ce->name, ZEND_CLONE_FUNC_NAME);
- } else if (name_len == sizeof(ZEND_GET_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME))) {
+ } else if (name_len == sizeof(ZEND_GET_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME) - 1)) {
if (fptr->common.num_args != 1) {
zend_error(error_type, "Method %s::%s() must take exactly 1 argument", ce->name, ZEND_GET_FUNC_NAME);
} else if (ARG_SHOULD_BE_SENT_BY_REF(fptr, 1)) {
zend_error(error_type, "Method %s::%s() cannot take arguments by reference", ce->name, ZEND_GET_FUNC_NAME);
}
- } else if (name_len == sizeof(ZEND_SET_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_SET_FUNC_NAME, sizeof(ZEND_SET_FUNC_NAME))) {
+ } else if (name_len == sizeof(ZEND_SET_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_SET_FUNC_NAME, sizeof(ZEND_SET_FUNC_NAME) - 1)) {
if (fptr->common.num_args != 2) {
zend_error(error_type, "Method %s::%s() must take exactly 2 arguments", ce->name, ZEND_SET_FUNC_NAME);
} else if (ARG_SHOULD_BE_SENT_BY_REF(fptr, 1) || ARG_SHOULD_BE_SENT_BY_REF(fptr, 2)) {
zend_error(error_type, "Method %s::%s() cannot take arguments by reference", ce->name, ZEND_SET_FUNC_NAME);
}
- } else if (name_len == sizeof(ZEND_UNSET_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_UNSET_FUNC_NAME, sizeof(ZEND_UNSET_FUNC_NAME))) {
+ } else if (name_len == sizeof(ZEND_UNSET_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_UNSET_FUNC_NAME, sizeof(ZEND_UNSET_FUNC_NAME) - 1)) {
if (fptr->common.num_args != 1) {
zend_error(error_type, "Method %s::%s() must take exactly 1 argument", ce->name, ZEND_UNSET_FUNC_NAME);
} else if (ARG_SHOULD_BE_SENT_BY_REF(fptr, 1)) {
zend_error(error_type, "Method %s::%s() cannot take arguments by reference", ce->name, ZEND_UNSET_FUNC_NAME);
}
- } else if (name_len == sizeof(ZEND_ISSET_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_ISSET_FUNC_NAME, sizeof(ZEND_ISSET_FUNC_NAME))) {
+ } else if (name_len == sizeof(ZEND_ISSET_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_ISSET_FUNC_NAME, sizeof(ZEND_ISSET_FUNC_NAME) - 1)) {
if (fptr->common.num_args != 1) {
zend_error(error_type, "Method %s::%s() must take exactly 1 argument", ce->name, ZEND_ISSET_FUNC_NAME);
} else if (ARG_SHOULD_BE_SENT_BY_REF(fptr, 1)) {
zend_error(error_type, "Method %s::%s() cannot take arguments by reference", ce->name, ZEND_ISSET_FUNC_NAME);
}
- } else if (name_len == sizeof(ZEND_CALL_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME))) {
+ } else if (name_len == sizeof(ZEND_CALL_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME) - 1)) {
if (fptr->common.num_args != 2) {
zend_error(error_type, "Method %s::%s() must take exactly 2 arguments", ce->name, ZEND_CALL_FUNC_NAME);
} else if (ARG_SHOULD_BE_SENT_BY_REF(fptr, 1) || ARG_SHOULD_BE_SENT_BY_REF(fptr, 2)) {
@@ -2019,6 +2018,9 @@ ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce,
!memcmp(lcname, ZEND_TOSTRING_FUNC_NAME, sizeof(ZEND_TOSTRING_FUNC_NAME)-1) && fptr->common.num_args != 0
) {
zend_error(error_type, "Method %s::%s() cannot take arguments", ce->name, ZEND_TOSTRING_FUNC_NAME);
+ } else if (name_len == sizeof(ZEND_DEBUGINFO_FUNC_NAME) - 1 &&
+ !memcmp(lcname, ZEND_DEBUGINFO_FUNC_NAME, sizeof(ZEND_DEBUGINFO_FUNC_NAME)-1) && fptr->common.num_args != 0) {
+ zend_error(error_type, "Method %s::%s() cannot take arguments", ce->name, ZEND_DEBUGINFO_FUNC_NAME);
}
}
/* }}} */
@@ -2029,14 +2031,15 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
const zend_function_entry *ptr = functions;
zend_function function, *reg_function;
zend_internal_function *internal_function = (zend_internal_function *)&function;
- int count=0, unload=0, result=0;
+ int count=0, unload=0;
HashTable *target_function_table = function_table;
int error_type;
- zend_function *ctor = NULL, *dtor = NULL, *clone = NULL, *__get = NULL, *__set = NULL, *__unset = NULL, *__isset = NULL, *__call = NULL, *__callstatic = NULL, *__tostring = NULL;
+ zend_function *ctor = NULL, *dtor = NULL, *clone = NULL, *__get = NULL, *__set = NULL, *__unset = NULL, *__isset = NULL, *__call = NULL, *__callstatic = NULL, *__tostring = NULL, *__debugInfo = NULL;
const char *lowercase_name;
int fname_len;
const char *lc_class_name = NULL;
int class_name_len = 0;
+ zend_ulong hash;
if (type==MODULE_PERSISTENT) {
error_type = E_CORE_WARNING;
@@ -2089,16 +2092,12 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
} else {
internal_function->required_num_args = info->required_num_args;
}
- if (info->pass_rest_by_reference) {
- if (info->pass_rest_by_reference == ZEND_SEND_PREFER_REF) {
- internal_function->fn_flags |= ZEND_ACC_PASS_REST_PREFER_REF;
- } else {
- internal_function->fn_flags |= ZEND_ACC_PASS_REST_BY_REFERENCE;
- }
- }
if (info->return_reference) {
internal_function->fn_flags |= ZEND_ACC_RETURN_REFERENCE;
}
+ if (ptr->arg_info[ptr->num_args].is_variadic) {
+ internal_function->fn_flags |= ZEND_ACC_VARIADIC;
+ }
} else {
internal_function->arg_info = NULL;
internal_function->num_args = 0;
@@ -2135,16 +2134,25 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
}
fname_len = strlen(ptr->fname);
lowercase_name = zend_new_interned_string(zend_str_tolower_dup(ptr->fname, fname_len), fname_len + 1, 1 TSRMLS_CC);
- if (IS_INTERNED(lowercase_name)) {
- result = zend_hash_quick_add(target_function_table, lowercase_name, fname_len+1, INTERNED_HASH(lowercase_name), &function, sizeof(zend_function), (void**)&reg_function);
- } else {
- result = zend_hash_add(target_function_table, lowercase_name, fname_len+1, &function, sizeof(zend_function), (void**)&reg_function);
- }
- if (result == FAILURE) {
+ hash = str_hash(lowercase_name, fname_len);
+ if (zend_hash_quick_add(target_function_table, lowercase_name, fname_len+1, hash, &function, sizeof(zend_function), (void**)&reg_function) == FAILURE) {
unload=1;
str_efree(lowercase_name);
break;
}
+
+ /* If types of arguments have to be checked */
+ if (reg_function->common.arg_info && reg_function->common.num_args) {
+ int i;
+ for (i = 0; i < reg_function->common.num_args; i++) {
+ if (reg_function->common.arg_info[i].class_name ||
+ reg_function->common.arg_info[i].type_hint) {
+ reg_function->common.fn_flags |= ZEND_ACC_HAS_TYPE_HINTS;
+ break;
+ }
+ }
+ }
+
if (scope) {
/* Look for ctor, dtor, clone
* If it's an old-style constructor, store it only if we don't have
@@ -2152,29 +2160,31 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
*/
if ((fname_len == class_name_len) && !ctor && !memcmp(lowercase_name, lc_class_name, class_name_len+1)) {
ctor = reg_function;
- } else if ((fname_len == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME))) {
+ } else if ((fname_len == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME) - 1)) {
ctor = reg_function;
- } else if ((fname_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_DESTRUCTOR_FUNC_NAME, sizeof(ZEND_DESTRUCTOR_FUNC_NAME))) {
+ } else if ((fname_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_DESTRUCTOR_FUNC_NAME, sizeof(ZEND_DESTRUCTOR_FUNC_NAME) - 1)) {
dtor = reg_function;
if (internal_function->num_args) {
zend_error(error_type, "Destructor %s::%s() cannot take arguments", scope->name, ptr->fname);
}
- } else if ((fname_len == sizeof(ZEND_CLONE_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME))) {
+ } else if ((fname_len == sizeof(ZEND_CLONE_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME) - 1)) {
clone = reg_function;
- } else if ((fname_len == sizeof(ZEND_CALL_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME))) {
+ } else if ((fname_len == sizeof(ZEND_CALL_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME) - 1)) {
__call = reg_function;
- } else if ((fname_len == sizeof(ZEND_CALLSTATIC_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_CALLSTATIC_FUNC_NAME, sizeof(ZEND_CALLSTATIC_FUNC_NAME))) {
+ } else if ((fname_len == sizeof(ZEND_CALLSTATIC_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_CALLSTATIC_FUNC_NAME, sizeof(ZEND_CALLSTATIC_FUNC_NAME) - 1)) {
__callstatic = reg_function;
- } else if ((fname_len == sizeof(ZEND_TOSTRING_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_TOSTRING_FUNC_NAME, sizeof(ZEND_TOSTRING_FUNC_NAME))) {
+ } else if ((fname_len == sizeof(ZEND_TOSTRING_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_TOSTRING_FUNC_NAME, sizeof(ZEND_TOSTRING_FUNC_NAME) - 1)) {
__tostring = reg_function;
- } else if ((fname_len == sizeof(ZEND_GET_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME))) {
+ } else if ((fname_len == sizeof(ZEND_GET_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME) - 1)) {
__get = reg_function;
- } else if ((fname_len == sizeof(ZEND_SET_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_SET_FUNC_NAME, sizeof(ZEND_SET_FUNC_NAME))) {
+ } else if ((fname_len == sizeof(ZEND_SET_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_SET_FUNC_NAME, sizeof(ZEND_SET_FUNC_NAME) - 1)) {
__set = reg_function;
- } else if ((fname_len == sizeof(ZEND_UNSET_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_UNSET_FUNC_NAME, sizeof(ZEND_UNSET_FUNC_NAME))) {
+ } else if ((fname_len == sizeof(ZEND_UNSET_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_UNSET_FUNC_NAME, sizeof(ZEND_UNSET_FUNC_NAME) - 1)) {
__unset = reg_function;
- } else if ((fname_len == sizeof(ZEND_ISSET_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_ISSET_FUNC_NAME, sizeof(ZEND_ISSET_FUNC_NAME))) {
+ } else if ((fname_len == sizeof(ZEND_ISSET_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_ISSET_FUNC_NAME, sizeof(ZEND_ISSET_FUNC_NAME) - 1)) {
__isset = reg_function;
+ } else if ((fname_len == sizeof(ZEND_DEBUGINFO_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_DEBUGINFO_FUNC_NAME, sizeof(ZEND_DEBUGINFO_FUNC_NAME) - 1)) {
+ __debugInfo = reg_function;
} else {
reg_function = NULL;
}
@@ -2213,6 +2223,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
scope->__set = __set;
scope->__unset = __unset;
scope->__isset = __isset;
+ scope->__debugInfo = __debugInfo;
if (ctor) {
ctor->common.fn_flags |= ZEND_ACC_CTOR;
if (ctor->common.fn_flags & ZEND_ACC_STATIC) {
@@ -2276,6 +2287,11 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
}
__isset->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC;
}
+ if (__debugInfo) {
+ if (__debugInfo->common.fn_flags & ZEND_ACC_STATIC) {
+ zend_error(error_type, "Method %s::%s() cannot be static", scope->name, __debugInfo->common.function_name);
+ }
+ }
efree((char*)lc_class_name);
}
return SUCCESS;
@@ -2388,7 +2404,7 @@ void module_destructor(zend_module_entry *module) /* {{{ */
}
/* }}} */
-void zend_activate_modules(TSRMLS_D) /* {{{ */
+ZEND_API void zend_activate_modules(TSRMLS_D) /* {{{ */
{
zend_module_entry **p = module_request_startup_handlers;
@@ -2417,7 +2433,7 @@ int module_registry_cleanup(zend_module_entry *module TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_deactivate_modules(TSRMLS_D) /* {{{ */
+ZEND_API void zend_deactivate_modules(TSRMLS_D) /* {{{ */
{
EG(opline_ptr) = NULL; /* we're no longer executing anything */
@@ -2464,7 +2480,7 @@ static int exec_done_cb(zend_module_entry *module TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_post_deactivate_modules(TSRMLS_D) /* {{{ */
+ZEND_API void zend_post_deactivate_modules(TSRMLS_D) /* {{{ */
{
if (EG(full_tables_cleanup)) {
zend_hash_apply(&module_registry, (apply_func_t) exec_done_cb TSRMLS_CC);
@@ -2483,7 +2499,7 @@ void zend_post_deactivate_modules(TSRMLS_D) /* {{{ */
/* }}} */
/* return the next free module number */
-int zend_next_free_module(void) /* {{{ */
+ZEND_API int zend_next_free_module(void) /* {{{ */
{
return zend_hash_num_elements(&module_registry) + 1;
}
@@ -2493,6 +2509,7 @@ static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class
{
zend_class_entry *class_entry = malloc(sizeof(zend_class_entry));
char *lowercase_name = emalloc(orig_class_entry->name_length + 1);
+ zend_ulong hash;
*class_entry = *orig_class_entry;
class_entry->type = ZEND_INTERNAL_CLASS;
@@ -2506,11 +2523,8 @@ static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class
zend_str_tolower_copy(lowercase_name, orig_class_entry->name, class_entry->name_length);
lowercase_name = (char*)zend_new_interned_string(lowercase_name, class_entry->name_length + 1, 1 TSRMLS_CC);
- if (IS_INTERNED(lowercase_name)) {
- zend_hash_quick_update(CG(class_table), lowercase_name, class_entry->name_length+1, INTERNED_HASH(lowercase_name), &class_entry, sizeof(zend_class_entry *), NULL);
- } else {
- zend_hash_update(CG(class_table), lowercase_name, class_entry->name_length+1, &class_entry, sizeof(zend_class_entry *), NULL);
- }
+ hash = str_hash(lowercase_name, class_entry->name_length);
+ zend_hash_quick_update(CG(class_table), lowercase_name, class_entry->name_length+1, hash, &class_entry, sizeof(zend_class_entry *), NULL);
str_efree(lowercase_name);
return class_entry;
}
@@ -2621,18 +2635,15 @@ ZEND_API ZEND_FUNCTION(display_disabled_function)
}
/* }}} */
-static zend_function_entry disabled_function[] = {
- ZEND_FE(display_disabled_function, NULL)
- ZEND_FE_END
-};
-
ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC) /* {{{ */
{
- if (zend_hash_del(CG(function_table), function_name, function_name_length+1)==FAILURE) {
- return FAILURE;
+ zend_internal_function *func;
+ if (zend_hash_find(CG(function_table), function_name, function_name_length+1, (void **)&func)==SUCCESS) {
+ func->arg_info = NULL;
+ func->handler = ZEND_FN(display_disabled_function);
+ return SUCCESS;
}
- disabled_function[0].fname = function_name;
- return zend_register_functions(NULL, disabled_function, CG(function_table), MODULE_PERSISTENT TSRMLS_CC);
+ return FAILURE;
}
/* }}} */
@@ -2827,7 +2838,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
if (strict_class &&
fcc->calling_scope &&
mlen == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1 &&
- !memcmp(lmname, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME))) {
+ !memcmp(lmname, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME) - 1)) {
fcc->function_handler = fcc->calling_scope->constructor;
if (fcc->function_handler) {
retval = 1;
@@ -3449,7 +3460,6 @@ ZEND_API int zend_declare_property_ex(zend_class_entry *ce, const char *name, in
if (ce->type & ZEND_INTERNAL_CLASS) {
switch(Z_TYPE_P(property)) {
case IS_ARRAY:
- case IS_CONSTANT_ARRAY:
case IS_OBJECT:
case IS_RESOURCE:
zend_error(E_CORE_ERROR, "Internal zval's can't be arrays, objects or resources");
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index 1042776830..e837647ce7 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -98,16 +98,18 @@ typedef struct _zend_fcall_info_cache {
#define ZEND_FE_END { NULL, NULL, NULL, 0, 0 }
-#define ZEND_ARG_INFO(pass_by_ref, name) { #name, sizeof(#name)-1, NULL, 0, 0, 0, pass_by_ref},
-#define ZEND_ARG_PASS_INFO(pass_by_ref) { NULL, 0, NULL, 0, 0, 0, pass_by_ref},
-#define ZEND_ARG_OBJ_INFO(pass_by_ref, name, classname, allow_null) { #name, sizeof(#name)-1, #classname, sizeof(#classname)-1, IS_OBJECT, allow_null, pass_by_ref},
-#define ZEND_ARG_ARRAY_INFO(pass_by_ref, name, allow_null) { #name, sizeof(#name)-1, NULL, 0, IS_ARRAY, allow_null, pass_by_ref},
-#define ZEND_ARG_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) { #name, sizeof(#name)-1, NULL, 0, type_hint, allow_null, pass_by_ref},
-#define ZEND_BEGIN_ARG_INFO_EX(name, pass_rest_by_reference, return_reference, required_num_args) \
+#define ZEND_ARG_INFO(pass_by_ref, name) { #name, sizeof(#name)-1, NULL, 0, 0, pass_by_ref, 0, 0 },
+#define ZEND_ARG_PASS_INFO(pass_by_ref) { NULL, 0, NULL, 0, 0, pass_by_ref, 0, 0 },
+#define ZEND_ARG_OBJ_INFO(pass_by_ref, name, classname, allow_null) { #name, sizeof(#name)-1, #classname, sizeof(#classname)-1, IS_OBJECT, pass_by_ref, allow_null, 0 },
+#define ZEND_ARG_ARRAY_INFO(pass_by_ref, name, allow_null) { #name, sizeof(#name)-1, NULL, 0, IS_ARRAY, pass_by_ref, allow_null, 0 },
+#define ZEND_ARG_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) { #name, sizeof(#name)-1, NULL, 0, type_hint, pass_by_ref, allow_null, 0 },
+#define ZEND_ARG_VARIADIC_INFO(pass_by_ref, name) { #name, sizeof(#name)-1, NULL, 0, 0, pass_by_ref, 0, 1 },
+
+#define ZEND_BEGIN_ARG_INFO_EX(name, _unused, return_reference, required_num_args) \
static const zend_arg_info name[] = { \
- { NULL, 0, NULL, required_num_args, 0, return_reference, pass_rest_by_reference},
-#define ZEND_BEGIN_ARG_INFO(name, pass_rest_by_reference) \
- ZEND_BEGIN_ARG_INFO_EX(name, pass_rest_by_reference, ZEND_RETURN_VALUE, -1)
+ { NULL, 0, NULL, required_num_args, 0, return_reference, 0, 0 },
+#define ZEND_BEGIN_ARG_INFO(name, _unused) \
+ ZEND_BEGIN_ARG_INFO_EX(name, 0, ZEND_RETURN_VALUE, -1)
#define ZEND_END_ARG_INFO() };
/* Name macros */
@@ -195,6 +197,7 @@ typedef struct _zend_fcall_info_cache {
class_container.__set = handle_propset; \
class_container.__unset = handle_propunset; \
class_container.__isset = handle_propisset; \
+ class_container.__debugInfo = NULL; \
class_container.serialize_func = NULL; \
class_container.unserialize_func = NULL; \
class_container.serialize = NULL; \
@@ -230,7 +233,7 @@ typedef struct _zend_fcall_info_cache {
#define ZEND_FCI_INITIALIZED(fci) ((fci).size != 0)
-int zend_next_free_module(void);
+ZEND_API int zend_next_free_module(void);
BEGIN_EXTERN_C()
ZEND_API int zend_get_parameters(int ht, int param_count, ...);
@@ -594,22 +597,20 @@ END_EXTERN_C()
Z_TYPE_P(__z) = IS_STRING; \
} while (0)
-#define ZVAL_ZVAL(z, zv, copy, dtor) { \
- zend_uchar is_ref = Z_ISREF_P(z); \
- zend_uint refcount = Z_REFCOUNT_P(z); \
- ZVAL_COPY_VALUE(z, zv); \
+#define ZVAL_ZVAL(z, zv, copy, dtor) do { \
+ zval *__z = (z); \
+ zval *__zv = (zv); \
+ ZVAL_COPY_VALUE(__z, __zv); \
if (copy) { \
- zval_copy_ctor(z); \
+ zval_copy_ctor(__z); \
} \
if (dtor) { \
if (!copy) { \
- ZVAL_NULL(zv); \
+ ZVAL_NULL(__zv); \
} \
- zval_ptr_dtor(&zv); \
+ zval_ptr_dtor(&__zv); \
} \
- Z_SET_ISREF_TO_P(z, is_ref); \
- Z_SET_REFCOUNT_P(z, refcount); \
- }
+ } while (0)
#define ZVAL_FALSE(z) ZVAL_BOOL(z, 0)
#define ZVAL_TRUE(z) ZVAL_BOOL(z, 1)
@@ -638,6 +639,18 @@ END_EXTERN_C()
#define RETURN_FALSE { RETVAL_FALSE; return; }
#define RETURN_TRUE { RETVAL_TRUE; return; }
+#define RETVAL_ZVAL_FAST(z) do { \
+ zval *_z = (z); \
+ if (Z_ISREF_P(_z)) { \
+ RETVAL_ZVAL(_z, 1, 0); \
+ } else { \
+ zval_ptr_dtor(&return_value); \
+ Z_ADDREF_P(_z); \
+ *return_value_ptr = _z; \
+ } \
+} while (0)
+#define RETURN_ZVAL_FAST(z) { RETVAL_ZVAL_FAST(z); return; }
+
#define SET_VAR_STRING(n, v) { \
{ \
zval *var; \
diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c
new file mode 100644
index 0000000000..0e04b83c3a
--- /dev/null
+++ b/Zend/zend_ast.c
@@ -0,0 +1,385 @@
+/*
+ +----------------------------------------------------------------------+
+ | Zend Engine |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 2.00 of the Zend license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.zend.com/license/2_00.txt. |
+ | If you did not receive a copy of the Zend license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@zend.com so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Bob Weinand <bwoebi@php.net> |
+ | Dmitry Stogov <dmitry@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id$ */
+
+#include "zend_ast.h"
+#include "zend_API.h"
+#include "zend_operators.h"
+
+ZEND_API zend_ast *zend_ast_create_constant(zval *zv)
+{
+ zend_ast *ast = emalloc(sizeof(zend_ast) + sizeof(zval));
+ ast->kind = ZEND_CONST;
+ ast->children = 0;
+ ast->u.val = (zval*)(ast + 1);
+ INIT_PZVAL_COPY(ast->u.val, zv);
+ return ast;
+}
+
+ZEND_API zend_ast* zend_ast_create_unary(uint kind, zend_ast *op0)
+{
+ zend_ast *ast = emalloc(sizeof(zend_ast));
+ ast->kind = kind;
+ ast->children = 1;
+ (&ast->u.child)[0] = op0;
+ return ast;
+}
+
+ZEND_API zend_ast* zend_ast_create_binary(uint kind, zend_ast *op0, zend_ast *op1)
+{
+ zend_ast *ast = emalloc(sizeof(zend_ast) + sizeof(zend_ast*));
+ ast->kind = kind;
+ ast->children = 2;
+ (&ast->u.child)[0] = op0;
+ (&ast->u.child)[1] = op1;
+ return ast;
+}
+
+ZEND_API zend_ast* zend_ast_create_ternary(uint kind, zend_ast *op0, zend_ast *op1, zend_ast *op2)
+{
+ zend_ast *ast = emalloc(sizeof(zend_ast) + sizeof(zend_ast*) * 2);
+ ast->kind = kind;
+ ast->children = 3;
+ (&ast->u.child)[0] = op0;
+ (&ast->u.child)[1] = op1;
+ (&ast->u.child)[2] = op2;
+ return ast;
+}
+
+ZEND_API zend_ast* zend_ast_create_dynamic(uint kind)
+{
+ zend_ast *ast = emalloc(sizeof(zend_ast) + sizeof(zend_ast*) * 3); /* use 4 children as deafult */
+ ast->kind = kind;
+ ast->children = 0;
+ return ast;
+}
+
+ZEND_API void zend_ast_dynamic_add(zend_ast **ast, zend_ast *op)
+{
+ if ((*ast)->children >= 4 && (*ast)->children == ((*ast)->children & -(*ast)->children)) {
+ *ast = erealloc(*ast, sizeof(zend_ast) + sizeof(zend_ast*) * ((*ast)->children * 2 + 1));
+ }
+ (&(*ast)->u.child)[(*ast)->children++] = op;
+}
+
+ZEND_API void zend_ast_dynamic_shrink(zend_ast **ast)
+{
+ *ast = erealloc(*ast, sizeof(zend_ast) + sizeof(zend_ast*) * ((*ast)->children - 1));
+}
+
+ZEND_API int zend_ast_is_ct_constant(zend_ast *ast)
+{
+ int i;
+
+ if (ast->kind == ZEND_CONST) {
+ return !IS_CONSTANT_TYPE(Z_TYPE_P(ast->u.val));
+ } else {
+ for (i = 0; i < ast->children; i++) {
+ if ((&ast->u.child)[i]) {
+ if (!zend_ast_is_ct_constant((&ast->u.child)[i])) {
+ return 0;
+ }
+ }
+ }
+ return 1;
+ }
+}
+
+ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *scope TSRMLS_DC)
+{
+ zval op1, op2;
+
+ switch (ast->kind) {
+ case ZEND_ADD:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ add_function(result, &op1, &op2 TSRMLS_CC);
+ zval_dtor(&op1);
+ zval_dtor(&op2);
+ break;
+ case ZEND_SUB:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ sub_function(result, &op1, &op2 TSRMLS_CC);
+ zval_dtor(&op1);
+ zval_dtor(&op2);
+ break;
+ case ZEND_MUL:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ mul_function(result, &op1, &op2 TSRMLS_CC);
+ zval_dtor(&op1);
+ zval_dtor(&op2);
+ break;
+ case ZEND_POW:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ pow_function(result, &op1, &op2 TSRMLS_CC);
+ zval_dtor(&op1);
+ zval_dtor(&op2);
+ break;
+ case ZEND_DIV:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ div_function(result, &op1, &op2 TSRMLS_CC);
+ zval_dtor(&op1);
+ zval_dtor(&op2);
+ break;
+ case ZEND_MOD:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ mod_function(result, &op1, &op2 TSRMLS_CC);
+ zval_dtor(&op1);
+ zval_dtor(&op2);
+ break;
+ case ZEND_SL:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ shift_left_function(result, &op1, &op2 TSRMLS_CC);
+ zval_dtor(&op1);
+ zval_dtor(&op2);
+ break;
+ case ZEND_SR:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ shift_right_function(result, &op1, &op2 TSRMLS_CC);
+ zval_dtor(&op1);
+ zval_dtor(&op2);
+ break;
+ case ZEND_CONCAT:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ concat_function(result, &op1, &op2 TSRMLS_CC);
+ zval_dtor(&op1);
+ zval_dtor(&op2);
+ break;
+ case ZEND_BW_OR:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ bitwise_or_function(result, &op1, &op2 TSRMLS_CC);
+ zval_dtor(&op1);
+ zval_dtor(&op2);
+ break;
+ case ZEND_BW_AND:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ bitwise_and_function(result, &op1, &op2 TSRMLS_CC);
+ zval_dtor(&op1);
+ zval_dtor(&op2);
+ break;
+ case ZEND_BW_XOR:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ bitwise_xor_function(result, &op1, &op2 TSRMLS_CC);
+ zval_dtor(&op1);
+ zval_dtor(&op2);
+ break;
+ case ZEND_BW_NOT:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ bitwise_not_function(result, &op1 TSRMLS_CC);
+ zval_dtor(&op1);
+ break;
+ case ZEND_BOOL_NOT:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ boolean_not_function(result, &op1 TSRMLS_CC);
+ zval_dtor(&op1);
+ break;
+ case ZEND_BOOL_XOR:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ boolean_xor_function(result, &op1, &op2 TSRMLS_CC);
+ zval_dtor(&op1);
+ zval_dtor(&op2);
+ break;
+ case ZEND_IS_IDENTICAL:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ is_identical_function(result, &op1, &op2 TSRMLS_CC);
+ zval_dtor(&op1);
+ zval_dtor(&op2);
+ break;
+ case ZEND_IS_NOT_IDENTICAL:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ is_not_identical_function(result, &op1, &op2 TSRMLS_CC);
+ zval_dtor(&op1);
+ zval_dtor(&op2);
+ break;
+ case ZEND_IS_EQUAL:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ is_equal_function(result, &op1, &op2 TSRMLS_CC);
+ zval_dtor(&op1);
+ zval_dtor(&op2);
+ break;
+ case ZEND_IS_NOT_EQUAL:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ is_not_equal_function(result, &op1, &op2 TSRMLS_CC);
+ zval_dtor(&op1);
+ zval_dtor(&op2);
+ break;
+ case ZEND_IS_SMALLER:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ is_smaller_function(result, &op1, &op2 TSRMLS_CC);
+ zval_dtor(&op1);
+ zval_dtor(&op2);
+ break;
+ case ZEND_IS_SMALLER_OR_EQUAL:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ is_smaller_or_equal_function(result, &op1, &op2 TSRMLS_CC);
+ zval_dtor(&op1);
+ zval_dtor(&op2);
+ break;
+ case ZEND_CONST:
+ /* class constants may be updated in-place */
+ if (scope) {
+ if (IS_CONSTANT_TYPE(Z_TYPE_P(ast->u.val))) {
+ zval_update_constant_ex(&ast->u.val, 1, scope TSRMLS_CC);
+ }
+ *result = *ast->u.val;
+ zval_copy_ctor(result);
+ } else {
+ *result = *ast->u.val;
+ zval_copy_ctor(result);
+ if (IS_CONSTANT_TYPE(Z_TYPE_P(result))) {
+ zval_update_constant_ex(&result, 1, scope TSRMLS_CC);
+ }
+ }
+ break;
+ case ZEND_BOOL_AND:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ if (zend_is_true(&op1)) {
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ ZVAL_BOOL(result, zend_is_true(&op2));
+ zval_dtor(&op2);
+ } else {
+ ZVAL_BOOL(result, 0);
+ }
+ zval_dtor(&op1);
+ break;
+ case ZEND_BOOL_OR:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ if (zend_is_true(&op1)) {
+ ZVAL_BOOL(result, 1);
+ } else {
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ ZVAL_BOOL(result, zend_is_true(&op2));
+ zval_dtor(&op2);
+ }
+ zval_dtor(&op1);
+ break;
+ case ZEND_SELECT:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ if (zend_is_true(&op1)) {
+ if (!(&ast->u.child)[1]) {
+ *result = op1;
+ } else {
+ zend_ast_evaluate(result, (&ast->u.child)[1], scope TSRMLS_CC);
+ zval_dtor(&op1);
+ }
+ } else {
+ zend_ast_evaluate(result, (&ast->u.child)[2], scope TSRMLS_CC);
+ zval_dtor(&op1);
+ }
+ break;
+ case ZEND_UNARY_PLUS:
+ ZVAL_LONG(&op1, 0);
+ zend_ast_evaluate(&op2, (&ast->u.child)[0], scope TSRMLS_CC);
+ add_function(result, &op1, &op2 TSRMLS_CC);
+ zval_dtor(&op2);
+ break;
+ case ZEND_UNARY_MINUS:
+ ZVAL_LONG(&op1, 0);
+ zend_ast_evaluate(&op2, (&ast->u.child)[0], scope TSRMLS_CC);
+ sub_function(result, &op1, &op2 TSRMLS_CC);
+ zval_dtor(&op2);
+ break;
+ case ZEND_INIT_ARRAY:
+ INIT_PZVAL(result);
+ array_init(result);
+ {
+ int i;
+ zend_bool has_key;
+ for (i = 0; i < ast->children; i+=2) {
+ zval *expr;
+ MAKE_STD_ZVAL(expr);
+ if ((has_key = !!(&ast->u.child)[i])) {
+ zend_ast_evaluate(&op1, (&ast->u.child)[i], scope TSRMLS_CC);
+ }
+ zend_ast_evaluate(expr, (&ast->u.child)[i+1], scope TSRMLS_CC);
+ zend_do_add_static_array_element(result, has_key?&op1:NULL, expr);
+ }
+ }
+ break;
+ case ZEND_FETCH_DIM_R:
+ zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
+ zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
+ {
+ zval *tmp;
+ zend_fetch_dimension_by_zval(&tmp, &op1, &op2 TSRMLS_CC);
+ ZVAL_ZVAL(result, tmp, 1, 1);
+ }
+ zval_dtor(&op1);
+ zval_dtor(&op2);
+ break;
+ default:
+ zend_error(E_ERROR, "Unsupported constant expression");
+ }
+}
+
+ZEND_API zend_ast *zend_ast_copy(zend_ast *ast)
+{
+ if (ast == NULL) {
+ return NULL;
+ } else if (ast->kind == ZEND_CONST) {
+ zend_ast *copy = zend_ast_create_constant(ast->u.val);
+ zval_copy_ctor(copy->u.val);
+ return copy;
+ } else if (ast->children) {
+ zend_ast *new = emalloc(sizeof(zend_ast) + sizeof(zend_ast*) * (ast->children - 1));
+ int i;
+ new->kind = ast->kind;
+ new->children = ast->children;
+ for (i = 0; i < ast->children; i++) {
+ (&new->u.child)[i] = zend_ast_copy((&ast->u.child)[i]);
+ }
+ return new;
+ }
+ return zend_ast_create_dynamic(ast->kind);
+}
+
+ZEND_API void zend_ast_destroy(zend_ast *ast)
+{
+ int i;
+
+ if (ast->kind == ZEND_CONST) {
+ zval_dtor(ast->u.val);
+ } else {
+ for (i = 0; i < ast->children; i++) {
+ if ((&ast->u.child)[i]) {
+ zend_ast_destroy((&ast->u.child)[i]);
+ }
+ }
+ }
+ efree(ast);
+}
diff --git a/Zend/zend_ast.h b/Zend/zend_ast.h
new file mode 100644
index 0000000000..4cc5acb413
--- /dev/null
+++ b/Zend/zend_ast.h
@@ -0,0 +1,64 @@
+/*
+ +----------------------------------------------------------------------+
+ | Zend Engine |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 2.00 of the Zend license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.zend.com/license/2_00.txt. |
+ | If you did not receive a copy of the Zend license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@zend.com so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Bob Weinand <bwoebi@php.net> |
+ | Dmitry Stogov <dmitry@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id$ */
+
+#ifndef ZEND_AST_H
+#define ZEND_AST_H
+
+typedef struct _zend_ast zend_ast;
+
+#include "zend.h"
+
+typedef enum _zend_ast_kind {
+ /* first 256 kinds are reserved for opcodes */
+ ZEND_CONST = 256,
+ ZEND_BOOL_AND,
+ ZEND_BOOL_OR,
+ ZEND_SELECT,
+ ZEND_UNARY_PLUS,
+ ZEND_UNARY_MINUS,
+} zend_ast_kind;
+
+struct _zend_ast {
+ unsigned short kind;
+ unsigned short children;
+ union {
+ zval *val;
+ zend_ast *child;
+ } u;
+};
+
+ZEND_API zend_ast *zend_ast_create_constant(zval *zv);
+
+ZEND_API zend_ast *zend_ast_create_unary(uint kind, zend_ast *op0);
+ZEND_API zend_ast *zend_ast_create_binary(uint kind, zend_ast *op0, zend_ast *op1);
+ZEND_API zend_ast *zend_ast_create_ternary(uint kind, zend_ast *op0, zend_ast *op1, zend_ast *op2);
+ZEND_API zend_ast* zend_ast_create_dynamic(uint kind);
+ZEND_API void zend_ast_dynamic_add(zend_ast **ast, zend_ast *op);
+ZEND_API void zend_ast_dynamic_shrink(zend_ast **ast);
+
+ZEND_API int zend_ast_is_ct_constant(zend_ast *ast);
+
+ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *scope TSRMLS_DC);
+
+ZEND_API zend_ast *zend_ast_copy(zend_ast *ast);
+ZEND_API void zend_ast_destroy(zend_ast *ast);
+
+#endif
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index ee01af49f2..be93dd430f 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -435,9 +435,7 @@ ZEND_FUNCTION(func_get_arg)
}
arg = *(p-(arg_count-requested_offset));
- *return_value = *arg;
- zval_copy_ctor(return_value);
- INIT_PZVAL(return_value);
+ RETURN_ZVAL_FAST(arg);
}
/* }}} */
@@ -461,12 +459,17 @@ ZEND_FUNCTION(func_get_args)
array_init_size(return_value, arg_count);
for (i=0; i<arg_count; i++) {
- zval *element;
+ zval *element, *arg;
- ALLOC_ZVAL(element);
- *element = **((zval **) (p-(arg_count-i)));
- zval_copy_ctor(element);
- INIT_PZVAL(element);
+ arg = *((zval **) (p-(arg_count-i)));
+ if (!Z_ISREF_P(arg)) {
+ element = arg;
+ Z_ADDREF_P(element);
+ } else {
+ ALLOC_ZVAL(element);
+ INIT_PZVAL_COPY(element, arg);
+ zval_copy_ctor(element);
+ }
zend_hash_next_index_insert(return_value->value.ht, &element, sizeof(zval *), NULL);
}
}
@@ -606,9 +609,9 @@ ZEND_FUNCTION(each)
Z_ADDREF_P(entry);
/* add the key elements */
- switch (zend_hash_get_current_key_ex(target_hash, &string_key, &string_key_len, &num_key, 1, NULL)) {
+ switch (zend_hash_get_current_key_ex(target_hash, &string_key, &string_key_len, &num_key, 0, NULL)) {
case HASH_KEY_IS_STRING:
- add_get_index_stringl(return_value, 0, string_key, string_key_len-1, (void **) &inserted_pointer, 0);
+ add_get_index_stringl(return_value, 0, string_key, string_key_len-1, (void **) &inserted_pointer, !IS_INTERNED(string_key));
break;
case HASH_KEY_IS_LONG:
add_get_index_long(return_value, 0, num_key, (void **) &inserted_pointer);
@@ -706,7 +709,7 @@ repeat:
zval_ptr_dtor(&val_free);
}
c.flags = case_sensitive; /* non persistent */
- c.name = IS_INTERNED(name) ? name : zend_strndup(name, name_len);
+ c.name = str_strndup(name, name_len);
if(c.name == NULL) {
RETURN_FALSE;
}
@@ -943,11 +946,11 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value
/* this is necessary to make it able to work with default array
* properties, returned to user */
- if (Z_TYPE_P(prop_copy) == IS_CONSTANT_ARRAY || (Z_TYPE_P(prop_copy) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
+ if (IS_CONSTANT_TYPE(Z_TYPE_P(prop_copy))) {
zval_update_constant(&prop_copy, 0 TSRMLS_CC);
}
- add_assoc_zval(return_value, key, prop_copy);
+ zend_hash_update(Z_ARRVAL_P(return_value), key, key_len, &prop_copy, sizeof(zval*), NULL);
}
}
/* }}} */
@@ -1017,7 +1020,14 @@ ZEND_FUNCTION(get_object_vars)
zend_unmangle_property_name_ex(key, key_len - 1, &class_name, &prop_name, (int*) &prop_len);
/* Not separating references */
Z_ADDREF_PP(value);
- add_assoc_zval_ex(return_value, prop_name, prop_len + 1, *value);
+ if (IS_INTERNED(key) && prop_name != key) {
+ /* we can't use substring of interned string as a new key */
+ char *tmp = estrndup(prop_name, prop_len);
+ add_assoc_zval_ex(return_value, tmp, prop_len + 1, *value);
+ efree(tmp);
+ } else {
+ add_assoc_zval_ex(return_value, prop_name, prop_len + 1, *value);
+ }
}
}
zend_hash_move_forward_ex(properties, &pos);
@@ -1388,12 +1398,11 @@ ZEND_FUNCTION(function_exists)
Creates an alias for user defined class */
ZEND_FUNCTION(class_alias)
{
- char *class_name, *lc_name, *alias_name;
+ char *class_name, *alias_name;
zend_class_entry **ce;
int class_name_len, alias_name_len;
int found;
zend_bool autoload = 1;
- ALLOCA_FLAG(use_heap)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &class_name, &class_name_len, &alias_name, &alias_name_len, &autoload) == FAILURE) {
return;
@@ -1474,6 +1483,7 @@ ZEND_FUNCTION(crash)
ZEND_FUNCTION(get_included_files)
{
char *entry;
+ uint entry_len;
if (zend_parse_parameters_none() == FAILURE) {
return;
@@ -1481,8 +1491,8 @@ ZEND_FUNCTION(get_included_files)
array_init(return_value);
zend_hash_internal_pointer_reset(&EG(included_files));
- while (zend_hash_get_current_key(&EG(included_files), &entry, NULL, 1) == HASH_KEY_IS_STRING) {
- add_next_index_string(return_value, entry, 0);
+ while (zend_hash_get_current_key_ex(&EG(included_files), &entry, &entry_len, NULL, 0, NULL) == HASH_KEY_IS_STRING) {
+ add_next_index_stringl(return_value, entry, entry_len-1, !IS_INTERNED(entry));
zend_hash_move_forward(&EG(included_files));
}
}
diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c
index 24bc6da26b..53465af026 100644
--- a/Zend/zend_closures.c
+++ b/Zend/zend_closures.c
@@ -59,14 +59,8 @@ ZEND_METHOD(Closure, __invoke) /* {{{ */
} else if (call_user_function_ex(CG(function_table), NULL, this_ptr, &closure_result_ptr, ZEND_NUM_ARGS(), arguments, 1, NULL TSRMLS_CC) == FAILURE) {
RETVAL_FALSE;
} else if (closure_result_ptr) {
- if (Z_ISREF_P(closure_result_ptr) && return_value_ptr) {
- if (return_value) {
- zval_ptr_dtor(&return_value);
- }
- *return_value_ptr = closure_result_ptr;
- } else {
- RETVAL_ZVAL(closure_result_ptr, 1, 1);
- }
+ zval_ptr_dtor(&return_value);
+ *return_value_ptr = closure_result_ptr;
}
efree(arguments);
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 4e7370c49c..d2f9fbc8d7 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -26,7 +26,7 @@
#include "zend_llist.h"
#include "zend_API.h"
#include "zend_exceptions.h"
-#include "tsrm_virtual_cwd.h"
+#include "zend_virtual_cwd.h"
#include "zend_multibyte.h"
#include "zend_language_scanner.h"
@@ -61,11 +61,8 @@
} while (0)
#define CALCULATE_LITERAL_HASH(num) do { \
- if (IS_INTERNED(Z_STRVAL(CONSTANT(num)))) { \
- Z_HASH_P(&CONSTANT(num)) = INTERNED_HASH(Z_STRVAL(CONSTANT(num))); \
- } else { \
- Z_HASH_P(&CONSTANT(num)) = zend_hash_func(Z_STRVAL(CONSTANT(num)), Z_STRLEN(CONSTANT(num))+1); \
- } \
+ zval *c = &CONSTANT(num); \
+ Z_HASH_P(c) = str_hash(Z_STRVAL_P(c), Z_STRLEN_P(c)); \
} while (0)
#define GET_CACHE_SLOT(literal) do { \
@@ -105,11 +102,16 @@ ZEND_API zend_compiler_globals compiler_globals;
ZEND_API zend_executor_globals executor_globals;
#endif
+static void zend_push_function_call_entry(zend_function *fbc TSRMLS_DC) /* {{{ */
+{
+ zend_function_call_entry fcall = { fbc };
+ zend_stack_push(&CG(function_call_stack), &fcall, sizeof(zend_function_call_entry));
+}
+/* }}} */
+
static void zend_duplicate_property_info(zend_property_info *property_info) /* {{{ */
{
- if (!IS_INTERNED(property_info->name)) {
- property_info->name = estrndup(property_info->name, property_info->name_length);
- }
+ property_info->name = str_estrndup(property_info->name, property_info->name_length);
if (property_info->doc_comment) {
property_info->doc_comment = estrndup(property_info->doc_comment, property_info->doc_comment_len);
}
@@ -118,9 +120,7 @@ static void zend_duplicate_property_info(zend_property_info *property_info) /* {
static void zend_duplicate_property_info_internal(zend_property_info *property_info) /* {{{ */
{
- if (!IS_INTERNED(property_info->name)) {
- property_info->name = zend_strndup(property_info->name, property_info->name_length);
- }
+ property_info->name = str_strndup(property_info->name, property_info->name_length);
}
/* }}} */
@@ -153,12 +153,12 @@ static void build_runtime_defined_function_key(zval *result, const char *name, i
}
/* NULL, name length, filename length, last accepting char position length */
- result->value.str.len = 1+name_length+strlen(filename)+char_pos_len;
+ Z_STRLEN_P(result) = 1+name_length+strlen(filename)+char_pos_len;
/* must be binary safe */
- result->value.str.val = (char *) safe_emalloc(result->value.str.len, 1, 1);
- result->value.str.val[0] = '\0';
- sprintf(result->value.str.val+1, "%s%s%s", name, filename, char_pos_buf);
+ Z_STRVAL_P(result) = (char *) safe_emalloc(Z_STRLEN_P(result), 1, 1);
+ Z_STRVAL_P(result)[0] = '\0';
+ sprintf(Z_STRVAL_P(result)+1, "%s%s%s", name, filename, char_pos_buf);
result->type = IS_STRING;
Z_SET_REFCOUNT_P(result, 1);
@@ -204,6 +204,9 @@ void zend_init_compiler_data_structures(TSRMLS_D) /* {{{ */
CG(in_namespace) = 0;
CG(has_bracketed_namespaces) = 0;
CG(current_import) = NULL;
+ CG(current_import_function) = NULL;
+ CG(current_import_const) = NULL;
+ zend_hash_init(&CG(const_filenames), 0, NULL, NULL, 0);
init_compiler_declarables(TSRMLS_C);
zend_stack_init(&CG(context_stack));
@@ -242,6 +245,7 @@ void shutdown_compiler(TSRMLS_D) /* {{{ */
zend_stack_destroy(&CG(list_stack));
zend_hash_destroy(&CG(filenames_table));
zend_llist_destroy(&CG(open_files));
+ zend_hash_destroy(&CG(const_filenames));
zend_stack_destroy(&CG(context_stack));
}
/* }}} */
@@ -424,12 +428,16 @@ int zend_add_ns_func_name_literal(zend_op_array *op_array, const zval *zv TSRMLS
lc_literal = zend_add_literal(CG(active_op_array), &c TSRMLS_CC);
CALCULATE_LITERAL_HASH(lc_literal);
- ns_separator = (const char*)zend_memrchr(Z_STRVAL_P(zv), '\\', Z_STRLEN_P(zv)) + 1;
- lc_len = Z_STRLEN_P(zv) - (ns_separator - Z_STRVAL_P(zv));
- lc_name = zend_str_tolower_dup(ns_separator, lc_len);
- ZVAL_STRINGL(&c, lc_name, lc_len, 0);
- lc_literal = zend_add_literal(CG(active_op_array), &c TSRMLS_CC);
- CALCULATE_LITERAL_HASH(lc_literal);
+ ns_separator = (const char*)zend_memrchr(Z_STRVAL_P(zv), '\\', Z_STRLEN_P(zv));
+
+ if (ns_separator != NULL) {
+ ns_separator += 1;
+ lc_len = Z_STRLEN_P(zv) - (ns_separator - Z_STRVAL_P(zv));
+ lc_name = zend_str_tolower_dup(ns_separator, lc_len);
+ ZVAL_STRINGL(&c, lc_name, lc_len, 0);
+ lc_literal = zend_add_literal(CG(active_op_array), &c TSRMLS_CC);
+ CALCULATE_LITERAL_HASH(lc_literal);
+ }
return ret;
}
@@ -657,21 +665,21 @@ void fetch_simple_variable_ex(znode *result, znode *varname, int bp, zend_uchar
zend_llist *fetch_list_ptr;
if (varname->op_type == IS_CONST) {
- ulong hash = 0;
+ ulong hash;
if (Z_TYPE(varname->u.constant) != IS_STRING) {
convert_to_string(&varname->u.constant);
- } else if (IS_INTERNED(Z_STRVAL(varname->u.constant))) {
- hash = INTERNED_HASH(Z_STRVAL(varname->u.constant));
}
- if (!zend_is_auto_global_quick(varname->u.constant.value.str.val, varname->u.constant.value.str.len, hash TSRMLS_CC) &&
- !(varname->u.constant.value.str.len == (sizeof("this")-1) &&
- !memcmp(varname->u.constant.value.str.val, "this", sizeof("this"))) &&
+
+ hash = str_hash(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant));
+ if (!zend_is_auto_global_quick(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant), hash TSRMLS_CC) &&
+ !(Z_STRLEN(varname->u.constant) == (sizeof("this")-1) &&
+ !memcmp(Z_STRVAL(varname->u.constant), "this", sizeof("this") - 1)) &&
(CG(active_op_array)->last == 0 ||
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].opcode != ZEND_BEGIN_SILENCE)) {
result->op_type = IS_CV;
- result->u.op.var = lookup_cv(CG(active_op_array), varname->u.constant.value.str.val, varname->u.constant.value.str.len, hash TSRMLS_CC);
- varname->u.constant.value.str.val = (char*)CG(active_op_array)->vars[result->u.op.var].name;
+ result->u.op.var = lookup_cv(CG(active_op_array), Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant), hash TSRMLS_CC);
+ Z_STRVAL(varname->u.constant) = (char*)CG(active_op_array)->vars[result->u.op.var].name;
result->EA = 0;
return;
}
@@ -694,7 +702,7 @@ void fetch_simple_variable_ex(znode *result, znode *varname, int bp, zend_uchar
if (varname->op_type == IS_CONST) {
CALCULATE_LITERAL_HASH(opline_ptr->op1.constant);
- if (zend_is_auto_global_quick(varname->u.constant.value.str.val, varname->u.constant.value.str.len, Z_HASH_P(&CONSTANT(opline_ptr->op1.constant)) TSRMLS_CC)) {
+ if (zend_is_auto_global_quick(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant), Z_HASH_P(&CONSTANT(opline_ptr->op1.constant)) TSRMLS_CC)) {
opline_ptr->extended_value = ZEND_FETCH_GLOBAL;
}
}
@@ -723,7 +731,7 @@ void zend_do_fetch_static_member(znode *result, znode *class_name TSRMLS_DC) /*
if (class_name->op_type == IS_CONST &&
ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant))) {
- zend_resolve_class_name(class_name, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC);
+ zend_resolve_class_name(class_name TSRMLS_CC);
class_node = *class_name;
} else {
zend_do_fetch_class(&class_node, class_name TSRMLS_CC);
@@ -882,9 +890,9 @@ void zend_do_abstract_method(const znode *function_name, znode *modifiers, const
method_type = "Abstract";
}
- if (modifiers->u.constant.value.lval & ZEND_ACC_ABSTRACT) {
- if(modifiers->u.constant.value.lval & ZEND_ACC_PRIVATE) {
- zend_error(E_COMPILE_ERROR, "%s function %s::%s() cannot be declared private", method_type, CG(active_class_entry)->name, function_name->u.constant.value.str.val);
+ if (Z_LVAL(modifiers->u.constant) & ZEND_ACC_ABSTRACT) {
+ if(Z_LVAL(modifiers->u.constant) & ZEND_ACC_PRIVATE) {
+ zend_error_noreturn(E_COMPILE_ERROR, "%s function %s::%s() cannot be declared private", method_type, CG(active_class_entry)->name, Z_STRVAL(function_name->u.constant));
}
if (Z_LVAL(body->u.constant) == ZEND_ACC_ABSTRACT) {
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -894,11 +902,11 @@ void zend_do_abstract_method(const znode *function_name, znode *modifiers, const
SET_UNUSED(opline->op2);
} else {
/* we had code in the function body */
- zend_error(E_COMPILE_ERROR, "%s function %s::%s() cannot contain body", method_type, CG(active_class_entry)->name, function_name->u.constant.value.str.val);
+ zend_error_noreturn(E_COMPILE_ERROR, "%s function %s::%s() cannot contain body", method_type, CG(active_class_entry)->name, Z_STRVAL(function_name->u.constant));
}
} else {
- if (body->u.constant.value.lval == ZEND_ACC_ABSTRACT) {
- zend_error(E_COMPILE_ERROR, "Non-abstract method %s::%s() must contain body", CG(active_class_entry)->name, function_name->u.constant.value.str.val);
+ if (Z_LVAL(body->u.constant) == ZEND_ACC_ABSTRACT) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Non-abstract method %s::%s() must contain body", CG(active_class_entry)->name, Z_STRVAL(function_name->u.constant));
}
}
}
@@ -911,7 +919,7 @@ static zend_bool opline_is_fetch_this(const zend_op *opline TSRMLS_DC) /* {{{ */
&& ((opline->extended_value & ZEND_FETCH_STATIC_MEMBER) != ZEND_FETCH_STATIC_MEMBER)
&& (Z_HASH_P(&CONSTANT(opline->op1.constant)) == THIS_HASHVAL)
&& (Z_STRLEN(CONSTANT(opline->op1.constant)) == (sizeof("this")-1))
- && !memcmp(Z_STRVAL(CONSTANT(opline->op1.constant)), "this", sizeof("this"))) {
+ && !memcmp(Z_STRVAL(CONSTANT(opline->op1.constant)), "this", sizeof("this") - 1)) {
return 1;
} else {
return 0;
@@ -958,7 +966,7 @@ void zend_do_assign(znode *result, znode *variable, znode *value TSRMLS_DC) /* {
if (variable->op_type == IS_CV) {
if (variable->u.op.var == CG(active_op_array)->this_var) {
- zend_error(E_COMPILE_ERROR, "Cannot re-assign $this");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign $this");
}
} else if (variable->op_type == IS_VAR) {
int n = 0;
@@ -1004,7 +1012,7 @@ void zend_do_assign(znode *result, znode *variable, znode *value TSRMLS_DC) /* {
GET_NODE(result, last_op->result);
return;
} else if (opline_is_fetch_this(last_op TSRMLS_CC)) {
- zend_error(E_COMPILE_ERROR, "Cannot re-assign $this");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign $this");
} else {
break;
}
@@ -1028,7 +1036,7 @@ void zend_do_assign_ref(znode *result, const znode *lvar, const znode *rvar TSRM
if (lvar->op_type == IS_CV) {
if (lvar->u.op.var == CG(active_op_array)->this_var) {
- zend_error(E_COMPILE_ERROR, "Cannot re-assign $this");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign $this");
}
} else if (lvar->op_type == IS_VAR) {
int last_op_number = get_next_op_number(CG(active_op_array));
@@ -1036,7 +1044,7 @@ void zend_do_assign_ref(znode *result, const znode *lvar, const znode *rvar TSRM
if (last_op_number > 0) {
opline = &CG(active_op_array)->opcodes[last_op_number-1];
if (opline_is_fetch_this(opline TSRMLS_CC)) {
- zend_error(E_COMPILE_ERROR, "Cannot re-assign $this");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign $this");
}
}
}
@@ -1278,10 +1286,10 @@ void zend_check_writable_variable(const znode *variable) /* {{{ */
zend_uint type = variable->EA;
if (type & ZEND_PARSED_METHOD_CALL) {
- zend_error(E_COMPILE_ERROR, "Can't use method return value in write context");
+ zend_error_noreturn(E_COMPILE_ERROR, "Can't use method return value in write context");
}
if (type == ZEND_PARSED_FUNCTION_CALL) {
- zend_error(E_COMPILE_ERROR, "Can't use function return value in write context");
+ zend_error_noreturn(E_COMPILE_ERROR, "Can't use function return value in write context");
}
}
/* }}} */
@@ -1354,7 +1362,7 @@ void zend_do_end_variable_parse(znode *variable, int type, int arg_offset TSRMLS
switch (type) {
case BP_VAR_R:
if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2_type == IS_UNUSED) {
- zend_error(E_COMPILE_ERROR, "Cannot use [] for reading");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading");
}
opline->opcode -= 3;
break;
@@ -1365,7 +1373,7 @@ void zend_do_end_variable_parse(znode *variable, int type, int arg_offset TSRMLS
break;
case BP_VAR_IS:
if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2_type == IS_UNUSED) {
- zend_error(E_COMPILE_ERROR, "Cannot use [] for reading");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading");
}
opline->opcode += 6; /* 3+3 */
break;
@@ -1375,7 +1383,7 @@ void zend_do_end_variable_parse(znode *variable, int type, int arg_offset TSRMLS
break;
case BP_VAR_UNSET:
if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2_type == IS_UNUSED) {
- zend_error(E_COMPILE_ERROR, "Cannot use [] for unsetting");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for unsetting");
}
opline->opcode += 12; /* 3+3+3+3 */
break;
@@ -1503,22 +1511,22 @@ int zend_do_verify_access_types(const znode *current_access_type, const znode *n
{
if ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_PPP_MASK)
&& (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_PPP_MASK)) {
- zend_error(E_COMPILE_ERROR, "Multiple access type modifiers are not allowed");
+ zend_error_noreturn(E_COMPILE_ERROR, "Multiple access type modifiers are not allowed");
}
if ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_ABSTRACT)
&& (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_ABSTRACT)) {
- zend_error(E_COMPILE_ERROR, "Multiple abstract modifiers are not allowed");
+ zend_error_noreturn(E_COMPILE_ERROR, "Multiple abstract modifiers are not allowed");
}
if ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_STATIC)
&& (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_STATIC)) {
- zend_error(E_COMPILE_ERROR, "Multiple static modifiers are not allowed");
+ zend_error_noreturn(E_COMPILE_ERROR, "Multiple static modifiers are not allowed");
}
if ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_FINAL)
&& (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_FINAL)) {
- zend_error(E_COMPILE_ERROR, "Multiple final modifiers are not allowed");
+ zend_error_noreturn(E_COMPILE_ERROR, "Multiple final modifiers are not allowed");
}
if (((Z_LVAL(current_access_type->u.constant) | Z_LVAL(new_modifier->u.constant)) & (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) == (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) {
- zend_error(E_COMPILE_ERROR, "Cannot use the final modifier on an abstract class member");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use the final modifier on an abstract class member");
}
return (Z_LVAL(current_access_type->u.constant) | Z_LVAL(new_modifier->u.constant));
}
@@ -1527,8 +1535,8 @@ int zend_do_verify_access_types(const znode *current_access_type, const znode *n
void zend_do_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference, znode *fn_flags_znode TSRMLS_DC) /* {{{ */
{
zend_op_array op_array;
- char *name = function_name->u.constant.value.str.val;
- int name_len = function_name->u.constant.value.str.len;
+ char *name = Z_STRVAL(function_name->u.constant);
+ int name_len = Z_STRLEN(function_name->u.constant);
int function_begin_line = function_token->u.op.opline_num;
zend_uint fn_flags;
const char *lcname;
@@ -1538,7 +1546,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
if (is_method) {
if (CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE) {
if ((Z_LVAL(fn_flags_znode->u.constant) & ~(ZEND_ACC_STATIC|ZEND_ACC_PUBLIC))) {
- zend_error(E_COMPILE_ERROR, "Access type for interface method %s::%s() must be omitted", CG(active_class_entry)->name, function_name->u.constant.value.str.val);
+ zend_error_noreturn(E_COMPILE_ERROR, "Access type for interface method %s::%s() must be omitted", CG(active_class_entry)->name, Z_STRVAL(function_name->u.constant));
}
Z_LVAL(fn_flags_znode->u.constant) |= ZEND_ACC_ABSTRACT; /* propagates to the rest of the parser */
}
@@ -1569,17 +1577,12 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
op_array.line_start = zend_get_compiled_lineno(TSRMLS_C);
if (is_method) {
- int result;
+ zend_ulong hash;
lcname = zend_new_interned_string(zend_str_tolower_dup(name, name_len), name_len + 1, 1 TSRMLS_CC);
-
- if (IS_INTERNED(lcname)) {
- result = zend_hash_quick_add(&CG(active_class_entry)->function_table, lcname, name_len+1, INTERNED_HASH(lcname), &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array));
- } else {
- result = zend_hash_add(&CG(active_class_entry)->function_table, lcname, name_len+1, &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array));
- }
- if (result == FAILURE) {
- zend_error(E_COMPILE_ERROR, "Cannot redeclare %s::%s()", CG(active_class_entry)->name, name);
+ hash = str_hash(lcname, name_len);
+ if (zend_hash_quick_add(&CG(active_class_entry)->function_table, lcname, name_len+1, hash, &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array)) == FAILURE) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare %s::%s()", CG(active_class_entry)->name, name);
}
zend_stack_push(&CG(context_stack), (void *) &CG(context), sizeof(CG(context)));
@@ -1626,6 +1629,11 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
zend_error(E_WARNING, "The magic method __invoke() must have public visibility and cannot be static");
}
+
+ } else if ((name_len == sizeof(ZEND_DEBUGINFO_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_DEBUGINFO_FUNC_NAME, sizeof(ZEND_DEBUGINFO_FUNC_NAME)-1))) {
+ if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
+ zend_error(E_WARNING, "The magic method __debugInfo() must have public visibility and cannot be static");
+ }
}
} else {
char *class_lcname;
@@ -1686,6 +1694,11 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
zend_error(E_WARNING, "The magic method __invoke() must have public visibility and cannot be static");
}
+ } else if ((name_len == sizeof(ZEND_DEBUGINFO_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_DEBUGINFO_FUNC_NAME, sizeof(ZEND_DEBUGINFO_FUNC_NAME)-1))) {
+ if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
+ zend_error(E_WARNING, "The magic method __debugInfo() must have public visibility and cannot be static");
+ }
+ CG(active_class_entry)->__debugInfo = (zend_function *) CG(active_op_array);
} else if (!(fn_flags & ZEND_ACC_STATIC)) {
CG(active_op_array)->fn_flags |= ZEND_ACC_ALLOW_STATIC;
}
@@ -1696,6 +1709,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
} else {
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
zval key;
+ zval **ns_name;
if (CG(current_namespace)) {
/* Prefix function name with current namespace name */
@@ -1711,18 +1725,32 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
lcname = zend_str_tolower_dup(name, name_len);
}
+ /* Function name must not conflict with import names */
+ if (CG(current_import_function) &&
+ zend_hash_find(CG(current_import_function), lcname, Z_STRLEN(function_name->u.constant)+1, (void**)&ns_name) == SUCCESS) {
+
+ char *tmp = zend_str_tolower_dup(Z_STRVAL_PP(ns_name), Z_STRLEN_PP(ns_name));
+
+ if (Z_STRLEN_PP(ns_name) != Z_STRLEN(function_name->u.constant) ||
+ memcmp(tmp, lcname, Z_STRLEN(function_name->u.constant))) {
+ zend_error(E_COMPILE_ERROR, "Cannot declare function %s because the name is already in use", Z_STRVAL(function_name->u.constant));
+ }
+ efree(tmp);
+ }
+
opline->opcode = ZEND_DECLARE_FUNCTION;
opline->op1_type = IS_CONST;
build_runtime_defined_function_key(&key, lcname, name_len TSRMLS_CC);
opline->op1.constant = zend_add_literal(CG(active_op_array), &key TSRMLS_CC);
Z_HASH_P(&CONSTANT(opline->op1.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline->op1.constant)), Z_STRLEN(CONSTANT(opline->op1.constant)));
opline->op2_type = IS_CONST;
- LITERAL_STRINGL(opline->op2, lcname, name_len, 0);
+ LITERAL_STRINGL(opline->op2, lcname, name_len, 1);
CALCULATE_LITERAL_HASH(opline->op2.constant);
opline->extended_value = ZEND_DECLARE_FUNCTION;
zend_hash_quick_update(CG(function_table), Z_STRVAL(key), Z_STRLEN(key), Z_HASH_P(&CONSTANT(opline->op1.constant)), &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array));
zend_stack_push(&CG(context_stack), (void *) &CG(context), sizeof(CG(context)));
zend_init_compiler_context(TSRMLS_C);
+ str_efree(lcname);
}
if (CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO) {
@@ -1820,7 +1848,7 @@ void zend_do_end_function_declaration(const znode *function_token TSRMLS_DC) /*
zend_str_tolower_copy(lcname, CG(active_op_array)->function_name, MIN(name_len, sizeof(lcname)-1));
lcname[sizeof(lcname)-1] = '\0'; /* zend_str_tolower_copy won't necessarily set the zero byte */
if (name_len == sizeof(ZEND_AUTOLOAD_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_AUTOLOAD_FUNC_NAME, sizeof(ZEND_AUTOLOAD_FUNC_NAME)) && CG(active_op_array)->num_args != 1) {
- zend_error(E_COMPILE_ERROR, "%s() must take exactly 1 argument", ZEND_AUTOLOAD_FUNC_NAME);
+ zend_error_noreturn(E_COMPILE_ERROR, "%s() must take exactly 1 argument", ZEND_AUTOLOAD_FUNC_NAME);
}
}
@@ -1834,26 +1862,17 @@ void zend_do_end_function_declaration(const znode *function_token TSRMLS_DC) /*
}
/* }}} */
-void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, const znode *initialization, znode *class_type, zend_uchar pass_by_reference TSRMLS_DC) /* {{{ */
+void zend_do_receive_param(zend_uchar op, znode *varname, const znode *initialization, znode *class_type, zend_uchar pass_by_reference, zend_bool is_variadic TSRMLS_DC) /* {{{ */
{
zend_op *opline;
zend_arg_info *cur_arg_info;
znode var;
- if (class_type->op_type == IS_CONST &&
- Z_TYPE(class_type->u.constant) == IS_STRING &&
- Z_STRLEN(class_type->u.constant) == 0) {
- /* Usage of namespace as class name not in namespace */
- zval_dtor(&class_type->u.constant);
- zend_error(E_COMPILE_ERROR, "Cannot use 'namespace' as a class name");
- return;
- }
-
- if (zend_is_auto_global_quick(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant), 0 TSRMLS_CC)) {
- zend_error(E_COMPILE_ERROR, "Cannot re-assign auto-global variable %s", Z_STRVAL(varname->u.constant));
+ if (zend_is_auto_global(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant) TSRMLS_CC)) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign auto-global variable %s", Z_STRVAL(varname->u.constant));
} else {
var.op_type = IS_CV;
- var.u.op.var = lookup_cv(CG(active_op_array), varname->u.constant.value.str.val, varname->u.constant.value.str.len, 0 TSRMLS_CC);
+ var.u.op.var = lookup_cv(CG(active_op_array), Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant), 0 TSRMLS_CC);
Z_STRVAL(varname->u.constant) = (char*)CG(active_op_array)->vars[var.u.op.var].name;
var.EA = 0;
if (CG(active_op_array)->vars[var.u.op.var].hash_value == THIS_HASHVAL &&
@@ -1861,30 +1880,47 @@ void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, con
!memcmp(Z_STRVAL(varname->u.constant), "this", sizeof("this")-1)) {
if (CG(active_op_array)->scope &&
(CG(active_op_array)->fn_flags & ZEND_ACC_STATIC) == 0) {
- zend_error(E_COMPILE_ERROR, "Cannot re-assign $this");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign $this");
}
CG(active_op_array)->this_var = var.u.op.var;
}
}
+ if (CG(active_op_array)->fn_flags & ZEND_ACC_VARIADIC) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Only the last parameter can be variadic");
+ }
+
+ if (is_variadic) {
+ if (op == ZEND_RECV_INIT) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Variadic parameter cannot have a default value");
+ }
+
+ op = ZEND_RECV_VARIADIC;
+ CG(active_op_array)->fn_flags |= ZEND_ACC_VARIADIC;
+ }
+
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
CG(active_op_array)->num_args++;
opline->opcode = op;
SET_NODE(opline->result, &var);
- SET_NODE(opline->op1, offset);
+ opline->op1_type = IS_UNUSED;
+ opline->op1.num = CG(active_op_array)->num_args;
if (op == ZEND_RECV_INIT) {
SET_NODE(opline->op2, initialization);
} else {
- CG(active_op_array)->required_num_args = CG(active_op_array)->num_args;
SET_UNUSED(opline->op2);
+ if (!is_variadic) {
+ CG(active_op_array)->required_num_args = CG(active_op_array)->num_args;
+ }
}
CG(active_op_array)->arg_info = erealloc(CG(active_op_array)->arg_info, sizeof(zend_arg_info)*(CG(active_op_array)->num_args));
cur_arg_info = &CG(active_op_array)->arg_info[CG(active_op_array)->num_args-1];
- cur_arg_info->name = zend_new_interned_string(estrndup(varname->u.constant.value.str.val, varname->u.constant.value.str.len), varname->u.constant.value.str.len + 1, 1 TSRMLS_CC);
- cur_arg_info->name_len = varname->u.constant.value.str.len;
+ cur_arg_info->name = zend_new_interned_string(estrndup(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant)), Z_STRLEN(varname->u.constant) + 1, 1 TSRMLS_CC);
+ cur_arg_info->name_len = Z_STRLEN(varname->u.constant);
cur_arg_info->type_hint = 0;
- cur_arg_info->allow_null = 1;
cur_arg_info->pass_by_reference = pass_by_reference;
+ cur_arg_info->allow_null = 1;
+ cur_arg_info->is_variadic = is_variadic;
cur_arg_info->class_name = NULL;
cur_arg_info->class_name_len = 0;
@@ -1897,8 +1933,11 @@ void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, con
if (op == ZEND_RECV_INIT) {
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) {
cur_arg_info->allow_null = 1;
- } else if (Z_TYPE(initialization->u.constant) != IS_ARRAY && Z_TYPE(initialization->u.constant) != IS_CONSTANT_ARRAY) {
- zend_error(E_COMPILE_ERROR, "Default value for parameters with array type hint can only be an array or NULL");
+ } else if (IS_CONSTANT_TYPE(Z_TYPE(initialization->u.constant))) {
+ /* delay constant resolution and check to run-time */
+ cur_arg_info->allow_null = 0;
+ } else if (Z_TYPE(initialization->u.constant) != IS_ARRAY) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with array type hint can only be an array or NULL");
}
}
} else if (class_type->u.constant.type == IS_CALLABLE) {
@@ -1906,23 +1945,29 @@ void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, con
if (op == ZEND_RECV_INIT) {
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) {
cur_arg_info->allow_null = 1;
+ } else if (IS_CONSTANT_TYPE(Z_TYPE(initialization->u.constant))) {
+ /* delay constant resolution and check to run-time */
+ cur_arg_info->allow_null = 0;
} else {
- zend_error(E_COMPILE_ERROR, "Default value for parameters with callable type hint can only be NULL");
+ zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with callable type hint can only be NULL");
}
}
} else {
cur_arg_info->type_hint = IS_OBJECT;
if (ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(class_type->u.constant), Z_STRLEN(class_type->u.constant))) {
- zend_resolve_class_name(class_type, opline->extended_value, 1 TSRMLS_CC);
+ zend_resolve_class_name(class_type TSRMLS_CC);
}
- Z_STRVAL(class_type->u.constant) = (char*)zend_new_interned_string(class_type->u.constant.value.str.val, class_type->u.constant.value.str.len + 1, 1 TSRMLS_CC);
- cur_arg_info->class_name = class_type->u.constant.value.str.val;
- cur_arg_info->class_name_len = class_type->u.constant.value.str.len;
+ Z_STRVAL(class_type->u.constant) = (char*)zend_new_interned_string(Z_STRVAL(class_type->u.constant), Z_STRLEN(class_type->u.constant) + 1, 1 TSRMLS_CC);
+ cur_arg_info->class_name = Z_STRVAL(class_type->u.constant);
+ cur_arg_info->class_name_len = Z_STRLEN(class_type->u.constant);
if (op == ZEND_RECV_INIT) {
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) {
cur_arg_info->allow_null = 1;
+ } else if (IS_CONSTANT_TYPE(Z_TYPE(initialization->u.constant))) {
+ /* delay constant resolution and check to run-time */
+ cur_arg_info->allow_null = 0;
} else {
- zend_error(E_COMPILE_ERROR, "Default value for parameters with a class type hint can only be NULL");
+ zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with a class type hint can only be NULL");
}
}
}
@@ -1937,7 +1982,7 @@ int zend_do_begin_function_call(znode *function_name, zend_bool check_namespace
char *lcname;
char *is_compound = memchr(Z_STRVAL(function_name->u.constant), '\\', Z_STRLEN(function_name->u.constant));
- zend_resolve_non_class_name(function_name, check_namespace TSRMLS_CC);
+ zend_resolve_function_name(function_name, &check_namespace TSRMLS_CC);
if (check_namespace && CG(current_namespace) && !is_compound) {
/* We assume we call function from the current namespace
@@ -1949,18 +1994,18 @@ int zend_do_begin_function_call(znode *function_name, zend_bool check_namespace
return 1;
}
- lcname = zend_str_tolower_dup(function_name->u.constant.value.str.val, function_name->u.constant.value.str.len);
- if ((zend_hash_find(CG(function_table), lcname, function_name->u.constant.value.str.len+1, (void **) &function)==FAILURE) ||
+ lcname = zend_str_tolower_dup(Z_STRVAL(function_name->u.constant), Z_STRLEN(function_name->u.constant));
+ if ((zend_hash_find(CG(function_table), lcname, Z_STRLEN(function_name->u.constant)+1, (void **) &function)==FAILURE) ||
((CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_FUNCTIONS) &&
(function->type == ZEND_INTERNAL_FUNCTION))) {
zend_do_begin_dynamic_function_call(function_name, 0 TSRMLS_CC);
efree(lcname);
return 1; /* Dynamic */
}
- efree(function_name->u.constant.value.str.val);
- function_name->u.constant.value.str.val = lcname;
+ efree(Z_STRVAL(function_name->u.constant));
+ Z_STRVAL(function_name->u.constant) = lcname;
- zend_stack_push(&CG(function_call_stack), (void *) &function, sizeof(zend_function *));
+ zend_push_function_call_entry(function TSRMLS_CC);
if (CG(context).nested_calls + 1 > CG(active_op_array)->nested_calls) {
CG(active_op_array)->nested_calls = CG(context).nested_calls + 1;
}
@@ -1973,7 +2018,6 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC) /* {{{ */
{
zend_op *last_op;
int last_op_number;
- unsigned char *ptr = NULL;
zend_do_end_variable_parse(left_bracket, BP_VAR_R, 0 TSRMLS_CC);
zend_do_begin_variable_parse(TSRMLS_C);
@@ -1983,7 +2027,7 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC) /* {{{ */
if ((last_op->op2_type == IS_CONST) && (Z_TYPE(CONSTANT(last_op->op2.constant)) == IS_STRING) && (Z_STRLEN(CONSTANT(last_op->op2.constant)) == sizeof(ZEND_CLONE_FUNC_NAME)-1)
&& !zend_binary_strcasecmp(Z_STRVAL(CONSTANT(last_op->op2.constant)), Z_STRLEN(CONSTANT(last_op->op2.constant)), ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME)-1)) {
- zend_error(E_COMPILE_ERROR, "Cannot call __clone() method on objects - use 'clone $obj' instead");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot call __clone() method on objects - use 'clone $obj' instead");
}
if (last_op->opcode == ZEND_FETCH_OBJ_R) {
@@ -1991,11 +2035,9 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC) /* {{{ */
zval name;
name = CONSTANT(last_op->op2.constant);
if (Z_TYPE(name) != IS_STRING) {
- zend_error(E_COMPILE_ERROR, "Method name must be a string");
- }
- if (!IS_INTERNED(Z_STRVAL(name))) {
- Z_STRVAL(name) = estrndup(Z_STRVAL(name), Z_STRLEN(name));
+ zend_error_noreturn(E_COMPILE_ERROR, "Method name must be a string");
}
+ Z_STRVAL(name) = str_estrndup(Z_STRVAL(name), Z_STRLEN(name));
FREE_POLYMORPHIC_CACHE_SLOT(last_op->op2.constant);
last_op->op2.constant =
zend_add_func_name_literal(CG(active_op_array), &name TSRMLS_CC);
@@ -2019,7 +2061,7 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC) /* {{{ */
}
}
- zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
+ zend_push_function_call_entry(NULL TSRMLS_CC);
if (++CG(context).nested_calls > CG(active_op_array)->nested_calls) {
CG(active_op_array)->nested_calls = CG(context).nested_calls;
}
@@ -2042,7 +2084,6 @@ void zend_do_clone(znode *result, const znode *expr TSRMLS_DC) /* {{{ */
void zend_do_begin_dynamic_function_call(znode *function_name, int ns_call TSRMLS_DC) /* {{{ */
{
- unsigned char *ptr = NULL;
zend_op *opline;
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -2068,7 +2109,7 @@ void zend_do_begin_dynamic_function_call(znode *function_name, int ns_call TSRML
}
}
- zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
+ zend_push_function_call_entry(NULL TSRMLS_CC);
if (++CG(context).nested_calls > CG(active_op_array)->nested_calls) {
CG(active_op_array)->nested_calls = CG(context).nested_calls;
}
@@ -2076,12 +2117,12 @@ void zend_do_begin_dynamic_function_call(znode *function_name, int ns_call TSRML
}
/* }}} */
-void zend_resolve_non_class_name(znode *element_name, zend_bool check_namespace TSRMLS_DC) /* {{{ */
+void zend_resolve_non_class_name(znode *element_name, zend_bool *check_namespace, zend_bool case_sensitive, HashTable *current_import_sub TSRMLS_DC) /* {{{ */
{
znode tmp;
int len;
zval **ns;
- char *lcname, *compound = memchr(Z_STRVAL(element_name->u.constant), '\\', Z_STRLEN(element_name->u.constant));
+ char *lookup_name, *compound = memchr(Z_STRVAL(element_name->u.constant), '\\', Z_STRLEN(element_name->u.constant));
if (Z_STRVAL(element_name->u.constant)[0] == '\\') {
/* name starts with \ so it is known and unambiguos, nothing to do here but shorten it */
@@ -2090,15 +2131,35 @@ void zend_resolve_non_class_name(znode *element_name, zend_bool check_namespace
return;
}
- if(!check_namespace) {
+ if(!*check_namespace) {
return;
}
+ if (current_import_sub) {
+ len = Z_STRLEN(element_name->u.constant)+1;
+ if (case_sensitive) {
+ lookup_name = estrndup(Z_STRVAL(element_name->u.constant), len);
+ } else {
+ lookup_name = zend_str_tolower_dup(Z_STRVAL(element_name->u.constant), len);
+ }
+ /* Check if function/const matches imported name */
+ if (zend_hash_find(current_import_sub, lookup_name, len, (void**)&ns) == SUCCESS) {
+ zval_dtor(&element_name->u.constant);
+ element_name->u.constant = **ns;
+ zval_copy_ctor(&element_name->u.constant);
+ efree(lookup_name);
+ *check_namespace = 0;
+ return;
+ }
+ efree(lookup_name);
+ }
+
if (compound && CG(current_import)) {
len = compound - Z_STRVAL(element_name->u.constant);
- lcname = zend_str_tolower_dup(Z_STRVAL(element_name->u.constant), len);
+ /* namespace is always lowercase */
+ lookup_name = zend_str_tolower_dup(Z_STRVAL(element_name->u.constant), len);
/* Check if first part of compound name is an import name */
- if (zend_hash_find(CG(current_import), lcname, len+1, (void**)&ns) == SUCCESS) {
+ if (zend_hash_find(CG(current_import), lookup_name, len+1, (void**)&ns) == SUCCESS) {
/* Substitute import name */
tmp.op_type = IS_CONST;
tmp.u.constant = **ns;
@@ -2108,10 +2169,11 @@ void zend_resolve_non_class_name(znode *element_name, zend_bool check_namespace
memmove(Z_STRVAL(element_name->u.constant), Z_STRVAL(element_name->u.constant)+len, Z_STRLEN(element_name->u.constant)+1);
zend_do_build_namespace_name(&tmp, &tmp, element_name TSRMLS_CC);
*element_name = tmp;
- efree(lcname);
+ efree(lookup_name);
+ *check_namespace = 0;
return;
}
- efree(lcname);
+ efree(lookup_name);
}
if (CG(current_namespace)) {
@@ -2121,24 +2183,36 @@ void zend_resolve_non_class_name(znode *element_name, zend_bool check_namespace
memcpy(Z_STRVAL(tmp.u.constant), Z_STRVAL_P(CG(current_namespace)), Z_STRLEN_P(CG(current_namespace)));
memcpy(&(Z_STRVAL(tmp.u.constant)[Z_STRLEN_P(CG(current_namespace))]), "\\", sizeof("\\")-1);
memcpy(&(Z_STRVAL(tmp.u.constant)[Z_STRLEN_P(CG(current_namespace)) + sizeof("\\")-1]), Z_STRVAL(element_name->u.constant), Z_STRLEN(element_name->u.constant)+1);
- STR_FREE(Z_STRVAL(element_name->u.constant));
+ str_efree(Z_STRVAL(element_name->u.constant));
*element_name = tmp;
}
}
/* }}} */
+void zend_resolve_function_name(znode *element_name, zend_bool *check_namespace TSRMLS_DC) /* {{{ */
+{
+ zend_resolve_non_class_name(element_name, check_namespace, 0, CG(current_import_function) TSRMLS_CC);
+}
+/* }}} */
+
+void zend_resolve_const_name(znode *element_name, zend_bool *check_namespace TSRMLS_DC) /* {{{ */
+{
+ zend_resolve_non_class_name(element_name, check_namespace, 1, CG(current_import_const) TSRMLS_CC);
+}
+/* }}} */
+
void zend_do_resolve_class_name(znode *result, znode *class_name, int is_static TSRMLS_DC) /* {{{ */
{
char *lcname;
int lctype;
znode constant_name;
- lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), class_name->u.constant.value.str.len);
+ lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant));
lctype = zend_get_class_fetch_type(lcname, strlen(lcname));
switch (lctype) {
case ZEND_FETCH_CLASS_SELF:
if (!CG(active_class_entry)) {
- zend_error(E_COMPILE_ERROR, "Cannot access self::class when no class scope is active");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot access self::class when no class scope is active");
}
if (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) {
constant_name.op_type = IS_CONST;
@@ -2154,13 +2228,13 @@ void zend_do_resolve_class_name(znode *result, znode *class_name, int is_static
case ZEND_FETCH_CLASS_STATIC:
case ZEND_FETCH_CLASS_PARENT:
if (is_static) {
- zend_error(E_COMPILE_ERROR,
+ zend_error_noreturn(E_COMPILE_ERROR,
"%s::class cannot be used for compile-time class name resolution",
lctype == ZEND_FETCH_CLASS_STATIC ? "static" : "parent"
);
}
if (!CG(active_class_entry)) {
- zend_error(E_COMPILE_ERROR,
+ zend_error_noreturn(E_COMPILE_ERROR,
"Cannot access %s::class when no class scope is active",
lctype == ZEND_FETCH_CLASS_STATIC ? "static" : "parent"
);
@@ -2170,7 +2244,7 @@ void zend_do_resolve_class_name(znode *result, znode *class_name, int is_static
zend_do_fetch_constant(result, class_name, &constant_name, ZEND_RT, 1 TSRMLS_CC);
break;
case ZEND_FETCH_CLASS_DEFAULT:
- zend_resolve_class_name(class_name, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC);
+ zend_resolve_class_name(class_name TSRMLS_CC);
*result = *class_name;
break;
}
@@ -2180,7 +2254,7 @@ void zend_do_resolve_class_name(znode *result, znode *class_name, int is_static
}
/* }}} */
-void zend_resolve_class_name(znode *class_name, ulong fetch_type, int check_ns_name TSRMLS_DC) /* {{{ */
+void zend_resolve_class_name(znode *class_name TSRMLS_DC) /* {{{ */
{
char *compound;
char *lcname;
@@ -2200,7 +2274,7 @@ void zend_resolve_class_name(znode *class_name, ulong fetch_type, int check_ns_n
Z_STRLEN(class_name->u.constant) + 1);
if (ZEND_FETCH_CLASS_DEFAULT != zend_get_class_fetch_type(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant))) {
- zend_error(E_COMPILE_ERROR, "'\\%s' is an invalid class name", Z_STRVAL(class_name->u.constant));
+ zend_error_noreturn(E_COMPILE_ERROR, "'\\%s' is an invalid class name", Z_STRVAL(class_name->u.constant));
}
} else {
if (CG(current_import)) {
@@ -2259,26 +2333,17 @@ void zend_do_fetch_class(znode *result, znode *class_name TSRMLS_DC) /* {{{ */
long fetch_class_op_number;
zend_op *opline;
- if (class_name->op_type == IS_CONST &&
- Z_TYPE(class_name->u.constant) == IS_STRING &&
- Z_STRLEN(class_name->u.constant) == 0) {
- /* Usage of namespace as class name not in namespace */
- zval_dtor(&class_name->u.constant);
- zend_error(E_COMPILE_ERROR, "Cannot use 'namespace' as a class name");
- return;
- }
-
fetch_class_op_number = get_next_op_number(CG(active_op_array));
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_FETCH_CLASS;
SET_UNUSED(opline->op1);
- opline->extended_value = ZEND_FETCH_CLASS_GLOBAL;
+ opline->extended_value = ZEND_FETCH_CLASS_DEFAULT;
CG(catch_begin) = fetch_class_op_number;
if (class_name->op_type == IS_CONST) {
int fetch_type;
- fetch_type = zend_get_class_fetch_type(class_name->u.constant.value.str.val, class_name->u.constant.value.str.len);
+ fetch_type = zend_get_class_fetch_type(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant));
switch (fetch_type) {
case ZEND_FETCH_CLASS_SELF:
case ZEND_FETCH_CLASS_PARENT:
@@ -2288,7 +2353,7 @@ void zend_do_fetch_class(znode *result, znode *class_name TSRMLS_DC) /* {{{ */
zval_dtor(&class_name->u.constant);
break;
default:
- zend_resolve_class_name(class_name, opline->extended_value, 0 TSRMLS_CC);
+ zend_resolve_class_name(class_name TSRMLS_CC);
opline->op2_type = IS_CONST;
opline->op2.constant =
zend_add_class_name_literal(CG(active_op_array), &class_name->u.constant TSRMLS_CC);
@@ -2317,7 +2382,7 @@ void zend_do_label(znode *label TSRMLS_DC) /* {{{ */
dest.opline_num = get_next_op_number(CG(active_op_array));
if (zend_hash_add(CG(context).labels, Z_STRVAL(label->u.constant), Z_STRLEN(label->u.constant) + 1, (void**)&dest, sizeof(zend_label), NULL) == FAILURE) {
- zend_error(E_COMPILE_ERROR, "Label '%s' already defined", Z_STRVAL(label->u.constant));
+ zend_error_noreturn(E_COMPILE_ERROR, "Label '%s' already defined", Z_STRVAL(label->u.constant));
}
/* Done with label now */
@@ -2343,7 +2408,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2
CG(in_compilation) = 1;
CG(active_op_array) = op_array;
CG(zend_lineno) = opline->lineno;
- zend_error(E_COMPILE_ERROR, "'goto' to undefined label '%s'", Z_STRVAL_P(label));
+ zend_error_noreturn(E_COMPILE_ERROR, "'goto' to undefined label '%s'", Z_STRVAL_P(label));
} else {
/* Label is not defined. Delay to pass 2. */
INC_BPC(op_array);
@@ -2364,7 +2429,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2
CG(active_op_array) = op_array;
CG(zend_lineno) = opline->lineno;
}
- zend_error(E_COMPILE_ERROR, "'goto' into loop or switch statement is disallowed");
+ zend_error_noreturn(E_COMPILE_ERROR, "'goto' into loop or switch statement is disallowed");
}
current = op_array->brk_cont_array[current].parent;
}
@@ -2425,19 +2490,19 @@ void zend_do_build_full_name(znode *result, znode *prefix, znode *name, int is_c
}
if (is_class_member) {
- length = sizeof("::")-1 + result->u.constant.value.str.len + name->u.constant.value.str.len;
- result->u.constant.value.str.val = erealloc(result->u.constant.value.str.val, length+1);
- memcpy(&result->u.constant.value.str.val[result->u.constant.value.str.len], "::", sizeof("::")-1);
- memcpy(&result->u.constant.value.str.val[result->u.constant.value.str.len + sizeof("::")-1], name->u.constant.value.str.val, name->u.constant.value.str.len+1);
- STR_FREE(name->u.constant.value.str.val);
- result->u.constant.value.str.len = length;
+ length = sizeof("::")-1 + Z_STRLEN(result->u.constant) + Z_STRLEN(name->u.constant);
+ Z_STRVAL(result->u.constant) = str_erealloc(Z_STRVAL(result->u.constant), length+1);
+ memcpy(&Z_STRVAL(result->u.constant)[Z_STRLEN(result->u.constant)], "::", sizeof("::")-1);
+ memcpy(&Z_STRVAL(result->u.constant)[Z_STRLEN(result->u.constant) + sizeof("::")-1], Z_STRVAL(name->u.constant), Z_STRLEN(name->u.constant)+1);
+ str_efree(Z_STRVAL(name->u.constant));
+ Z_STRLEN(result->u.constant) = length;
} else {
- length = sizeof("\\")-1 + result->u.constant.value.str.len + name->u.constant.value.str.len;
- result->u.constant.value.str.val = erealloc(result->u.constant.value.str.val, length+1);
- memcpy(&result->u.constant.value.str.val[result->u.constant.value.str.len], "\\", sizeof("\\")-1);
- memcpy(&result->u.constant.value.str.val[result->u.constant.value.str.len + sizeof("\\")-1], name->u.constant.value.str.val, name->u.constant.value.str.len+1);
- STR_FREE(name->u.constant.value.str.val);
- result->u.constant.value.str.len = length;
+ length = sizeof("\\")-1 + Z_STRLEN(result->u.constant) + Z_STRLEN(name->u.constant);
+ Z_STRVAL(result->u.constant) = str_erealloc(Z_STRVAL(result->u.constant), length+1);
+ memcpy(&Z_STRVAL(result->u.constant)[Z_STRLEN(result->u.constant)], "\\", sizeof("\\")-1);
+ memcpy(&Z_STRVAL(result->u.constant)[Z_STRLEN(result->u.constant) + sizeof("\\")-1], Z_STRVAL(name->u.constant), Z_STRLEN(name->u.constant)+1);
+ str_efree(Z_STRVAL(name->u.constant));
+ Z_STRLEN(result->u.constant) = length;
}
}
/* }}} */
@@ -2445,13 +2510,12 @@ void zend_do_build_full_name(znode *result, znode *prefix, znode *name, int is_c
int zend_do_begin_class_member_function_call(znode *class_name, znode *method_name TSRMLS_DC) /* {{{ */
{
znode class_node;
- unsigned char *ptr = NULL;
zend_op *opline;
if (method_name->op_type == IS_CONST) {
char *lcname;
if (Z_TYPE(method_name->u.constant) != IS_STRING) {
- zend_error(E_COMPILE_ERROR, "Method name must be a string");
+ zend_error_noreturn(E_COMPILE_ERROR, "Method name must be a string");
}
lcname = zend_str_tolower_dup(Z_STRVAL(method_name->u.constant), Z_STRLEN(method_name->u.constant));
if ((sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == Z_STRLEN(method_name->u.constant) &&
@@ -2464,7 +2528,7 @@ int zend_do_begin_class_member_function_call(znode *class_name, znode *method_na
if (class_name->op_type == IS_CONST &&
ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant))) {
- zend_resolve_class_name(class_name, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC);
+ zend_resolve_class_name(class_name TSRMLS_CC);
class_node = *class_name;
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
} else {
@@ -2494,7 +2558,7 @@ int zend_do_begin_class_member_function_call(znode *class_name, znode *method_na
SET_NODE(opline->op2, method_name);
}
- zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
+ zend_push_function_call_entry(NULL TSRMLS_CC);
if (++CG(context).nested_calls > CG(active_op_array)->nested_calls) {
CG(active_op_array)->nested_calls = CG(context).nested_calls;
}
@@ -2503,19 +2567,21 @@ int zend_do_begin_class_member_function_call(znode *class_name, znode *method_na
}
/* }}} */
-void zend_do_end_function_call(znode *function_name, znode *result, const znode *argument_list, int is_method, int is_dynamic_fcall TSRMLS_DC) /* {{{ */
+void zend_do_end_function_call(znode *function_name, znode *result, int is_method, int is_dynamic_fcall TSRMLS_DC) /* {{{ */
{
zend_op *opline;
+ zend_function_call_entry *fcall;
+ zend_stack_top(&CG(function_call_stack), (void **) &fcall);
if (is_method && function_name && function_name->op_type == IS_UNUSED) {
/* clone */
- if (Z_LVAL(argument_list->u.constant) != 0) {
+ if (fcall->arg_num != 0) {
zend_error(E_WARNING, "Clone method does not require arguments");
}
opline = &CG(active_op_array)->opcodes[Z_LVAL(function_name->u.constant)];
} else {
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
- if (!is_method && !is_dynamic_fcall && function_name->op_type==IS_CONST) {
+ if (fcall->fbc) {
opline->opcode = ZEND_DO_FCALL;
SET_NODE(opline->op1, function_name);
SET_UNUSED(opline->op2);
@@ -2527,67 +2593,77 @@ void zend_do_end_function_call(znode *function_name, znode *result, const znode
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
opline->op2.num = --CG(context).nested_calls;
+
+ /* This would normally be a ZEND_DO_FCALL, but was forced to use
+ * ZEND_DO_FCALL_BY_NAME due to a ... argument. In this case we need to
+ * free the function_name */
+ if (!is_method && !is_dynamic_fcall && function_name->op_type==IS_CONST) {
+ zval_dtor(&function_name->u.constant);
+ }
}
}
opline->result.var = get_temporary_variable(CG(active_op_array));
opline->result_type = IS_VAR;
GET_NODE(result, opline->result);
-
- zend_stack_del_top(&CG(function_call_stack));
- opline->extended_value = Z_LVAL(argument_list->u.constant);
+ opline->extended_value = fcall->arg_num;
if (CG(context).used_stack + 1 > CG(active_op_array)->used_stack) {
CG(active_op_array)->used_stack = CG(context).used_stack + 1;
}
- CG(context).used_stack -= Z_LVAL(argument_list->u.constant);
+ CG(context).used_stack -= fcall->arg_num;
+ zend_stack_del_top(&CG(function_call_stack));
}
/* }}} */
-void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{{ */
+void zend_do_pass_param(znode *param, zend_uchar op TSRMLS_DC) /* {{{ */
{
zend_op *opline;
- int original_op=op;
- zend_function **function_ptr_ptr, *function_ptr;
- int send_by_reference;
+ int original_op = op;
+ zend_function_call_entry *fcall;
+ zend_function *function_ptr;
+ int send_by_reference = 0;
int send_function = 0;
- zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
- function_ptr = *function_ptr_ptr;
+ zend_stack_top(&CG(function_call_stack), (void **) &fcall);
+ function_ptr = fcall->fbc;
+ fcall->arg_num++;
+
+ if (fcall->uses_argument_unpacking) {
+ zend_error_noreturn(E_COMPILE_ERROR,
+ "Cannot use positional argument after argument unpacking");
+ }
if (original_op == ZEND_SEND_REF) {
if (function_ptr &&
function_ptr->common.function_name &&
function_ptr->common.type == ZEND_USER_FUNCTION &&
- !ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) {
- zend_error(E_COMPILE_ERROR,
+ !ARG_SHOULD_BE_SENT_BY_REF(function_ptr, fcall->arg_num)) {
+ zend_error_noreturn(E_COMPILE_ERROR,
"Call-time pass-by-reference has been removed; "
"If you would like to pass argument by reference, modify the declaration of %s().",
function_ptr->common.function_name);
} else {
- zend_error(E_COMPILE_ERROR, "Call-time pass-by-reference has been removed");
+ zend_error_noreturn(E_COMPILE_ERROR, "Call-time pass-by-reference has been removed");
}
return;
}
if (function_ptr) {
- if (ARG_MAY_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) {
- if (param->op_type & (IS_VAR|IS_CV) && original_op != ZEND_SEND_VAL) {
- send_by_reference = 1;
- if (op == ZEND_SEND_VAR && zend_is_function_or_method_call(param)) {
+ if (ARG_MAY_BE_SENT_BY_REF(function_ptr, fcall->arg_num)) {
+ if (op == ZEND_SEND_VAR && param->op_type & (IS_VAR|IS_CV)) {
+ send_by_reference = ZEND_ARG_SEND_BY_REF;
+ if (zend_is_function_or_method_call(param)) {
/* Method call */
op = ZEND_SEND_VAR_NO_REF;
send_function = ZEND_ARG_SEND_FUNCTION | ZEND_ARG_SEND_SILENT;
}
} else {
op = ZEND_SEND_VAL;
- send_by_reference = 0;
}
- } else {
- send_by_reference = ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset) ? ZEND_ARG_SEND_BY_REF : 0;
+ } else if (ARG_SHOULD_BE_SENT_BY_REF(function_ptr, fcall->arg_num)) {
+ send_by_reference = ZEND_ARG_SEND_BY_REF;
}
- } else {
- send_by_reference = 0;
}
if (op == ZEND_SEND_VAR && zend_is_function_or_method_call(param)) {
@@ -2606,7 +2682,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{
op = ZEND_SEND_REF;
break;
default:
- zend_error(E_COMPILE_ERROR, "Only variables can be passed by reference");
+ zend_error_noreturn(E_COMPILE_ERROR, "Only variables can be passed by reference");
break;
}
}
@@ -2620,7 +2696,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{
if (function_ptr) {
zend_do_end_variable_parse(param, BP_VAR_R, 0 TSRMLS_CC);
} else {
- zend_do_end_variable_parse(param, BP_VAR_FUNC_ARG, offset TSRMLS_CC);
+ zend_do_end_variable_parse(param, BP_VAR_FUNC_ARG, fcall->arg_num TSRMLS_CC);
}
break;
case ZEND_SEND_REF:
@@ -2646,7 +2722,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{
}
opline->opcode = op;
SET_NODE(opline->op1, param);
- opline->op2.opline_num = offset;
+ opline->op2.opline_num = fcall->arg_num;
SET_UNUSED(opline->op2);
if (++CG(context).used_stack > CG(active_op_array)->used_stack) {
@@ -2655,6 +2731,41 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{
}
/* }}} */
+void zend_do_unpack_params(znode *params TSRMLS_DC) /* {{{ */
+{
+ zend_op *opline;
+ zend_function_call_entry *fcall;
+
+ zend_stack_top(&CG(function_call_stack), (void **) &fcall);
+ fcall->uses_argument_unpacking = 1;
+
+ if (fcall->fbc) {
+ /* If argument unpacking is used argument numbers and sending modes can no longer be
+ * computed at compile time, thus we need access to EX(call). In order to have it we
+ * retroactively emit a ZEND_INIT_FCALL_BY_NAME opcode. */
+ zval func_name;
+ ZVAL_STRING(&func_name, fcall->fbc->common.function_name, 1);
+
+ opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ opline->opcode = ZEND_INIT_FCALL_BY_NAME;
+ opline->result.num = CG(context).nested_calls;
+ SET_UNUSED(opline->op1);
+ opline->op2_type = IS_CONST;
+ opline->op2.constant = zend_add_func_name_literal(CG(active_op_array), &func_name TSRMLS_CC);
+ GET_CACHE_SLOT(opline->op2.constant);
+
+ ++CG(context).nested_calls;
+ fcall->fbc = NULL;
+ }
+
+ opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ opline->opcode = ZEND_SEND_UNPACK;
+ SET_NODE(opline->op1, params);
+ SET_UNUSED(opline->op2);
+ opline->op2.num = fcall->arg_num;
+}
+/* }}} */
+
static int generate_free_switch_expr(const zend_switch_entry *switch_entry TSRMLS_DC) /* {{{ */
{
zend_op *opline;
@@ -2738,7 +2849,9 @@ void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC) /* {{{ */
if (expr) {
SET_NODE(opline->op1, expr);
- if (do_end_vparse && zend_is_function_or_method_call(expr)) {
+ if (!do_end_vparse) {
+ opline->extended_value = ZEND_RETURNS_VALUE;
+ } else if (zend_is_function_or_method_call(expr)) {
opline->extended_value = ZEND_RETURNS_FUNCTION;
}
} else {
@@ -2755,7 +2868,7 @@ void zend_do_yield(znode *result, znode *value, const znode *key, zend_bool is_v
zend_op *opline;
if (!CG(active_op_array)->function_name) {
- zend_error(E_COMPILE_ERROR, "The \"yield\" expression can only be used inside a function");
+ zend_error_noreturn(E_COMPILE_ERROR, "The \"yield\" expression can only be used inside a function");
}
CG(active_op_array)->fn_flags |= ZEND_ACC_GENERATOR;
@@ -2892,10 +3005,10 @@ void zend_do_begin_catch(znode *catch_token, znode *class_name, znode *catch_var
if (class_name->op_type == IS_CONST &&
ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant))) {
- zend_resolve_class_name(class_name, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC);
+ zend_resolve_class_name(class_name TSRMLS_CC);
catch_class = *class_name;
} else {
- zend_error(E_COMPILE_ERROR, "Bad class name in the catch statement");
+ zend_error_noreturn(E_COMPILE_ERROR, "Bad class name in the catch statement");
}
catch_op_number = get_next_op_number(CG(active_op_array));
@@ -2908,7 +3021,7 @@ void zend_do_begin_catch(znode *catch_token, znode *class_name, znode *catch_var
opline->op1_type = IS_CONST;
opline->op1.constant = zend_add_class_name_literal(CG(active_op_array), &catch_class.u.constant TSRMLS_CC);
opline->op2_type = IS_CV;
- opline->op2.var = lookup_cv(CG(active_op_array), catch_var->u.constant.value.str.val, catch_var->u.constant.value.str.len, 0 TSRMLS_CC);
+ opline->op2.var = lookup_cv(CG(active_op_array), Z_STRVAL(catch_var->u.constant), Z_STRLEN(catch_var->u.constant), 0 TSRMLS_CC);
Z_STRVAL(catch_var->u.constant) = (char*)CG(active_op_array)->vars[opline->op2.var].name;
opline->result.num = 0; /* 1 means it's the last catch in the block */
@@ -2944,7 +3057,7 @@ void zend_do_bind_catch(znode *try_token, znode *catch_token TSRMLS_DC) /* {{{ *
void zend_do_end_finally(znode *try_token, znode* catch_token, znode *finally_token TSRMLS_DC) /* {{{ */
{
if (catch_token->op_type == IS_UNUSED && finally_token->op_type == IS_UNUSED) {
- zend_error(E_COMPILE_ERROR, "Cannot use try without catch or finally");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use try without catch or finally");
}
if (finally_token->op_type != IS_UNUSED) {
zend_op *opline;
@@ -3046,6 +3159,9 @@ static void do_inherit_parent_constructor(zend_class_entry *ce) /* {{{ */
if (!ce->destructor) {
ce->destructor = ce->parent->destructor;
}
+ if (!ce->__debugInfo) {
+ ce->__debugInfo = ce->parent->__debugInfo;
+ }
if (ce->constructor) {
if (ce->parent->constructor && ce->parent->constructor->common.fn_flags & ZEND_ACC_FINAL) {
zend_error(E_ERROR, "Cannot override final %s::%s() with %s::%s()",
@@ -3111,7 +3227,7 @@ static void do_inherit_method(zend_function *function) /* {{{ */
static zend_bool zend_do_perform_implementation_check(const zend_function *fe, const zend_function *proto TSRMLS_DC) /* {{{ */
{
- zend_uint i;
+ zend_uint i, num_args;
/* If it's a user function then arg_info == NULL means we don't have any parameters but
* we still need to do the arg number checks. We are only willing to ignore this for internal
@@ -3141,48 +3257,66 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
return 0;
}
- if (fe->common.type != ZEND_USER_FUNCTION
- && (proto->common.fn_flags & ZEND_ACC_PASS_REST_BY_REFERENCE) != 0
- && (fe->common.fn_flags & ZEND_ACC_PASS_REST_BY_REFERENCE) == 0) {
- return 0;
- }
-
/* by-ref constraints on return values are covariant */
if ((proto->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)
&& !(fe->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)) {
return 0;
}
- for (i=0; i < proto->common.num_args; i++) {
- if (ZEND_LOG_XOR(fe->common.arg_info[i].class_name, proto->common.arg_info[i].class_name)) {
+ if ((proto->common.fn_flags & ZEND_ACC_VARIADIC)
+ && !(fe->common.fn_flags & ZEND_ACC_VARIADIC)) {
+ return 0;
+ }
+
+ /* For variadic functions any additional (optional) arguments that were added must be
+ * checked against the signature of the variadic argument, so in this case we have to
+ * go through all the parameters of the function and not just those present in the
+ * prototype. */
+ num_args = proto->common.num_args;
+ if ((proto->common.fn_flags & ZEND_ACC_VARIADIC)
+ && fe->common.num_args > proto->common.num_args) {
+ num_args = fe->common.num_args;
+ }
+
+ for (i = 0; i < num_args; i++) {
+ zend_arg_info *fe_arg_info = &fe->common.arg_info[i];
+
+ zend_arg_info *proto_arg_info;
+ if (i < proto->common.num_args) {
+ proto_arg_info = &proto->common.arg_info[i];
+ } else {
+ proto_arg_info = &proto->common.arg_info[proto->common.num_args-1];
+ }
+
+ if (ZEND_LOG_XOR(fe_arg_info->class_name, proto_arg_info->class_name)) {
/* Only one has a type hint and the other one doesn't */
return 0;
}
- if (fe->common.arg_info[i].class_name) {
+ if (fe_arg_info->class_name) {
const char *fe_class_name, *proto_class_name;
zend_uint fe_class_name_len, proto_class_name_len;
- if (!strcasecmp(fe->common.arg_info[i].class_name, "parent") && proto->common.scope) {
+ if (!strcasecmp(fe_arg_info->class_name, "parent") && proto->common.scope) {
fe_class_name = proto->common.scope->name;
fe_class_name_len = proto->common.scope->name_length;
- } else if (!strcasecmp(fe->common.arg_info[i].class_name, "self") && fe->common.scope) {
+ } else if (!strcasecmp(fe_arg_info->class_name, "self") && fe->common.scope) {
fe_class_name = fe->common.scope->name;
fe_class_name_len = fe->common.scope->name_length;
} else {
- fe_class_name = fe->common.arg_info[i].class_name;
- fe_class_name_len = fe->common.arg_info[i].class_name_len;
+ fe_class_name = fe_arg_info->class_name;
+ fe_class_name_len = fe_arg_info->class_name_len;
}
- if (!strcasecmp(proto->common.arg_info[i].class_name, "parent") && proto->common.scope && proto->common.scope->parent) {
+ if (!strcasecmp(proto_arg_info->class_name, "parent") && proto->common.scope && proto->common.scope->parent) {
proto_class_name = proto->common.scope->parent->name;
proto_class_name_len = proto->common.scope->parent->name_length;
- } else if (!strcasecmp(proto->common.arg_info[i].class_name, "self") && proto->common.scope) {
+ } else if (!strcasecmp(proto_arg_info->class_name, "self") && proto->common.scope) {
proto_class_name = proto->common.scope->name;
proto_class_name_len = proto->common.scope->name_length;
} else {
- proto_class_name = proto->common.arg_info[i].class_name;
- proto_class_name_len = proto->common.arg_info[i].class_name_len;
+ proto_class_name = proto_arg_info->class_name;
+ proto_class_name_len = proto_arg_info->class_name_len;
}
if (strcasecmp(fe_class_name, proto_class_name)!=0) {
@@ -3209,24 +3343,17 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
}
}
}
- if (fe->common.arg_info[i].type_hint != proto->common.arg_info[i].type_hint) {
+ if (fe_arg_info->type_hint != proto_arg_info->type_hint) {
/* Incompatible type hint */
return 0;
}
/* by-ref constraints on arguments are invariant */
- if (fe->common.arg_info[i].pass_by_reference != proto->common.arg_info[i].pass_by_reference) {
+ if (fe_arg_info->pass_by_reference != proto_arg_info->pass_by_reference) {
return 0;
}
}
- if (proto->common.fn_flags & ZEND_ACC_PASS_REST_BY_REFERENCE) {
- for (i=proto->common.num_args; i < fe->common.num_args; i++) {
- if (!fe->common.arg_info[i].pass_by_reference) {
- return 0;
- }
- }
- }
return 1;
}
/* }}} */
@@ -3299,6 +3426,13 @@ static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{
if (arg_info->pass_by_reference) {
*(offset++) = '&';
}
+
+ if (arg_info->is_variadic) {
+ *(offset++) = '.';
+ *(offset++) = '.';
+ *(offset++) = '.';
+ }
+
*(offset++) = '$';
if (arg_info->name) {
@@ -3314,7 +3448,7 @@ static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{
idx /= 10;
} while (idx > 0);
}
- if (i >= required) {
+ if (i >= required && !arg_info->is_variadic) {
*(offset++) = ' ';
*(offset++) = '=';
*(offset++) = ' ';
@@ -3368,9 +3502,12 @@ static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{
*(offset++) = '.';
}
*(offset++) = '\'';
- } else if (Z_TYPE_P(zv) == IS_ARRAY || (Z_TYPE_P(zv) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT_ARRAY) {
+ } else if (Z_TYPE_P(zv) == IS_ARRAY) {
memcpy(offset, "Array", 5);
offset += 5;
+ } else if ((Z_TYPE_P(zv) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT_AST) {
+ memcpy(offset, "<expression>", 12);
+ offset += 12;
} else {
zend_make_printable_zval(zv, &zv_copy, &use_copy);
REALLOC_BUF_IF_EXCEED(buf, offset, length, Z_STRLEN(zv_copy));
@@ -3412,14 +3549,14 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
&& parent->common.fn_flags & ZEND_ACC_ABSTRACT
&& parent->common.scope != (child->common.prototype ? child->common.prototype->common.scope : child->common.scope)
&& child->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_IMPLEMENTED_ABSTRACT)) {
- zend_error(E_COMPILE_ERROR, "Can't inherit abstract function %s::%s() (previously declared abstract in %s)",
+ zend_error_noreturn(E_COMPILE_ERROR, "Can't inherit abstract function %s::%s() (previously declared abstract in %s)",
parent->common.scope->name,
child->common.function_name,
child->common.prototype ? child->common.prototype->common.scope->name : child->common.scope->name);
}
if (parent_flags & ZEND_ACC_FINAL) {
- zend_error(E_COMPILE_ERROR, "Cannot override final method %s::%s()", ZEND_FN_SCOPE_NAME(parent), child->common.function_name);
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot override final method %s::%s()", ZEND_FN_SCOPE_NAME(parent), child->common.function_name);
}
child_flags = child->common.fn_flags;
@@ -3427,15 +3564,15 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
*/
if ((child_flags & ZEND_ACC_STATIC) != (parent_flags & ZEND_ACC_STATIC)) {
if (child->common.fn_flags & ZEND_ACC_STATIC) {
- zend_error(E_COMPILE_ERROR, "Cannot make non static method %s::%s() static in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name, ZEND_FN_SCOPE_NAME(child));
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot make non static method %s::%s() static in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name, ZEND_FN_SCOPE_NAME(child));
} else {
- zend_error(E_COMPILE_ERROR, "Cannot make static method %s::%s() non static in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name, ZEND_FN_SCOPE_NAME(child));
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot make static method %s::%s() non static in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name, ZEND_FN_SCOPE_NAME(child));
}
}
/* Disallow making an inherited method abstract. */
if ((child_flags & ZEND_ACC_ABSTRACT) && !(parent_flags & ZEND_ACC_ABSTRACT)) {
- zend_error(E_COMPILE_ERROR, "Cannot make non abstract method %s::%s() abstract in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name, ZEND_FN_SCOPE_NAME(child));
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot make non abstract method %s::%s() abstract in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name, ZEND_FN_SCOPE_NAME(child));
}
if (parent_flags & ZEND_ACC_CHANGED) {
@@ -3444,7 +3581,7 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
/* Prevent derived classes from restricting access that was available in parent classes
*/
if ((child_flags & ZEND_ACC_PPP_MASK) > (parent_flags & ZEND_ACC_PPP_MASK)) {
- zend_error(E_COMPILE_ERROR, "Access level to %s::%s() must be %s (as in class %s)%s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_visibility_string(parent_flags), ZEND_FN_SCOPE_NAME(parent), (parent_flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
+ zend_error_noreturn(E_COMPILE_ERROR, "Access level to %s::%s() must be %s (as in class %s)%s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_visibility_string(parent_flags), ZEND_FN_SCOPE_NAME(parent), (parent_flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
} else if (((child_flags & ZEND_ACC_PPP_MASK) < (parent_flags & ZEND_ACC_PPP_MASK))
&& ((parent_flags & ZEND_ACC_PPP_MASK) & ZEND_ACC_PRIVATE)) {
child->common.fn_flags |= ZEND_ACC_CHANGED;
@@ -3463,7 +3600,7 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) {
- zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype TSRMLS_CC));
+ zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype TSRMLS_CC));
}
} else if (EG(error_reporting) & E_STRICT || EG(user_error_handler)) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */
if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) {
@@ -3517,7 +3654,7 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
if (zend_hash_quick_find(&ce->properties_info, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void **) &child_info)==SUCCESS) {
if ((parent_info->flags & ZEND_ACC_STATIC) != (child_info->flags & ZEND_ACC_STATIC)) {
- zend_error(E_COMPILE_ERROR, "Cannot redeclare %s%s::$%s as %s%s::$%s",
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare %s%s::$%s as %s%s::$%s",
(parent_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", parent_ce->name, hash_key->arKey,
(child_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", ce->name, hash_key->arKey);
@@ -3528,7 +3665,7 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
}
if ((child_info->flags & ZEND_ACC_PPP_MASK) > (parent_info->flags & ZEND_ACC_PPP_MASK)) {
- zend_error(E_COMPILE_ERROR, "Access level to %s::$%s must be %s (as in class %s)%s", ce->name, hash_key->arKey, zend_visibility_string(parent_info->flags), parent_ce->name, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
+ zend_error_noreturn(E_COMPILE_ERROR, "Access level to %s::$%s must be %s (as in class %s)%s", ce->name, hash_key->arKey, zend_visibility_string(parent_info->flags), parent_ce->name, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
} else if ((child_info->flags & ZEND_ACC_STATIC) == 0) {
zval_ptr_dtor(&(ce->default_properties_table[parent_info->offset]));
ce->default_properties_table[parent_info->offset] = ce->default_properties_table[child_info->offset];
@@ -3613,10 +3750,10 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
if ((ce->ce_flags & ZEND_ACC_INTERFACE)
&& !(parent_ce->ce_flags & ZEND_ACC_INTERFACE)) {
- zend_error(E_COMPILE_ERROR, "Interface %s may not inherit from class (%s)", ce->name, parent_ce->name);
+ zend_error_noreturn(E_COMPILE_ERROR, "Interface %s may not inherit from class (%s)", ce->name, parent_ce->name);
}
if (parent_ce->ce_flags & ZEND_ACC_FINAL_CLASS) {
- zend_error(E_COMPILE_ERROR, "Class %s may not inherit from final class (%s)", ce->name, parent_ce->name);
+ zend_error_noreturn(E_COMPILE_ERROR, "Class %s may not inherit from final class (%s)", ce->name, parent_ce->name);
}
ce->parent = parent_ce;
@@ -3738,7 +3875,7 @@ static zend_bool do_inherit_constant_check(HashTable *child_constants_table, con
if (zend_hash_quick_find(child_constants_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void**)&old_constant) == SUCCESS) {
if (*old_constant != *parent_constant) {
- zend_error(E_COMPILE_ERROR, "Cannot inherit previously-inherited or override constant %s from interface %s", hash_key->arKey, iface->name);
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot inherit previously-inherited or override constant %s from interface %s", hash_key->arKey, iface->name);
}
return 0;
}
@@ -3770,7 +3907,7 @@ ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry
if (i < parent_iface_num) {
ignore = 1;
} else {
- zend_error(E_COMPILE_ERROR, "Class %s cannot implement previously implemented interface %s", ce->name, iface->name);
+ zend_error_noreturn(E_COMPILE_ERROR, "Class %s cannot implement previously implemented interface %s", ce->name, iface->name);
}
}
}
@@ -3843,7 +3980,7 @@ static void zend_add_magic_methods(zend_class_entry* ce, const char* mname, uint
ce->clone = fe; fe->common.fn_flags |= ZEND_ACC_CLONE;
} else if (!strncmp(mname, ZEND_CONSTRUCTOR_FUNC_NAME, mname_len)) {
if (ce->constructor && (!ce->parent || ce->constructor != ce->parent->constructor)) {
- zend_error(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name);
+ zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name);
}
ce->constructor = fe; fe->common.fn_flags |= ZEND_ACC_CTOR;
} else if (!strncmp(mname, ZEND_DESTRUCTOR_FUNC_NAME, mname_len)) {
@@ -3862,13 +3999,15 @@ static void zend_add_magic_methods(zend_class_entry* ce, const char* mname, uint
ce->__callstatic = fe;
} else if (!strncmp(mname, ZEND_TOSTRING_FUNC_NAME, mname_len)) {
ce->__tostring = fe;
+ } else if (!strncmp(mname, ZEND_DEBUGINFO_FUNC_NAME, mname_len)) {
+ ce->__debugInfo = fe;
} else if (ce->name_length + 1 == mname_len) {
char *lowercase_name = emalloc(ce->name_length + 1);
zend_str_tolower_copy(lowercase_name, ce->name, ce->name_length);
lowercase_name = (char*)zend_new_interned_string(lowercase_name, ce->name_length + 1, 1 TSRMLS_CC);
if (!memcmp(mname, lowercase_name, mname_len)) {
if (ce->constructor && (!ce->parent || ce->constructor != ce->parent->constructor)) {
- zend_error(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name);
+ zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name);
}
ce->constructor = fe;
fe->common.fn_flags |= ZEND_ACC_CTOR;
@@ -3892,14 +4031,14 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, const
if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
/* Make sure the trait method is compatible with previosly declared abstract method */
if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) {
- zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
+ zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
zend_get_function_declaration(fn TSRMLS_CC),
zend_get_function_declaration(existing_fn TSRMLS_CC));
}
} else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
/* Make sure the abstract declaration is compatible with previous declaration */
if (!zend_traits_method_compatibility_check(existing_fn, fn TSRMLS_CC)) {
- zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
+ zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
zend_get_function_declaration(fn TSRMLS_CC),
zend_get_function_declaration(existing_fn TSRMLS_CC));
}
@@ -3916,25 +4055,25 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, const
(existing_fn->common.scope->ce_flags & ZEND_ACC_INTERFACE) == 0) {
/* Make sure the trait method is compatible with previosly declared abstract method */
if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) {
- zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
+ zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
zend_get_function_declaration(fn TSRMLS_CC),
zend_get_function_declaration(existing_fn TSRMLS_CC));
}
} else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
/* Make sure the abstract declaration is compatible with previous declaration */
if (!zend_traits_method_compatibility_check(existing_fn, fn TSRMLS_CC)) {
- zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
+ zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
zend_get_function_declaration(fn TSRMLS_CC),
zend_get_function_declaration(existing_fn TSRMLS_CC));
}
return;
} else if ((existing_fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
- /* two trais can't define the same non-abstract method */
+ /* two traits can't define the same non-abstract method */
#if 1
- zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because there are collisions with other trait methods on %s",
+ zend_error_noreturn(E_COMPILE_ERROR, "Trait method %s has not been applied, because there are collisions with other trait methods on %s",
name, ce->name);
-#else /* TODO: better errot message */
- zend_error(E_COMPILE_ERROR, "Trait method %s::%s has not been applied as %s::%s, because of collision with %s::%s",
+#else /* TODO: better error message */
+ zend_error_noreturn(E_COMPILE_ERROR, "Trait method %s::%s has not been applied as %s::%s, because of collision with %s::%s",
fn->common.scope->name, fn->common.function_name,
ce->name, name,
existing_fn->common.scope->name, existing_fn->common.function_name);
@@ -4018,7 +4157,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
}
}
- lcname = hash_key->arKey;
+ lcname = (char *) hash_key->arKey;
if (exclude_table == NULL || zend_hash_find(exclude_table, lcname, fnname_len, &dummy) == FAILURE) {
/* is not in hashtable, thus, function is not to be excluded */
@@ -4059,7 +4198,7 @@ static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait
zend_uint i;
if ((trait->ce_flags & ZEND_ACC_TRAIT) != ZEND_ACC_TRAIT) {
- zend_error(E_COMPILE_ERROR, "Class %s is not a trait, Only traits may be used in 'as' and 'insteadof' statements", trait->name);
+ zend_error_noreturn(E_COMPILE_ERROR, "Class %s is not a trait, Only traits may be used in 'as' and 'insteadof' statements", trait->name);
}
for (i = 0; i < ce->num_traits; i++) {
@@ -4067,7 +4206,7 @@ static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait
return;
}
}
- zend_error(E_COMPILE_ERROR, "Required Trait %s wasn't added to %s", trait->name, ce->name);
+ zend_error_noreturn(E_COMPILE_ERROR, "Required Trait %s wasn't added to %s", trait->name, ce->name);
}
/* }}} */
@@ -4091,7 +4230,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
cur_method_ref = cur_precedence->trait_method;
if (!(cur_precedence->trait_method->ce = zend_fetch_class(cur_method_ref->class_name, cur_method_ref->cname_len,
ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) {
- zend_error(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name);
+ zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name);
}
zend_check_trait_usage(ce, cur_precedence->trait_method->ce TSRMLS_CC);
@@ -4103,7 +4242,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
cur_method_ref->mname_len + 1);
efree(lcname);
if (!method_exists) {
- zend_error(E_COMPILE_ERROR,
+ zend_error_noreturn(E_COMPILE_ERROR,
"A precedence rule was defined for %s::%s but this method does not exist",
cur_method_ref->ce->name,
cur_method_ref->method_name);
@@ -4121,7 +4260,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
zend_uint name_length = strlen(class_name);
if (!(cur_precedence->exclude_from_classes[j] = zend_fetch_class(class_name, name_length, ZEND_FETCH_CLASS_TRAIT |ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) {
- zend_error(E_COMPILE_ERROR, "Could not find trait %s", class_name);
+ zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", class_name);
}
zend_check_trait_usage(ce, cur_precedence->exclude_from_classes[j] TSRMLS_CC);
@@ -4152,7 +4291,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
if (ce->trait_aliases[i]->trait_method->class_name) {
cur_method_ref = ce->trait_aliases[i]->trait_method;
if (!(cur_method_ref->ce = zend_fetch_class(cur_method_ref->class_name, cur_method_ref->cname_len, ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) {
- zend_error(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name);
+ zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name);
}
zend_check_trait_usage(ce, cur_method_ref->ce TSRMLS_CC);
@@ -4164,7 +4303,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
efree(lcname);
if (!method_exists) {
- zend_error(E_COMPILE_ERROR, "An alias was defined for %s::%s but this method does not exist", cur_method_ref->ce->name, cur_method_ref->method_name);
+ zend_error_noreturn(E_COMPILE_ERROR, "An alias was defined for %s::%s but this method does not exist", cur_method_ref->ce->name, cur_method_ref->method_name);
}
}
i++;
@@ -4190,7 +4329,7 @@ static void zend_traits_compile_exclude_table(HashTable* exclude_table, zend_tra
if (zend_hash_add(exclude_table, lcname, lcname_len, NULL, 0, NULL) == FAILURE) {
efree(lcname);
- zend_error(E_COMPILE_ERROR, "Failed to evaluate a trait precedence (%s). Method of trait %s was defined to be excluded multiple times", precedences[i]->trait_method->method_name, trait->name);
+ zend_error_noreturn(E_COMPILE_ERROR, "Failed to evaluate a trait precedence (%s). Method of trait %s was defined to be excluded multiple times", precedences[i]->trait_method->method_name, trait->name);
}
efree(lcname);
}
@@ -4330,7 +4469,7 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {
}
if (not_compatible) {
- zend_error(E_COMPILE_ERROR,
+ zend_error_noreturn(E_COMPILE_ERROR,
"%s and %s define the same property ($%s) in the composition of %s. However, the definition differs and is considered incompatible. Class was composed",
find_first_definition(ce, i, prop_name, prop_name_length, prop_hash, coliding_prop->ce)->name,
property_info->ce->name,
@@ -4379,7 +4518,7 @@ static void zend_do_check_for_inconsistent_traits_aliasing(zend_class_entry *ce
if (!cur_alias->trait_method->ce) {
if (cur_alias->alias) {
/** Plain old inconsistency/typo/bug */
- zend_error(E_COMPILE_ERROR,
+ zend_error_noreturn(E_COMPILE_ERROR,
"An alias (%s) was defined for method %s(), but this method does not exist",
cur_alias->alias,
cur_alias->trait_method->method_name);
@@ -4398,12 +4537,12 @@ static void zend_do_check_for_inconsistent_traits_aliasing(zend_class_entry *ce
lc_method_name,
cur_alias->trait_method->mname_len+1)) {
efree(lc_method_name);
- zend_error(E_COMPILE_ERROR,
+ zend_error_noreturn(E_COMPILE_ERROR,
"The modifiers for the trait alias %s() need to be changed in the same statment in which the alias is defined. Error",
cur_alias->trait_method->method_name);
} else {
efree(lc_method_name);
- zend_error(E_COMPILE_ERROR,
+ zend_error_noreturn(E_COMPILE_ERROR,
"The modifiers of the trait method %s() are changed, but this method does not exist. Error",
cur_alias->trait_method->method_name);
@@ -4490,7 +4629,7 @@ void zend_prepare_reference(znode *result, znode *class_name, znode *method_name
/* REM: There should not be a need for copying,
zend_do_begin_class_declaration is also just using that string */
if (class_name) {
- zend_resolve_class_name(class_name, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC);
+ zend_resolve_class_name(class_name TSRMLS_CC);
method_ref->class_name = Z_STRVAL(class_name->u.constant);
method_ref->cname_len = Z_STRLEN(class_name->u.constant);
} else {
@@ -4512,13 +4651,13 @@ void zend_add_trait_alias(znode *method_reference, znode *modifiers, znode *alia
zend_trait_alias *trait_alias;
if (Z_LVAL(modifiers->u.constant) == ZEND_ACC_STATIC) {
- zend_error(E_COMPILE_ERROR, "Cannot use 'static' as method modifier");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use 'static' as method modifier");
return;
} else if (Z_LVAL(modifiers->u.constant) == ZEND_ACC_ABSTRACT) {
- zend_error(E_COMPILE_ERROR, "Cannot use 'abstract' as method modifier");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use 'abstract' as method modifier");
return;
} else if (Z_LVAL(modifiers->u.constant) == ZEND_ACC_FINAL) {
- zend_error(E_COMPILE_ERROR, "Cannot use 'final' as method modifier");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use 'final' as method modifier");
return;
}
@@ -4560,7 +4699,7 @@ ZEND_API zend_class_entry *do_bind_class(const zend_op_array* op_array, const ze
op2 = opline->op2.zv;
}
if (zend_hash_quick_find(class_table, Z_STRVAL_P(op1), Z_STRLEN_P(op1), Z_HASH_P(op1), (void **) &pce)==FAILURE) {
- zend_error(E_COMPILE_ERROR, "Internal Zend error - Missing class information for %s", Z_STRVAL_P(op1));
+ zend_error_noreturn(E_COMPILE_ERROR, "Internal Zend error - Missing class information for %s", Z_STRVAL_P(op1));
return NULL;
} else {
ce = *pce;
@@ -4574,7 +4713,7 @@ ZEND_API zend_class_entry *do_bind_class(const zend_op_array* op_array, const ze
* so we shut up about it. This allows the if (!defined('FOO')) { return; }
* approach to work.
*/
- zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name);
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name);
}
return NULL;
} else {
@@ -4609,7 +4748,7 @@ ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array
* so we shut up about it. This allows the if (!defined('FOO')) { return; }
* approach to work.
*/
- zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", Z_STRVAL_P(op2));
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare class %s", Z_STRVAL_P(op2));
}
return NULL;
} else {
@@ -4617,9 +4756,9 @@ ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array
}
if (parent_ce->ce_flags & ZEND_ACC_INTERFACE) {
- zend_error(E_COMPILE_ERROR, "Class %s cannot extend from interface %s", ce->name, parent_ce->name);
+ zend_error_noreturn(E_COMPILE_ERROR, "Class %s cannot extend from interface %s", ce->name, parent_ce->name);
} else if ((parent_ce->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
- zend_error(E_COMPILE_ERROR, "Class %s cannot extend from trait %s", ce->name, parent_ce->name);
+ zend_error_noreturn(E_COMPILE_ERROR, "Class %s cannot extend from trait %s", ce->name, parent_ce->name);
}
zend_do_inheritance(ce, parent_ce TSRMLS_CC);
@@ -4628,7 +4767,7 @@ ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array
/* Register the derived class */
if (zend_hash_quick_add(class_table, Z_STRVAL_P(op2), Z_STRLEN_P(op2)+1, Z_HASH_P(op2), pce, sizeof(zend_class_entry *), NULL)==FAILURE) {
- zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name);
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name);
}
return ce;
}
@@ -4697,7 +4836,7 @@ void zend_do_early_binding(TSRMLS_D) /* {{{ */
/* Classes with traits are handled exactly the same, no early-bind here */
return;
default:
- zend_error(E_COMPILE_ERROR, "Invalid binding type");
+ zend_error_noreturn(E_COMPILE_ERROR, "Invalid binding type");
return;
}
@@ -4828,9 +4967,9 @@ void zend_do_brk_cont(zend_uchar op, const znode *expr TSRMLS_DC) /* {{{ */
SET_UNUSED(opline->op1);
if (expr) {
if (expr->op_type != IS_CONST) {
- zend_error(E_COMPILE_ERROR, "'%s' operator with non-constant operand is no longer supported", op == ZEND_BRK ? "break" : "continue");
+ zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator with non-constant operand is no longer supported", op == ZEND_BRK ? "break" : "continue");
} else if (Z_TYPE(expr->u.constant) != IS_LONG || Z_LVAL(expr->u.constant) < 1) {
- zend_error(E_COMPILE_ERROR, "'%s' operator accepts only positive numbers", op == ZEND_BRK ? "break" : "continue");
+ zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator accepts only positive numbers", op == ZEND_BRK ? "break" : "continue");
}
SET_NODE(opline->op2, expr);
} else {
@@ -4989,15 +5128,15 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name
zval **ns_name, key;
if (CG(active_class_entry)) {
- zend_error(E_COMPILE_ERROR, "Class declarations may not be nested");
+ zend_error_noreturn(E_COMPILE_ERROR, "Class declarations may not be nested");
return;
}
- lcname = zend_str_tolower_dup(class_name->u.constant.value.str.val, class_name->u.constant.value.str.len);
+ lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant));
if (!(strcmp(lcname, "self") && strcmp(lcname, "parent"))) {
efree(lcname);
- zend_error(E_COMPILE_ERROR, "Cannot use '%s' as class name as it is reserved", Z_STRVAL(class_name->u.constant));
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use '%s' as class name as it is reserved", Z_STRVAL(class_name->u.constant));
}
/* Class name must not conflict with import names */
@@ -5024,7 +5163,7 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name
if (Z_STRLEN_PP(ns_name) != Z_STRLEN(class_name->u.constant) ||
memcmp(tmp, lcname, Z_STRLEN(class_name->u.constant))) {
- zend_error(E_COMPILE_ERROR, "Cannot declare class %s because the name is already in use", Z_STRVAL(class_name->u.constant));
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare class %s because the name is already in use", Z_STRVAL(class_name->u.constant));
}
efree(tmp);
}
@@ -5042,13 +5181,13 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name
if (parent_class_name && parent_class_name->op_type != IS_UNUSED) {
switch (parent_class_name->EA) {
case ZEND_FETCH_CLASS_SELF:
- zend_error(E_COMPILE_ERROR, "Cannot use 'self' as class name as it is reserved");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use 'self' as class name as it is reserved");
break;
case ZEND_FETCH_CLASS_PARENT:
- zend_error(E_COMPILE_ERROR, "Cannot use 'parent' as class name as it is reserved");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use 'parent' as class name as it is reserved");
break;
case ZEND_FETCH_CLASS_STATIC:
- zend_error(E_COMPILE_ERROR, "Cannot use 'static' as class name as it is reserved");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use 'static' as class name as it is reserved");
break;
default:
break;
@@ -5067,7 +5206,7 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name
if (doing_inheritance) {
/* Make sure a trait does not try to extend a class */
if ((new_class_entry->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
- zend_error(E_COMPILE_ERROR, "A trait (%s) cannot extend a class. Traits can only be composed from other traits with the 'use' keyword. Error", new_class_entry->name);
+ zend_error_noreturn(E_COMPILE_ERROR, "A trait (%s) cannot extend a class. Traits can only be composed from other traits with the 'use' keyword. Error", new_class_entry->name);
}
opline->extended_value = parent_class_name->u.op.var;
@@ -5112,19 +5251,19 @@ void zend_do_end_class_declaration(const znode *class_token, const znode *parent
if (ce->constructor) {
ce->constructor->common.fn_flags |= ZEND_ACC_CTOR;
if (ce->constructor->common.fn_flags & ZEND_ACC_STATIC) {
- zend_error(E_COMPILE_ERROR, "Constructor %s::%s() cannot be static", ce->name, ce->constructor->common.function_name);
+ zend_error_noreturn(E_COMPILE_ERROR, "Constructor %s::%s() cannot be static", ce->name, ce->constructor->common.function_name);
}
}
if (ce->destructor) {
ce->destructor->common.fn_flags |= ZEND_ACC_DTOR;
if (ce->destructor->common.fn_flags & ZEND_ACC_STATIC) {
- zend_error(E_COMPILE_ERROR, "Destructor %s::%s() cannot be static", ce->name, ce->destructor->common.function_name);
+ zend_error_noreturn(E_COMPILE_ERROR, "Destructor %s::%s() cannot be static", ce->name, ce->destructor->common.function_name);
}
}
if (ce->clone) {
ce->clone->common.fn_flags |= ZEND_ACC_CLONE;
if (ce->clone->common.fn_flags & ZEND_ACC_STATIC) {
- zend_error(E_COMPILE_ERROR, "Clone method %s::%s() cannot be static", ce->name, ce->clone->common.function_name);
+ zend_error_noreturn(E_COMPILE_ERROR, "Clone method %s::%s() cannot be static", ce->name, ce->clone->common.function_name);
}
}
@@ -5173,7 +5312,7 @@ void zend_do_implements_interface(znode *interface_name TSRMLS_DC) /* {{{ */
/* Traits can not implement interfaces */
if ((CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
- zend_error(E_COMPILE_ERROR, "Cannot use '%s' as interface on '%s' since it is a Trait",
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use '%s' as interface on '%s' since it is a Trait",
Z_STRVAL(interface_name->u.constant),
CG(active_class_entry)->name);
}
@@ -5182,7 +5321,7 @@ void zend_do_implements_interface(znode *interface_name TSRMLS_DC) /* {{{ */
case ZEND_FETCH_CLASS_SELF:
case ZEND_FETCH_CLASS_PARENT:
case ZEND_FETCH_CLASS_STATIC:
- zend_error(E_COMPILE_ERROR, "Cannot use '%s' as interface name as it is reserved", Z_STRVAL(interface_name->u.constant));
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use '%s' as interface name as it is reserved", Z_STRVAL(interface_name->u.constant));
break;
default:
break;
@@ -5191,7 +5330,7 @@ void zend_do_implements_interface(znode *interface_name TSRMLS_DC) /* {{{ */
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_ADD_INTERFACE;
SET_NODE(opline->op1, &CG(implementing_class));
- zend_resolve_class_name(interface_name, opline->extended_value, 0 TSRMLS_CC);
+ zend_resolve_class_name(interface_name TSRMLS_CC);
opline->extended_value = (opline->extended_value & ~ZEND_FETCH_CLASS_MASK) | ZEND_FETCH_CLASS_INTERFACE;
opline->op2_type = IS_CONST;
opline->op2.constant = zend_add_class_name_literal(CG(active_op_array), &interface_name->u.constant TSRMLS_CC);
@@ -5204,7 +5343,7 @@ void zend_do_use_trait(znode *trait_name TSRMLS_DC) /* {{{ */
zend_op *opline;
if ((CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE)) {
- zend_error(E_COMPILE_ERROR,
+ zend_error_noreturn(E_COMPILE_ERROR,
"Cannot use traits inside of interfaces. %s is used in %s",
Z_STRVAL(trait_name->u.constant), CG(active_class_entry)->name);
}
@@ -5214,7 +5353,7 @@ void zend_do_use_trait(znode *trait_name TSRMLS_DC) /* {{{ */
case ZEND_FETCH_CLASS_SELF:
case ZEND_FETCH_CLASS_PARENT:
case ZEND_FETCH_CLASS_STATIC:
- zend_error(E_COMPILE_ERROR, "Cannot use '%s' as trait name as it is reserved", Z_STRVAL(trait_name->u.constant));
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use '%s' as trait name as it is reserved", Z_STRVAL(trait_name->u.constant));
break;
default:
break;
@@ -5223,7 +5362,7 @@ void zend_do_use_trait(znode *trait_name TSRMLS_DC) /* {{{ */
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_ADD_TRAIT;
SET_NODE(opline->op1, &CG(implementing_class));
- zend_resolve_class_name(trait_name, opline->extended_value, 0 TSRMLS_CC);
+ zend_resolve_class_name(trait_name TSRMLS_CC);
opline->extended_value = ZEND_FETCH_CLASS_TRAIT;
opline->op2_type = IS_CONST;
opline->op2.constant = zend_add_class_name_literal(CG(active_op_array), &trait_name->u.constant TSRMLS_CC);
@@ -5303,20 +5442,20 @@ void zend_do_declare_property(const znode *var_name, const znode *value, zend_ui
int comment_len = 0;
if (CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE) {
- zend_error(E_COMPILE_ERROR, "Interfaces may not include member variables");
+ zend_error_noreturn(E_COMPILE_ERROR, "Interfaces may not include member variables");
}
if (access_type & ZEND_ACC_ABSTRACT) {
- zend_error(E_COMPILE_ERROR, "Properties cannot be declared abstract");
+ zend_error_noreturn(E_COMPILE_ERROR, "Properties cannot be declared abstract");
}
if (access_type & ZEND_ACC_FINAL) {
- zend_error(E_COMPILE_ERROR, "Cannot declare property %s::$%s final, the final modifier is allowed only for methods and classes",
- CG(active_class_entry)->name, var_name->u.constant.value.str.val);
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare property %s::$%s final, the final modifier is allowed only for methods and classes",
+ CG(active_class_entry)->name, Z_STRVAL(var_name->u.constant));
}
- if (zend_hash_find(&CG(active_class_entry)->properties_info, var_name->u.constant.value.str.val, var_name->u.constant.value.str.len+1, (void **) &existing_property_info)==SUCCESS) {
- zend_error(E_COMPILE_ERROR, "Cannot redeclare %s::$%s", CG(active_class_entry)->name, var_name->u.constant.value.str.val);
+ if (zend_hash_find(&CG(active_class_entry)->properties_info, Z_STRVAL(var_name->u.constant), Z_STRLEN(var_name->u.constant)+1, (void **) &existing_property_info)==SUCCESS) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare %s::$%s", CG(active_class_entry)->name, Z_STRVAL(var_name->u.constant));
}
ALLOC_ZVAL(property);
@@ -5334,8 +5473,8 @@ void zend_do_declare_property(const znode *var_name, const znode *value, zend_ui
CG(doc_comment_len) = 0;
}
- zend_declare_property_ex(CG(active_class_entry), zend_new_interned_string(var_name->u.constant.value.str.val, var_name->u.constant.value.str.len + 1, 0 TSRMLS_CC), var_name->u.constant.value.str.len, property, access_type, comment, comment_len TSRMLS_CC);
- efree(var_name->u.constant.value.str.val);
+ zend_declare_property_ex(CG(active_class_entry), zend_new_interned_string(Z_STRVAL(var_name->u.constant), Z_STRLEN(var_name->u.constant) + 1, 0 TSRMLS_CC), Z_STRLEN(var_name->u.constant), property, access_type, comment, comment_len TSRMLS_CC);
+ efree(Z_STRVAL(var_name->u.constant));
}
/* }}} */
@@ -5343,30 +5482,21 @@ void zend_do_declare_class_constant(znode *var_name, const znode *value TSRMLS_D
{
zval *property;
const char *cname = NULL;
- int result;
+ zend_ulong hash;
- if(Z_TYPE(value->u.constant) == IS_CONSTANT_ARRAY) {
- zend_error(E_COMPILE_ERROR, "Arrays are not allowed in class constants");
- return;
- }
if ((CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
- zend_error(E_COMPILE_ERROR, "Traits cannot have constants");
+ zend_error_noreturn(E_COMPILE_ERROR, "Traits cannot have constants");
return;
}
ALLOC_ZVAL(property);
*property = value->u.constant;
- cname = zend_new_interned_string(var_name->u.constant.value.str.val, var_name->u.constant.value.str.len+1, 0 TSRMLS_CC);
-
- if (IS_INTERNED(cname)) {
- result = zend_hash_quick_add(&CG(active_class_entry)->constants_table, cname, var_name->u.constant.value.str.len+1, INTERNED_HASH(cname), &property, sizeof(zval *), NULL);
- } else {
- result = zend_hash_add(&CG(active_class_entry)->constants_table, cname, var_name->u.constant.value.str.len+1, &property, sizeof(zval *), NULL);
- }
- if (result == FAILURE) {
+ cname = zend_new_interned_string(Z_STRVAL(var_name->u.constant), Z_STRLEN(var_name->u.constant)+1, 0 TSRMLS_CC);
+ hash = str_hash(cname, Z_STRLEN(var_name->u.constant));
+ if (zend_hash_quick_add(&CG(active_class_entry)->constants_table, cname, Z_STRLEN(var_name->u.constant)+1, hash, &property, sizeof(zval *), NULL) == FAILURE) {
FREE_ZVAL(property);
- zend_error(E_COMPILE_ERROR, "Cannot redefine class constant %s::%s", CG(active_class_entry)->name, var_name->u.constant.value.str.val);
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot redefine class constant %s::%s", CG(active_class_entry)->name, Z_STRVAL(var_name->u.constant));
}
FREE_PNODE(var_name);
@@ -5460,7 +5590,7 @@ void zend_do_halt_compiler_register(TSRMLS_D) /* {{{ */
int len, clen;
if (CG(has_bracketed_namespaces) && CG(in_namespace)) {
- zend_error(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used from the outermost scope");
+ zend_error_noreturn(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used from the outermost scope");
}
cfilename = zend_get_compiled_filename(TSRMLS_C);
@@ -5496,7 +5626,6 @@ void zend_do_pop_object(znode *object TSRMLS_DC) /* {{{ */
void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC) /* {{{ */
{
zend_op *opline;
- unsigned char *ptr = NULL;
new_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -5507,18 +5636,18 @@ void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC) /*
SET_NODE(opline->op1, class_type);
SET_UNUSED(opline->op2);
- zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(unsigned char *));
+ zend_push_function_call_entry(NULL TSRMLS_CC);
if (++CG(context).nested_calls > CG(active_op_array)->nested_calls) {
CG(active_op_array)->nested_calls = CG(context).nested_calls;
}
}
/* }}} */
-void zend_do_end_new_object(znode *result, const znode *new_token, const znode *argument_list TSRMLS_DC) /* {{{ */
+void zend_do_end_new_object(znode *result, const znode *new_token TSRMLS_DC) /* {{{ */
{
znode ctor_result;
- zend_do_end_function_call(NULL, &ctor_result, argument_list, 1, 0 TSRMLS_CC);
+ zend_do_end_function_call(NULL, &ctor_result, 1, 0 TSRMLS_CC);
zend_do_free(&ctor_result TSRMLS_CC);
CG(active_op_array)->opcodes[new_token->u.op.opline_num].op2.opline_num = get_next_op_number(CG(active_op_array));
@@ -5561,8 +5690,7 @@ static zend_constant* zend_get_ct_const(const zval *const_name, int all_internal
if (all_internal_constants_substitution &&
(c->flags & CONST_PERSISTENT) &&
!(CG(compiler_options) & ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION) &&
- Z_TYPE(c->value) != IS_CONSTANT &&
- Z_TYPE(c->value) != IS_CONSTANT_ARRAY) {
+ !IS_CONSTANT_TYPE(Z_TYPE(c->value))) {
return c;
}
return NULL;
@@ -5602,7 +5730,7 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con
if (ZEND_FETCH_CLASS_STATIC == type) {
zend_error(E_ERROR, "\"static::\" is not allowed in compile-time constants");
} else if (ZEND_FETCH_CLASS_DEFAULT == type) {
- zend_resolve_class_name(constant_container, fetch_type, 1 TSRMLS_CC);
+ zend_resolve_class_name(constant_container TSRMLS_CC);
}
zend_do_build_full_name(NULL, constant_container, constant_name, 1 TSRMLS_CC);
*result = *constant_container;
@@ -5611,7 +5739,7 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con
case ZEND_RT:
if (constant_container->op_type == IS_CONST &&
ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(constant_container->u.constant), Z_STRLEN(constant_container->u.constant))) {
- zend_resolve_class_name(constant_container, fetch_type, 1 TSRMLS_CC);
+ zend_resolve_class_name(constant_container TSRMLS_CC);
} else {
zend_do_fetch_class(&tmp, constant_container TSRMLS_CC);
constant_container = &tmp;
@@ -5649,7 +5777,7 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con
break;
}
- zend_resolve_non_class_name(constant_name, check_namespace TSRMLS_CC);
+ zend_resolve_const_name(constant_name, &check_namespace TSRMLS_CC);
if(!compound) {
fetch_type |= IS_CONSTANT_UNQUALIFIED;
@@ -5661,7 +5789,7 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con
case ZEND_RT:
compound = memchr(Z_STRVAL(constant_name->u.constant), '\\', Z_STRLEN(constant_name->u.constant));
- zend_resolve_non_class_name(constant_name, check_namespace TSRMLS_CC);
+ zend_resolve_const_name(constant_name, &check_namespace TSRMLS_CC);
if(zend_constant_ct_subst(result, &constant_name->u.constant, 1 TSRMLS_CC)) {
break;
@@ -5797,43 +5925,30 @@ void zend_do_add_array_element(znode *result, const znode *expr, const znode *of
}
/* }}} */
-void zend_do_add_static_array_element(znode *result, znode *offset, const znode *expr) /* {{{ */
+void zend_do_add_static_array_element(zval *result, zval *offset, const zval *expr) /* {{{ */
{
- zval *element;
-
- ALLOC_ZVAL(element);
- *element = expr->u.constant;
if (offset) {
- switch (offset->u.constant.type & IS_CONSTANT_TYPE_MASK) {
- case IS_CONSTANT:
- /* Ugly hack to denote that this value has a constant index */
- Z_TYPE_P(element) |= IS_CONSTANT_INDEX;
- Z_STRVAL(offset->u.constant) = erealloc(Z_STRVAL(offset->u.constant), Z_STRLEN(offset->u.constant)+3);
- Z_STRVAL(offset->u.constant)[Z_STRLEN(offset->u.constant)+1] = Z_TYPE(offset->u.constant);
- Z_STRVAL(offset->u.constant)[Z_STRLEN(offset->u.constant)+2] = 0;
- zend_symtable_update(result->u.constant.value.ht, Z_STRVAL(offset->u.constant), Z_STRLEN(offset->u.constant)+3, &element, sizeof(zval *), NULL);
- zval_dtor(&offset->u.constant);
- break;
+ switch (Z_TYPE_P(offset)) {
case IS_STRING:
- zend_symtable_update(result->u.constant.value.ht, offset->u.constant.value.str.val, offset->u.constant.value.str.len+1, &element, sizeof(zval *), NULL);
- zval_dtor(&offset->u.constant);
+ zend_symtable_update(Z_ARRVAL_P(result), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr, sizeof(zval *), NULL);
+ zval_dtor(offset);
break;
case IS_NULL:
- zend_symtable_update(Z_ARRVAL(result->u.constant), "", 1, &element, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(result), "", 1, &expr, sizeof(zval *), NULL);
break;
case IS_LONG:
case IS_BOOL:
- zend_hash_index_update(Z_ARRVAL(result->u.constant), Z_LVAL(offset->u.constant), &element, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(result), Z_LVAL_P(offset), &expr, sizeof(zval *), NULL);
break;
case IS_DOUBLE:
- zend_hash_index_update(Z_ARRVAL(result->u.constant), zend_dval_to_lval(Z_DVAL(offset->u.constant)), &element, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(result), zend_dval_to_lval(Z_DVAL_P(offset)), &expr, sizeof(zval *), NULL);
break;
- case IS_CONSTANT_ARRAY:
+ case IS_ARRAY:
zend_error(E_ERROR, "Illegal offset type");
break;
}
} else {
- zend_hash_next_index_insert(Z_ARRVAL(result->u.constant), &element, sizeof(zval *), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL_P(result), &expr, sizeof(zval *), NULL);
}
}
/* }}} */
@@ -5992,7 +6107,7 @@ void zend_do_fetch_static_variable(znode *varname, const znode *static_assignmen
ALLOC_HASHTABLE(CG(active_op_array)->static_variables);
zend_hash_init(CG(active_op_array)->static_variables, 2, NULL, ZVAL_PTR_DTOR, 0);
}
- zend_hash_update(CG(active_op_array)->static_variables, varname->u.constant.value.str.val, varname->u.constant.value.str.len+1, &tmp, sizeof(zval *), NULL);
+ zend_hash_update(CG(active_op_array)->static_variables, Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant)+1, &tmp, sizeof(zval *), NULL);
if (varname->op_type == IS_CONST) {
if (Z_TYPE(varname->u.constant) != IS_STRING) {
@@ -6036,7 +6151,7 @@ void zend_do_fetch_lexical_variable(znode *varname, zend_bool is_ref TSRMLS_DC)
if (Z_STRLEN(varname->u.constant) == sizeof("this") - 1 &&
memcmp(Z_STRVAL(varname->u.constant), "this", sizeof("this") - 1) == 0) {
- zend_error(E_COMPILE_ERROR, "Cannot use $this as lexical variable");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use $this as lexical variable");
return;
}
@@ -6121,7 +6236,7 @@ void zend_do_indirect_references(znode *result, const znode *num_references, zno
int i;
zend_do_end_variable_parse(variable, BP_VAR_R, 0 TSRMLS_CC);
- for (i=1; i<num_references->u.constant.value.lval; i++) {
+ for (i=1; i<Z_LVAL(num_references->u.constant); i++) {
fetch_simple_variable_ex(result, variable, 0, ZEND_FETCH_R TSRMLS_CC);
*variable = *result;
}
@@ -6180,7 +6295,7 @@ void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC
/* empty(func()) can be transformed to !func() */
zend_do_unary_op(ZEND_BOOL_NOT, result, variable TSRMLS_CC);
} else {
- zend_error(E_COMPILE_ERROR, "Cannot use isset() on the result of a function call (you can use \"null !== func()\" instead)");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use isset() on the result of a function call (you can use \"null !== func()\" instead)");
}
return;
@@ -6228,7 +6343,7 @@ void zend_do_instanceof(znode *result, const znode *expr, const znode *class_zno
}
if (expr->op_type == IS_CONST) {
- zend_error(E_COMPILE_ERROR, "instanceof expects an object instance, constant given");
+ zend_error_noreturn(E_COMPILE_ERROR, "instanceof expects an object instance, constant given");
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -6328,10 +6443,10 @@ void zend_do_foreach_cont(znode *foreach_token, const znode *open_brackets_token
if ((key->op_type != IS_UNUSED)) {
if (key->EA & ZEND_PARSED_REFERENCE_VARIABLE) {
- zend_error(E_COMPILE_ERROR, "Key element cannot be a reference");
+ zend_error_noreturn(E_COMPILE_ERROR, "Key element cannot be a reference");
}
if (key->EA & ZEND_PARSED_LIST_EXPR) {
- zend_error(E_COMPILE_ERROR, "Cannot use list as key element");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use list as key element");
}
}
@@ -6350,7 +6465,7 @@ void zend_do_foreach_cont(znode *foreach_token, const znode *open_brackets_token
while (fetch != end) {
--fetch;
if (fetch->opcode == ZEND_FETCH_DIM_W && fetch->op2_type == IS_UNUSED) {
- zend_error(E_COMPILE_ERROR, "Cannot use [] for reading");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading");
}
if (fetch->opcode == ZEND_SEPARATE) {
MAKE_NOP(fetch);
@@ -6364,7 +6479,7 @@ void zend_do_foreach_cont(znode *foreach_token, const znode *open_brackets_token
if (value->EA & ZEND_PARSED_LIST_EXPR) {
if (!CG(list_llist).head) {
- zend_error(E_COMPILE_ERROR, "Cannot use empty list");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use empty list");
}
zend_do_list_end(&dummy, &value_node TSRMLS_CC);
zend_do_free(&dummy TSRMLS_CC);
@@ -6427,12 +6542,12 @@ void zend_do_declare_begin(TSRMLS_D) /* {{{ */
void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC) /* {{{ */
{
- if (!zend_binary_strcasecmp(var->u.constant.value.str.val, var->u.constant.value.str.len, "ticks", sizeof("ticks")-1)) {
+ if (!zend_binary_strcasecmp(Z_STRVAL(var->u.constant), Z_STRLEN(var->u.constant), "ticks", sizeof("ticks")-1)) {
convert_to_long(&val->u.constant);
CG(declarables).ticks = val->u.constant;
- } else if (!zend_binary_strcasecmp(var->u.constant.value.str.val, var->u.constant.value.str.len, "encoding", sizeof("encoding")-1)) {
+ } else if (!zend_binary_strcasecmp(Z_STRVAL(var->u.constant), Z_STRLEN(var->u.constant), "encoding", sizeof("encoding")-1)) {
if ((Z_TYPE(val->u.constant) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
- zend_error(E_COMPILE_ERROR, "Cannot use constants as encoding");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use constants as encoding");
}
/*
@@ -6451,7 +6566,7 @@ void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC) /* {{{ */
}
if (num > 0) {
- zend_error(E_COMPILE_ERROR, "Encoding declaration pragma must be the very first statement in the script");
+ zend_error_noreturn(E_COMPILE_ERROR, "Encoding declaration pragma must be the very first statement in the script");
}
}
@@ -6462,9 +6577,9 @@ void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC) /* {{{ */
CG(encoding_declared) = 1;
convert_to_string(&val->u.constant);
- new_encoding = zend_multibyte_fetch_encoding(val->u.constant.value.str.val TSRMLS_CC);
+ new_encoding = zend_multibyte_fetch_encoding(Z_STRVAL(val->u.constant) TSRMLS_CC);
if (!new_encoding) {
- zend_error(E_COMPILE_WARNING, "Unsupported encoding [%s]", val->u.constant.value.str.val);
+ zend_error(E_COMPILE_WARNING, "Unsupported encoding [%s]", Z_STRVAL(val->u.constant));
} else {
old_input_filter = LANG_SCNG(input_filter);
old_encoding = LANG_SCNG(script_encoding);
@@ -6481,7 +6596,7 @@ void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC) /* {{{ */
}
zval_dtor(&val->u.constant);
} else {
- zend_error(E_COMPILE_WARNING, "Unsupported declare '%s'", var->u.constant.value.str.val);
+ zend_error(E_COMPILE_WARNING, "Unsupported declare '%s'", Z_STRVAL(var->u.constant));
zval_dtor(&val->u.constant);
}
zval_dtor(&var->u.constant);
@@ -6721,10 +6836,9 @@ void zend_do_ticks(TSRMLS_D) /* {{{ */
}
/* }}} */
-zend_bool zend_is_auto_global_quick(const char *name, uint name_len, ulong hashval TSRMLS_DC) /* {{{ */
+zend_bool zend_is_auto_global_quick(const char *name, uint name_len, ulong hash TSRMLS_DC) /* {{{ */
{
zend_auto_global *auto_global;
- ulong hash = hashval ? hashval : zend_hash_func(name, name_len+1);
if (zend_hash_quick_find(CG(auto_globals), name, name_len+1, hash, (void **) &auto_global)==SUCCESS) {
if (auto_global->armed) {
@@ -6738,7 +6852,7 @@ zend_bool zend_is_auto_global_quick(const char *name, uint name_len, ulong hashv
zend_bool zend_is_auto_global(const char *name, uint name_len TSRMLS_DC) /* {{{ */
{
- return zend_is_auto_global_quick(name, name_len, 0 TSRMLS_CC);
+ return zend_is_auto_global_quick(name, name_len, zend_hash_func(name, name_len+1) TSRMLS_CC);
}
/* }}} */
@@ -6877,6 +6991,7 @@ ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify
ce->unserialize = NULL;
ce->serialize_func = NULL;
ce->unserialize_func = NULL;
+ ce->__debugInfo = NULL;
if (ce->type == ZEND_INTERNAL_CLASS) {
ce->info.internal.module = NULL;
ce->info.internal.builtin_functions = NULL;
@@ -6948,15 +7063,15 @@ void zend_do_begin_namespace(const znode *name, zend_bool with_bracket TSRMLS_DC
if (CG(current_namespace)) {
/* previous namespace declarations were unbracketed */
if (with_bracket) {
- zend_error(E_COMPILE_ERROR, "Cannot mix bracketed namespace declarations with unbracketed namespace declarations");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot mix bracketed namespace declarations with unbracketed namespace declarations");
}
}
} else {
/* previous namespace declarations were bracketed */
if (!with_bracket) {
- zend_error(E_COMPILE_ERROR, "Cannot mix bracketed namespace declarations with unbracketed namespace declarations");
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot mix bracketed namespace declarations with unbracketed namespace declarations");
} else if (CG(current_namespace) || CG(in_namespace)) {
- zend_error(E_COMPILE_ERROR, "Namespace declarations cannot be nested");
+ zend_error_noreturn(E_COMPILE_ERROR, "Namespace declarations cannot be nested");
}
}
@@ -6969,7 +7084,7 @@ void zend_do_begin_namespace(const znode *name, zend_bool with_bracket TSRMLS_DC
--num;
}
if (num > 0) {
- zend_error(E_COMPILE_ERROR, "Namespace declaration statement has to be the very first statement in the script");
+ zend_error_noreturn(E_COMPILE_ERROR, "Namespace declaration statement has to be the very first statement in the script");
}
}
@@ -6984,7 +7099,7 @@ void zend_do_begin_namespace(const znode *name, zend_bool with_bracket TSRMLS_DC
!memcmp(lcname, "self", sizeof("self")-1)) ||
((Z_STRLEN(name->u.constant) == sizeof("parent")-1) &&
!memcmp(lcname, "parent", sizeof("parent")-1))) {
- zend_error(E_COMPILE_ERROR, "Cannot use '%s' as namespace name", Z_STRVAL(name->u.constant));
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use '%s' as namespace name", Z_STRVAL(name->u.constant));
}
efree(lcname);
@@ -7008,6 +7123,18 @@ void zend_do_begin_namespace(const znode *name, zend_bool with_bracket TSRMLS_DC
CG(current_import) = NULL;
}
+ if (CG(current_import_function)) {
+ zend_hash_destroy(CG(current_import_function));
+ efree(CG(current_import_function));
+ CG(current_import_function) = NULL;
+ }
+
+ if (CG(current_import_const)) {
+ zend_hash_destroy(CG(current_import_const));
+ efree(CG(current_import_const));
+ CG(current_import_const) = NULL;
+ }
+
if (CG(doc_comment)) {
efree(CG(doc_comment));
CG(doc_comment) = NULL;
@@ -7028,8 +7155,8 @@ void zend_do_use(znode *ns_name, znode *new_name TSRMLS_DC) /* {{{ */
zend_hash_init(CG(current_import), 0, NULL, ZVAL_PTR_DTOR, 0);
}
- ALLOC_ZVAL(ns);
- *ns = ns_name->u.constant;
+ MAKE_STD_ZVAL(ns);
+ ZVAL_ZVAL(ns, &ns_name->u.constant, 0, 0);
if (new_name) {
name = &new_name->u.constant;
} else {
@@ -7042,8 +7169,7 @@ void zend_do_use(znode *ns_name, znode *new_name TSRMLS_DC) /* {{{ */
if (p) {
ZVAL_STRING(name, p+1, 1);
} else {
- *name = *ns;
- zval_copy_ctor(name);
+ ZVAL_ZVAL(name, ns, 1, 0);
warn = !CG(current_namespace);
}
}
@@ -7054,7 +7180,7 @@ void zend_do_use(znode *ns_name, znode *new_name TSRMLS_DC) /* {{{ */
!memcmp(lcname, "self", sizeof("self")-1)) ||
((Z_STRLEN_P(name) == sizeof("parent")-1) &&
!memcmp(lcname, "parent", sizeof("parent")-1))) {
- zend_error(E_COMPILE_ERROR, "Cannot use %s as %s because '%s' is a special class name", Z_STRVAL_P(ns), Z_STRVAL_P(name), Z_STRVAL_P(name));
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use %s as %s because '%s' is a special class name", Z_STRVAL_P(ns), Z_STRVAL_P(name), Z_STRVAL_P(name));
}
if (CG(current_namespace)) {
@@ -7069,7 +7195,7 @@ void zend_do_use(znode *ns_name, znode *new_name TSRMLS_DC) /* {{{ */
if (Z_STRLEN_P(ns) != Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name) ||
memcmp(tmp2, c_ns_name, Z_STRLEN_P(ns))) {
- zend_error(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name));
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name));
}
efree(tmp2);
}
@@ -7081,17 +7207,17 @@ void zend_do_use(znode *ns_name, znode *new_name TSRMLS_DC) /* {{{ */
if (Z_STRLEN_P(ns) != Z_STRLEN_P(name) ||
memcmp(c_tmp, lcname, Z_STRLEN_P(ns))) {
- zend_error(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name));
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name));
}
efree(c_tmp);
}
if (zend_hash_add(CG(current_import), lcname, Z_STRLEN_P(name)+1, &ns, sizeof(zval*), NULL) != SUCCESS) {
- zend_error(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name));
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name));
}
if (warn) {
if (!strcmp(Z_STRVAL_P(name), "strict")) {
- zend_error(E_COMPILE_ERROR, "You seem to be trying to use a different language...");
+ zend_error_noreturn(E_COMPILE_ERROR, "You seem to be trying to use a different language...");
}
zend_error(E_WARNING, "The use statement with non-compound name '%s' has no effect", Z_STRVAL_P(name));
}
@@ -7100,16 +7226,120 @@ void zend_do_use(znode *ns_name, znode *new_name TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_do_declare_constant(znode *name, znode *value TSRMLS_DC) /* {{{ */
+void zend_do_use_non_class(znode *ns_name, znode *new_name, int is_function, zend_bool case_sensitive, HashTable *current_import_sub, HashTable *lookup_table TSRMLS_DC) /* {{{ */
{
- zend_op *opline;
+ char *lookup_name;
+ zval *name, *ns, tmp;
+ zend_bool warn = 0;
- if(Z_TYPE(value->u.constant) == IS_CONSTANT_ARRAY) {
- zend_error(E_COMPILE_ERROR, "Arrays are not allowed as constants");
+ MAKE_STD_ZVAL(ns);
+ ZVAL_ZVAL(ns, &ns_name->u.constant, 0, 0);
+ if (new_name) {
+ name = &new_name->u.constant;
+ } else {
+ const char *p;
+
+ /* The form "use A\B" is eqivalent to "use A\B as B".
+ So we extract the last part of compound name to use as a new_name */
+ name = &tmp;
+ p = zend_memrchr(Z_STRVAL_P(ns), '\\', Z_STRLEN_P(ns));
+ if (p) {
+ ZVAL_STRING(name, p+1, 1);
+ } else {
+ ZVAL_ZVAL(name, ns, 1, 0);
+ warn = !CG(current_namespace);
+ }
}
+ if (case_sensitive) {
+ lookup_name = estrndup(Z_STRVAL_P(name), Z_STRLEN_P(name));
+ } else {
+ lookup_name = zend_str_tolower_dup(Z_STRVAL_P(name), Z_STRLEN_P(name));
+ }
+
+ if (CG(current_namespace)) {
+ /* Prefix import name with current namespace name to avoid conflicts with functions/consts */
+ char *c_ns_name = emalloc(Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name) + 1);
+
+ zend_str_tolower_copy(c_ns_name, Z_STRVAL_P(CG(current_namespace)), Z_STRLEN_P(CG(current_namespace)));
+ c_ns_name[Z_STRLEN_P(CG(current_namespace))] = '\\';
+ memcpy(c_ns_name+Z_STRLEN_P(CG(current_namespace))+1, lookup_name, Z_STRLEN_P(name)+1);
+ if (zend_hash_exists(lookup_table, c_ns_name, Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name)+1)) {
+ char *tmp2 = zend_str_tolower_dup(Z_STRVAL_P(ns), Z_STRLEN_P(ns));
+
+ if (Z_STRLEN_P(ns) != Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name) ||
+ memcmp(tmp2, c_ns_name, Z_STRLEN_P(ns))) {
+ zend_error(E_COMPILE_ERROR, "Cannot use %s %s as %s because the name is already in use", is_function ? "function" : "const", Z_STRVAL_P(ns), Z_STRVAL_P(name));
+ }
+ efree(tmp2);
+ }
+ efree(c_ns_name);
+ } else if (is_function) {
+ zend_function *function;
+
+ if (zend_hash_find(lookup_table, lookup_name, Z_STRLEN_P(name)+1, (void **) &function) == SUCCESS && function->type == ZEND_USER_FUNCTION && strcmp(function->op_array.filename, CG(compiled_filename)) == 0) {
+ char *c_tmp = zend_str_tolower_dup(Z_STRVAL_P(ns), Z_STRLEN_P(ns));
+
+ if (Z_STRLEN_P(ns) != Z_STRLEN_P(name) ||
+ memcmp(c_tmp, lookup_name, Z_STRLEN_P(ns))) {
+ zend_error(E_COMPILE_ERROR, "Cannot use function %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name));
+ }
+ efree(c_tmp);
+ }
+ } else {
+ const char *filename;
+
+ if (zend_hash_find(lookup_table, lookup_name, Z_STRLEN_P(name)+1, (void **) &filename) == SUCCESS && strcmp(filename, CG(compiled_filename)) == 0) {
+ char *c_tmp = zend_str_tolower_dup(Z_STRVAL_P(ns), Z_STRLEN_P(ns));
+
+ if (Z_STRLEN_P(ns) != Z_STRLEN_P(name) ||
+ memcmp(c_tmp, lookup_name, Z_STRLEN_P(ns))) {
+ zend_error(E_COMPILE_ERROR, "Cannot use const %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name));
+ }
+ efree(c_tmp);
+ }
+ }
+
+ if (zend_hash_add(current_import_sub, lookup_name, Z_STRLEN_P(name)+1, &ns, sizeof(zval*), NULL) != SUCCESS) {
+ zend_error(E_COMPILE_ERROR, "Cannot use %s %s as %s because the name is already in use", is_function ? "function" : "const", Z_STRVAL_P(ns), Z_STRVAL_P(name));
+ }
+ if (warn) {
+ zend_error(E_WARNING, "The use %s statement with non-compound name '%s' has no effect", is_function ? "function" : "const", Z_STRVAL_P(name));
+ }
+ efree(lookup_name);
+ zval_dtor(name);
+}
+/* }}} */
+
+void zend_do_use_function(znode *ns_name, znode *new_name TSRMLS_DC) /* {{{ */
+{
+ if (!CG(current_import_function)) {
+ CG(current_import_function) = emalloc(sizeof(HashTable));
+ zend_hash_init(CG(current_import_function), 0, NULL, ZVAL_PTR_DTOR, 0);
+ }
+
+ zend_do_use_non_class(ns_name, new_name, 1, 0, CG(current_import_function), CG(function_table) TSRMLS_CC);
+}
+/* }}} */
+
+void zend_do_use_const(znode *ns_name, znode *new_name TSRMLS_DC) /* {{{ */
+{
+ if (!CG(current_import_const)) {
+ CG(current_import_const) = emalloc(sizeof(HashTable));
+ zend_hash_init(CG(current_import_const), 0, NULL, ZVAL_PTR_DTOR, 0);
+ }
+
+ zend_do_use_non_class(ns_name, new_name, 0, 1, CG(current_import_const), &CG(const_filenames) TSRMLS_CC);
+}
+/* }}} */
+
+void zend_do_declare_constant(znode *name, znode *value TSRMLS_DC) /* {{{ */
+{
+ zend_op *opline;
+ zval **ns_name;
+
if (zend_get_ct_const(&name->u.constant, 0 TSRMLS_CC)) {
- zend_error(E_COMPILE_ERROR, "Cannot redeclare constant '%s'", Z_STRVAL(name->u.constant));
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare constant '%s'", Z_STRVAL(name->u.constant));
}
if (CG(current_namespace)) {
@@ -7123,18 +7353,33 @@ void zend_do_declare_constant(znode *name, znode *value TSRMLS_DC) /* {{{ */
*name = tmp;
}
+ /* Constant name must not conflict with import names */
+ if (CG(current_import_const) &&
+ zend_hash_find(CG(current_import_const), Z_STRVAL(name->u.constant), Z_STRLEN(name->u.constant)+1, (void**)&ns_name) == SUCCESS) {
+
+ char *tmp = estrndup(Z_STRVAL_PP(ns_name), Z_STRLEN_PP(ns_name));
+
+ if (Z_STRLEN_PP(ns_name) != Z_STRLEN(name->u.constant) ||
+ memcmp(tmp, Z_STRVAL(name->u.constant), Z_STRLEN(name->u.constant))) {
+ zend_error(E_COMPILE_ERROR, "Cannot declare const %s because the name is already in use", Z_STRVAL(name->u.constant));
+ }
+ efree(tmp);
+ }
+
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_DECLARE_CONST;
SET_UNUSED(opline->result);
SET_NODE(opline->op1, name);
SET_NODE(opline->op2, value);
+
+ zend_hash_add(&CG(const_filenames), Z_STRVAL(name->u.constant), Z_STRLEN(name->u.constant)+1, CG(compiled_filename), strlen(CG(compiled_filename))+1, NULL);
}
/* }}} */
void zend_verify_namespace(TSRMLS_D) /* {{{ */
{
if (CG(has_bracketed_namespaces) && !CG(in_namespace)) {
- zend_error(E_COMPILE_ERROR, "No code may exist outside of namespace {}");
+ zend_error_noreturn(E_COMPILE_ERROR, "No code may exist outside of namespace {}");
}
}
/* }}} */
@@ -7152,6 +7397,16 @@ void zend_do_end_namespace(TSRMLS_D) /* {{{ */
efree(CG(current_import));
CG(current_import) = NULL;
}
+ if (CG(current_import_function)) {
+ zend_hash_destroy(CG(current_import_function));
+ efree(CG(current_import_function));
+ CG(current_import_function) = NULL;
+ }
+ if (CG(current_import_const)) {
+ zend_hash_destroy(CG(current_import_const));
+ efree(CG(current_import_const));
+ CG(current_import_const) = NULL;
+ }
}
/* }}} */
@@ -7162,6 +7417,21 @@ void zend_do_end_compilation(TSRMLS_D) /* {{{ */
}
/* }}} */
+void zend_do_constant_expression(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+{
+ if (ast->kind == ZEND_CONST) {
+ result->u.constant = *ast->u.val;
+ efree(ast);
+ } else if (zend_ast_is_ct_constant(ast)) {
+ zend_ast_evaluate(&result->u.constant, ast, NULL TSRMLS_CC);
+ zend_ast_destroy(ast);
+ } else {
+ Z_TYPE(result->u.constant) = IS_CONSTANT_AST;
+ Z_AST(result->u.constant) = ast;
+ }
+}
+/* }}} */
+
/* {{{ zend_dirname
Returns directory name component of path */
ZEND_API size_t zend_dirname(char *path, size_t len)
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 2d8833400b..921d3897cd 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -23,6 +23,7 @@
#define ZEND_COMPILE_H
#include "zend.h"
+#include "zend_ast.h"
#ifdef HAVE_STDARG_H
# include <stdarg.h>
@@ -74,7 +75,7 @@ typedef struct _zend_literal {
#define Z_HASH_P(zv) \
(((zend_literal*)(zv))->hash_value)
-typedef union _znode_op {
+typedef union _znode_op {
zend_uint constant;
zend_uint var;
zend_uint num;
@@ -86,12 +87,13 @@ typedef union _znode_op {
void *ptr; /* Used for passing pointers from the compile to execution phase, currently used for traits */
} znode_op;
-typedef struct _znode { /* used only during compilation */
+typedef struct _znode { /* used only during compilation */
int op_type;
union {
znode_op op;
zval constant; /* replaced by literal/zv */
zend_op_array *op_array;
+ zend_ast *ast;
} u;
zend_uint EA; /* extended attributes */
} znode;
@@ -207,12 +209,14 @@ typedef struct _zend_try_catch_element {
/* disable inline caching */
#define ZEND_ACC_NEVER_CACHE 0x400000
-#define ZEND_ACC_PASS_REST_BY_REFERENCE 0x1000000
-#define ZEND_ACC_PASS_REST_PREFER_REF 0x2000000
+#define ZEND_ACC_VARIADIC 0x1000000
#define ZEND_ACC_RETURN_REFERENCE 0x4000000
#define ZEND_ACC_DONE_PASS_TWO 0x8000000
+/* function has arguments with type hinting */
+#define ZEND_ACC_HAS_TYPE_HINTS 0x10000000
+
char *zend_visibility_string(zend_uint fn_flags);
@@ -234,12 +238,13 @@ typedef struct _zend_arg_info {
const char *class_name;
zend_uint class_name_len;
zend_uchar type_hint;
+ zend_uchar pass_by_reference;
zend_bool allow_null;
- zend_bool pass_by_reference;
+ zend_bool is_variadic;
} zend_arg_info;
/* the following structure repeats the layout of zend_arg_info,
- * but its fields have different meaning. It's used as the first element of
+ * but its fields have different meaning. It's used as the first element of
* arg_info array to define properties of internal functions.
*/
typedef struct _zend_internal_function_info {
@@ -249,7 +254,8 @@ typedef struct _zend_internal_function_info {
zend_uint required_num_args;
zend_uchar _type_hint;
zend_bool return_reference;
- zend_bool pass_rest_by_reference;
+ zend_bool _allow_null;
+ zend_bool _is_variadic;
} zend_internal_function_info;
typedef struct _zend_compiled_variable {
@@ -261,7 +267,7 @@ typedef struct _zend_compiled_variable {
struct _zend_op_array {
/* Common elements */
zend_uchar type;
- const char *function_name;
+ const char *function_name;
zend_class_entry *scope;
zend_uint fn_flags;
union _zend_function *prototype;
@@ -357,6 +363,11 @@ typedef struct _zend_function_state {
void **arguments;
} zend_function_state;
+typedef struct _zend_function_call_entry {
+ zend_function *fbc;
+ zend_uint arg_num;
+ zend_bool uses_argument_unpacking;
+} zend_function_call_entry;
typedef struct _zend_switch_entry {
znode cond;
@@ -377,6 +388,7 @@ typedef struct _call_slot {
zend_function *fbc;
zval *object;
zend_class_entry *called_scope;
+ zend_uint num_additional_args;
zend_bool is_ctor_call;
zend_bool is_ctor_result_used;
} call_slot;
@@ -395,6 +407,7 @@ struct _zend_execute_data {
zend_class_entry *current_called_scope;
zval *current_this;
struct _zend_op *fast_ret; /* used by FAST_CALL/FAST_RET (finally keyword) */
+ zval *delayed_exception;
call_slot *call_slots;
call_slot *call;
};
@@ -437,8 +450,10 @@ ZEND_API char *zend_get_compiled_filename(TSRMLS_D);
ZEND_API int zend_get_compiled_lineno(TSRMLS_D);
ZEND_API size_t zend_get_scanned_file_offset(TSRMLS_D);
-void zend_resolve_non_class_name(znode *element_name, zend_bool check_namespace TSRMLS_DC);
-void zend_resolve_class_name(znode *class_name, ulong fetch_type, int check_ns_name TSRMLS_DC);
+void zend_resolve_non_class_name(znode *element_name, zend_bool *check_namespace, zend_bool case_sensitive, HashTable *current_import_sub TSRMLS_DC);
+void zend_resolve_function_name(znode *element_name, zend_bool *check_namespace TSRMLS_DC);
+void zend_resolve_const_name(znode *element_name, zend_bool *check_namespace TSRMLS_DC);
+void zend_resolve_class_name(znode *class_name TSRMLS_DC);
ZEND_API const char* zend_get_compiled_variable_name(const zend_op_array *op_array, zend_uint var, int* name_len);
#ifdef ZTS
@@ -500,7 +515,7 @@ void zend_do_add_variable(znode *result, const znode *op1, const znode *op2 TSRM
int zend_do_verify_access_types(const znode *current_access_type, const znode *new_modifier);
void zend_do_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference, znode *fn_flags_znode TSRMLS_DC);
void zend_do_end_function_declaration(const znode *function_token TSRMLS_DC);
-void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, const znode *initialization, znode *class_type, zend_bool pass_by_reference TSRMLS_DC);
+void zend_do_receive_param(zend_uchar op, znode *varname, const znode *initialization, znode *class_type, zend_bool pass_by_reference, zend_bool is_variadic TSRMLS_DC);
int zend_do_begin_function_call(znode *function_name, zend_bool check_namespace TSRMLS_DC);
void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC);
void zend_do_clone(znode *result, const znode *expr TSRMLS_DC);
@@ -508,7 +523,7 @@ void zend_do_begin_dynamic_function_call(znode *function_name, int prefix_len TS
void zend_do_fetch_class(znode *result, znode *class_name TSRMLS_DC);
void zend_do_build_full_name(znode *result, znode *prefix, znode *name, int is_class_member TSRMLS_DC);
int zend_do_begin_class_member_function_call(znode *class_name, znode *method_name TSRMLS_DC);
-void zend_do_end_function_call(znode *function_name, znode *result, const znode *argument_list, int is_method, int is_dynamic_fcall TSRMLS_DC);
+void zend_do_end_function_call(znode *function_name, znode *result, int is_method, int is_dynamic_fcall TSRMLS_DC);
void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC);
void zend_do_yield(znode *result, znode *value, const znode *key, zend_bool is_variable TSRMLS_DC);
void zend_do_handle_exception(TSRMLS_D);
@@ -544,7 +559,8 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
void zend_do_early_binding(TSRMLS_D);
ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array TSRMLS_DC);
-void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC);
+void zend_do_pass_param(znode *param, zend_uchar op TSRMLS_DC);
+void zend_do_unpack_params(znode *params TSRMLS_DC);
void zend_do_boolean_or_begin(znode *expr1, znode *op_token TSRMLS_DC);
@@ -574,7 +590,7 @@ void zend_do_pop_object(znode *object TSRMLS_DC);
void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC);
-void zend_do_end_new_object(znode *result, const znode *new_token, const znode *argument_list TSRMLS_DC);
+void zend_do_end_new_object(znode *result, const znode *new_token TSRMLS_DC);
void zend_do_fetch_constant(znode *result, znode *constant_container, znode *constant_name, int mode, zend_bool check_namespace TSRMLS_DC);
@@ -582,7 +598,7 @@ void zend_do_shell_exec(znode *result, const znode *cmd TSRMLS_DC);
void zend_do_init_array(znode *result, const znode *expr, const znode *offset, zend_bool is_ref TSRMLS_DC);
void zend_do_add_array_element(znode *result, const znode *expr, const znode *offset, zend_bool is_ref TSRMLS_DC);
-void zend_do_add_static_array_element(znode *result, znode *offset, const znode *expr);
+void zend_do_add_static_array_element(zval *result, zval *offset, const zval *expr);
void zend_do_list_init(TSRMLS_D);
void zend_do_list_end(znode *result, znode *expr TSRMLS_DC);
void zend_do_add_list_element(const znode *element TSRMLS_DC);
@@ -636,7 +652,11 @@ void zend_do_begin_namespace(const znode *name, zend_bool with_brackets TSRMLS_D
void zend_do_end_namespace(TSRMLS_D);
void zend_verify_namespace(TSRMLS_D);
void zend_do_use(znode *name, znode *new_name TSRMLS_DC);
+void zend_do_use_non_class(znode *ns_name, znode *new_name, int is_function, zend_bool case_sensitive, HashTable *current_import_sub, HashTable *lookup_table TSRMLS_DC);
+void zend_do_use_function(znode *name, znode *new_name TSRMLS_DC);
+void zend_do_use_const(znode *name, znode *new_name TSRMLS_DC);
void zend_do_end_compilation(TSRMLS_D);
+void zend_do_constant_expression(znode *result, zend_ast *ast TSRMLS_DC);
void zend_do_resolve_class_name(znode *result, znode *class_name, int is_static TSRMLS_DC);
@@ -676,7 +696,7 @@ void zend_class_add_ref(zend_class_entry **ce);
ZEND_API void zend_mangle_property_name(char **dest, int *dest_length, const char *src1, int src1_length, const char *src2, int src2_length, int internal);
#define zend_unmangle_property_name(mangled_property, mangled_property_len, class_name, prop_name) \
- zend_unmangle_property_name_ex(mangled_property, mangled_property_len, class_name, prop_name, NULL)
+ zend_unmangle_property_name_ex(mangled_property, mangled_property_len, class_name, prop_name, NULL)
ZEND_API int zend_unmangle_property_name_ex(const char *mangled_property, int mangled_property_len, const char **class_name, const char **prop_name, int *prop_len);
#define ZEND_FUNCTION_DTOR (void (*)(void *)) zend_function_dtor
@@ -728,8 +748,8 @@ int zend_add_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC);
#define ZEND_FETCH_CLASS_DEFAULT 0
#define ZEND_FETCH_CLASS_SELF 1
#define ZEND_FETCH_CLASS_PARENT 2
-#define ZEND_FETCH_CLASS_MAIN 3
-#define ZEND_FETCH_CLASS_GLOBAL 4
+#define ZEND_FETCH_CLASS_MAIN 3 /* unused */
+#define ZEND_FETCH_CLASS_GLOBAL 4 /* unused */
#define ZEND_FETCH_CLASS_AUTO 5
#define ZEND_FETCH_CLASS_INTERFACE 6
#define ZEND_FETCH_CLASS_STATIC 7
@@ -819,21 +839,21 @@ int zend_add_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC);
#define ZEND_SEND_BY_REF 1
#define ZEND_SEND_PREFER_REF 2
-#define CHECK_ARG_SEND_TYPE(zf, arg_num, m1, m2) \
- ((zf) && \
- ((((zend_function*)(zf))->common.arg_info && \
- arg_num <= ((zend_function*)(zf))->common.num_args) ? \
- (((zend_function *)(zf))->common.arg_info[arg_num-1].pass_by_reference & (m1)) : \
- (((zend_function *)(zf))->common.fn_flags & (m2))))
+#define CHECK_ARG_SEND_TYPE(zf, arg_num, m) \
+ ((zf)->common.arg_info && \
+ (arg_num <= (zf)->common.num_args \
+ ? ((zf)->common.arg_info[arg_num-1].pass_by_reference & (m)) \
+ : ((zf)->common.fn_flags & ZEND_ACC_VARIADIC) \
+ ? ((zf)->common.arg_info[(zf)->common.num_args-1].pass_by_reference & (m)) : 0))
#define ARG_MUST_BE_SENT_BY_REF(zf, arg_num) \
- CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_BY_REF, ZEND_ACC_PASS_REST_BY_REFERENCE)
+ CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_BY_REF)
#define ARG_SHOULD_BE_SENT_BY_REF(zf, arg_num) \
- CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_BY_REF|ZEND_SEND_PREFER_REF, ZEND_ACC_PASS_REST_BY_REFERENCE|ZEND_ACC_PASS_REST_PREFER_REF)
+ CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_BY_REF|ZEND_SEND_PREFER_REF)
#define ARG_MAY_BE_SENT_BY_REF(zf, arg_num) \
- CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_PREFER_REF, ZEND_ACC_PASS_REST_PREFER_REF)
+ CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_PREFER_REF)
#define ZEND_RETURN_VAL 0
#define ZEND_RETURN_REF 1
@@ -841,6 +861,7 @@ int zend_add_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC);
#define ZEND_RETURNS_FUNCTION 1<<0
#define ZEND_RETURNS_NEW 1<<1
+#define ZEND_RETURNS_VALUE 1<<2
#define ZEND_FAST_RET_TO_CATCH 1
#define ZEND_FAST_RET_TO_FINALLY 2
@@ -862,6 +883,7 @@ END_EXTERN_C()
#define ZEND_TOSTRING_FUNC_NAME "__tostring"
#define ZEND_AUTOLOAD_FUNC_NAME "__autoload"
#define ZEND_INVOKE_FUNC_NAME "__invoke"
+#define ZEND_DEBUGINFO_FUNC_NAME "__debuginfo"
/* The following constants may be combined in CG(compiler_options)
* to change the default compiler behavior */
diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c
index 1e556678a3..3feb02115a 100644
--- a/Zend/zend_constants.c
+++ b/Zend/zend_constants.c
@@ -25,7 +25,7 @@
#include "zend_variables.h"
#include "zend_operators.h"
#include "zend_globals.h"
-
+#include "zend_API.h"
void free_zend_constant(zend_constant *c)
{
@@ -38,9 +38,7 @@ void free_zend_constant(zend_constant *c)
void copy_zend_constant(zend_constant *c)
{
- if (!IS_INTERNED(c->name)) {
- c->name = zend_strndup(c->name, c->name_len - 1);
- }
+ c->name = str_strndup(c->name, c->name_len - 1);
if (!(c->flags & CONST_PERSISTENT)) {
zval_copy_ctor(&c->value);
}
@@ -119,42 +117,12 @@ void zend_register_standard_constants(TSRMLS_D)
REGISTER_MAIN_LONG_CONSTANT("DEBUG_BACKTRACE_IGNORE_ARGS", DEBUG_BACKTRACE_IGNORE_ARGS, CONST_PERSISTENT | CONST_CS);
/* true/false constants */
{
- zend_constant c;
-
- c.flags = CONST_PERSISTENT | CONST_CT_SUBST;
- c.module_number = 0;
-
- c.name = zend_strndup(ZEND_STRL("TRUE"));
- c.name_len = sizeof("TRUE");
- c.value.value.lval = 1;
- c.value.type = IS_BOOL;
- zend_register_constant(&c TSRMLS_CC);
-
- c.name = zend_strndup(ZEND_STRL("FALSE"));
- c.name_len = sizeof("FALSE");
- c.value.value.lval = 0;
- c.value.type = IS_BOOL;
- zend_register_constant(&c TSRMLS_CC);
-
- c.name = zend_strndup(ZEND_STRL("NULL"));
- c.name_len = sizeof("NULL");
- c.value.type = IS_NULL;
- zend_register_constant(&c TSRMLS_CC);
-
- c.flags = CONST_PERSISTENT | CONST_CS;
-
- c.name = zend_strndup(ZEND_STRL("ZEND_THREAD_SAFE"));
- c.name_len = sizeof("ZEND_THREAD_SAFE");
- c.value.value.lval = ZTS_V;
- c.value.type = IS_BOOL;
- zend_register_constant(&c TSRMLS_CC);
-
- c.name = zend_strndup(ZEND_STRL("ZEND_DEBUG_BUILD"));
- c.name_len = sizeof("ZEND_DEBUG_BUILD");
- c.value.value.lval = ZEND_DEBUG;
- c.value.type = IS_BOOL;
- zend_register_constant(&c TSRMLS_CC);
+ REGISTER_MAIN_BOOL_CONSTANT("TRUE", 1, CONST_PERSISTENT | CONST_CT_SUBST);
+ REGISTER_MAIN_BOOL_CONSTANT("FALSE", 0, CONST_PERSISTENT | CONST_CT_SUBST);
+ REGISTER_MAIN_BOOL_CONSTANT("ZEND_THREAD_SAFE", ZTS_V, CONST_PERSISTENT | CONST_CS);
+ REGISTER_MAIN_BOOL_CONSTANT("ZEND_DEBUG_BUILD", ZEND_DEBUG, CONST_PERSISTENT | CONST_CS);
}
+ REGISTER_MAIN_NULL_CONSTANT("NULL", CONST_PERSISTENT | CONST_CT_SUBST);
}
@@ -175,13 +143,35 @@ void clean_non_persistent_constants(TSRMLS_D)
}
}
+ZEND_API void zend_register_null_constant(const char *name, uint name_len, int flags, int module_number TSRMLS_DC)
+{
+ zend_constant c;
+
+ ZVAL_NULL(&c.value);
+ c.flags = flags;
+ c.name = zend_strndup(name, name_len-1);
+ c.name_len = name_len;
+ c.module_number = module_number;
+ zend_register_constant(&c TSRMLS_CC);
+}
+
+ZEND_API void zend_register_bool_constant(const char *name, uint name_len, zend_bool bval, int flags, int module_number TSRMLS_DC)
+{
+ zend_constant c;
+
+ ZVAL_BOOL(&c.value, bval);
+ c.flags = flags;
+ c.name = zend_strndup(name, name_len-1);
+ c.name_len = name_len;
+ c.module_number = module_number;
+ zend_register_constant(&c TSRMLS_CC);
+}
ZEND_API void zend_register_long_constant(const char *name, uint name_len, long lval, int flags, int module_number TSRMLS_DC)
{
zend_constant c;
- c.value.type = IS_LONG;
- c.value.value.lval = lval;
+ ZVAL_LONG(&c.value, lval);
c.flags = flags;
c.name = zend_strndup(name, name_len-1);
c.name_len = name_len;
@@ -194,8 +184,7 @@ ZEND_API void zend_register_double_constant(const char *name, uint name_len, dou
{
zend_constant c;
- c.value.type = IS_DOUBLE;
- c.value.value.dval = dval;
+ ZVAL_DOUBLE(&c.value, dval);
c.flags = flags;
c.name = zend_strndup(name, name_len-1);
c.name_len = name_len;
@@ -208,9 +197,7 @@ ZEND_API void zend_register_stringl_constant(const char *name, uint name_len, ch
{
zend_constant c;
- c.value.type = IS_STRING;
- c.value.value.str.val = strval;
- c.value.value.str.len = strlen;
+ ZVAL_STRINGL(&c.value, strval, strlen, 0);
c.flags = flags;
c.name = zend_strndup(name, name_len-1);
c.name_len = name_len;
@@ -421,7 +408,7 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
efree(lcname);
if(found_const) {
*result = c->value;
- zval_update_constant_ex(&result, (void*)1, NULL TSRMLS_CC);
+ zval_update_constant_ex(&result, 1, NULL TSRMLS_CC);
zval_copy_ctor(result);
Z_SET_REFCOUNT_P(result, 1);
Z_UNSET_ISREF_P(result);
@@ -436,7 +423,7 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
retval = 0;
finish:
if (retval) {
- zval_update_constant_ex(ret_constant, (void*)1, ce TSRMLS_CC);
+ zval_update_constant_ex(ret_constant, 1, ce TSRMLS_CC);
*result = **ret_constant;
zval_copy_ctor(result);
INIT_PZVAL(result);
@@ -485,7 +472,7 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC)
char *lowercase_name = NULL;
char *name;
int ret = SUCCESS;
- ulong chash = 0;
+ ulong chash;
#if 0
printf("Registering constant for module %d\n", c->module_number);
@@ -497,23 +484,18 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC)
zend_str_tolower(lowercase_name, c->name_len-1);
lowercase_name = (char*)zend_new_interned_string(lowercase_name, c->name_len, 1 TSRMLS_CC);
name = lowercase_name;
- chash = IS_INTERNED(lowercase_name) ? INTERNED_HASH(lowercase_name) : 0;
} else {
char *slash = strrchr(c->name, '\\');
- if(slash) {
+ if (slash) {
lowercase_name = estrndup(c->name, c->name_len-1);
zend_str_tolower(lowercase_name, slash-c->name);
lowercase_name = (char*)zend_new_interned_string(lowercase_name, c->name_len, 1 TSRMLS_CC);
name = lowercase_name;
-
- chash = IS_INTERNED(lowercase_name) ? INTERNED_HASH(lowercase_name) : 0;
} else {
name = c->name;
}
}
- if (chash == 0) {
- chash = zend_hash_func(name, c->name_len);
- }
+ chash = str_hash(name, c->name_len-1);
/* Check if the user is trying to define the internal pseudo constant name __COMPILER_HALT_OFFSET__ */
if ((c->name_len == sizeof("__COMPILER_HALT_OFFSET__")
@@ -532,8 +514,8 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC)
}
ret = FAILURE;
}
- if (lowercase_name && !IS_INTERNED(lowercase_name)) {
- efree(lowercase_name);
+ if (lowercase_name) {
+ str_efree(lowercase_name);
}
return ret;
}
diff --git a/Zend/zend_constants.h b/Zend/zend_constants.h
index e816f77157..8e65d5d088 100644
--- a/Zend/zend_constants.h
+++ b/Zend/zend_constants.h
@@ -38,16 +38,22 @@ typedef struct _zend_constant {
int module_number;
} zend_constant;
+#define REGISTER_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name), (flags), module_number TSRMLS_CC)
+#define REGISTER_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name), (bval), (flags), module_number TSRMLS_CC)
#define REGISTER_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name), (lval), (flags), module_number TSRMLS_CC)
#define REGISTER_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name), (dval), (flags), module_number TSRMLS_CC)
#define REGISTER_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name), (str), (flags), module_number TSRMLS_CC)
#define REGISTER_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name), (str), (len), (flags), module_number TSRMLS_CC)
+#define REGISTER_NS_NULL_CONSTANT(ns, name, flags) zend_register_null_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (flags), module_number TSRMLS_CC)
+#define REGISTER_NS_BOOL_CONSTANT(ns, name, bval, flags) zend_register_bool_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (bval), (flags), module_number TSRMLS_CC)
#define REGISTER_NS_LONG_CONSTANT(ns, name, lval, flags) zend_register_long_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (lval), (flags), module_number TSRMLS_CC)
#define REGISTER_NS_DOUBLE_CONSTANT(ns, name, dval, flags) zend_register_double_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (dval), (flags), module_number TSRMLS_CC)
#define REGISTER_NS_STRING_CONSTANT(ns, name, str, flags) zend_register_string_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (str), (flags), module_number TSRMLS_CC)
#define REGISTER_NS_STRINGL_CONSTANT(ns, name, str, len, flags) zend_register_stringl_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (str), (len), (flags), module_number TSRMLS_CC)
+#define REGISTER_MAIN_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name), (flags), 0 TSRMLS_CC)
+#define REGISTER_MAIN_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name), (bval), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name), (lval), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name), (dval), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name), (str), (flags), 0 TSRMLS_CC)
@@ -62,6 +68,8 @@ void zend_register_standard_constants(TSRMLS_D);
void clean_non_persistent_constants(TSRMLS_D);
ZEND_API int zend_get_constant(const char *name, uint name_len, zval *result TSRMLS_DC);
ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result, zend_class_entry *scope, ulong flags TSRMLS_DC);
+ZEND_API void zend_register_bool_constant(const char *name, uint name_len, zend_bool bval, int flags, int module_number TSRMLS_DC);
+ZEND_API void zend_register_null_constant(const char *name, uint name_len, int flags, int module_number TSRMLS_DC);
ZEND_API void zend_register_long_constant(const char *name, uint name_len, long lval, int flags, int module_number TSRMLS_DC);
ZEND_API void zend_register_double_constant(const char *name, uint name_len, double dval, int flags, int module_number TSRMLS_DC);
ZEND_API void zend_register_string_constant(const char *name, uint name_len, char *strval, int flags, int module_number TSRMLS_DC);
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index ac00c283ea..7d21c2943b 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -40,7 +40,7 @@
#include "zend_dtrace.h"
/* Virtual current working directory support */
-#include "tsrm_virtual_cwd.h"
+#include "zend_virtual_cwd.h"
#define _CONST_CODE 0
#define _TMP_CODE 1
@@ -79,7 +79,6 @@ static zend_always_inline void zend_pzval_unlock_func(zval *z, zend_free_op *sho
if (unref && Z_ISREF_P(z) && Z_REFCOUNT_P(z) == 1) {
Z_UNSET_ISREF_P(z);
}
- GC_ZVAL_CHECK_POSSIBLE_ROOT(z);
}
}
@@ -94,7 +93,8 @@ static zend_always_inline void zend_pzval_unlock_free_func(zval *z TSRMLS_DC)
}
#undef zval_ptr_dtor
-#define zval_ptr_dtor(pzv) i_zval_ptr_dtor(*(pzv) ZEND_FILE_LINE_CC)
+#define zval_ptr_dtor(pzv) i_zval_ptr_dtor(*(pzv) ZEND_FILE_LINE_CC TSRMLS_CC)
+#define zval_ptr_dtor_nogc(pzv) i_zval_ptr_dtor_nogc(*(pzv) ZEND_FILE_LINE_CC TSRMLS_CC)
#define PZVAL_UNLOCK(z, f) zend_pzval_unlock_func(z, f, 1 TSRMLS_CC)
#define PZVAL_UNLOCK_EX(z, f, u) zend_pzval_unlock_func(z, f, u TSRMLS_CC)
@@ -102,16 +102,14 @@ static zend_always_inline void zend_pzval_unlock_free_func(zval *z TSRMLS_DC)
#define PZVAL_LOCK(z) Z_ADDREF_P((z))
#define SELECTIVE_PZVAL_LOCK(pzv, opline) if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(pzv); }
-#define EXTRACT_ZVAL_PTR(t) do { \
- temp_variable *__t = (t); \
- if (__t->var.ptr_ptr) { \
- __t->var.ptr = *__t->var.ptr_ptr; \
- __t->var.ptr_ptr = &__t->var.ptr; \
- if (!PZVAL_IS_REF(__t->var.ptr) && \
- Z_REFCOUNT_P(__t->var.ptr) > 2) { \
- SEPARATE_ZVAL(__t->var.ptr_ptr); \
- } \
- } \
+#define EXTRACT_ZVAL_PTR(t) do { \
+ temp_variable *__t = (t); \
+ __t->var.ptr = *__t->var.ptr_ptr; \
+ __t->var.ptr_ptr = &__t->var.ptr; \
+ if (!PZVAL_IS_REF(__t->var.ptr) && \
+ Z_REFCOUNT_P(__t->var.ptr) > 2) { \
+ SEPARATE_ZVAL(__t->var.ptr_ptr); \
+ } \
} while (0)
#define AI_SET_PTR(t, val) do { \
@@ -125,18 +123,18 @@ static zend_always_inline void zend_pzval_unlock_free_func(zval *z TSRMLS_DC)
if ((zend_uintptr_t)should_free.var & 1L) { \
zval_dtor((zval*)((zend_uintptr_t)should_free.var & ~1L)); \
} else { \
- zval_ptr_dtor(&should_free.var); \
+ zval_ptr_dtor_nogc(&should_free.var); \
} \
}
#define FREE_OP_IF_VAR(should_free) \
if (should_free.var != NULL && (((zend_uintptr_t)should_free.var & 1L) == 0)) { \
- zval_ptr_dtor(&should_free.var); \
+ zval_ptr_dtor_nogc(&should_free.var); \
}
#define FREE_OP_VAR_PTR(should_free) \
if (should_free.var) { \
- zval_ptr_dtor(&should_free.var); \
+ zval_ptr_dtor_nogc(&should_free.var); \
}
#define TMP_FREE(z) (zval*)(((zend_uintptr_t)(z)) | 1L)
@@ -183,8 +181,7 @@ static zend_always_inline zval *_get_zval_ptr_var(zend_uint var, const zend_exec
{
zval *ptr = EX_T(var).var.ptr;
- PZVAL_UNLOCK(ptr, should_free);
- return ptr;
+ return should_free->var = ptr;
}
static zend_never_inline zval **_get_zval_cv_lookup(zval ***ptr, zend_uint var, int type TSRMLS_DC)
@@ -386,6 +383,19 @@ static zend_always_inline zval **_get_zval_ptr_ptr_var(zend_uint var, const zend
return ptr_ptr;
}
+static zend_always_inline zval **_get_zval_ptr_ptr_var_fast(zend_uint var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC)
+{
+ zval** ptr_ptr = EX_T(var).var.ptr_ptr;
+
+ if (EXPECTED(ptr_ptr != NULL)) {
+ should_free->var = *ptr_ptr;
+ } else {
+ /* string offset */
+ should_free->var = EX_T(var).str_offset.str;
+ }
+ return ptr_ptr;
+}
+
static zend_always_inline zval **_get_zval_ptr_ptr_cv(zend_uint var, int type TSRMLS_DC)
{
zval ***ptr = EX_CV_NUM(EG(current_execute_data), var);
@@ -598,18 +608,38 @@ ZEND_API int zend_verify_arg_error(int error_type, const zend_function *zf, zend
return 0;
}
-static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zval *arg, ulong fetch_type TSRMLS_DC)
+static int is_null_constant(zval *default_value TSRMLS_DC)
+{
+ if (IS_CONSTANT_TYPE(Z_TYPE_P(default_value))) {
+ zval constant = *default_value;
+ zval *constant_ptr = &constant;
+
+ zval_update_constant(&constant_ptr, 0 TSRMLS_CC);
+ if (Z_TYPE(constant) == IS_NULL) {
+ return 1;
+ }
+ zval_dtor(&constant);
+ }
+ return 0;
+}
+
+static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zval *arg, ulong fetch_type, zval *default_value TSRMLS_DC)
{
zend_arg_info *cur_arg_info;
char *need_msg;
zend_class_entry *ce;
- if (!zf->common.arg_info
- || arg_num>zf->common.num_args) {
+ if (!zf->common.arg_info) {
return 1;
}
- cur_arg_info = &zf->common.arg_info[arg_num-1];
+ if (arg_num <= zf->common.num_args) {
+ cur_arg_info = &zf->common.arg_info[arg_num-1];
+ } else if (zf->common.fn_flags & ZEND_ACC_VARIADIC) {
+ cur_arg_info = &zf->common.arg_info[zf->common.num_args-1];
+ } else {
+ return 1;
+ }
if (cur_arg_info->class_name) {
const char *class_name;
@@ -623,7 +653,7 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva
if (!ce || !instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC)) {
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, "instance of ", Z_OBJCE_P(arg)->name TSRMLS_CC);
}
- } else if (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null) {
+ } else if (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC)))) {
need_msg = zend_verify_arg_class_kind(cur_arg_info, fetch_type, &class_name, &ce TSRMLS_CC);
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, zend_zval_type_name(arg), "" TSRMLS_CC);
}
@@ -634,7 +664,7 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", "none", "" TSRMLS_CC);
}
- if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
+ if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC))))) {
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", zend_zval_type_name(arg), "" TSRMLS_CC);
}
break;
@@ -643,7 +673,7 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva
if (!arg) {
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", "none", "" TSRMLS_CC);
}
- if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL TSRMLS_CC) && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
+ if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL TSRMLS_CC) && (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC))))) {
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", zend_zval_type_name(arg), "" TSRMLS_CC);
}
break;
@@ -755,32 +785,21 @@ static inline void zend_assign_to_object(zval **retval, zval **object_ptr, zval
static inline int zend_assign_to_string_offset(const temp_variable *T, const zval *value, int value_type TSRMLS_DC)
{
- if (Z_TYPE_P(T->str_offset.str) == IS_STRING) {
-
- if (((int)T->str_offset.offset < 0)) {
- zend_error(E_WARNING, "Illegal string offset: %d", T->str_offset.offset);
+ zval *str = T->str_offset.str;
+ zend_uint offset = T->str_offset.offset;
+ if (Z_TYPE_P(str) == IS_STRING) {
+ if ((int)offset < 0) {
+ zend_error(E_WARNING, "Illegal string offset: %d", offset);
return 0;
}
- if (T->str_offset.offset >= Z_STRLEN_P(T->str_offset.str)) {
- if (IS_INTERNED(Z_STRVAL_P(T->str_offset.str))) {
- char *tmp = (char *) emalloc(T->str_offset.offset+1+1);
-
- memcpy(tmp, Z_STRVAL_P(T->str_offset.str), Z_STRLEN_P(T->str_offset.str)+1);
- Z_STRVAL_P(T->str_offset.str) = tmp;
- } else {
- Z_STRVAL_P(T->str_offset.str) = (char *) erealloc(Z_STRVAL_P(T->str_offset.str), T->str_offset.offset+1+1);
- }
- memset(Z_STRVAL_P(T->str_offset.str) + Z_STRLEN_P(T->str_offset.str),
- ' ',
- T->str_offset.offset - Z_STRLEN_P(T->str_offset.str));
- Z_STRVAL_P(T->str_offset.str)[T->str_offset.offset+1] = 0;
- Z_STRLEN_P(T->str_offset.str) = T->str_offset.offset+1;
- } else if (IS_INTERNED(Z_STRVAL_P(T->str_offset.str))) {
- char *tmp = (char *) emalloc(Z_STRLEN_P(T->str_offset.str) + 1);
-
- memcpy(tmp, Z_STRVAL_P(T->str_offset.str), Z_STRLEN_P(T->str_offset.str) + 1);
- Z_STRVAL_P(T->str_offset.str) = tmp;
+ if (offset >= Z_STRLEN_P(str)) {
+ Z_STRVAL_P(str) = str_erealloc(Z_STRVAL_P(str), offset+1+1);
+ memset(Z_STRVAL_P(str) + Z_STRLEN_P(str), ' ', offset - Z_STRLEN_P(str));
+ Z_STRVAL_P(str)[offset+1] = 0;
+ Z_STRLEN_P(str) = offset+1;
+ } else if (IS_INTERNED(Z_STRVAL_P(str))) {
+ Z_STRVAL_P(str) = estrndup(Z_STRVAL_P(str), Z_STRLEN_P(str));
}
if (Z_TYPE_P(value) != IS_STRING) {
@@ -791,15 +810,15 @@ static inline int zend_assign_to_string_offset(const temp_variable *T, const zva
zval_copy_ctor(&tmp);
}
convert_to_string(&tmp);
- Z_STRVAL_P(T->str_offset.str)[T->str_offset.offset] = Z_STRVAL(tmp)[0];
- STR_FREE(Z_STRVAL(tmp));
+ Z_STRVAL_P(str)[offset] = Z_STRVAL(tmp)[0];
+ str_efree(Z_STRVAL(tmp));
} else {
- Z_STRVAL_P(T->str_offset.str)[T->str_offset.offset] = Z_STRVAL_P(value)[0];
+ Z_STRVAL_P(str)[offset] = Z_STRVAL_P(value)[0];
if (value_type == IS_TMP_VAR) {
/* we can safely free final_value here
* because separation is done only
* in case value_type == IS_VAR */
- STR_FREE(Z_STRVAL_P(value));
+ str_efree(Z_STRVAL_P(value));
}
}
/*
@@ -909,7 +928,7 @@ static inline zval* zend_assign_to_variable(zval **variable_ptr_ptr, zval *value
} else { /* we need to split */
Z_DELREF_P(variable_ptr);
GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr);
- if (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) {
+ if (PZVAL_IS_REF(value)) {
ALLOC_ZVAL(variable_ptr);
*variable_ptr_ptr = variable_ptr;
INIT_PZVAL_COPY(variable_ptr, value);
@@ -918,7 +937,6 @@ static inline zval* zend_assign_to_variable(zval **variable_ptr_ptr, zval *value
} else {
*variable_ptr_ptr = value;
Z_ADDREF_P(value);
- Z_UNSET_ISREF_P(value);
return value;
}
}
@@ -940,6 +958,26 @@ copy_value:
}
}
+static void zval_deep_copy(zval **p)
+{
+ zval *value;
+
+ ALLOC_ZVAL(value);
+ *value = **p;
+ if (Z_TYPE_P(value) == IS_ARRAY) {
+ HashTable *ht;
+
+ ALLOC_HASHTABLE(ht);
+ zend_hash_init(ht, zend_hash_num_elements(Z_ARRVAL_P(value)), NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_copy(ht, Z_ARRVAL_P(value), (copy_ctor_func_t) zval_deep_copy, NULL, sizeof(zval *));
+ Z_ARRVAL_P(value) = ht;
+ } else {
+ zval_copy_ctor(value);
+ }
+ INIT_PZVAL(value);
+ *p = value;
+}
+
/* Utility Functions for Extensions */
static void zend_extension_statement_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
{
@@ -1013,11 +1051,7 @@ static inline zval **zend_fetch_dimension_address_inner(HashTable *ht, const zva
hval = Z_HASH_P(dim);
} else {
ZEND_HANDLE_NUMERIC_EX(offset_key, offset_key_length+1, hval, goto num_index);
- if (IS_INTERNED(offset_key)) {
- hval = INTERNED_HASH(offset_key);
- } else {
- hval = zend_hash_func(offset_key, offset_key_length+1);
- }
+ hval = str_hash(offset_key, offset_key_length);
}
fetch_string_dim:
if (zend_hash_quick_find(ht, offset_key, offset_key_length+1, hval, (void **) &retval) == FAILURE) {
@@ -1214,12 +1248,12 @@ convert_to_array:
zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ce->name);
}
}
- retval = &overloaded_result;
+ AI_SET_PTR(result, overloaded_result);
+ PZVAL_LOCK(overloaded_result);
} else {
- retval = &EG(error_zval_ptr);
+ result->var.ptr_ptr = &EG(error_zval_ptr);
+ PZVAL_LOCK(EG(error_zval_ptr));
}
- AI_SET_PTR(result, *retval);
- PZVAL_LOCK(*retval);
if (dim_type == IS_TMP_VAR) {
zval_ptr_dtor(&dim);
}
@@ -1236,8 +1270,8 @@ convert_to_array:
default:
if (type == BP_VAR_UNSET) {
zend_error(E_WARNING, "Cannot unset offset in a non-array variable");
- AI_SET_PTR(result, &EG(uninitialized_zval));
- PZVAL_LOCK(&EG(uninitialized_zval));
+ result->var.ptr_ptr = &EG(uninitialized_zval_ptr);
+ PZVAL_LOCK(EG(uninitialized_zval_ptr));
} else {
zend_error(E_WARNING, "Cannot use a scalar value as an array");
result->var.ptr_ptr = &EG(error_zval_ptr);
@@ -1255,12 +1289,12 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval *conta
case IS_ARRAY:
retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, dim_type, type TSRMLS_CC);
- AI_SET_PTR(result, *retval);
+ result->var.ptr = *retval;
PZVAL_LOCK(*retval);
return;
case IS_NULL:
- AI_SET_PTR(result, &EG(uninitialized_zval));
+ result->var.ptr = &EG(uninitialized_zval);
PZVAL_LOCK(&EG(uninitialized_zval));
return;
@@ -1313,7 +1347,7 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval *conta
Z_STRVAL_P(ptr)[1] = 0;
Z_STRLEN_P(ptr) = 1;
}
- AI_SET_PTR(result, ptr);
+ result->var.ptr = ptr;
return;
}
break;
@@ -1331,12 +1365,14 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval *conta
}
overloaded_result = Z_OBJ_HT_P(container)->read_dimension(container, dim, type TSRMLS_CC);
- if (overloaded_result) {
- AI_SET_PTR(result, overloaded_result);
- PZVAL_LOCK(overloaded_result);
- } else if (result) {
- AI_SET_PTR(result, &EG(uninitialized_zval));
- PZVAL_LOCK(&EG(uninitialized_zval));
+ if (result) {
+ if (overloaded_result) {
+ result->var.ptr = overloaded_result;
+ PZVAL_LOCK(overloaded_result);
+ } else {
+ result->var.ptr = &EG(uninitialized_zval);
+ PZVAL_LOCK(&EG(uninitialized_zval));
+ }
}
if (dim_type == IS_TMP_VAR) {
zval_ptr_dtor(&dim);
@@ -1345,15 +1381,21 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval *conta
return;
default:
- AI_SET_PTR(result, &EG(uninitialized_zval));
+ result->var.ptr = &EG(uninitialized_zval);
PZVAL_LOCK(&EG(uninitialized_zval));
return;
}
}
+ZEND_API void zend_fetch_dimension_by_zval(zval **result, zval *container, zval *dim TSRMLS_DC) {
+ temp_variable tmp;
+ zend_fetch_dimension_address_read(&tmp, container, dim, IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
+ *result = tmp.var.ptr;
+}
+
static void zend_fetch_property_address(temp_variable *result, zval **container_ptr, zval *prop_ptr, const zend_literal *key, int type TSRMLS_DC)
{
- zval *container = *container_ptr;;
+ zval *container = *container_ptr;
if (Z_TYPE_P(container) != IS_OBJECT) {
if (container == &EG(error_zval)) {
@@ -1475,15 +1517,18 @@ ZEND_API opcode_handler_t *zend_opcode_handlers;
ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, zend_fcall_info *fci, int return_value_used TSRMLS_DC)
{
- if(fci != NULL) {
- ((zend_internal_function *) execute_data_ptr->function_state.function)->handler(fci->param_count,
- *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC);
-
+ if (fci != NULL) {
+ execute_data_ptr->function_state.function->internal_function.handler(
+ fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr,
+ fci->object_ptr, 1 TSRMLS_CC
+ );
} else {
zval **return_value_ptr = &EX_TMP_VAR(execute_data_ptr, execute_data_ptr->opline->result.var)->var.ptr;
- ((zend_internal_function *) execute_data_ptr->function_state.function)->handler(execute_data_ptr->opline->extended_value, *return_value_ptr,
- (execute_data_ptr->function_state.function->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)?return_value_ptr:NULL,
- execute_data_ptr->object, return_value_used TSRMLS_CC);
+ execute_data_ptr->function_state.function->internal_function.handler(
+ execute_data_ptr->opline->extended_value + execute_data_ptr->call->num_additional_args,
+ *return_value_ptr, return_value_ptr,
+ execute_data_ptr->object, return_value_used TSRMLS_CC
+ );
}
}
@@ -1501,7 +1546,7 @@ void zend_clean_and_cache_symbol_table(HashTable *symbol_table TSRMLS_DC) /* {{{
}
/* }}} */
-static zend_always_inline void i_free_compiled_variables(zend_execute_data *execute_data) /* {{{ */
+static zend_always_inline void i_free_compiled_variables(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */
{
zval ***cv = EX_CV_NUM(execute_data, 0);
zval ***end = cv + EX(op_array)->last_var;
@@ -1514,9 +1559,9 @@ static zend_always_inline void i_free_compiled_variables(zend_execute_data *exec
}
/* }}} */
-void zend_free_compiled_variables(zend_execute_data *execute_data) /* {{{ */
+void zend_free_compiled_variables(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */
{
- i_free_compiled_variables(execute_data);
+ i_free_compiled_variables(execute_data TSRMLS_CC);
}
/* }}} */
@@ -1647,6 +1692,7 @@ static zend_always_inline zend_execute_data *i_create_execute_data_from_op_array
EX(call) = NULL;
EG(current_execute_data) = execute_data;
EX(nested) = nested;
+ EX(delayed_exception) = NULL;
if (!op_array->run_time_cache && op_array->last_cache_slot) {
op_array->run_time_cache = ecalloc(op_array->last_cache_slot, sizeof(void*));
@@ -1674,12 +1720,55 @@ static zend_always_inline zend_execute_data *i_create_execute_data_from_op_array
}
/* }}} */
-zend_execute_data *zend_create_execute_data_from_op_array(zend_op_array *op_array, zend_bool nested TSRMLS_DC) /* {{{ */
+ZEND_API zend_execute_data *zend_create_execute_data_from_op_array(zend_op_array *op_array, zend_bool nested TSRMLS_DC) /* {{{ */
{
return i_create_execute_data_from_op_array(op_array, nested TSRMLS_CC);
}
/* }}} */
+static zend_always_inline zend_bool zend_is_by_ref_func_arg_fetch(zend_op *opline, call_slot *call TSRMLS_DC) /* {{{ */
+{
+ zend_uint arg_num = opline->extended_value & ZEND_FETCH_ARG_MASK;
+ return ARG_SHOULD_BE_SENT_BY_REF(call->fbc, arg_num);
+}
+/* }}} */
+
+static void **zend_vm_stack_push_args_with_copy(int count TSRMLS_DC) /* {{{ */
+{
+ zend_vm_stack p = EG(argument_stack);
+
+ zend_vm_stack_extend(count + 1 TSRMLS_CC);
+
+ EG(argument_stack)->top += count;
+ *(EG(argument_stack)->top) = (void*)(zend_uintptr_t)count;
+ while (count-- > 0) {
+ void *data = *(--p->top);
+
+ if (UNEXPECTED(p->top == ZEND_VM_STACK_ELEMETS(p))) {
+ zend_vm_stack r = p;
+
+ EG(argument_stack)->prev = p->prev;
+ p = p->prev;
+ efree(r);
+ }
+ *(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) + count) = data;
+ }
+ return EG(argument_stack)->top++;
+}
+/* }}} */
+
+static zend_always_inline void** zend_vm_stack_push_args(int count TSRMLS_DC) /* {{{ */
+{
+ if (UNEXPECTED(EG(argument_stack)->top - ZEND_VM_STACK_ELEMETS(EG(argument_stack)) < count)
+ || UNEXPECTED(EG(argument_stack)->top == EG(argument_stack)->end)) {
+ return zend_vm_stack_push_args_with_copy(count TSRMLS_CC);
+ }
+ *(EG(argument_stack)->top) = (void*)(zend_uintptr_t)count;
+ return EG(argument_stack)->top++;
+}
+/* }}} */
+
+
#define ZEND_VM_NEXT_OPCODE() \
CHECK_SYMBOL_TABLES() \
ZEND_VM_INC_OPCODE(); \
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h
index 707739d5f5..b82b55af2f 100644
--- a/Zend/zend_execute.h
+++ b/Zend/zend_execute.h
@@ -56,7 +56,7 @@ ZEND_API extern void (*zend_execute_internal)(zend_execute_data *execute_data_pt
void init_executor(TSRMLS_D);
void shutdown_executor(TSRMLS_D);
void shutdown_destructors(TSRMLS_D);
-zend_execute_data *zend_create_execute_data_from_op_array(zend_op_array *op_array, zend_bool nested TSRMLS_DC);
+ZEND_API zend_execute_data *zend_create_execute_data_from_op_array(zend_op_array *op_array, zend_bool nested TSRMLS_DC);
ZEND_API void zend_execute(zend_op_array *op_array TSRMLS_DC);
ZEND_API void execute_ex(zend_execute_data *execute_data TSRMLS_DC);
ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, struct _zend_fcall_info *fci, int return_value_used TSRMLS_DC);
@@ -71,18 +71,14 @@ ZEND_API int zend_eval_stringl_ex(char *str, int str_len, zval *retval_ptr, char
ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, ulong fetch_type, const char **class_name, zend_class_entry **pce TSRMLS_DC);
ZEND_API int zend_verify_arg_error(int error_type, const zend_function *zf, zend_uint arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind TSRMLS_DC);
-static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC)
+static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC TSRMLS_DC)
{
if (!Z_DELREF_P(zval_ptr)) {
- TSRMLS_FETCH();
-
ZEND_ASSERT(zval_ptr != &EG(uninitialized_zval));
GC_REMOVE_ZVAL_FROM_BUFFER(zval_ptr);
zval_dtor(zval_ptr);
efree_rel(zval_ptr);
} else {
- TSRMLS_FETCH();
-
if (Z_REFCOUNT_P(zval_ptr) == 1) {
Z_UNSET_ISREF_P(zval_ptr);
}
@@ -91,6 +87,20 @@ static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC)
}
}
+static zend_always_inline void i_zval_ptr_dtor_nogc(zval *zval_ptr ZEND_FILE_LINE_DC TSRMLS_DC)
+{
+ if (!Z_DELREF_P(zval_ptr)) {
+ ZEND_ASSERT(zval_ptr != &EG(uninitialized_zval));
+ GC_REMOVE_ZVAL_FROM_BUFFER(zval_ptr);
+ zval_dtor(zval_ptr);
+ efree_rel(zval_ptr);
+ } else {
+ if (Z_REFCOUNT_P(zval_ptr) == 1) {
+ Z_UNSET_ISREF_P(zval_ptr);
+ }
+ }
+}
+
static zend_always_inline int i_zend_is_true(zval *op)
{
int result;
@@ -148,10 +158,10 @@ static zend_always_inline int i_zend_is_true(zval *op)
return result;
}
-ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC);
-ZEND_API int zval_update_constant_inline_change(zval **pp, void *arg TSRMLS_DC);
-ZEND_API int zval_update_constant_no_inline_change(zval **pp, void *arg TSRMLS_DC);
-ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *scope TSRMLS_DC);
+ZEND_API int zval_update_constant(zval **pp, zend_bool inline_change TSRMLS_DC);
+ZEND_API int zval_update_constant_inline_change(zval **pp, zend_class_entry *scope TSRMLS_DC);
+ZEND_API int zval_update_constant_no_inline_change(zval **pp, zend_class_entry *scope TSRMLS_DC);
+ZEND_API int zval_update_constant_ex(zval **pp, zend_bool inline_change, zend_class_entry *scope TSRMLS_DC);
/* dedicated Zend executor functions - do not use! */
#define ZEND_VM_STACK_PAGE_SIZE ((16 * 1024) - 16)
@@ -295,7 +305,7 @@ static zend_always_inline void zend_vm_stack_clear_multiple(int nested TSRMLS_DC
while (p != end) {
zval *q = (zval *) *(--p);
*p = NULL;
- i_zval_ptr_dtor(q ZEND_FILE_LINE_CC);
+ i_zval_ptr_dtor(q ZEND_FILE_LINE_CC TSRMLS_CC);
}
if (nested) {
EG(argument_stack)->top = p;
@@ -352,6 +362,8 @@ ZEND_API zend_class_entry *zend_fetch_class(const char *class_name, uint class_n
ZEND_API zend_class_entry *zend_fetch_class_by_name(const char *class_name, uint class_name_len, const zend_literal *key, int fetch_type TSRMLS_DC);
void zend_verify_abstract_class(zend_class_entry *ce TSRMLS_DC);
+ZEND_API void zend_fetch_dimension_by_zval(zval **result, zval *container, zval *dim TSRMLS_DC);
+
#define zendi_zval_copy_ctor(p) zval_copy_ctor(&(p))
#define zendi_zval_dtor(p) zval_dtor(&(p))
@@ -387,7 +399,7 @@ ZEND_API zval **zend_get_zval_ptr_ptr(int op_type, const znode_op *node, const z
ZEND_API int zend_do_fcall(ZEND_OPCODE_HANDLER_ARGS);
void zend_clean_and_cache_symbol_table(HashTable *symbol_table TSRMLS_DC);
-void zend_free_compiled_variables(zend_execute_data *execute_data);
+void zend_free_compiled_variables(zend_execute_data *execute_data TSRMLS_DC);
#define CACHED_PTR(num) \
EG(active_op_array)->run_time_cache[(num)]
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index f3045c7b2c..a230b9c270 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -420,7 +420,8 @@ ZEND_API zend_bool zend_is_executing(TSRMLS_D) /* {{{ */
ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC) /* {{{ */
{
- i_zval_ptr_dtor(*zval_ptr ZEND_FILE_LINE_RELAY_CC);
+ TSRMLS_FETCH();
+ i_zval_ptr_dtor(*zval_ptr ZEND_FILE_LINE_RELAY_CC TSRMLS_CC);
}
/* }}} */
@@ -445,28 +446,14 @@ ZEND_API int zend_is_true(zval *op) /* {{{ */
}
/* }}} */
-#define IS_VISITED_CONSTANT IS_CONSTANT_INDEX
+#define IS_VISITED_CONSTANT 0x80
#define IS_CONSTANT_VISITED(p) (Z_TYPE_P(p) & IS_VISITED_CONSTANT)
#define Z_REAL_TYPE_P(p) (Z_TYPE_P(p) & ~IS_VISITED_CONSTANT)
#define MARK_CONSTANT_VISITED(p) Z_TYPE_P(p) |= IS_VISITED_CONSTANT
-static void zval_deep_copy(zval **p)
-{
- zval *value;
-
- ALLOC_ZVAL(value);
- *value = **p;
- Z_TYPE_P(value) &= ~IS_CONSTANT_INDEX;
- zval_copy_ctor(value);
- Z_TYPE_P(value) = Z_TYPE_PP(p);
- INIT_PZVAL(value);
- *p = value;
-}
-
-ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *scope TSRMLS_DC) /* {{{ */
+ZEND_API int zval_update_constant_ex(zval **pp, zend_bool inline_change, zend_class_entry *scope TSRMLS_DC) /* {{{ */
{
zval *p = *pp;
- zend_bool inline_change = (zend_bool) (zend_uintptr_t) arg;
zval const_value;
char *colon;
@@ -528,13 +515,13 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco
if (fix_save) {
save--;
}
- if (inline_change && !IS_INTERNED(save)) {
- efree(save);
+ if (inline_change) {
+ str_efree(save);
}
save = NULL;
}
- if (inline_change && save && save != actual && !IS_INTERNED(save)) {
- efree(save);
+ if (inline_change && save && save != actual) {
+ str_efree(save);
}
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", actual, actual);
p->type = IS_STRING;
@@ -546,134 +533,42 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco
}
} else {
if (inline_change) {
- STR_FREE(Z_STRVAL_P(p));
+ str_efree(Z_STRVAL_P(p));
}
*p = const_value;
}
Z_SET_REFCOUNT_P(p, refcount);
Z_SET_ISREF_TO_P(p, is_ref);
- } else if (Z_TYPE_P(p) == IS_CONSTANT_ARRAY) {
- zval **element, *new_val;
- char *str_index;
- uint str_index_len;
- ulong num_index;
- int ret;
-
+ } else if (Z_TYPE_P(p) == IS_CONSTANT_AST) {
SEPARATE_ZVAL_IF_NOT_REF(pp);
p = *pp;
- Z_TYPE_P(p) = IS_ARRAY;
-
- if (!inline_change) {
- zval *tmp;
- HashTable *tmp_ht = NULL;
-
- ALLOC_HASHTABLE(tmp_ht);
- zend_hash_init(tmp_ht, zend_hash_num_elements(Z_ARRVAL_P(p)), NULL, ZVAL_PTR_DTOR, 0);
- zend_hash_copy(tmp_ht, Z_ARRVAL_P(p), (copy_ctor_func_t) zval_deep_copy, (void *) &tmp, sizeof(zval *));
- Z_ARRVAL_P(p) = tmp_ht;
- }
-
- /* First go over the array and see if there are any constant indices */
- zend_hash_internal_pointer_reset(Z_ARRVAL_P(p));
- while (zend_hash_get_current_data(Z_ARRVAL_P(p), (void **) &element) == SUCCESS) {
- if (!(Z_TYPE_PP(element) & IS_CONSTANT_INDEX)) {
- zend_hash_move_forward(Z_ARRVAL_P(p));
- continue;
- }
- Z_TYPE_PP(element) &= ~IS_CONSTANT_INDEX;
- if (zend_hash_get_current_key_ex(Z_ARRVAL_P(p), &str_index, &str_index_len, &num_index, 0, NULL) != HASH_KEY_IS_STRING) {
- zend_hash_move_forward(Z_ARRVAL_P(p));
- continue;
- }
- if (!zend_get_constant_ex(str_index, str_index_len - 3, &const_value, scope, str_index[str_index_len - 2] TSRMLS_CC)) {
- char *actual;
- const char *save = str_index;
- if ((colon = (char*)zend_memrchr(str_index, ':', str_index_len - 3))) {
- zend_error(E_ERROR, "Undefined class constant '%s'", str_index);
- str_index_len -= ((colon - str_index) + 1);
- str_index = colon;
- } else {
- if (str_index[str_index_len - 2] & IS_CONSTANT_UNQUALIFIED) {
- if ((actual = (char *)zend_memrchr(str_index, '\\', str_index_len - 3))) {
- actual++;
- str_index_len -= (actual - str_index);
- str_index = actual;
- }
- }
- if (str_index[0] == '\\') {
- ++str_index;
- --str_index_len;
- }
- if (save[0] == '\\') {
- ++save;
- }
- if ((str_index[str_index_len - 2] & IS_CONSTANT_UNQUALIFIED) == 0) {
- zend_error(E_ERROR, "Undefined constant '%s'", save);
- }
- zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", str_index, str_index);
- }
- ZVAL_STRINGL(&const_value, str_index, str_index_len-3, 1);
- }
-
- if (Z_REFCOUNT_PP(element) > 1) {
- ALLOC_ZVAL(new_val);
- *new_val = **element;
- zval_copy_ctor(new_val);
- Z_SET_REFCOUNT_P(new_val, 1);
- Z_UNSET_ISREF_P(new_val);
-
- /* preserve this bit for inheritance */
- Z_TYPE_PP(element) |= IS_CONSTANT_INDEX;
- zval_ptr_dtor(element);
- *element = new_val;
- }
- switch (Z_TYPE(const_value)) {
- case IS_STRING:
- ret = zend_symtable_update_current_key(Z_ARRVAL_P(p), Z_STRVAL(const_value), Z_STRLEN(const_value) + 1, HASH_UPDATE_KEY_IF_BEFORE);
- break;
- case IS_BOOL:
- case IS_LONG:
- ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_LONG, NULL, 0, Z_LVAL(const_value), HASH_UPDATE_KEY_IF_BEFORE, NULL);
- break;
- case IS_DOUBLE:
- ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_LONG, NULL, 0, zend_dval_to_lval(Z_DVAL(const_value)), HASH_UPDATE_KEY_IF_BEFORE, NULL);
- break;
- case IS_NULL:
- ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_STRING, "", 1, 0, HASH_UPDATE_KEY_IF_BEFORE, NULL);
- break;
- default:
- ret = SUCCESS;
- break;
- }
- if (ret == SUCCESS) {
- zend_hash_move_forward(Z_ARRVAL_P(p));
- }
- zval_dtor(&const_value);
+ zend_ast_evaluate(&const_value, Z_AST_P(p), scope TSRMLS_CC);
+ if (inline_change) {
+ zend_ast_destroy(Z_AST_P(p));
}
- zend_hash_apply_with_argument(Z_ARRVAL_P(p), (apply_func_arg_t) zval_update_constant_inline_change, (void *) scope TSRMLS_CC);
- zend_hash_internal_pointer_reset(Z_ARRVAL_P(p));
+ ZVAL_COPY_VALUE(p, &const_value);
}
return 0;
}
/* }}} */
-ZEND_API int zval_update_constant_inline_change(zval **pp, void *scope TSRMLS_DC) /* {{{ */
+ZEND_API int zval_update_constant_inline_change(zval **pp, zend_class_entry *scope TSRMLS_DC) /* {{{ */
{
- return zval_update_constant_ex(pp, (void*)1, scope TSRMLS_CC);
+ return zval_update_constant_ex(pp, 1, scope TSRMLS_CC);
}
/* }}} */
-ZEND_API int zval_update_constant_no_inline_change(zval **pp, void *scope TSRMLS_DC) /* {{{ */
+ZEND_API int zval_update_constant_no_inline_change(zval **pp, zend_class_entry *scope TSRMLS_DC) /* {{{ */
{
- return zval_update_constant_ex(pp, (void*)0, scope TSRMLS_CC);
+ return zval_update_constant_ex(pp, 0, scope TSRMLS_CC);
}
/* }}} */
-ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC) /* {{{ */
+ZEND_API int zval_update_constant(zval **pp, zend_bool inline_change TSRMLS_DC) /* {{{ */
{
- return zval_update_constant_ex(pp, arg, NULL TSRMLS_CC);
+ return zval_update_constant_ex(pp, inline_change, NULL TSRMLS_CC);
}
/* }}} */
@@ -947,9 +842,9 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
if (EX(function_state).function->common.scope) {
EG(scope) = EX(function_state).function->common.scope;
}
- if(EXPECTED(zend_execute_internal == NULL)) {
+ if (EXPECTED(zend_execute_internal == NULL)) {
/* saves one function call if zend_execute_internal is not used */
- ((zend_internal_function *) EX(function_state).function)->handler(fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC);
+ EX(function_state).function->internal_function.handler(fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC);
} else {
zend_execute_internal(&execute_data, fci, 1 TSRMLS_CC);
}
diff --git a/Zend/zend_extensions.h b/Zend/zend_extensions.h
index 92732dbf53..ed615f1f6e 100644
--- a/Zend/zend_extensions.h
+++ b/Zend/zend_extensions.h
@@ -28,7 +28,7 @@
/* The first number is the engine version and the rest is the date.
* This way engine 2/3 API no. is always greater than engine 1 API no..
*/
-#define ZEND_EXTENSION_API_NO 220121212
+#define ZEND_EXTENSION_API_NO 220131226
typedef struct _zend_extension_version_info {
int zend_extension_api_no;
@@ -111,7 +111,7 @@ END_EXTERN_C()
ZEND_API extern zend_llist zend_extensions;
void zend_extension_dtor(zend_extension *extension);
-void zend_append_version_info(const zend_extension *extension);
+ZEND_API void zend_append_version_info(const zend_extension *extension);
int zend_startup_extensions_mechanism(void);
int zend_startup_extensions(void);
void zend_shutdown_extensions(TSRMLS_D);
diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c
index b457f56463..4b18f4221d 100644
--- a/Zend/zend_generators.c
+++ b/Zend/zend_generators.c
@@ -113,7 +113,7 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
zend_op_array *op_array = execute_data->op_array;
if (!execute_data->symbol_table) {
- zend_free_compiled_variables(execute_data);
+ zend_free_compiled_variables(execute_data TSRMLS_CC);
} else {
zend_clean_and_cache_symbol_table(execute_data->symbol_table TSRMLS_CC);
}
@@ -467,7 +467,7 @@ ZEND_METHOD(Generator, current)
zend_generator_ensure_initialized(generator TSRMLS_CC);
if (generator->value) {
- RETURN_ZVAL(generator->value, 1, 0);
+ RETURN_ZVAL_FAST(generator->value);
}
}
/* }}} */
@@ -487,7 +487,7 @@ ZEND_METHOD(Generator, key)
zend_generator_ensure_initialized(generator TSRMLS_CC);
if (generator->key) {
- RETURN_ZVAL(generator->key, 1, 0);
+ RETURN_ZVAL_FAST(generator->key);
}
}
/* }}} */
@@ -540,7 +540,7 @@ ZEND_METHOD(Generator, send)
zend_generator_resume(generator TSRMLS_CC);
if (generator->value) {
- RETURN_ZVAL(generator->value, 1, 0);
+ RETURN_ZVAL_FAST(generator->value);
}
}
/* }}} */
@@ -575,7 +575,7 @@ ZEND_METHOD(Generator, throw)
zend_generator_resume(generator TSRMLS_CC);
if (generator->value) {
- RETURN_ZVAL(generator->value, 1, 0);
+ RETURN_ZVAL_FAST(generator->value);
}
} else {
/* If the generator is already closed throw the exception in the
diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h
index fec5d84e78..480c4afb8f 100644
--- a/Zend/zend_globals.h
+++ b/Zend/zend_globals.h
@@ -131,9 +131,13 @@ struct _zend_compiler_globals {
zval *current_namespace;
HashTable *current_import;
+ HashTable *current_import_function;
+ HashTable *current_import_const;
zend_bool in_namespace;
zend_bool has_bracketed_namespaces;
+ HashTable const_filenames;
+
zend_compiler_context context;
zend_stack context_stack;
@@ -142,6 +146,9 @@ struct _zend_compiler_globals {
char *interned_strings_end;
char *interned_strings_top;
char *interned_strings_snapshot_top;
+#ifndef ZTS
+ char *interned_empty_string;
+#endif
HashTable interned_strings;
@@ -276,7 +283,7 @@ struct _zend_ini_scanner_globals {
char *filename;
int lineno;
- /* Modes are: ZEND_INI_SCANNER_NORMAL, ZEND_INI_SCANNER_RAW */
+ /* Modes are: ZEND_INI_SCANNER_NORMAL, ZEND_INI_SCANNER_RAW, ZEND_INI_SCANNER_TYPED */
int scanner_mode;
};
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c
index b18fd59da8..c00012c0a4 100644
--- a/Zend/zend_hash.c
+++ b/Zend/zend_hash.c
@@ -29,18 +29,24 @@
(element)->pNext->pLast = (element); \
}
-#define CONNECT_TO_GLOBAL_DLLIST(element, ht) \
- (element)->pListLast = (ht)->pListTail; \
- (ht)->pListTail = (element); \
- (element)->pListNext = NULL; \
- if ((element)->pListLast != NULL) { \
- (element)->pListLast->pListNext = (element); \
- } \
- if (!(ht)->pListHead) { \
+#define CONNECT_TO_GLOBAL_DLLIST_EX(element, ht, last, next)\
+ (element)->pListLast = (last); \
+ (element)->pListNext = (next); \
+ if ((last) != NULL) { \
+ (last)->pListNext = (element); \
+ } else { \
(ht)->pListHead = (element); \
} \
- if ((ht)->pInternalPointer == NULL) { \
- (ht)->pInternalPointer = (element); \
+ if ((next) != NULL) { \
+ (next)->pListLast = (element); \
+ } else { \
+ (ht)->pListTail = (element); \
+ } \
+
+#define CONNECT_TO_GLOBAL_DLLIST(element, ht) \
+ CONNECT_TO_GLOBAL_DLLIST_EX(element, ht, (ht)->pListTail, (Bucket *) NULL); \
+ if ((ht)->pInternalPointer == NULL) { \
+ (ht)->pInternalPointer = (element); \
}
#if ZEND_DEBUG
@@ -96,7 +102,7 @@ static void _zend_is_inconsistent(const HashTable *ht, const char *file, int lin
zend_hash_do_resize(ht); \
}
-static int zend_hash_do_resize(HashTable *ht);
+static void zend_hash_do_resize(HashTable *ht);
ZEND_API ulong zend_hash_func(const char *arKey, uint nKeyLength)
{
@@ -122,17 +128,13 @@ ZEND_API ulong zend_hash_func(const char *arKey, uint nKeyLength)
memcpy((p)->pData, pData, nDataSize); \
}
-#define INIT_DATA(ht, p, pData, nDataSize); \
+#define INIT_DATA(ht, p, _pData, nDataSize); \
if (nDataSize == sizeof(void*)) { \
- memcpy(&(p)->pDataPtr, pData, sizeof(void *)); \
+ memcpy(&(p)->pDataPtr, (_pData), sizeof(void *)); \
(p)->pData = &(p)->pDataPtr; \
} else { \
(p)->pData = (void *) pemalloc_rel(nDataSize, (ht)->persistent);\
- if (!(p)->pData) { \
- pefree_rel(p, (ht)->persistent); \
- return FAILURE; \
- } \
- memcpy((p)->pData, pData, nDataSize); \
+ memcpy((p)->pData, (_pData), nDataSize); \
(p)->pDataPtr=NULL; \
}
@@ -145,7 +147,52 @@ ZEND_API ulong zend_hash_func(const char *arKey, uint nKeyLength)
static const Bucket *uninitialized_bucket = NULL;
-ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC)
+static zend_always_inline void i_zend_hash_bucket_delete(HashTable *ht, Bucket *p)
+{
+#ifdef ZEND_SIGNALS
+ TSRMLS_FETCH();
+#endif
+
+ HANDLE_BLOCK_INTERRUPTIONS();
+ if (p->pLast) {
+ p->pLast->pNext = p->pNext;
+ } else {
+ ht->arBuckets[p->h & ht->nTableMask] = p->pNext;
+ }
+ if (p->pNext) {
+ p->pNext->pLast = p->pLast;
+ }
+ if (p->pListLast != NULL) {
+ p->pListLast->pListNext = p->pListNext;
+ } else {
+ /* Deleting the head of the list */
+ ht->pListHead = p->pListNext;
+ }
+ if (p->pListNext != NULL) {
+ p->pListNext->pListLast = p->pListLast;
+ } else {
+ /* Deleting the tail of the list */
+ ht->pListTail = p->pListLast;
+ }
+ if (ht->pInternalPointer == p) {
+ ht->pInternalPointer = p->pListNext;
+ }
+ ht->nNumOfElements--;
+ if (ht->pDestructor) {
+ ht->pDestructor(p->pData);
+ }
+ if (p->pData != &p->pDataPtr) {
+ pefree(p->pData, ht->persistent);
+ }
+ pefree(p, ht->persistent);
+ HANDLE_UNBLOCK_INTERRUPTIONS();
+}
+
+static void zend_hash_bucket_delete(HashTable *ht, Bucket *p) {
+ i_zend_hash_bucket_delete(ht, p);
+}
+
+ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC)
{
uint i = 3;
@@ -176,9 +223,9 @@ ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunctio
}
-ZEND_API int _zend_hash_init_ex(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC)
+ZEND_API int _zend_hash_init_ex(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC)
{
- int retval = _zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent ZEND_FILE_LINE_CC);
+ int retval = _zend_hash_init(ht, nSize, pDestructor, persistent ZEND_FILE_LINE_CC);
ht->bApplyProtection = bApplyProtection;
return retval;
@@ -203,12 +250,7 @@ ZEND_API int _zend_hash_add_or_update(HashTable *ht, const char *arKey, uint nKe
IS_CONSISTENT(ht);
- if (nKeyLength <= 0) {
-#if ZEND_DEBUG
- ZEND_PUTS("zend_hash_update: Can't put in empty key\n");
-#endif
- return FAILURE;
- }
+ ZEND_ASSERT(nKeyLength != 0);
CHECK_INIT(ht);
@@ -222,14 +264,8 @@ ZEND_API int _zend_hash_add_or_update(HashTable *ht, const char *arKey, uint nKe
if (flag & HASH_ADD) {
return FAILURE;
}
+ ZEND_ASSERT(p->pData != pData);
HANDLE_BLOCK_INTERRUPTIONS();
-#if ZEND_DEBUG
- if (p->pData == pData) {
- ZEND_PUTS("Fatal error in zend_hash_update: p->pData == pData\n");
- HANDLE_UNBLOCK_INTERRUPTIONS();
- return FAILURE;
- }
-#endif
if (ht->pDestructor) {
ht->pDestructor(p->pData);
}
@@ -245,15 +281,9 @@ ZEND_API int _zend_hash_add_or_update(HashTable *ht, const char *arKey, uint nKe
if (IS_INTERNED(arKey)) {
p = (Bucket *) pemalloc(sizeof(Bucket), ht->persistent);
- if (!p) {
- return FAILURE;
- }
p->arKey = arKey;
} else {
p = (Bucket *) pemalloc(sizeof(Bucket) + nKeyLength, ht->persistent);
- if (!p) {
- return FAILURE;
- }
p->arKey = (const char*)(p + 1);
memcpy((char*)p->arKey, arKey, nKeyLength);
}
@@ -285,9 +315,7 @@ ZEND_API int _zend_hash_quick_add_or_update(HashTable *ht, const char *arKey, ui
IS_CONSISTENT(ht);
- if (nKeyLength == 0) {
- return zend_hash_index_update(ht, h, pData, nDataSize, pDest);
- }
+ ZEND_ASSERT(nKeyLength != 0);
CHECK_INIT(ht);
nIndex = h & ht->nTableMask;
@@ -299,14 +327,8 @@ ZEND_API int _zend_hash_quick_add_or_update(HashTable *ht, const char *arKey, ui
if (flag & HASH_ADD) {
return FAILURE;
}
+ ZEND_ASSERT(p->pData != pData);
HANDLE_BLOCK_INTERRUPTIONS();
-#if ZEND_DEBUG
- if (p->pData == pData) {
- ZEND_PUTS("Fatal error in zend_hash_update: p->pData == pData\n");
- HANDLE_UNBLOCK_INTERRUPTIONS();
- return FAILURE;
- }
-#endif
if (ht->pDestructor) {
ht->pDestructor(p->pData);
}
@@ -322,15 +344,9 @@ ZEND_API int _zend_hash_quick_add_or_update(HashTable *ht, const char *arKey, ui
if (IS_INTERNED(arKey)) {
p = (Bucket *) pemalloc(sizeof(Bucket), ht->persistent);
- if (!p) {
- return FAILURE;
- }
p->arKey = arKey;
} else {
p = (Bucket *) pemalloc(sizeof(Bucket) + nKeyLength, ht->persistent);
- if (!p) {
- return FAILURE;
- }
p->arKey = (const char*)(p + 1);
memcpy((char*)p->arKey, arKey, nKeyLength);
}
@@ -386,22 +402,13 @@ ZEND_API int _zend_hash_index_update_or_next_insert(HashTable *ht, ulong h, void
if (flag & HASH_NEXT_INSERT || flag & HASH_ADD) {
return FAILURE;
}
+ ZEND_ASSERT(p->pData != pData);
HANDLE_BLOCK_INTERRUPTIONS();
-#if ZEND_DEBUG
- if (p->pData == pData) {
- ZEND_PUTS("Fatal error in zend_hash_index_update: p->pData == pData\n");
- HANDLE_UNBLOCK_INTERRUPTIONS();
- return FAILURE;
- }
-#endif
if (ht->pDestructor) {
ht->pDestructor(p->pData);
}
UPDATE_DATA(ht, p, pData, nDataSize);
HANDLE_UNBLOCK_INTERRUPTIONS();
- if ((long)h >= (long)ht->nNextFreeElement) {
- ht->nNextFreeElement = h < LONG_MAX ? h + 1 : LONG_MAX;
- }
if (pDest) {
*pDest = p->pData;
}
@@ -410,9 +417,6 @@ ZEND_API int _zend_hash_index_update_or_next_insert(HashTable *ht, ulong h, void
p = p->pNext;
}
p = (Bucket *) pemalloc_rel(sizeof(Bucket), ht->persistent);
- if (!p) {
- return FAILURE;
- }
p->arKey = NULL;
p->nKeyLength = 0; /* Numeric indices are marked by making the nKeyLength == 0 */
p->h = h;
@@ -437,7 +441,7 @@ ZEND_API int _zend_hash_index_update_or_next_insert(HashTable *ht, ulong h, void
}
-static int zend_hash_do_resize(HashTable *ht)
+static void zend_hash_do_resize(HashTable *ht)
{
Bucket **t;
#ifdef ZEND_SIGNALS
@@ -447,19 +451,14 @@ static int zend_hash_do_resize(HashTable *ht)
IS_CONSISTENT(ht);
if ((ht->nTableSize << 1) > 0) { /* Let's double the table size */
- t = (Bucket **) perealloc_recoverable(ht->arBuckets, (ht->nTableSize << 1) * sizeof(Bucket *), ht->persistent);
- if (t) {
- HANDLE_BLOCK_INTERRUPTIONS();
- ht->arBuckets = t;
- ht->nTableSize = (ht->nTableSize << 1);
- ht->nTableMask = ht->nTableSize - 1;
- zend_hash_rehash(ht);
- HANDLE_UNBLOCK_INTERRUPTIONS();
- return SUCCESS;
- }
- return FAILURE;
+ t = (Bucket **) perealloc(ht->arBuckets, (ht->nTableSize << 1) * sizeof(Bucket *), ht->persistent);
+ HANDLE_BLOCK_INTERRUPTIONS();
+ ht->arBuckets = t;
+ ht->nTableSize = (ht->nTableSize << 1);
+ ht->nTableMask = ht->nTableSize - 1;
+ zend_hash_rehash(ht);
+ HANDLE_UNBLOCK_INTERRUPTIONS();
}
- return SUCCESS;
}
ZEND_API int zend_hash_rehash(HashTable *ht)
@@ -473,23 +472,43 @@ ZEND_API int zend_hash_rehash(HashTable *ht)
}
memset(ht->arBuckets, 0, ht->nTableSize * sizeof(Bucket *));
- p = ht->pListHead;
- while (p != NULL) {
+ for (p = ht->pListHead; p != NULL; p = p->pListNext) {
nIndex = p->h & ht->nTableMask;
CONNECT_TO_BUCKET_DLLIST(p, ht->arBuckets[nIndex]);
ht->arBuckets[nIndex] = p;
- p = p->pListNext;
}
return SUCCESS;
}
+ZEND_API void zend_hash_reindex(HashTable *ht, zend_bool only_integer_keys) {
+ Bucket *p;
+ uint nIndex;
+ ulong offset = 0;
+
+ IS_CONSISTENT(ht);
+ if (UNEXPECTED(ht->nNumOfElements == 0)) {
+ ht->nNextFreeElement = 0;
+ return;
+ }
+
+ memset(ht->arBuckets, 0, ht->nTableSize * sizeof(Bucket *));
+ for (p = ht->pListHead; p != NULL; p = p->pListNext) {
+ if (!only_integer_keys || p->nKeyLength == 0) {
+ p->h = offset++;
+ p->nKeyLength = 0;
+ }
+
+ nIndex = p->h & ht->nTableMask;
+ CONNECT_TO_BUCKET_DLLIST(p, ht->arBuckets[nIndex]);
+ ht->arBuckets[nIndex] = p;
+ }
+ ht->nNextFreeElement = offset;
+}
+
ZEND_API int zend_hash_del_key_or_index(HashTable *ht, const char *arKey, uint nKeyLength, ulong h, int flag)
{
uint nIndex;
Bucket *p;
-#ifdef ZEND_SIGNALS
- TSRMLS_FETCH();
-#endif
IS_CONSISTENT(ht);
@@ -504,38 +523,7 @@ ZEND_API int zend_hash_del_key_or_index(HashTable *ht, const char *arKey, uint n
&& (p->nKeyLength == nKeyLength)
&& ((p->nKeyLength == 0) /* Numeric index (short circuits the memcmp() check) */
|| !memcmp(p->arKey, arKey, nKeyLength))) { /* String index */
- HANDLE_BLOCK_INTERRUPTIONS();
- if (p == ht->arBuckets[nIndex]) {
- ht->arBuckets[nIndex] = p->pNext;
- } else {
- p->pLast->pNext = p->pNext;
- }
- if (p->pNext) {
- p->pNext->pLast = p->pLast;
- }
- if (p->pListLast != NULL) {
- p->pListLast->pListNext = p->pListNext;
- } else {
- /* Deleting the head of the list */
- ht->pListHead = p->pListNext;
- }
- if (p->pListNext != NULL) {
- p->pListNext->pListLast = p->pListLast;
- } else {
- ht->pListTail = p->pListLast;
- }
- if (ht->pInternalPointer == p) {
- ht->pInternalPointer = p->pListNext;
- }
- ht->nNumOfElements--;
- if (ht->pDestructor) {
- ht->pDestructor(p->pData);
- }
- if (p->pData != &p->pDataPtr) {
- pefree(p->pData, ht->persistent);
- }
- pefree(p, ht->persistent);
- HANDLE_UNBLOCK_INTERRUPTIONS();
+ i_zend_hash_bucket_delete(ht, p);
return SUCCESS;
}
p = p->pNext;
@@ -602,73 +590,14 @@ ZEND_API void zend_hash_clean(HashTable *ht)
}
}
-/* This function is used by the various apply() functions.
- * It deletes the passed bucket, and returns the address of the
- * next bucket. The hash *may* be altered during that time, the
- * returned value will still be valid.
- */
-static Bucket *zend_hash_apply_deleter(HashTable *ht, Bucket *p)
-{
- Bucket *retval;
-#ifdef ZEND_SIGNALS
- TSRMLS_FETCH();
-#endif
-
- HANDLE_BLOCK_INTERRUPTIONS();
- if (p->pLast) {
- p->pLast->pNext = p->pNext;
- } else {
- uint nIndex;
-
- nIndex = p->h & ht->nTableMask;
- ht->arBuckets[nIndex] = p->pNext;
- }
- if (p->pNext) {
- p->pNext->pLast = p->pLast;
- } else {
- /* Nothing to do as this list doesn't have a tail */
- }
-
- if (p->pListLast != NULL) {
- p->pListLast->pListNext = p->pListNext;
- } else {
- /* Deleting the head of the list */
- ht->pListHead = p->pListNext;
- }
- if (p->pListNext != NULL) {
- p->pListNext->pListLast = p->pListLast;
- } else {
- ht->pListTail = p->pListLast;
- }
- if (ht->pInternalPointer == p) {
- ht->pInternalPointer = p->pListNext;
- }
- ht->nNumOfElements--;
- HANDLE_UNBLOCK_INTERRUPTIONS();
-
- if (ht->pDestructor) {
- ht->pDestructor(p->pData);
- }
- if (p->pData != &p->pDataPtr) {
- pefree(p->pData, ht->persistent);
- }
- retval = p->pListNext;
- pefree(p, ht->persistent);
-
- return retval;
-}
-
-
ZEND_API void zend_hash_graceful_destroy(HashTable *ht)
{
- Bucket *p;
-
IS_CONSISTENT(ht);
- p = ht->pListHead;
- while (p != NULL) {
- p = zend_hash_apply_deleter(ht, p);
+ while (ht->pListHead != NULL) {
+ zend_hash_bucket_delete(ht, ht->pListHead);
}
+
if (ht->nTableMask) {
pefree(ht->arBuckets, ht->persistent);
}
@@ -678,14 +607,10 @@ ZEND_API void zend_hash_graceful_destroy(HashTable *ht)
ZEND_API void zend_hash_graceful_reverse_destroy(HashTable *ht)
{
- Bucket *p;
-
IS_CONSISTENT(ht);
- p = ht->pListTail;
- while (p != NULL) {
- zend_hash_apply_deleter(ht, p);
- p = ht->pListTail;
+ while (ht->pListTail != NULL) {
+ zend_hash_bucket_delete(ht, ht->pListTail);
}
if (ht->nTableMask) {
@@ -714,12 +639,13 @@ ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC)
p = ht->pListHead;
while (p != NULL) {
int result = apply_func(p->pData TSRMLS_CC);
-
+
+ Bucket *p_next = p->pListNext;
if (result & ZEND_HASH_APPLY_REMOVE) {
- p = zend_hash_apply_deleter(ht, p);
- } else {
- p = p->pListNext;
+ zend_hash_bucket_delete(ht, p);
}
+ p = p_next;
+
if (result & ZEND_HASH_APPLY_STOP) {
break;
}
@@ -739,11 +665,12 @@ ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t appl
while (p != NULL) {
int result = apply_func(p->pData, argument TSRMLS_CC);
+ Bucket *p_next = p->pListNext;
if (result & ZEND_HASH_APPLY_REMOVE) {
- p = zend_hash_apply_deleter(ht, p);
- } else {
- p = p->pListNext;
+ zend_hash_bucket_delete(ht, p);
}
+ p = p_next;
+
if (result & ZEND_HASH_APPLY_STOP) {
break;
}
@@ -765,17 +692,20 @@ ZEND_API void zend_hash_apply_with_arguments(HashTable *ht TSRMLS_DC, apply_func
p = ht->pListHead;
while (p != NULL) {
int result;
+ Bucket *p_next;
+
va_start(args, num_args);
hash_key.arKey = p->arKey;
hash_key.nKeyLength = p->nKeyLength;
hash_key.h = p->h;
result = apply_func(p->pData TSRMLS_CC, num_args, args, &hash_key);
+ p_next = p->pListNext;
if (result & ZEND_HASH_APPLY_REMOVE) {
- p = zend_hash_apply_deleter(ht, p);
- } else {
- p = p->pListNext;
+ zend_hash_bucket_delete(ht, p);
}
+ p = p_next;
+
if (result & ZEND_HASH_APPLY_STOP) {
va_end(args);
break;
@@ -789,7 +719,7 @@ ZEND_API void zend_hash_apply_with_arguments(HashTable *ht TSRMLS_DC, apply_func
ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC)
{
- Bucket *p, *q;
+ Bucket *p;
IS_CONSISTENT(ht);
@@ -798,11 +728,12 @@ ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSR
while (p != NULL) {
int result = apply_func(p->pData TSRMLS_CC);
- q = p;
- p = p->pListLast;
+ Bucket *p_last = p->pListLast;
if (result & ZEND_HASH_APPLY_REMOVE) {
- zend_hash_apply_deleter(ht, q);
+ zend_hash_bucket_delete(ht, p);
}
+ p = p_last;
+
if (result & ZEND_HASH_APPLY_STOP) {
break;
}
@@ -900,12 +831,6 @@ ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor
}
-ZEND_API ulong zend_get_hash_value(const char *arKey, uint nKeyLength)
-{
- return zend_inline_hash_func(arKey, nKeyLength);
-}
-
-
/* Returns SUCCESS if found and FAILURE if not. The pointer to the
* data is returned in pData. The reason is that there's no reason
* someone using the hash table might not want to have NULL data
@@ -939,9 +864,7 @@ ZEND_API int zend_hash_quick_find(const HashTable *ht, const char *arKey, uint n
uint nIndex;
Bucket *p;
- if (nKeyLength==0) {
- return zend_hash_index_find(ht, h, pData);
- }
+ ZEND_ASSERT(nKeyLength != 0);
IS_CONSISTENT(ht);
@@ -988,9 +911,7 @@ ZEND_API int zend_hash_quick_exists(const HashTable *ht, const char *arKey, uint
uint nIndex;
Bucket *p;
- if (nKeyLength==0) {
- return zend_hash_index_exists(ht, h);
- }
+ ZEND_ASSERT(nKeyLength != 0);
IS_CONSISTENT(ht);
@@ -1182,7 +1103,7 @@ ZEND_API void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key,
Z_TYPE_P(key) = IS_NULL;
} else if (p->nKeyLength) {
Z_TYPE_P(key) = IS_STRING;
- Z_STRVAL_P(key) = estrndup(p->arKey, p->nKeyLength - 1);
+ Z_STRVAL_P(key) = IS_INTERNED(p->arKey) ? (char*)p->arKey : estrndup(p->arKey, p->nKeyLength - 1);
Z_STRLEN_P(key) = p->nKeyLength - 1;
} else {
Z_TYPE_P(key) = IS_LONG;
@@ -1282,8 +1203,6 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
return FAILURE;
}
- HANDLE_BLOCK_INTERRUPTIONS();
-
if (q) {
if (mode != HASH_UPDATE_KEY_ANYWAY) {
Bucket *r = p->pListLast;
@@ -1298,73 +1217,17 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
}
if (mode & found) {
/* delete current bucket */
- if (p == ht->arBuckets[p->h & ht->nTableMask]) {
- ht->arBuckets[p->h & ht->nTableMask] = p->pNext;
- } else {
- p->pLast->pNext = p->pNext;
- }
- if (p->pNext) {
- p->pNext->pLast = p->pLast;
- }
- if (p->pListLast != NULL) {
- p->pListLast->pListNext = p->pListNext;
- } else {
- /* Deleting the head of the list */
- ht->pListHead = p->pListNext;
- }
- if (p->pListNext != NULL) {
- p->pListNext->pListLast = p->pListLast;
- } else {
- ht->pListTail = p->pListLast;
- }
- if (ht->pInternalPointer == p) {
- ht->pInternalPointer = p->pListNext;
- }
- ht->nNumOfElements--;
- if (ht->pDestructor) {
- ht->pDestructor(p->pData);
- }
- if (p->pData != &p->pDataPtr) {
- pefree(p->pData, ht->persistent);
- }
- pefree(p, ht->persistent);
- HANDLE_UNBLOCK_INTERRUPTIONS();
+ zend_hash_bucket_delete(ht, p);
return FAILURE;
}
}
+
/* delete another bucket with the same key */
- if (q == ht->arBuckets[q->h & ht->nTableMask]) {
- ht->arBuckets[q->h & ht->nTableMask] = q->pNext;
- } else {
- q->pLast->pNext = q->pNext;
- }
- if (q->pNext) {
- q->pNext->pLast = q->pLast;
- }
- if (q->pListLast != NULL) {
- q->pListLast->pListNext = q->pListNext;
- } else {
- /* Deleting the head of the list */
- ht->pListHead = q->pListNext;
- }
- if (q->pListNext != NULL) {
- q->pListNext->pListLast = q->pListLast;
- } else {
- ht->pListTail = q->pListLast;
- }
- if (ht->pInternalPointer == q) {
- ht->pInternalPointer = q->pListNext;
- }
- ht->nNumOfElements--;
- if (ht->pDestructor) {
- ht->pDestructor(q->pData);
- }
- if (q->pData != &q->pDataPtr) {
- pefree(q->pData, ht->persistent);
- }
- pefree(q, ht->persistent);
+ zend_hash_bucket_delete(ht, q);
}
+ HANDLE_BLOCK_INTERRUPTIONS();
+
if (p->pNext) {
p->pNext->pLast = p->pLast;
}
@@ -1391,21 +1254,12 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
q->pData = p->pData;
}
q->pDataPtr = p->pDataPtr;
- q->pListNext = p->pListNext;
- q->pListLast = p->pListLast;
- if (q->pListNext) {
- p->pListNext->pListLast = q;
- } else {
- ht->pListTail = q;
- }
- if (q->pListLast) {
- p->pListLast->pListNext = q;
- } else {
- ht->pListHead = q;
- }
+
+ CONNECT_TO_GLOBAL_DLLIST_EX(q, ht, p->pListLast, p->pListNext);
if (ht->pInternalPointer == p) {
ht->pInternalPointer = q;
}
+
if (pos) {
*pos = q;
}
@@ -1439,6 +1293,75 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
}
}
+/* Performs an in-place splice operation on a hashtable:
+ * The elements between offset and offset+length are removed and the elements in list[list_count]
+ * are inserted in their place. The removed elements can be optionally collected into a hashtable.
+ * This operation reindexes the hashtable, i.e. integer keys will be zero-based and sequential,
+ * while string keys stay intact. The same applies to the elements inserted into the removed HT. */
+ZEND_API void _zend_hash_splice(HashTable *ht, uint nDataSize, copy_ctor_func_t pCopyConstructor, uint offset, uint length, void **list, uint list_count, HashTable *removed ZEND_FILE_LINE_DC) /* {{{ */
+{
+ int pos;
+ Bucket *p;
+
+ IS_CONSISTENT(ht);
+ CHECK_INIT(ht);
+
+ /* Skip all elements until offset */
+ for (pos = 0, p = ht->pListHead; pos < offset && p; pos++, p = p->pListNext);
+
+ while (pos < offset + length && p) {
+ /* Copy removed element into HT, if it was specified */
+ if (removed != NULL) {
+ void *new_entry;
+
+ if (p->nKeyLength == 0) {
+ zend_hash_next_index_insert(removed, p->pData, sizeof(zval *), &new_entry);
+ } else {
+ zend_hash_quick_update(removed, p->arKey, p->nKeyLength, p->h, p->pData, sizeof(zval *), &new_entry);
+ }
+
+ if (pCopyConstructor) {
+ pCopyConstructor(new_entry);
+ }
+ }
+
+ /* Remove element */
+ {
+ Bucket *p_next = p->pListNext;
+ zend_hash_bucket_delete(ht, p);
+ p = p_next;
+ }
+
+ pos++;
+ }
+
+ if (list != NULL) {
+ int i;
+ for (i = 0; i < list_count; i++) {
+ /* Add new element only to the global linked list, not the bucket list.
+ * Also use key 0 for everything, as we'll reindex the hashtable anyways. */
+ Bucket *q = pemalloc_rel(sizeof(Bucket), ht->persistent);
+ q->arKey = NULL;
+ q->nKeyLength = 0;
+ q->h = 0;
+ INIT_DATA(ht, q, list[i], nDataSize);
+
+ CONNECT_TO_GLOBAL_DLLIST_EX(q, ht, p ? p->pListLast : ht->pListTail, p);
+
+ ht->nNumOfElements++;
+
+ if (pCopyConstructor) {
+ pCopyConstructor(q->pData);
+ }
+ }
+
+ ZEND_HASH_IF_FULL_DO_RESIZE(ht);
+ }
+
+ zend_hash_reindex(ht, 1);
+}
+/* }}} */
+
ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func,
compare_func_t compar, int renumber TSRMLS_DC)
{
@@ -1452,9 +1375,6 @@ ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func,
return SUCCESS;
}
arTmp = (Bucket **) pemalloc(ht->nNumOfElements * sizeof(Bucket *), ht->persistent);
- if (!arTmp) {
- return FAILURE;
- }
p = ht->pListHead;
i = 0;
while (p) {
@@ -1488,15 +1408,7 @@ ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func,
HANDLE_UNBLOCK_INTERRUPTIONS();
if (renumber) {
- p = ht->pListHead;
- i=0;
- while (p != NULL) {
- p->nKeyLength = 0;
- p->h = i++;
- p = p->pListNext;
- }
- ht->nNextFreeElement = i;
- zend_hash_rehash(ht);
+ zend_hash_reindex(ht, 0);
}
return SUCCESS;
}
diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h
index f5b349cf94..88cbca8689 100644
--- a/Zend/zend_hash.h
+++ b/Zend/zend_hash.h
@@ -97,12 +97,12 @@ typedef Bucket* HashPosition;
BEGIN_EXTERN_C()
/* startup/shutdown */
-ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC);
-ZEND_API int _zend_hash_init_ex(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC);
+ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC);
+ZEND_API int _zend_hash_init_ex(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC);
ZEND_API void zend_hash_destroy(HashTable *ht);
ZEND_API void zend_hash_clean(HashTable *ht);
-#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent) _zend_hash_init((ht), (nSize), (pHashFunction), (pDestructor), (persistent) ZEND_FILE_LINE_CC)
-#define zend_hash_init_ex(ht, nSize, pHashFunction, pDestructor, persistent, bApplyProtection) _zend_hash_init_ex((ht), (nSize), (pHashFunction), (pDestructor), (persistent), (bApplyProtection) ZEND_FILE_LINE_CC)
+#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent) _zend_hash_init((ht), (nSize), (pDestructor), (persistent) ZEND_FILE_LINE_CC)
+#define zend_hash_init_ex(ht, nSize, pHashFunction, pDestructor, persistent, bApplyProtection) _zend_hash_init_ex((ht), (nSize), (pDestructor), (persistent), (bApplyProtection) ZEND_FILE_LINE_CC)
/* additions/updates/changes */
ZEND_API int _zend_hash_add_or_update(HashTable *ht, const char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
@@ -157,8 +157,8 @@ ZEND_API int zend_hash_del_key_or_index(HashTable *ht, const char *arKey, uint n
zend_hash_del_key_or_index(ht, arKey, nKeyLength, h, HASH_DEL_KEY_QUICK)
#define zend_hash_index_del(ht, h) \
zend_hash_del_key_or_index(ht, NULL, 0, h, HASH_DEL_INDEX)
-
-ZEND_API ulong zend_get_hash_value(const char *arKey, uint nKeyLength);
+#define zend_get_hash_value \
+ zend_hash_func
/* Data retreival */
ZEND_API int zend_hash_find(const HashTable *ht, const char *arKey, uint nKeyLength, void **pData);
@@ -227,6 +227,11 @@ ZEND_API int zend_hash_minmax(const HashTable *ht, compare_func_t compar, int fl
ZEND_API int zend_hash_num_elements(const HashTable *ht);
ZEND_API int zend_hash_rehash(HashTable *ht);
+ZEND_API void zend_hash_reindex(HashTable *ht, zend_bool only_integer_keys);
+
+ZEND_API void _zend_hash_splice(HashTable *ht, uint nDataSize, copy_ctor_func_t pCopyConstructor, uint offset, uint length, void **list, uint list_count, HashTable *removed ZEND_FILE_LINE_DC);
+#define zend_hash_splice(ht, nDataSize, pCopyConstructor, offset, length, list, list_count, removed) \
+ _zend_hash_splice(ht, nDataSize, pCopyConstructor, offset, length, list, list_count, removed ZEND_FILE_LINE_CC)
/*
* DJBX33A (Daniel J. Bernstein, Times 33 with Addition)
diff --git a/Zend/zend_highlight.c b/Zend/zend_highlight.c
index 232a22dd30..4c99f3bb93 100644
--- a/Zend/zend_highlight.c
+++ b/Zend/zend_highlight.c
@@ -150,7 +150,7 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
case T_DOC_COMMENT:
break;
default:
- efree(token.value.str.val);
+ str_efree(token.value.str.val);
break;
}
}
@@ -211,7 +211,7 @@ ZEND_API void zend_strip(TSRMLS_D)
break;
default:
- efree(token.value.str.val);
+ STR_FREE(token.value.str.val);
break;
}
}
diff --git a/Zend/zend_indent.c b/Zend/zend_indent.c
index a6d60e01f5..4991a99479 100644
--- a/Zend/zend_indent.c
+++ b/Zend/zend_indent.c
@@ -139,7 +139,7 @@ dflt_printout:
case T_WHITESPACE:
break;
default:
- efree(token.value.str.val);
+ str_efree(token.value.str.val);
break;
}
}
diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y
index 3718594a2f..952ef9c506 100644
--- a/Zend/zend_ini_parser.y
+++ b/Zend/zend_ini_parser.y
@@ -268,6 +268,7 @@ ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, int s
%token TC_QUOTED_STRING
%token BOOL_TRUE
%token BOOL_FALSE
+%token NULL_NULL
%token END_OF_LINE
%token '=' ':' ',' '.' '"' '\'' '^' '+' '-' '/' '*' '%' '$' '~' '<' '>' '?' '@' '{' '}'
%left '|' '&' '^'
@@ -294,7 +295,7 @@ statement:
#endif
ZEND_INI_PARSER_CB(&$1, &$3, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG TSRMLS_CC);
free(Z_STRVAL($1));
- free(Z_STRVAL($3));
+ zval_internal_dtor(&$3);
}
| TC_OFFSET option_offset ']' '=' string_or_value {
#if DEBUG_CFG_PARSER
@@ -303,7 +304,7 @@ statement:
ZEND_INI_PARSER_CB(&$1, &$5, &$2, ZEND_INI_PARSER_POP_ENTRY, ZEND_INI_PARSER_ARG TSRMLS_CC);
free(Z_STRVAL($1));
free(Z_STRVAL($2));
- free(Z_STRVAL($5));
+ zval_internal_dtor(&$5);
}
| TC_LABEL { ZEND_INI_PARSER_CB(&$1, NULL, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG TSRMLS_CC); free(Z_STRVAL($1)); }
| END_OF_LINE
@@ -318,6 +319,7 @@ string_or_value:
expr { $$ = $1; }
| BOOL_TRUE { $$ = $1; }
| BOOL_FALSE { $$ = $1; }
+ | NULL_NULL { $$ = $1; }
| END_OF_LINE { zend_ini_init_string(&$$); }
;
diff --git a/Zend/zend_ini_scanner.c b/Zend/zend_ini_scanner.c
index 8f6f7035b2..c4727d33e4 100644
--- a/Zend/zend_ini_scanner.c
+++ b/Zend/zend_ini_scanner.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 */
+/* Generated by re2c 0.13.6 */
#line 1 "Zend/zend_ini_scanner.l"
/*
+----------------------------------------------------------------------+
@@ -26,6 +26,7 @@
#include <errno.h>
#include "zend.h"
+#include "zend_API.h"
#include "zend_globals.h"
#include <zend_ini_parser.h>
#include "zend_ini_scanner.h"
@@ -139,9 +140,55 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
Z_TYPE_P(retval) = IS_STRING; \
}
-#define RETURN_TOKEN(type, str, len) { \
- zend_ini_copy_value(ini_lval, str, len); \
- return type; \
+#define RETURN_TOKEN(type, str, len) { \
+ if (SCNG(scanner_mode) == ZEND_INI_SCANNER_TYPED) { \
+ zend_ini_copy_typed_value(ini_lval, type, str, len); \
+ } else { \
+ zend_ini_copy_value(ini_lval, str, len); \
+ } \
+ return type; \
+}
+
+static inline int convert_to_number(zval *retval, const char *str, const int str_len)
+{
+ zend_uchar type;
+ int overflow;
+ long lval;
+ double dval;
+
+ if ((type = is_numeric_string_ex(str, str_len, &lval, &dval, 0, &overflow)) != 0) {
+ if (type == IS_LONG) {
+ ZVAL_LONG(retval, lval);
+ return SUCCESS;
+ } else if (type == IS_DOUBLE && !overflow) {
+ ZVAL_DOUBLE(retval, dval);
+ return SUCCESS;
+ }
+ }
+
+ return FAILURE;
+}
+
+static void zend_ini_copy_typed_value(zval *retval, const int type, const char *str, int len)
+{
+ switch (type) {
+ case BOOL_FALSE:
+ case BOOL_TRUE:
+ ZVAL_BOOL(retval, type == BOOL_TRUE);
+ break;
+
+ case NULL_NULL:
+ ZVAL_NULL(retval);
+ break;
+
+ case TC_NUMBER:
+ if (convert_to_number(retval, str, len) == SUCCESS) {
+ break;
+ }
+ /* intentional fall-through */
+ default:
+ zend_ini_copy_value(retval, str, len);
+ }
}
static void _yy_push_state(int new_state TSRMLS_DC)
@@ -174,7 +221,7 @@ static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC)
static int init_ini_scanner(int scanner_mode, zend_file_handle *fh TSRMLS_DC)
{
/* Sanity check */
- if (scanner_mode != ZEND_INI_SCANNER_NORMAL && scanner_mode != ZEND_INI_SCANNER_RAW) {
+ if (scanner_mode != ZEND_INI_SCANNER_NORMAL && scanner_mode != ZEND_INI_SCANNER_RAW && scanner_mode != ZEND_INI_SCANNER_TYPED) {
zend_error(E_WARNING, "Invalid scanner mode");
return FAILURE;
}
@@ -333,7 +380,7 @@ restart:
}
}
-#line 337 "Zend/zend_ini_scanner.c"
+#line 384 "Zend/zend_ini_scanner.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
@@ -403,16 +450,15 @@ yyc_INITIAL:
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
};
-
- YYDEBUG(0, *YYCURSOR);
+ YYDEBUG(1, *YYCURSOR);
YYFILL(5);
yych = *YYCURSOR;
YYDEBUG(-1, yych);
switch (yych) {
- case '\t': goto yy4;
- case '\n': goto yy6;
- case '\r': goto yy8;
- case ' ': goto yy9;
+ case '\t': goto yy5;
+ case '\n': goto yy7;
+ case '\r': goto yy9;
+ case ' ': goto yy10;
case '!':
case '"':
case '$':
@@ -423,8 +469,8 @@ yyc_INITIAL:
case '{':
case '|':
case '}':
- case '~': goto yy10;
- case '#': goto yy12;
+ case '~': goto yy11;
+ case '#': goto yy13;
case '%':
case '\'':
case '*':
@@ -438,31 +484,31 @@ yyc_INITIAL:
case '>':
case '?':
case '@':
- case ']': goto yy13;
- case ';': goto yy14;
- case '=': goto yy16;
+ case ']': goto yy14;
+ case ';': goto yy15;
+ case '=': goto yy17;
case 'F':
- case 'f': goto yy18;
+ case 'f': goto yy19;
case 'N':
- case 'n': goto yy19;
+ case 'n': goto yy20;
case 'O':
- case 'o': goto yy20;
+ case 'o': goto yy21;
case 'T':
- case 't': goto yy21;
+ case 't': goto yy22;
case 'Y':
- case 'y': goto yy22;
- case '[': goto yy23;
- default: goto yy2;
+ case 'y': goto yy23;
+ case '[': goto yy24;
+ default: goto yy3;
}
-yy2:
- YYDEBUG(2, *YYCURSOR);
- ++YYCURSOR;
- yych = *YYCURSOR;
- goto yy26;
yy3:
YYDEBUG(3, *YYCURSOR);
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy27;
+yy4:
+ YYDEBUG(4, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 429 "Zend/zend_ini_scanner.l"
+#line 480 "Zend/zend_ini_scanner.l"
{ /* Get option name */
/* Eat leading whitespace */
EAT_LEADING_WHITESPACE();
@@ -472,102 +518,102 @@ yy3:
RETURN_TOKEN(TC_LABEL, yytext, yyleng);
}
-#line 476 "Zend/zend_ini_scanner.c"
-yy4:
- YYDEBUG(4, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- goto yy68;
+#line 522 "Zend/zend_ini_scanner.c"
yy5:
YYDEBUG(5, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ goto yy74;
+yy6:
+ YYDEBUG(6, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 575 "Zend/zend_ini_scanner.l"
+#line 626 "Zend/zend_ini_scanner.l"
{
/* eat whitespace */
goto restart;
}
-#line 490 "Zend/zend_ini_scanner.c"
-yy6:
- YYDEBUG(6, *YYCURSOR);
- ++YYCURSOR;
+#line 536 "Zend/zend_ini_scanner.c"
yy7:
YYDEBUG(7, *YYCURSOR);
+ ++YYCURSOR;
+yy8:
+ YYDEBUG(8, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 580 "Zend/zend_ini_scanner.l"
+#line 631 "Zend/zend_ini_scanner.l"
{
SCNG(lineno)++;
return END_OF_LINE;
}
-#line 502 "Zend/zend_ini_scanner.c"
-yy8:
- YYDEBUG(8, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '\n') goto yy71;
- goto yy7;
+#line 548 "Zend/zend_ini_scanner.c"
yy9:
YYDEBUG(9, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '\n') goto yy77;
+ goto yy8;
+yy10:
+ YYDEBUG(10, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= ' ') {
if (yych <= '\n') {
- if (yych <= 0x08) goto yy26;
- if (yych <= '\t') goto yy67;
- goto yy71;
+ if (yych <= 0x08) goto yy27;
+ if (yych <= '\t') goto yy73;
+ goto yy77;
} else {
- if (yych == '\r') goto yy72;
- if (yych <= 0x1F) goto yy26;
- goto yy69;
+ if (yych == '\r') goto yy78;
+ if (yych <= 0x1F) goto yy27;
+ goto yy75;
}
} else {
if (yych <= ':') {
- if (yych == '#') goto yy58;
- goto yy26;
+ if (yych == '#') goto yy64;
+ goto yy27;
} else {
- if (yych <= ';') goto yy53;
- if (yych == '=') goto yy51;
- goto yy26;
+ if (yych <= ';') goto yy59;
+ if (yych == '=') goto yy57;
+ goto yy27;
}
}
-yy10:
- YYDEBUG(10, *YYCURSOR);
- ++YYCURSOR;
+yy11:
YYDEBUG(11, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(12, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 503 "Zend/zend_ini_scanner.l"
+#line 554 "Zend/zend_ini_scanner.l"
{ /* Disallow these chars outside option values */
return yytext[0];
}
-#line 541 "Zend/zend_ini_scanner.c"
-yy12:
- YYDEBUG(12, *YYCURSOR);
- yyaccept = 1;
- yych = *(YYMARKER = ++YYCURSOR);
- goto yy59;
+#line 587 "Zend/zend_ini_scanner.c"
yy13:
YYDEBUG(13, *YYCURSOR);
- yych = *++YYCURSOR;
- goto yy26;
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ goto yy65;
yy14:
YYDEBUG(14, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy27;
+yy15:
+ YYDEBUG(15, *YYCURSOR);
yyaccept = 2;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy54;
- YYDEBUG(15, *YYCURSOR);
+ goto yy60;
+ YYDEBUG(16, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 603 "Zend/zend_ini_scanner.l"
+#line 654 "Zend/zend_ini_scanner.l"
{
return 0;
}
-#line 562 "Zend/zend_ini_scanner.c"
-yy16:
- YYDEBUG(16, *YYCURSOR);
- ++YYCURSOR;
- yych = *YYCURSOR;
- goto yy52;
+#line 608 "Zend/zend_ini_scanner.c"
yy17:
YYDEBUG(17, *YYCURSOR);
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy58;
+yy18:
+ YYDEBUG(18, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 439 "Zend/zend_ini_scanner.l"
+#line 490 "Zend/zend_ini_scanner.l"
{ /* Start option value */
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
yy_push_state(ST_RAW TSRMLS_CC);
@@ -576,63 +622,63 @@ yy17:
}
return '=';
}
-#line 580 "Zend/zend_ini_scanner.c"
-yy18:
- YYDEBUG(18, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy48;
- if (yych == 'a') goto yy48;
- goto yy26;
+#line 626 "Zend/zend_ini_scanner.c"
yy19:
YYDEBUG(19, *YYCURSOR);
yych = *++YYCURSOR;
+ if (yych == 'A') goto yy54;
+ if (yych == 'a') goto yy54;
+ goto yy27;
+yy20:
+ YYDEBUG(20, *YYCURSOR);
+ yych = *++YYCURSOR;
if (yych <= 'U') {
- if (yych == 'O') goto yy44;
- if (yych <= 'T') goto yy26;
- goto yy45;
+ if (yych == 'O') goto yy45;
+ if (yych <= 'T') goto yy27;
+ goto yy46;
} else {
if (yych <= 'o') {
- if (yych <= 'n') goto yy26;
- goto yy44;
+ if (yych <= 'n') goto yy27;
+ goto yy45;
} else {
- if (yych == 'u') goto yy45;
- goto yy26;
+ if (yych == 'u') goto yy46;
+ goto yy27;
}
}
-yy20:
- YYDEBUG(20, *YYCURSOR);
+yy21:
+ YYDEBUG(21, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'N') {
- if (yych == 'F') goto yy38;
- if (yych <= 'M') goto yy26;
- goto yy31;
+ if (yych == 'F') goto yy39;
+ if (yych <= 'M') goto yy27;
+ goto yy32;
} else {
if (yych <= 'f') {
- if (yych <= 'e') goto yy26;
- goto yy38;
+ if (yych <= 'e') goto yy27;
+ goto yy39;
} else {
- if (yych == 'n') goto yy31;
- goto yy26;
+ if (yych == 'n') goto yy32;
+ goto yy27;
}
}
-yy21:
- YYDEBUG(21, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy36;
- if (yych == 'r') goto yy36;
- goto yy26;
yy22:
YYDEBUG(22, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'E') goto yy27;
- if (yych == 'e') goto yy27;
- goto yy26;
+ if (yych == 'R') goto yy37;
+ if (yych == 'r') goto yy37;
+ goto yy27;
yy23:
YYDEBUG(23, *YYCURSOR);
- ++YYCURSOR;
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy28;
+ if (yych == 'e') goto yy28;
+ goto yy27;
+yy24:
YYDEBUG(24, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(25, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 358 "Zend/zend_ini_scanner.l"
+#line 405 "Zend/zend_ini_scanner.l"
{ /* Section start */
/* Enter section data lookup state */
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
@@ -642,37 +688,37 @@ yy23:
}
return TC_SECTION;
}
-#line 646 "Zend/zend_ini_scanner.c"
-yy25:
- YYDEBUG(25, *YYCURSOR);
+#line 692 "Zend/zend_ini_scanner.c"
+yy26:
+ YYDEBUG(26, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy26:
- YYDEBUG(26, *YYCURSOR);
- if (yybm[0+yych] & 16) {
- goto yy25;
- }
- if (yych == '[') goto yy28;
- goto yy3;
yy27:
YYDEBUG(27, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'S') goto yy31;
- if (yych == 's') goto yy31;
- goto yy26;
+ if (yybm[0+yych] & 16) {
+ goto yy26;
+ }
+ if (yych == '[') goto yy29;
+ goto yy4;
yy28:
YYDEBUG(28, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'S') goto yy32;
+ if (yych == 's') goto yy32;
+ goto yy27;
+yy29:
+ YYDEBUG(29, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(29, *YYCURSOR);
+ YYDEBUG(30, *YYCURSOR);
if (yybm[0+yych] & 32) {
- goto yy28;
+ goto yy29;
}
- YYDEBUG(30, *YYCURSOR);
+ YYDEBUG(31, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 383 "Zend/zend_ini_scanner.l"
+#line 430 "Zend/zend_ini_scanner.l"
{ /* Start of option with offset */
/* Eat leading whitespace */
EAT_LEADING_WHITESPACE();
@@ -685,431 +731,488 @@ yy28:
RETURN_TOKEN(TC_OFFSET, yytext, yyleng);
}
-#line 689 "Zend/zend_ini_scanner.c"
-yy31:
- YYDEBUG(31, *YYCURSOR);
+#line 735 "Zend/zend_ini_scanner.c"
+yy32:
+ YYDEBUG(32, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(32, *YYCURSOR);
+ YYDEBUG(33, *YYCURSOR);
if (yybm[0+yych] & 64) {
- goto yy31;
+ goto yy32;
}
if (yych <= '\'') {
if (yych <= ' ') {
if (yych <= '\n') {
- if (yych <= 0x08) goto yy25;
- if (yych <= '\t') goto yy34;
+ if (yych <= 0x08) goto yy26;
+ if (yych <= '\t') goto yy35;
} else {
- if (yych != '\r') goto yy25;
+ if (yych != '\r') goto yy26;
}
} else {
if (yych <= '$') {
- if (yych == '#') goto yy25;
+ if (yych == '#') goto yy26;
} else {
- if (yych != '&') goto yy25;
+ if (yych != '&') goto yy26;
}
}
} else {
if (yych <= 'Z') {
if (yych <= ';') {
- if (yych <= ')') goto yy33;
- if (yych <= ':') goto yy25;
+ if (yych <= ')') goto yy34;
+ if (yych <= ':') goto yy26;
} else {
- if (yych != '=') goto yy25;
+ if (yych != '=') goto yy26;
}
} else {
if (yych <= '^') {
- if (yych <= '[') goto yy28;
- if (yych <= ']') goto yy25;
+ if (yych <= '[') goto yy29;
+ if (yych <= ']') goto yy26;
} else {
- if (yych <= 'z') goto yy25;
- if (yych >= 0x7F) goto yy25;
+ if (yych <= 'z') goto yy26;
+ if (yych >= 0x7F) goto yy26;
}
}
}
-yy33:
- YYDEBUG(33, *YYCURSOR);
+yy34:
+ YYDEBUG(34, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 421 "Zend/zend_ini_scanner.l"
+#line 468 "Zend/zend_ini_scanner.l"
{ /* TRUE value (when used outside option value/offset this causes parse error!) */
RETURN_TOKEN(BOOL_TRUE, "1", 1);
}
-#line 739 "Zend/zend_ini_scanner.c"
-yy34:
- YYDEBUG(34, *YYCURSOR);
+#line 785 "Zend/zend_ini_scanner.c"
+yy35:
+ YYDEBUG(35, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(35, *YYCURSOR);
- if (yych == '\t') goto yy34;
- if (yych == ' ') goto yy34;
- goto yy33;
-yy36:
YYDEBUG(36, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'U') goto yy37;
- if (yych != 'u') goto yy26;
+ if (yych == '\t') goto yy35;
+ if (yych == ' ') goto yy35;
+ goto yy34;
yy37:
YYDEBUG(37, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'E') goto yy31;
- if (yych == 'e') goto yy31;
- goto yy26;
+ if (yych == 'U') goto yy38;
+ if (yych != 'u') goto yy27;
yy38:
YYDEBUG(38, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'F') goto yy39;
- if (yych != 'f') goto yy26;
+ if (yych == 'E') goto yy32;
+ if (yych == 'e') goto yy32;
+ goto yy27;
yy39:
YYDEBUG(39, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'F') goto yy40;
+ if (yych != 'f') goto yy27;
+yy40:
+ YYDEBUG(40, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(40, *YYCURSOR);
+ YYDEBUG(41, *YYCURSOR);
if (yych <= '&') {
if (yych <= 0x1F) {
if (yych <= '\n') {
- if (yych <= 0x08) goto yy25;
- if (yych <= '\t') goto yy42;
+ if (yych <= 0x08) goto yy26;
+ if (yych <= '\t') goto yy43;
} else {
- if (yych != '\r') goto yy25;
+ if (yych != '\r') goto yy26;
}
} else {
if (yych <= '#') {
- if (yych <= ' ') goto yy39;
- if (yych >= '#') goto yy25;
+ if (yych <= ' ') goto yy40;
+ if (yych >= '#') goto yy26;
} else {
- if (yych == '%') goto yy25;
+ if (yych == '%') goto yy26;
}
}
} else {
if (yych <= '=') {
if (yych <= ':') {
- if (yych <= '\'') goto yy25;
- if (yych >= '*') goto yy25;
+ if (yych <= '\'') goto yy26;
+ if (yych >= '*') goto yy26;
} else {
- if (yych == '<') goto yy25;
+ if (yych == '<') goto yy26;
}
} else {
if (yych <= ']') {
- if (yych == '[') goto yy28;
- goto yy25;
+ if (yych == '[') goto yy29;
+ goto yy26;
} else {
- if (yych <= '^') goto yy41;
- if (yych <= 'z') goto yy25;
- if (yych >= 0x7F) goto yy25;
+ if (yych <= '^') goto yy42;
+ if (yych <= 'z') goto yy26;
+ if (yych >= 0x7F) goto yy26;
}
}
}
-yy41:
- YYDEBUG(41, *YYCURSOR);
+yy42:
+ YYDEBUG(42, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 425 "Zend/zend_ini_scanner.l"
+#line 472 "Zend/zend_ini_scanner.l"
{ /* FALSE value (when used outside option value/offset this causes parse error!)*/
RETURN_TOKEN(BOOL_FALSE, "", 0);
}
-#line 813 "Zend/zend_ini_scanner.c"
-yy42:
- YYDEBUG(42, *YYCURSOR);
+#line 859 "Zend/zend_ini_scanner.c"
+yy43:
+ YYDEBUG(43, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(43, *YYCURSOR);
- if (yych == '\t') goto yy42;
- if (yych == ' ') goto yy42;
- goto yy41;
-yy44:
YYDEBUG(44, *YYCURSOR);
+ if (yych == '\t') goto yy43;
+ if (yych == ' ') goto yy43;
+ goto yy42;
+yy45:
+ YYDEBUG(45, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '\'') {
if (yych <= 0x1F) {
if (yych <= '\n') {
- if (yych <= 0x08) goto yy26;
- if (yych <= '\t') goto yy42;
- goto yy41;
+ if (yych <= 0x08) goto yy27;
+ if (yych <= '\t') goto yy43;
+ goto yy42;
} else {
- if (yych == '\r') goto yy41;
- goto yy26;
+ if (yych == '\r') goto yy42;
+ goto yy27;
}
} else {
if (yych <= '#') {
- if (yych <= ' ') goto yy39;
- if (yych <= '"') goto yy41;
- goto yy26;
+ if (yych <= ' ') goto yy40;
+ if (yych <= '"') goto yy42;
+ goto yy27;
} else {
- if (yych == '%') goto yy26;
- if (yych <= '&') goto yy41;
- goto yy26;
+ if (yych == '%') goto yy27;
+ if (yych <= '&') goto yy42;
+ goto yy27;
}
}
} else {
if (yych <= 'N') {
if (yych <= ';') {
- if (yych <= ')') goto yy41;
- if (yych <= ':') goto yy26;
- goto yy41;
+ if (yych <= ')') goto yy42;
+ if (yych <= ':') goto yy27;
+ goto yy42;
} else {
- if (yych == '=') goto yy41;
- if (yych <= 'M') goto yy26;
- goto yy47;
+ if (yych == '=') goto yy42;
+ if (yych <= 'M') goto yy27;
+ goto yy53;
}
} else {
if (yych <= 'm') {
- if (yych == '^') goto yy41;
- goto yy26;
+ if (yych == '^') goto yy42;
+ goto yy27;
} else {
- if (yych <= 'n') goto yy47;
- if (yych <= 'z') goto yy26;
- if (yych <= '~') goto yy41;
- goto yy26;
+ if (yych <= 'n') goto yy53;
+ if (yych <= 'z') goto yy27;
+ if (yych <= '~') goto yy42;
+ goto yy27;
}
}
}
-yy45:
- YYDEBUG(45, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy46;
- if (yych != 'l') goto yy26;
yy46:
YYDEBUG(46, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'L') goto yy39;
- if (yych == 'l') goto yy39;
- goto yy26;
+ if (yych == 'L') goto yy47;
+ if (yych != 'l') goto yy27;
yy47:
YYDEBUG(47, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == 'E') goto yy39;
- if (yych == 'e') goto yy39;
- goto yy26;
+ if (yych == 'L') goto yy48;
+ if (yych != 'l') goto yy27;
yy48:
YYDEBUG(48, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy49;
- if (yych != 'l') goto yy26;
-yy49:
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
YYDEBUG(49, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'S') goto yy50;
- if (yych != 's') goto yy26;
+ if (yych <= '&') {
+ if (yych <= 0x1F) {
+ if (yych <= '\n') {
+ if (yych <= 0x08) goto yy26;
+ if (yych <= '\t') goto yy51;
+ } else {
+ if (yych != '\r') goto yy26;
+ }
+ } else {
+ if (yych <= '#') {
+ if (yych <= ' ') goto yy48;
+ if (yych >= '#') goto yy26;
+ } else {
+ if (yych == '%') goto yy26;
+ }
+ }
+ } else {
+ if (yych <= '=') {
+ if (yych <= ':') {
+ if (yych <= '\'') goto yy26;
+ if (yych >= '*') goto yy26;
+ } else {
+ if (yych == '<') goto yy26;
+ }
+ } else {
+ if (yych <= ']') {
+ if (yych == '[') goto yy29;
+ goto yy26;
+ } else {
+ if (yych <= '^') goto yy50;
+ if (yych <= 'z') goto yy26;
+ if (yych >= 0x7F) goto yy26;
+ }
+ }
+ }
yy50:
YYDEBUG(50, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy39;
- if (yych == 'e') goto yy39;
- goto yy26;
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 476 "Zend/zend_ini_scanner.l"
+ {
+ RETURN_TOKEN(NULL_NULL, "", 0);
+}
+#line 974 "Zend/zend_ini_scanner.c"
yy51:
YYDEBUG(51, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy52:
YYDEBUG(52, *YYCURSOR);
if (yych == '\t') goto yy51;
if (yych == ' ') goto yy51;
- goto yy17;
+ goto yy50;
yy53:
YYDEBUG(53, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(2);
- yych = *YYCURSOR;
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy40;
+ if (yych == 'e') goto yy40;
+ goto yy27;
yy54:
YYDEBUG(54, *YYCURSOR);
- if (yybm[0+yych] & 128) {
- goto yy53;
- }
- if (yych >= '\r') goto yy57;
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy55;
+ if (yych != 'l') goto yy27;
yy55:
YYDEBUG(55, *YYCURSOR);
- ++YYCURSOR;
+ yych = *++YYCURSOR;
+ if (yych == 'S') goto yy56;
+ if (yych != 's') goto yy27;
yy56:
YYDEBUG(56, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy40;
+ if (yych == 'e') goto yy40;
+ goto yy27;
+yy57:
+ YYDEBUG(57, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+yy58:
+ YYDEBUG(58, *YYCURSOR);
+ if (yych == '\t') goto yy57;
+ if (yych == ' ') goto yy57;
+ goto yy18;
+yy59:
+ YYDEBUG(59, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(2);
+ yych = *YYCURSOR;
+yy60:
+ YYDEBUG(60, *YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy59;
+ }
+ if (yych >= '\r') goto yy63;
+yy61:
+ YYDEBUG(61, *YYCURSOR);
+ ++YYCURSOR;
+yy62:
+ YYDEBUG(62, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 585 "Zend/zend_ini_scanner.l"
+#line 636 "Zend/zend_ini_scanner.l"
{ /* Comment */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
-#line 936 "Zend/zend_ini_scanner.c"
-yy57:
- YYDEBUG(57, *YYCURSOR);
+#line 1039 "Zend/zend_ini_scanner.c"
+yy63:
+ YYDEBUG(63, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == '\n') goto yy55;
- goto yy56;
-yy58:
- YYDEBUG(58, *YYCURSOR);
+ if (yych == '\n') goto yy61;
+ goto yy62;
+yy64:
+ YYDEBUG(64, *YYCURSOR);
yyaccept = 1;
YYMARKER = ++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
-yy59:
- YYDEBUG(59, *YYCURSOR);
+yy65:
+ YYDEBUG(65, *YYCURSOR);
if (yych <= '\'') {
if (yych <= ' ') {
if (yych <= '\n') {
- if (yych <= 0x08) goto yy58;
- if (yych >= '\n') goto yy64;
+ if (yych <= 0x08) goto yy64;
+ if (yych >= '\n') goto yy70;
} else {
- if (yych == '\r') goto yy66;
- goto yy58;
+ if (yych == '\r') goto yy72;
+ goto yy64;
}
} else {
if (yych <= '$') {
- if (yych == '#') goto yy58;
+ if (yych == '#') goto yy64;
} else {
- if (yych != '&') goto yy58;
+ if (yych != '&') goto yy64;
}
}
} else {
if (yych <= 'Z') {
if (yych <= ';') {
- if (yych <= ')') goto yy60;
- if (yych <= ':') goto yy58;
+ if (yych <= ')') goto yy66;
+ if (yych <= ':') goto yy64;
} else {
- if (yych != '=') goto yy58;
+ if (yych != '=') goto yy64;
}
} else {
if (yych <= '^') {
- if (yych <= '[') goto yy62;
- if (yych <= ']') goto yy58;
+ if (yych <= '[') goto yy68;
+ if (yych <= ']') goto yy64;
} else {
- if (yych <= 'z') goto yy58;
- if (yych >= 0x7F) goto yy58;
+ if (yych <= 'z') goto yy64;
+ if (yych >= 0x7F) goto yy64;
}
}
}
-yy60:
- YYDEBUG(60, *YYCURSOR);
+yy66:
+ YYDEBUG(66, *YYCURSOR);
++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
- YYDEBUG(61, *YYCURSOR);
- if (yych == '\n') goto yy64;
- if (yych == '\r') goto yy66;
- goto yy60;
-yy62:
- YYDEBUG(62, *YYCURSOR);
+ YYDEBUG(67, *YYCURSOR);
+ if (yych == '\n') goto yy70;
+ if (yych == '\r') goto yy72;
+ goto yy66;
+yy68:
+ YYDEBUG(68, *YYCURSOR);
yyaccept = 3;
YYMARKER = ++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
- YYDEBUG(63, *YYCURSOR);
+ YYDEBUG(69, *YYCURSOR);
if (yych <= '\f') {
- if (yych <= 0x08) goto yy60;
- if (yych <= '\t') goto yy62;
- if (yych >= '\v') goto yy60;
+ if (yych <= 0x08) goto yy66;
+ if (yych <= '\t') goto yy68;
+ if (yych >= '\v') goto yy66;
} else {
- if (yych <= '\r') goto yy66;
- if (yych == ' ') goto yy62;
- goto yy60;
+ if (yych <= '\r') goto yy72;
+ if (yych == ' ') goto yy68;
+ goto yy66;
}
-yy64:
- YYDEBUG(64, *YYCURSOR);
+yy70:
+ YYDEBUG(70, *YYCURSOR);
++YYCURSOR;
-yy65:
- YYDEBUG(65, *YYCURSOR);
+yy71:
+ YYDEBUG(71, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 591 "Zend/zend_ini_scanner.l"
+#line 642 "Zend/zend_ini_scanner.l"
{ /* #Comment */
zend_error(E_DEPRECATED, "Comments starting with '#' are deprecated in %s on line %d", zend_ini_scanner_get_filename(TSRMLS_C), SCNG(lineno));
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
-#line 1022 "Zend/zend_ini_scanner.c"
-yy66:
- YYDEBUG(66, *YYCURSOR);
+#line 1125 "Zend/zend_ini_scanner.c"
+yy72:
+ YYDEBUG(72, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == '\n') goto yy64;
- goto yy65;
-yy67:
- YYDEBUG(67, *YYCURSOR);
+ if (yych == '\n') goto yy70;
+ goto yy71;
+yy73:
+ YYDEBUG(73, *YYCURSOR);
yyaccept = 0;
YYMARKER = ++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
-yy68:
- YYDEBUG(68, *YYCURSOR);
+yy74:
+ YYDEBUG(74, *YYCURSOR);
if (yych <= ' ') {
if (yych <= '\n') {
- if (yych <= 0x08) goto yy5;
- if (yych <= '\t') goto yy67;
- goto yy71;
+ if (yych <= 0x08) goto yy6;
+ if (yych <= '\t') goto yy73;
+ goto yy77;
} else {
- if (yych == '\r') goto yy72;
- if (yych <= 0x1F) goto yy5;
- goto yy67;
+ if (yych == '\r') goto yy78;
+ if (yych <= 0x1F) goto yy6;
+ goto yy73;
}
} else {
if (yych <= ':') {
- if (yych == '#') goto yy60;
- goto yy5;
+ if (yych == '#') goto yy66;
+ goto yy6;
} else {
- if (yych <= ';') goto yy53;
- if (yych == '=') goto yy51;
- goto yy5;
+ if (yych <= ';') goto yy59;
+ if (yych == '=') goto yy57;
+ goto yy6;
}
}
-yy69:
- YYDEBUG(69, *YYCURSOR);
+yy75:
+ YYDEBUG(75, *YYCURSOR);
yyaccept = 1;
YYMARKER = ++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
- YYDEBUG(70, *YYCURSOR);
+ YYDEBUG(76, *YYCURSOR);
if (yych <= '&') {
if (yych <= 0x1F) {
if (yych <= '\n') {
- if (yych <= 0x08) goto yy25;
- if (yych <= '\t') goto yy67;
+ if (yych <= 0x08) goto yy26;
+ if (yych <= '\t') goto yy73;
} else {
- if (yych == '\r') goto yy72;
- goto yy25;
+ if (yych == '\r') goto yy78;
+ goto yy26;
}
} else {
if (yych <= '#') {
- if (yych <= ' ') goto yy69;
- if (yych <= '"') goto yy3;
- goto yy58;
+ if (yych <= ' ') goto yy75;
+ if (yych <= '"') goto yy4;
+ goto yy64;
} else {
- if (yych == '%') goto yy25;
- goto yy3;
+ if (yych == '%') goto yy26;
+ goto yy4;
}
}
} else {
if (yych <= '=') {
if (yych <= ':') {
- if (yych <= '\'') goto yy25;
- if (yych <= ')') goto yy3;
- goto yy25;
+ if (yych <= '\'') goto yy26;
+ if (yych <= ')') goto yy4;
+ goto yy26;
} else {
- if (yych <= ';') goto yy53;
- if (yych <= '<') goto yy25;
- goto yy51;
+ if (yych <= ';') goto yy59;
+ if (yych <= '<') goto yy26;
+ goto yy57;
}
} else {
if (yych <= ']') {
- if (yych == '[') goto yy28;
- goto yy25;
+ if (yych == '[') goto yy29;
+ goto yy26;
} else {
- if (yych <= '^') goto yy3;
- if (yych <= 'z') goto yy25;
- if (yych <= '~') goto yy3;
- goto yy25;
+ if (yych <= '^') goto yy4;
+ if (yych <= 'z') goto yy26;
+ if (yych <= '~') goto yy4;
+ goto yy26;
}
}
}
-yy71:
- YYDEBUG(71, *YYCURSOR);
+yy77:
+ YYDEBUG(77, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy7;
-yy72:
- YYDEBUG(72, *YYCURSOR);
+ goto yy8;
+yy78:
+ YYDEBUG(78, *YYCURSOR);
++YYCURSOR;
- if ((yych = *YYCURSOR) == '\n') goto yy71;
- goto yy7;
+ if ((yych = *YYCURSOR) == '\n') goto yy77;
+ goto yy8;
}
/* *********************************** */
yyc_ST_DOUBLE_QUOTES:
@@ -1148,17 +1251,17 @@ yyc_ST_DOUBLE_QUOTES:
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
- YYDEBUG(73, *YYCURSOR);
+ YYDEBUG(79, *YYCURSOR);
YYFILL(2);
yych = *YYCURSOR;
- if (yych == '"') goto yy77;
- if (yych == '$') goto yy79;
- YYDEBUG(75, *YYCURSOR);
+ if (yych == '"') goto yy83;
+ if (yych == '$') goto yy85;
+ YYDEBUG(81, *YYCURSOR);
++YYCURSOR;
-yy76:
- YYDEBUG(76, *YYCURSOR);
+yy82:
+ YYDEBUG(82, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 535 "Zend/zend_ini_scanner.l"
+#line 586 "Zend/zend_ini_scanner.l"
{ /* Escape double quoted string contents */
if (YYCURSOR > YYLIMIT) {
return 0;
@@ -1194,46 +1297,46 @@ yy76:
zend_ini_escape_string(ini_lval, yytext, yyleng, '"' TSRMLS_CC);
return TC_QUOTED_STRING;
}
-#line 1198 "Zend/zend_ini_scanner.c"
-yy77:
- YYDEBUG(77, *YYCURSOR);
+#line 1301 "Zend/zend_ini_scanner.c"
+yy83:
+ YYDEBUG(83, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
- goto yy83;
-yy78:
- YYDEBUG(78, *YYCURSOR);
+ goto yy89;
+yy84:
+ YYDEBUG(84, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 530 "Zend/zend_ini_scanner.l"
+#line 581 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string ends */
yy_pop_state(TSRMLS_C);
return '"';
}
-#line 1212 "Zend/zend_ini_scanner.c"
-yy79:
- YYDEBUG(79, *YYCURSOR);
+#line 1315 "Zend/zend_ini_scanner.c"
+yy85:
+ YYDEBUG(85, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych != '{') goto yy76;
- YYDEBUG(80, *YYCURSOR);
+ if (yych != '{') goto yy82;
+ YYDEBUG(86, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(81, *YYCURSOR);
+ YYDEBUG(87, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 401 "Zend/zend_ini_scanner.l"
+#line 448 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME TSRMLS_CC);
return TC_DOLLAR_CURLY;
}
-#line 1226 "Zend/zend_ini_scanner.c"
-yy82:
- YYDEBUG(82, *YYCURSOR);
+#line 1329 "Zend/zend_ini_scanner.c"
+yy88:
+ YYDEBUG(88, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy83:
- YYDEBUG(83, *YYCURSOR);
+yy89:
+ YYDEBUG(89, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy82;
+ goto yy88;
}
- goto yy78;
+ goto yy84;
}
/* *********************************** */
yyc_ST_OFFSET:
@@ -1272,496 +1375,496 @@ yyc_ST_OFFSET:
66, 66, 66, 66, 66, 66, 66, 66,
66, 66, 66, 66, 66, 66, 66, 66,
};
- YYDEBUG(84, *YYCURSOR);
+ YYDEBUG(90, *YYCURSOR);
YYFILL(2);
yych = *YYCURSOR;
if (yych <= '-') {
if (yych <= ' ') {
if (yych <= '\n') {
- if (yych <= 0x08) goto yy86;
- if (yych <= '\t') goto yy88;
- goto yy89;
+ if (yych <= 0x08) goto yy92;
+ if (yych <= '\t') goto yy94;
+ goto yy95;
} else {
- if (yych == '\r') goto yy89;
- if (yych >= ' ') goto yy88;
+ if (yych == '\r') goto yy95;
+ if (yych >= ' ') goto yy94;
}
} else {
if (yych <= '$') {
- if (yych == '"') goto yy91;
- if (yych >= '$') goto yy93;
+ if (yych == '"') goto yy97;
+ if (yych >= '$') goto yy99;
} else {
- if (yych == '\'') goto yy94;
- if (yych >= '-') goto yy95;
+ if (yych == '\'') goto yy100;
+ if (yych >= '-') goto yy101;
}
}
} else {
if (yych <= 'Z') {
if (yych <= '9') {
- if (yych <= '.') goto yy96;
- if (yych >= '0') goto yy97;
+ if (yych <= '.') goto yy102;
+ if (yych >= '0') goto yy103;
} else {
- if (yych == ';') goto yy89;
- if (yych >= 'A') goto yy99;
+ if (yych == ';') goto yy95;
+ if (yych >= 'A') goto yy105;
}
} else {
if (yych <= '^') {
- if (yych <= '[') goto yy86;
- if (yych <= '\\') goto yy101;
- if (yych <= ']') goto yy102;
+ if (yych <= '[') goto yy92;
+ if (yych <= '\\') goto yy107;
+ if (yych <= ']') goto yy108;
} else {
- if (yych == '`') goto yy86;
- if (yych <= 'z') goto yy99;
+ if (yych == '`') goto yy92;
+ if (yych <= 'z') goto yy105;
}
}
}
-yy86:
- YYDEBUG(86, *YYCURSOR);
+yy92:
+ YYDEBUG(92, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy105;
-yy87:
- YYDEBUG(87, *YYCURSOR);
+ goto yy111;
+yy93:
+ YYDEBUG(93, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 521 "Zend/zend_ini_scanner.l"
+#line 572 "Zend/zend_ini_scanner.l"
{ /* Get rest as section/offset value */
RETURN_TOKEN(TC_STRING, yytext, yyleng);
}
-#line 1330 "Zend/zend_ini_scanner.c"
-yy88:
- YYDEBUG(88, *YYCURSOR);
+#line 1433 "Zend/zend_ini_scanner.c"
+yy94:
+ YYDEBUG(94, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy131;
+ goto yy137;
}
- if (yych == '"') goto yy133;
- if (yych == ']') goto yy134;
- goto yy105;
-yy89:
- YYDEBUG(89, *YYCURSOR);
+ if (yych == '"') goto yy139;
+ if (yych == ']') goto yy140;
+ goto yy111;
+yy95:
+ YYDEBUG(95, *YYCURSOR);
++YYCURSOR;
-yy90:
- YYDEBUG(90, *YYCURSOR);
+yy96:
+ YYDEBUG(96, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 603 "Zend/zend_ini_scanner.l"
+#line 654 "Zend/zend_ini_scanner.l"
{
return 0;
}
-#line 1351 "Zend/zend_ini_scanner.c"
-yy91:
- YYDEBUG(91, *YYCURSOR);
+#line 1454 "Zend/zend_ini_scanner.c"
+yy97:
+ YYDEBUG(97, *YYCURSOR);
++YYCURSOR;
-yy92:
- YYDEBUG(92, *YYCURSOR);
+yy98:
+ YYDEBUG(98, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 525 "Zend/zend_ini_scanner.l"
+#line 576 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string start */
yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
return '"';
}
-#line 1363 "Zend/zend_ini_scanner.c"
-yy93:
- YYDEBUG(93, *YYCURSOR);
+#line 1466 "Zend/zend_ini_scanner.c"
+yy99:
+ YYDEBUG(99, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '\\') {
- if (yych <= 0x00) goto yy90;
- if (yych <= '[') goto yy104;
- goto yy109;
+ if (yych <= 0x00) goto yy96;
+ if (yych <= '[') goto yy110;
+ goto yy115;
} else {
- if (yych == '{') goto yy129;
- goto yy104;
+ if (yych == '{') goto yy135;
+ goto yy110;
}
-yy94:
- YYDEBUG(94, *YYCURSOR);
+yy100:
+ YYDEBUG(100, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 64) {
- goto yy125;
+ goto yy131;
}
- goto yy90;
-yy95:
- YYDEBUG(95, *YYCURSOR);
+ goto yy96;
+yy101:
+ YYDEBUG(101, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '/') goto yy105;
- if (yych <= '9') goto yy123;
- goto yy105;
-yy96:
- YYDEBUG(96, *YYCURSOR);
+ if (yych <= '/') goto yy111;
+ if (yych <= '9') goto yy129;
+ goto yy111;
+yy102:
+ YYDEBUG(102, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '/') goto yy105;
- if (yych <= '9') goto yy121;
- goto yy105;
-yy97:
- YYDEBUG(97, *YYCURSOR);
+ if (yych <= '/') goto yy111;
+ if (yych <= '9') goto yy127;
+ goto yy111;
+yy103:
+ YYDEBUG(103, *YYCURSOR);
yyaccept = 2;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '\'') {
if (yych <= '\r') {
- if (yych == '\n') goto yy98;
- if (yych <= '\f') goto yy105;
+ if (yych == '\n') goto yy104;
+ if (yych <= '\f') goto yy111;
} else {
- if (yych == '"') goto yy98;
- if (yych <= '&') goto yy105;
+ if (yych == '"') goto yy104;
+ if (yych <= '&') goto yy111;
}
} else {
if (yych <= '9') {
- if (yych == '.') goto yy117;
- if (yych <= '/') goto yy105;
- goto yy119;
+ if (yych == '.') goto yy123;
+ if (yych <= '/') goto yy111;
+ goto yy125;
} else {
if (yych <= ';') {
- if (yych <= ':') goto yy105;
+ if (yych <= ':') goto yy111;
} else {
- if (yych != ']') goto yy105;
+ if (yych != ']') goto yy111;
}
}
}
-yy98:
- YYDEBUG(98, *YYCURSOR);
+yy104:
+ YYDEBUG(104, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 499 "Zend/zend_ini_scanner.l"
+#line 550 "Zend/zend_ini_scanner.l"
{ /* Get number option value as string */
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
}
-#line 1429 "Zend/zend_ini_scanner.c"
-yy99:
- YYDEBUG(99, *YYCURSOR);
+#line 1532 "Zend/zend_ini_scanner.c"
+yy105:
+ YYDEBUG(105, *YYCURSOR);
yyaccept = 3;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 16) {
- goto yy115;
+ goto yy121;
}
if (yych <= '"') {
if (yych <= '\f') {
- if (yych != '\n') goto yy105;
+ if (yych != '\n') goto yy111;
} else {
- if (yych <= '\r') goto yy100;
- if (yych <= '!') goto yy105;
+ if (yych <= '\r') goto yy106;
+ if (yych <= '!') goto yy111;
}
} else {
if (yych <= ':') {
- if (yych != '\'') goto yy105;
+ if (yych != '\'') goto yy111;
} else {
- if (yych <= ';') goto yy100;
- if (yych != ']') goto yy105;
+ if (yych <= ';') goto yy106;
+ if (yych != ']') goto yy111;
}
}
-yy100:
- YYDEBUG(100, *YYCURSOR);
+yy106:
+ YYDEBUG(106, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 495 "Zend/zend_ini_scanner.l"
+#line 546 "Zend/zend_ini_scanner.l"
{ /* Get constant option value */
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
}
-#line 1459 "Zend/zend_ini_scanner.c"
-yy101:
- YYDEBUG(101, *YYCURSOR);
+#line 1562 "Zend/zend_ini_scanner.c"
+yy107:
+ YYDEBUG(107, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy104;
-yy102:
- YYDEBUG(102, *YYCURSOR);
+ goto yy110;
+yy108:
+ YYDEBUG(108, *YYCURSOR);
++YYCURSOR;
-yy103:
- YYDEBUG(103, *YYCURSOR);
+yy109:
+ YYDEBUG(109, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 396 "Zend/zend_ini_scanner.l"
+#line 443 "Zend/zend_ini_scanner.l"
{ /* End of section or an option offset */
BEGIN(INITIAL);
return ']';
}
-#line 1475 "Zend/zend_ini_scanner.c"
-yy104:
- YYDEBUG(104, *YYCURSOR);
+#line 1578 "Zend/zend_ini_scanner.c"
+yy110:
+ YYDEBUG(110, *YYCURSOR);
yyaccept = 0;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy105:
- YYDEBUG(105, *YYCURSOR);
+yy111:
+ YYDEBUG(111, *YYCURSOR);
if (yybm[0+yych] & 2) {
- goto yy104;
+ goto yy110;
}
- if (yych == '$') goto yy107;
- if (yych != '\\') goto yy87;
-yy106:
- YYDEBUG(106, *YYCURSOR);
+ if (yych == '$') goto yy113;
+ if (yych != '\\') goto yy93;
+yy112:
+ YYDEBUG(112, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- goto yy104;
-yy107:
- YYDEBUG(107, *YYCURSOR);
+ goto yy110;
+yy113:
+ YYDEBUG(113, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
if (yych <= '\\') {
- if (yych <= 0x00) goto yy108;
- if (yych <= '[') goto yy104;
- goto yy109;
+ if (yych <= 0x00) goto yy114;
+ if (yych <= '[') goto yy110;
+ goto yy115;
} else {
- if (yych != '{') goto yy104;
+ if (yych != '{') goto yy110;
}
-yy108:
- YYDEBUG(108, *YYCURSOR);
+yy114:
+ YYDEBUG(114, *YYCURSOR);
YYCURSOR = YYMARKER;
if (yyaccept <= 1) {
- if (yyaccept <= 0) {
- goto yy87;
+ if (yyaccept == 0) {
+ goto yy93;
} else {
- goto yy90;
+ goto yy96;
}
} else {
- if (yyaccept <= 2) {
- goto yy98;
+ if (yyaccept == 2) {
+ goto yy104;
} else {
- goto yy100;
+ goto yy106;
}
}
-yy109:
- YYDEBUG(109, *YYCURSOR);
+yy115:
+ YYDEBUG(115, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
if (yybm[0+yych] & 4) {
- goto yy110;
+ goto yy116;
}
- if (yych == '\\') goto yy112;
- goto yy104;
-yy110:
- YYDEBUG(110, *YYCURSOR);
+ if (yych == '\\') goto yy118;
+ goto yy110;
+yy116:
+ YYDEBUG(116, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(111, *YYCURSOR);
+ YYDEBUG(117, *YYCURSOR);
if (yybm[0+yych] & 4) {
- goto yy110;
+ goto yy116;
}
- if (yych == '\\') goto yy114;
- goto yy104;
-yy112:
- YYDEBUG(112, *YYCURSOR);
+ if (yych == '\\') goto yy120;
+ goto yy110;
+yy118:
+ YYDEBUG(118, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(113, *YYCURSOR);
+ YYDEBUG(119, *YYCURSOR);
if (yybm[0+yych] & 4) {
- goto yy110;
+ goto yy116;
}
- if (yych == '\\') goto yy112;
- goto yy104;
-yy114:
- YYDEBUG(114, *YYCURSOR);
+ if (yych == '\\') goto yy118;
+ goto yy110;
+yy120:
+ YYDEBUG(120, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
if (yybm[0+yych] & 4) {
- goto yy110;
+ goto yy116;
}
- if (yych == '\\') goto yy112;
- goto yy104;
-yy115:
- YYDEBUG(115, *YYCURSOR);
+ if (yych == '\\') goto yy118;
+ goto yy110;
+yy121:
+ YYDEBUG(121, *YYCURSOR);
yyaccept = 3;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(116, *YYCURSOR);
+ YYDEBUG(122, *YYCURSOR);
if (yybm[0+yych] & 16) {
- goto yy115;
+ goto yy121;
}
if (yych <= '$') {
if (yych <= '\r') {
- if (yych == '\n') goto yy100;
- if (yych <= '\f') goto yy104;
- goto yy100;
+ if (yych == '\n') goto yy106;
+ if (yych <= '\f') goto yy110;
+ goto yy106;
} else {
- if (yych == '"') goto yy100;
- if (yych <= '#') goto yy104;
- goto yy107;
+ if (yych == '"') goto yy106;
+ if (yych <= '#') goto yy110;
+ goto yy113;
}
} else {
if (yych <= ';') {
- if (yych == '\'') goto yy100;
- if (yych <= ':') goto yy104;
- goto yy100;
+ if (yych == '\'') goto yy106;
+ if (yych <= ':') goto yy110;
+ goto yy106;
} else {
- if (yych <= '[') goto yy104;
- if (yych <= '\\') goto yy106;
- if (yych <= ']') goto yy100;
- goto yy104;
+ if (yych <= '[') goto yy110;
+ if (yych <= '\\') goto yy112;
+ if (yych <= ']') goto yy106;
+ goto yy110;
}
}
-yy117:
- YYDEBUG(117, *YYCURSOR);
+yy123:
+ YYDEBUG(123, *YYCURSOR);
yyaccept = 2;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(118, *YYCURSOR);
+ YYDEBUG(124, *YYCURSOR);
if (yybm[0+yych] & 32) {
- goto yy117;
+ goto yy123;
}
if (yych <= '$') {
if (yych <= '\r') {
- if (yych == '\n') goto yy98;
- if (yych <= '\f') goto yy104;
- goto yy98;
+ if (yych == '\n') goto yy104;
+ if (yych <= '\f') goto yy110;
+ goto yy104;
} else {
- if (yych == '"') goto yy98;
- if (yych <= '#') goto yy104;
- goto yy107;
+ if (yych == '"') goto yy104;
+ if (yych <= '#') goto yy110;
+ goto yy113;
}
} else {
if (yych <= ';') {
- if (yych == '\'') goto yy98;
- if (yych <= ':') goto yy104;
- goto yy98;
- } else {
- if (yych <= '[') goto yy104;
- if (yych <= '\\') goto yy106;
- if (yych <= ']') goto yy98;
+ if (yych == '\'') goto yy104;
+ if (yych <= ':') goto yy110;
goto yy104;
+ } else {
+ if (yych <= '[') goto yy110;
+ if (yych <= '\\') goto yy112;
+ if (yych <= ']') goto yy104;
+ goto yy110;
}
}
-yy119:
- YYDEBUG(119, *YYCURSOR);
+yy125:
+ YYDEBUG(125, *YYCURSOR);
yyaccept = 2;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(120, *YYCURSOR);
+ YYDEBUG(126, *YYCURSOR);
if (yych <= '\'') {
if (yych <= '!') {
if (yych <= '\n') {
- if (yych <= '\t') goto yy104;
- goto yy98;
- } else {
- if (yych == '\r') goto yy98;
+ if (yych <= '\t') goto yy110;
goto yy104;
+ } else {
+ if (yych == '\r') goto yy104;
+ goto yy110;
}
} else {
if (yych <= '#') {
- if (yych <= '"') goto yy98;
- goto yy104;
+ if (yych <= '"') goto yy104;
+ goto yy110;
} else {
- if (yych <= '$') goto yy107;
- if (yych <= '&') goto yy104;
- goto yy98;
+ if (yych <= '$') goto yy113;
+ if (yych <= '&') goto yy110;
+ goto yy104;
}
}
} else {
if (yych <= ':') {
if (yych <= '.') {
- if (yych <= '-') goto yy104;
- goto yy117;
+ if (yych <= '-') goto yy110;
+ goto yy123;
} else {
- if (yych <= '/') goto yy104;
- if (yych <= '9') goto yy119;
- goto yy104;
+ if (yych <= '/') goto yy110;
+ if (yych <= '9') goto yy125;
+ goto yy110;
}
} else {
if (yych <= '[') {
- if (yych <= ';') goto yy98;
- goto yy104;
+ if (yych <= ';') goto yy104;
+ goto yy110;
} else {
- if (yych <= '\\') goto yy106;
- if (yych <= ']') goto yy98;
- goto yy104;
+ if (yych <= '\\') goto yy112;
+ if (yych <= ']') goto yy104;
+ goto yy110;
}
}
}
-yy121:
- YYDEBUG(121, *YYCURSOR);
+yy127:
+ YYDEBUG(127, *YYCURSOR);
yyaccept = 2;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(122, *YYCURSOR);
+ YYDEBUG(128, *YYCURSOR);
if (yych <= '&') {
if (yych <= '\r') {
- if (yych == '\n') goto yy98;
- if (yych <= '\f') goto yy104;
- goto yy98;
+ if (yych == '\n') goto yy104;
+ if (yych <= '\f') goto yy110;
+ goto yy104;
} else {
if (yych <= '"') {
- if (yych <= '!') goto yy104;
- goto yy98;
- } else {
- if (yych == '$') goto yy107;
+ if (yych <= '!') goto yy110;
goto yy104;
+ } else {
+ if (yych == '$') goto yy113;
+ goto yy110;
}
}
} else {
if (yych <= ':') {
- if (yych <= '\'') goto yy98;
- if (yych <= '/') goto yy104;
- if (yych <= '9') goto yy121;
- goto yy104;
+ if (yych <= '\'') goto yy104;
+ if (yych <= '/') goto yy110;
+ if (yych <= '9') goto yy127;
+ goto yy110;
} else {
if (yych <= '[') {
- if (yych <= ';') goto yy98;
- goto yy104;
+ if (yych <= ';') goto yy104;
+ goto yy110;
} else {
- if (yych <= '\\') goto yy106;
- if (yych <= ']') goto yy98;
- goto yy104;
+ if (yych <= '\\') goto yy112;
+ if (yych <= ']') goto yy104;
+ goto yy110;
}
}
}
-yy123:
- YYDEBUG(123, *YYCURSOR);
+yy129:
+ YYDEBUG(129, *YYCURSOR);
yyaccept = 2;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(124, *YYCURSOR);
+ YYDEBUG(130, *YYCURSOR);
if (yych <= '&') {
if (yych <= '\r') {
- if (yych == '\n') goto yy98;
- if (yych <= '\f') goto yy104;
- goto yy98;
+ if (yych == '\n') goto yy104;
+ if (yych <= '\f') goto yy110;
+ goto yy104;
} else {
if (yych <= '"') {
- if (yych <= '!') goto yy104;
- goto yy98;
- } else {
- if (yych == '$') goto yy107;
+ if (yych <= '!') goto yy110;
goto yy104;
+ } else {
+ if (yych == '$') goto yy113;
+ goto yy110;
}
}
} else {
if (yych <= ':') {
- if (yych <= '\'') goto yy98;
- if (yych <= '/') goto yy104;
- if (yych <= '9') goto yy123;
- goto yy104;
+ if (yych <= '\'') goto yy104;
+ if (yych <= '/') goto yy110;
+ if (yych <= '9') goto yy129;
+ goto yy110;
} else {
if (yych <= '[') {
- if (yych <= ';') goto yy98;
- goto yy104;
+ if (yych <= ';') goto yy104;
+ goto yy110;
} else {
- if (yych <= '\\') goto yy106;
- if (yych <= ']') goto yy98;
- goto yy104;
+ if (yych <= '\\') goto yy112;
+ if (yych <= ']') goto yy104;
+ goto yy110;
}
}
}
-yy125:
- YYDEBUG(125, *YYCURSOR);
+yy131:
+ YYDEBUG(131, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(126, *YYCURSOR);
+ YYDEBUG(132, *YYCURSOR);
if (yybm[0+yych] & 64) {
- goto yy125;
+ goto yy131;
}
- YYDEBUG(127, *YYCURSOR);
+ YYDEBUG(133, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(128, *YYCURSOR);
+ YYDEBUG(134, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 368 "Zend/zend_ini_scanner.l"
+#line 415 "Zend/zend_ini_scanner.l"
{ /* Raw string */
/* Eat leading and trailing single quotes */
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
@@ -1770,59 +1873,59 @@ yy125:
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
-#line 1774 "Zend/zend_ini_scanner.c"
-yy129:
- YYDEBUG(129, *YYCURSOR);
+#line 1877 "Zend/zend_ini_scanner.c"
+yy135:
+ YYDEBUG(135, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(130, *YYCURSOR);
+ YYDEBUG(136, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 401 "Zend/zend_ini_scanner.l"
+#line 448 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME TSRMLS_CC);
return TC_DOLLAR_CURLY;
}
-#line 1785 "Zend/zend_ini_scanner.c"
-yy131:
- YYDEBUG(131, *YYCURSOR);
+#line 1888 "Zend/zend_ini_scanner.c"
+yy137:
+ YYDEBUG(137, *YYCURSOR);
yyaccept = 0;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(132, *YYCURSOR);
+ YYDEBUG(138, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy131;
+ goto yy137;
}
if (yych <= '$') {
if (yych <= '\r') {
- if (yych == '\n') goto yy87;
- if (yych <= '\f') goto yy104;
- goto yy87;
+ if (yych == '\n') goto yy93;
+ if (yych <= '\f') goto yy110;
+ goto yy93;
} else {
- if (yych == '"') goto yy133;
- if (yych <= '#') goto yy104;
- goto yy107;
+ if (yych == '"') goto yy139;
+ if (yych <= '#') goto yy110;
+ goto yy113;
}
} else {
if (yych <= ';') {
- if (yych == '\'') goto yy87;
- if (yych <= ':') goto yy104;
- goto yy87;
+ if (yych == '\'') goto yy93;
+ if (yych <= ':') goto yy110;
+ goto yy93;
} else {
- if (yych <= '[') goto yy104;
- if (yych <= '\\') goto yy106;
- if (yych <= ']') goto yy134;
- goto yy104;
+ if (yych <= '[') goto yy110;
+ if (yych <= '\\') goto yy112;
+ if (yych <= ']') goto yy140;
+ goto yy110;
}
}
-yy133:
- YYDEBUG(133, *YYCURSOR);
+yy139:
+ YYDEBUG(139, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy92;
-yy134:
- YYDEBUG(134, *YYCURSOR);
+ goto yy98;
+yy140:
+ YYDEBUG(140, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
- goto yy103;
+ goto yy109;
}
/* *********************************** */
yyc_ST_RAW:
@@ -1861,44 +1964,44 @@ yyc_ST_RAW:
64, 64, 64, 64, 64, 64, 64, 64,
64, 64, 64, 64, 64, 64, 64, 64,
};
- YYDEBUG(135, *YYCURSOR);
+ YYDEBUG(141, *YYCURSOR);
YYFILL(3);
yych = *YYCURSOR;
if (yych <= '\f') {
if (yych <= 0x08) {
- if (yych >= 0x01) goto yy139;
+ if (yych >= 0x01) goto yy145;
} else {
- if (yych <= '\t') goto yy141;
- if (yych <= '\n') goto yy142;
- goto yy139;
+ if (yych <= '\t') goto yy147;
+ if (yych <= '\n') goto yy148;
+ goto yy145;
}
} else {
if (yych <= ' ') {
- if (yych <= '\r') goto yy144;
- if (yych <= 0x1F) goto yy139;
- goto yy141;
+ if (yych <= '\r') goto yy150;
+ if (yych <= 0x1F) goto yy145;
+ goto yy147;
} else {
- if (yych == ';') goto yy145;
- goto yy139;
+ if (yych == ';') goto yy151;
+ goto yy145;
}
}
- YYDEBUG(137, *YYCURSOR);
+ YYDEBUG(143, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(138, *YYCURSOR);
+ YYDEBUG(144, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 598 "Zend/zend_ini_scanner.l"
+#line 649 "Zend/zend_ini_scanner.l"
{ /* End of option value (if EOF is reached before EOL */
BEGIN(INITIAL);
return END_OF_LINE;
}
-#line 1895 "Zend/zend_ini_scanner.c"
-yy139:
- YYDEBUG(139, *YYCURSOR);
+#line 1998 "Zend/zend_ini_scanner.c"
+yy145:
+ YYDEBUG(145, *YYCURSOR);
++YYCURSOR;
-yy140:
- YYDEBUG(140, *YYCURSOR);
+yy146:
+ YYDEBUG(146, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 448 "Zend/zend_ini_scanner.l"
+#line 499 "Zend/zend_ini_scanner.l"
{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
char *sc = NULL;
while (YYCURSOR < YYLIMIT) {
@@ -1935,111 +2038,111 @@ end_raw_value_chars:
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
-#line 1939 "Zend/zend_ini_scanner.c"
-yy141:
- YYDEBUG(141, *YYCURSOR);
+#line 2042 "Zend/zend_ini_scanner.c"
+yy147:
+ YYDEBUG(147, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '\r') {
- if (yych <= 0x08) goto yy140;
- if (yych <= '\n') goto yy153;
- if (yych <= '\f') goto yy140;
- goto yy153;
+ if (yych <= 0x08) goto yy146;
+ if (yych <= '\n') goto yy159;
+ if (yych <= '\f') goto yy146;
+ goto yy159;
} else {
if (yych <= ' ') {
- if (yych <= 0x1F) goto yy140;
- goto yy153;
+ if (yych <= 0x1F) goto yy146;
+ goto yy159;
} else {
- if (yych == ';') goto yy153;
- goto yy140;
+ if (yych == ';') goto yy159;
+ goto yy146;
}
}
-yy142:
- YYDEBUG(142, *YYCURSOR);
+yy148:
+ YYDEBUG(148, *YYCURSOR);
++YYCURSOR;
-yy143:
- YYDEBUG(143, *YYCURSOR);
+yy149:
+ YYDEBUG(149, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 489 "Zend/zend_ini_scanner.l"
+#line 540 "Zend/zend_ini_scanner.l"
{ /* End of option value */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
-#line 1970 "Zend/zend_ini_scanner.c"
-yy144:
- YYDEBUG(144, *YYCURSOR);
+#line 2073 "Zend/zend_ini_scanner.c"
+yy150:
+ YYDEBUG(150, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == '\n') goto yy151;
- goto yy143;
-yy145:
- YYDEBUG(145, *YYCURSOR);
+ if (yych == '\n') goto yy157;
+ goto yy149;
+yy151:
+ YYDEBUG(151, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy147;
-yy146:
- YYDEBUG(146, *YYCURSOR);
+ goto yy153;
+yy152:
+ YYDEBUG(152, *YYCURSOR);
++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
-yy147:
- YYDEBUG(147, *YYCURSOR);
+yy153:
+ YYDEBUG(153, *YYCURSOR);
if (yybm[0+yych] & 64) {
- goto yy146;
+ goto yy152;
}
- if (yych >= '\r') goto yy150;
-yy148:
- YYDEBUG(148, *YYCURSOR);
+ if (yych >= '\r') goto yy156;
+yy154:
+ YYDEBUG(154, *YYCURSOR);
++YYCURSOR;
-yy149:
- YYDEBUG(149, *YYCURSOR);
+yy155:
+ YYDEBUG(155, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 585 "Zend/zend_ini_scanner.l"
+#line 636 "Zend/zend_ini_scanner.l"
{ /* Comment */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
-#line 2004 "Zend/zend_ini_scanner.c"
-yy150:
- YYDEBUG(150, *YYCURSOR);
+#line 2107 "Zend/zend_ini_scanner.c"
+yy156:
+ YYDEBUG(156, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == '\n') goto yy148;
- goto yy149;
-yy151:
- YYDEBUG(151, *YYCURSOR);
+ if (yych == '\n') goto yy154;
+ goto yy155;
+yy157:
+ YYDEBUG(157, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy143;
-yy152:
- YYDEBUG(152, *YYCURSOR);
+ goto yy149;
+yy158:
+ YYDEBUG(158, *YYCURSOR);
yyaccept = 2;
YYMARKER = ++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
-yy153:
- YYDEBUG(153, *YYCURSOR);
+yy159:
+ YYDEBUG(159, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy152;
+ goto yy158;
}
if (yych <= '\f') {
- if (yych == '\n') goto yy151;
+ if (yych == '\n') goto yy157;
} else {
- if (yych <= '\r') goto yy155;
- if (yych == ';') goto yy146;
+ if (yych <= '\r') goto yy161;
+ if (yych == ';') goto yy152;
}
- YYDEBUG(154, *YYCURSOR);
+ YYDEBUG(160, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 575 "Zend/zend_ini_scanner.l"
+#line 626 "Zend/zend_ini_scanner.l"
{
/* eat whitespace */
goto restart;
}
-#line 2038 "Zend/zend_ini_scanner.c"
-yy155:
- YYDEBUG(155, *YYCURSOR);
+#line 2141 "Zend/zend_ini_scanner.c"
+yy161:
+ YYDEBUG(161, *YYCURSOR);
++YYCURSOR;
- if ((yych = *YYCURSOR) == '\n') goto yy151;
- goto yy143;
+ if ((yych = *YYCURSOR) == '\n') goto yy157;
+ goto yy149;
}
/* *********************************** */
yyc_ST_SECTION_RAW:
@@ -2078,85 +2181,85 @@ yyc_ST_SECTION_RAW:
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
};
- YYDEBUG(156, *YYCURSOR);
+ YYDEBUG(162, *YYCURSOR);
YYFILL(3);
yych = *YYCURSOR;
if (yych <= '\f') {
- if (yych == '\n') goto yy160;
+ if (yych == '\n') goto yy166;
} else {
- if (yych <= '\r') goto yy160;
- if (yych == ']') goto yy162;
+ if (yych <= '\r') goto yy166;
+ if (yych == ']') goto yy168;
}
- YYDEBUG(158, *YYCURSOR);
+ YYDEBUG(164, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
- goto yy169;
-yy159:
- YYDEBUG(159, *YYCURSOR);
+ goto yy175;
+yy165:
+ YYDEBUG(165, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 485 "Zend/zend_ini_scanner.l"
+#line 536 "Zend/zend_ini_scanner.l"
{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
-#line 2102 "Zend/zend_ini_scanner.c"
-yy160:
- YYDEBUG(160, *YYCURSOR);
+#line 2205 "Zend/zend_ini_scanner.c"
+yy166:
+ YYDEBUG(166, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(161, *YYCURSOR);
+ YYDEBUG(167, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 603 "Zend/zend_ini_scanner.l"
+#line 654 "Zend/zend_ini_scanner.l"
{
return 0;
}
-#line 2112 "Zend/zend_ini_scanner.c"
-yy162:
- YYDEBUG(162, *YYCURSOR);
+#line 2215 "Zend/zend_ini_scanner.c"
+yy168:
+ YYDEBUG(168, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
- goto yy165;
-yy163:
- YYDEBUG(163, *YYCURSOR);
+ goto yy171;
+yy169:
+ YYDEBUG(169, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 377 "Zend/zend_ini_scanner.l"
+#line 424 "Zend/zend_ini_scanner.l"
{ /* End of section */
BEGIN(INITIAL);
SCNG(lineno)++;
return ']';
}
-#line 2127 "Zend/zend_ini_scanner.c"
-yy164:
- YYDEBUG(164, *YYCURSOR);
+#line 2230 "Zend/zend_ini_scanner.c"
+yy170:
+ YYDEBUG(170, *YYCURSOR);
++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
-yy165:
- YYDEBUG(165, *YYCURSOR);
+yy171:
+ YYDEBUG(171, *YYCURSOR);
if (yybm[0+yych] & 64) {
- goto yy164;
+ goto yy170;
}
- if (yych == '\n') goto yy166;
- if (yych == '\r') goto yy167;
- goto yy163;
-yy166:
- YYDEBUG(166, *YYCURSOR);
+ if (yych == '\n') goto yy172;
+ if (yych == '\r') goto yy173;
+ goto yy169;
+yy172:
+ YYDEBUG(172, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy163;
-yy167:
- YYDEBUG(167, *YYCURSOR);
+ goto yy169;
+yy173:
+ YYDEBUG(173, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == '\n') goto yy166;
- goto yy163;
-yy168:
- YYDEBUG(168, *YYCURSOR);
+ if (yych == '\n') goto yy172;
+ goto yy169;
+yy174:
+ YYDEBUG(174, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy169:
- YYDEBUG(169, *YYCURSOR);
+yy175:
+ YYDEBUG(175, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy168;
+ goto yy174;
}
- goto yy159;
+ goto yy165;
}
/* *********************************** */
yyc_ST_SECTION_VALUE:
@@ -2195,523 +2298,523 @@ yyc_ST_SECTION_VALUE:
132, 132, 132, 132, 132, 132, 132, 132,
132, 132, 132, 132, 132, 132, 132, 132,
};
- YYDEBUG(170, *YYCURSOR);
+ YYDEBUG(176, *YYCURSOR);
YYFILL(3);
yych = *YYCURSOR;
if (yych <= '-') {
if (yych <= ' ') {
if (yych <= '\n') {
- if (yych <= 0x08) goto yy172;
- if (yych <= '\t') goto yy174;
- goto yy175;
+ if (yych <= 0x08) goto yy178;
+ if (yych <= '\t') goto yy180;
+ goto yy181;
} else {
- if (yych == '\r') goto yy175;
- if (yych >= ' ') goto yy174;
+ if (yych == '\r') goto yy181;
+ if (yych >= ' ') goto yy180;
}
} else {
if (yych <= '$') {
- if (yych == '"') goto yy177;
- if (yych >= '$') goto yy179;
+ if (yych == '"') goto yy183;
+ if (yych >= '$') goto yy185;
} else {
- if (yych == '\'') goto yy180;
- if (yych >= '-') goto yy181;
+ if (yych == '\'') goto yy186;
+ if (yych >= '-') goto yy187;
}
}
} else {
if (yych <= 'Z') {
if (yych <= '9') {
- if (yych <= '.') goto yy182;
- if (yych >= '0') goto yy183;
+ if (yych <= '.') goto yy188;
+ if (yych >= '0') goto yy189;
} else {
- if (yych == ';') goto yy175;
- if (yych >= 'A') goto yy185;
+ if (yych == ';') goto yy181;
+ if (yych >= 'A') goto yy191;
}
} else {
if (yych <= '^') {
- if (yych <= '[') goto yy172;
- if (yych <= '\\') goto yy187;
- if (yych <= ']') goto yy188;
+ if (yych <= '[') goto yy178;
+ if (yych <= '\\') goto yy193;
+ if (yych <= ']') goto yy194;
} else {
- if (yych == '`') goto yy172;
- if (yych <= 'z') goto yy185;
+ if (yych == '`') goto yy178;
+ if (yych <= 'z') goto yy191;
}
}
}
-yy172:
- YYDEBUG(172, *YYCURSOR);
+yy178:
+ YYDEBUG(178, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy195;
-yy173:
- YYDEBUG(173, *YYCURSOR);
+ goto yy201;
+yy179:
+ YYDEBUG(179, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 521 "Zend/zend_ini_scanner.l"
+#line 572 "Zend/zend_ini_scanner.l"
{ /* Get rest as section/offset value */
RETURN_TOKEN(TC_STRING, yytext, yyleng);
}
-#line 2253 "Zend/zend_ini_scanner.c"
-yy174:
- YYDEBUG(174, *YYCURSOR);
+#line 2356 "Zend/zend_ini_scanner.c"
+yy180:
+ YYDEBUG(180, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= 0x1F) {
- if (yych == '\t') goto yy221;
- goto yy195;
+ if (yych == '\t') goto yy227;
+ goto yy201;
} else {
- if (yych <= ' ') goto yy221;
- if (yych == '"') goto yy223;
- goto yy195;
+ if (yych <= ' ') goto yy227;
+ if (yych == '"') goto yy229;
+ goto yy201;
}
-yy175:
- YYDEBUG(175, *YYCURSOR);
+yy181:
+ YYDEBUG(181, *YYCURSOR);
++YYCURSOR;
-yy176:
- YYDEBUG(176, *YYCURSOR);
+yy182:
+ YYDEBUG(182, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 603 "Zend/zend_ini_scanner.l"
+#line 654 "Zend/zend_ini_scanner.l"
{
return 0;
}
-#line 2276 "Zend/zend_ini_scanner.c"
-yy177:
- YYDEBUG(177, *YYCURSOR);
+#line 2379 "Zend/zend_ini_scanner.c"
+yy183:
+ YYDEBUG(183, *YYCURSOR);
++YYCURSOR;
-yy178:
- YYDEBUG(178, *YYCURSOR);
+yy184:
+ YYDEBUG(184, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 525 "Zend/zend_ini_scanner.l"
+#line 576 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string start */
yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
return '"';
}
-#line 2288 "Zend/zend_ini_scanner.c"
-yy179:
- YYDEBUG(179, *YYCURSOR);
+#line 2391 "Zend/zend_ini_scanner.c"
+yy185:
+ YYDEBUG(185, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '\\') {
- if (yych <= 0x00) goto yy176;
- if (yych <= '[') goto yy194;
- goto yy199;
+ if (yych <= 0x00) goto yy182;
+ if (yych <= '[') goto yy200;
+ goto yy205;
} else {
- if (yych == '{') goto yy219;
- goto yy194;
+ if (yych == '{') goto yy225;
+ goto yy200;
}
-yy180:
- YYDEBUG(180, *YYCURSOR);
+yy186:
+ YYDEBUG(186, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy215;
+ goto yy221;
}
- goto yy176;
-yy181:
- YYDEBUG(181, *YYCURSOR);
+ goto yy182;
+yy187:
+ YYDEBUG(187, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '/') goto yy195;
- if (yych <= '9') goto yy213;
- goto yy195;
-yy182:
- YYDEBUG(182, *YYCURSOR);
+ if (yych <= '/') goto yy201;
+ if (yych <= '9') goto yy219;
+ goto yy201;
+yy188:
+ YYDEBUG(188, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '/') goto yy195;
- if (yych <= '9') goto yy211;
- goto yy195;
-yy183:
- YYDEBUG(183, *YYCURSOR);
+ if (yych <= '/') goto yy201;
+ if (yych <= '9') goto yy217;
+ goto yy201;
+yy189:
+ YYDEBUG(189, *YYCURSOR);
yyaccept = 2;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '\'') {
if (yych <= '\r') {
- if (yych == '\n') goto yy184;
- if (yych <= '\f') goto yy195;
+ if (yych == '\n') goto yy190;
+ if (yych <= '\f') goto yy201;
} else {
- if (yych == '"') goto yy184;
- if (yych <= '&') goto yy195;
+ if (yych == '"') goto yy190;
+ if (yych <= '&') goto yy201;
}
} else {
if (yych <= '9') {
- if (yych == '.') goto yy207;
- if (yych <= '/') goto yy195;
- goto yy209;
+ if (yych == '.') goto yy213;
+ if (yych <= '/') goto yy201;
+ goto yy215;
} else {
if (yych <= ';') {
- if (yych <= ':') goto yy195;
+ if (yych <= ':') goto yy201;
} else {
- if (yych != ']') goto yy195;
+ if (yych != ']') goto yy201;
}
}
}
-yy184:
- YYDEBUG(184, *YYCURSOR);
+yy190:
+ YYDEBUG(190, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 499 "Zend/zend_ini_scanner.l"
+#line 550 "Zend/zend_ini_scanner.l"
{ /* Get number option value as string */
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
}
-#line 2354 "Zend/zend_ini_scanner.c"
-yy185:
- YYDEBUG(185, *YYCURSOR);
+#line 2457 "Zend/zend_ini_scanner.c"
+yy191:
+ YYDEBUG(191, *YYCURSOR);
yyaccept = 3;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 32) {
- goto yy205;
+ goto yy211;
}
if (yych <= '"') {
if (yych <= '\f') {
- if (yych != '\n') goto yy195;
+ if (yych != '\n') goto yy201;
} else {
- if (yych <= '\r') goto yy186;
- if (yych <= '!') goto yy195;
+ if (yych <= '\r') goto yy192;
+ if (yych <= '!') goto yy201;
}
} else {
if (yych <= ':') {
- if (yych != '\'') goto yy195;
+ if (yych != '\'') goto yy201;
} else {
- if (yych <= ';') goto yy186;
- if (yych != ']') goto yy195;
+ if (yych <= ';') goto yy192;
+ if (yych != ']') goto yy201;
}
}
-yy186:
- YYDEBUG(186, *YYCURSOR);
+yy192:
+ YYDEBUG(192, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 495 "Zend/zend_ini_scanner.l"
+#line 546 "Zend/zend_ini_scanner.l"
{ /* Get constant option value */
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
}
-#line 2384 "Zend/zend_ini_scanner.c"
-yy187:
- YYDEBUG(187, *YYCURSOR);
+#line 2487 "Zend/zend_ini_scanner.c"
+yy193:
+ YYDEBUG(193, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy194;
-yy188:
- YYDEBUG(188, *YYCURSOR);
+ goto yy200;
+yy194:
+ YYDEBUG(194, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
- goto yy191;
-yy189:
- YYDEBUG(189, *YYCURSOR);
+ goto yy197;
+yy195:
+ YYDEBUG(195, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 377 "Zend/zend_ini_scanner.l"
+#line 424 "Zend/zend_ini_scanner.l"
{ /* End of section */
BEGIN(INITIAL);
SCNG(lineno)++;
return ']';
}
-#line 2403 "Zend/zend_ini_scanner.c"
-yy190:
- YYDEBUG(190, *YYCURSOR);
+#line 2506 "Zend/zend_ini_scanner.c"
+yy196:
+ YYDEBUG(196, *YYCURSOR);
++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
-yy191:
- YYDEBUG(191, *YYCURSOR);
+yy197:
+ YYDEBUG(197, *YYCURSOR);
if (yybm[0+yych] & 2) {
- goto yy190;
+ goto yy196;
}
- if (yych == '\n') goto yy192;
- if (yych == '\r') goto yy193;
- goto yy189;
-yy192:
- YYDEBUG(192, *YYCURSOR);
+ if (yych == '\n') goto yy198;
+ if (yych == '\r') goto yy199;
+ goto yy195;
+yy198:
+ YYDEBUG(198, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy189;
-yy193:
- YYDEBUG(193, *YYCURSOR);
+ goto yy195;
+yy199:
+ YYDEBUG(199, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == '\n') goto yy192;
- goto yy189;
-yy194:
- YYDEBUG(194, *YYCURSOR);
+ if (yych == '\n') goto yy198;
+ goto yy195;
+yy200:
+ YYDEBUG(200, *YYCURSOR);
yyaccept = 0;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy195:
- YYDEBUG(195, *YYCURSOR);
+yy201:
+ YYDEBUG(201, *YYCURSOR);
if (yybm[0+yych] & 4) {
- goto yy194;
+ goto yy200;
}
- if (yych == '$') goto yy197;
- if (yych != '\\') goto yy173;
-yy196:
- YYDEBUG(196, *YYCURSOR);
+ if (yych == '$') goto yy203;
+ if (yych != '\\') goto yy179;
+yy202:
+ YYDEBUG(202, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- goto yy194;
-yy197:
- YYDEBUG(197, *YYCURSOR);
+ goto yy200;
+yy203:
+ YYDEBUG(203, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
if (yych <= '\\') {
- if (yych <= 0x00) goto yy198;
- if (yych <= '[') goto yy194;
- goto yy199;
+ if (yych <= 0x00) goto yy204;
+ if (yych <= '[') goto yy200;
+ goto yy205;
} else {
- if (yych != '{') goto yy194;
+ if (yych != '{') goto yy200;
}
-yy198:
- YYDEBUG(198, *YYCURSOR);
+yy204:
+ YYDEBUG(204, *YYCURSOR);
YYCURSOR = YYMARKER;
if (yyaccept <= 1) {
- if (yyaccept <= 0) {
- goto yy173;
+ if (yyaccept == 0) {
+ goto yy179;
} else {
- goto yy176;
+ goto yy182;
}
} else {
- if (yyaccept <= 2) {
- goto yy184;
+ if (yyaccept == 2) {
+ goto yy190;
} else {
- goto yy186;
+ goto yy192;
}
}
-yy199:
- YYDEBUG(199, *YYCURSOR);
+yy205:
+ YYDEBUG(205, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
if (yybm[0+yych] & 8) {
- goto yy200;
+ goto yy206;
}
- if (yych == '\\') goto yy202;
- goto yy194;
-yy200:
- YYDEBUG(200, *YYCURSOR);
+ if (yych == '\\') goto yy208;
+ goto yy200;
+yy206:
+ YYDEBUG(206, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(201, *YYCURSOR);
+ YYDEBUG(207, *YYCURSOR);
if (yybm[0+yych] & 8) {
- goto yy200;
+ goto yy206;
}
- if (yych == '\\') goto yy204;
- goto yy194;
-yy202:
- YYDEBUG(202, *YYCURSOR);
+ if (yych == '\\') goto yy210;
+ goto yy200;
+yy208:
+ YYDEBUG(208, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(203, *YYCURSOR);
+ YYDEBUG(209, *YYCURSOR);
if (yybm[0+yych] & 8) {
- goto yy200;
+ goto yy206;
}
- if (yych == '\\') goto yy202;
- goto yy194;
-yy204:
- YYDEBUG(204, *YYCURSOR);
+ if (yych == '\\') goto yy208;
+ goto yy200;
+yy210:
+ YYDEBUG(210, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
if (yybm[0+yych] & 8) {
- goto yy200;
+ goto yy206;
}
- if (yych == '\\') goto yy202;
- goto yy194;
-yy205:
- YYDEBUG(205, *YYCURSOR);
+ if (yych == '\\') goto yy208;
+ goto yy200;
+yy211:
+ YYDEBUG(211, *YYCURSOR);
yyaccept = 3;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(206, *YYCURSOR);
+ YYDEBUG(212, *YYCURSOR);
if (yybm[0+yych] & 32) {
- goto yy205;
+ goto yy211;
}
if (yych <= '$') {
if (yych <= '\r') {
- if (yych == '\n') goto yy186;
- if (yych <= '\f') goto yy194;
- goto yy186;
+ if (yych == '\n') goto yy192;
+ if (yych <= '\f') goto yy200;
+ goto yy192;
} else {
- if (yych == '"') goto yy186;
- if (yych <= '#') goto yy194;
- goto yy197;
+ if (yych == '"') goto yy192;
+ if (yych <= '#') goto yy200;
+ goto yy203;
}
} else {
if (yych <= ';') {
- if (yych == '\'') goto yy186;
- if (yych <= ':') goto yy194;
- goto yy186;
+ if (yych == '\'') goto yy192;
+ if (yych <= ':') goto yy200;
+ goto yy192;
} else {
- if (yych <= '[') goto yy194;
- if (yych <= '\\') goto yy196;
- if (yych <= ']') goto yy186;
- goto yy194;
+ if (yych <= '[') goto yy200;
+ if (yych <= '\\') goto yy202;
+ if (yych <= ']') goto yy192;
+ goto yy200;
}
}
-yy207:
- YYDEBUG(207, *YYCURSOR);
+yy213:
+ YYDEBUG(213, *YYCURSOR);
yyaccept = 2;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(208, *YYCURSOR);
+ YYDEBUG(214, *YYCURSOR);
if (yybm[0+yych] & 64) {
- goto yy207;
+ goto yy213;
}
if (yych <= '$') {
if (yych <= '\r') {
- if (yych == '\n') goto yy184;
- if (yych <= '\f') goto yy194;
- goto yy184;
+ if (yych == '\n') goto yy190;
+ if (yych <= '\f') goto yy200;
+ goto yy190;
} else {
- if (yych == '"') goto yy184;
- if (yych <= '#') goto yy194;
- goto yy197;
+ if (yych == '"') goto yy190;
+ if (yych <= '#') goto yy200;
+ goto yy203;
}
} else {
if (yych <= ';') {
- if (yych == '\'') goto yy184;
- if (yych <= ':') goto yy194;
- goto yy184;
+ if (yych == '\'') goto yy190;
+ if (yych <= ':') goto yy200;
+ goto yy190;
} else {
- if (yych <= '[') goto yy194;
- if (yych <= '\\') goto yy196;
- if (yych <= ']') goto yy184;
- goto yy194;
+ if (yych <= '[') goto yy200;
+ if (yych <= '\\') goto yy202;
+ if (yych <= ']') goto yy190;
+ goto yy200;
}
}
-yy209:
- YYDEBUG(209, *YYCURSOR);
+yy215:
+ YYDEBUG(215, *YYCURSOR);
yyaccept = 2;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(210, *YYCURSOR);
+ YYDEBUG(216, *YYCURSOR);
if (yych <= '\'') {
if (yych <= '!') {
if (yych <= '\n') {
- if (yych <= '\t') goto yy194;
- goto yy184;
+ if (yych <= '\t') goto yy200;
+ goto yy190;
} else {
- if (yych == '\r') goto yy184;
- goto yy194;
+ if (yych == '\r') goto yy190;
+ goto yy200;
}
} else {
if (yych <= '#') {
- if (yych <= '"') goto yy184;
- goto yy194;
+ if (yych <= '"') goto yy190;
+ goto yy200;
} else {
- if (yych <= '$') goto yy197;
- if (yych <= '&') goto yy194;
- goto yy184;
+ if (yych <= '$') goto yy203;
+ if (yych <= '&') goto yy200;
+ goto yy190;
}
}
} else {
if (yych <= ':') {
if (yych <= '.') {
- if (yych <= '-') goto yy194;
- goto yy207;
+ if (yych <= '-') goto yy200;
+ goto yy213;
} else {
- if (yych <= '/') goto yy194;
- if (yych <= '9') goto yy209;
- goto yy194;
+ if (yych <= '/') goto yy200;
+ if (yych <= '9') goto yy215;
+ goto yy200;
}
} else {
if (yych <= '[') {
- if (yych <= ';') goto yy184;
- goto yy194;
+ if (yych <= ';') goto yy190;
+ goto yy200;
} else {
- if (yych <= '\\') goto yy196;
- if (yych <= ']') goto yy184;
- goto yy194;
+ if (yych <= '\\') goto yy202;
+ if (yych <= ']') goto yy190;
+ goto yy200;
}
}
}
-yy211:
- YYDEBUG(211, *YYCURSOR);
+yy217:
+ YYDEBUG(217, *YYCURSOR);
yyaccept = 2;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(212, *YYCURSOR);
+ YYDEBUG(218, *YYCURSOR);
if (yych <= '&') {
if (yych <= '\r') {
- if (yych == '\n') goto yy184;
- if (yych <= '\f') goto yy194;
- goto yy184;
+ if (yych == '\n') goto yy190;
+ if (yych <= '\f') goto yy200;
+ goto yy190;
} else {
if (yych <= '"') {
- if (yych <= '!') goto yy194;
- goto yy184;
+ if (yych <= '!') goto yy200;
+ goto yy190;
} else {
- if (yych == '$') goto yy197;
- goto yy194;
+ if (yych == '$') goto yy203;
+ goto yy200;
}
}
} else {
if (yych <= ':') {
- if (yych <= '\'') goto yy184;
- if (yych <= '/') goto yy194;
- if (yych <= '9') goto yy211;
- goto yy194;
+ if (yych <= '\'') goto yy190;
+ if (yych <= '/') goto yy200;
+ if (yych <= '9') goto yy217;
+ goto yy200;
} else {
if (yych <= '[') {
- if (yych <= ';') goto yy184;
- goto yy194;
+ if (yych <= ';') goto yy190;
+ goto yy200;
} else {
- if (yych <= '\\') goto yy196;
- if (yych <= ']') goto yy184;
- goto yy194;
+ if (yych <= '\\') goto yy202;
+ if (yych <= ']') goto yy190;
+ goto yy200;
}
}
}
-yy213:
- YYDEBUG(213, *YYCURSOR);
+yy219:
+ YYDEBUG(219, *YYCURSOR);
yyaccept = 2;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(214, *YYCURSOR);
+ YYDEBUG(220, *YYCURSOR);
if (yych <= '&') {
if (yych <= '\r') {
- if (yych == '\n') goto yy184;
- if (yych <= '\f') goto yy194;
- goto yy184;
+ if (yych == '\n') goto yy190;
+ if (yych <= '\f') goto yy200;
+ goto yy190;
} else {
if (yych <= '"') {
- if (yych <= '!') goto yy194;
- goto yy184;
+ if (yych <= '!') goto yy200;
+ goto yy190;
} else {
- if (yych == '$') goto yy197;
- goto yy194;
+ if (yych == '$') goto yy203;
+ goto yy200;
}
}
} else {
if (yych <= ':') {
- if (yych <= '\'') goto yy184;
- if (yych <= '/') goto yy194;
- if (yych <= '9') goto yy213;
- goto yy194;
+ if (yych <= '\'') goto yy190;
+ if (yych <= '/') goto yy200;
+ if (yych <= '9') goto yy219;
+ goto yy200;
} else {
if (yych <= '[') {
- if (yych <= ';') goto yy184;
- goto yy194;
+ if (yych <= ';') goto yy190;
+ goto yy200;
} else {
- if (yych <= '\\') goto yy196;
- if (yych <= ']') goto yy184;
- goto yy194;
+ if (yych <= '\\') goto yy202;
+ if (yych <= ']') goto yy190;
+ goto yy200;
}
}
}
-yy215:
- YYDEBUG(215, *YYCURSOR);
+yy221:
+ YYDEBUG(221, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(216, *YYCURSOR);
+ YYDEBUG(222, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy215;
+ goto yy221;
}
- YYDEBUG(217, *YYCURSOR);
+ YYDEBUG(223, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(218, *YYCURSOR);
+ YYDEBUG(224, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 368 "Zend/zend_ini_scanner.l"
+#line 415 "Zend/zend_ini_scanner.l"
{ /* Raw string */
/* Eat leading and trailing single quotes */
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
@@ -2720,65 +2823,65 @@ yy215:
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
-#line 2724 "Zend/zend_ini_scanner.c"
-yy219:
- YYDEBUG(219, *YYCURSOR);
+#line 2827 "Zend/zend_ini_scanner.c"
+yy225:
+ YYDEBUG(225, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(220, *YYCURSOR);
+ YYDEBUG(226, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 401 "Zend/zend_ini_scanner.l"
+#line 448 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME TSRMLS_CC);
return TC_DOLLAR_CURLY;
}
-#line 2735 "Zend/zend_ini_scanner.c"
-yy221:
- YYDEBUG(221, *YYCURSOR);
+#line 2838 "Zend/zend_ini_scanner.c"
+yy227:
+ YYDEBUG(227, *YYCURSOR);
yyaccept = 0;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(222, *YYCURSOR);
+ YYDEBUG(228, *YYCURSOR);
if (yych <= '"') {
if (yych <= '\f') {
- if (yych <= 0x08) goto yy194;
- if (yych <= '\t') goto yy221;
- if (yych <= '\n') goto yy173;
- goto yy194;
+ if (yych <= 0x08) goto yy200;
+ if (yych <= '\t') goto yy227;
+ if (yych <= '\n') goto yy179;
+ goto yy200;
} else {
if (yych <= 0x1F) {
- if (yych <= '\r') goto yy173;
- goto yy194;
+ if (yych <= '\r') goto yy179;
+ goto yy200;
} else {
- if (yych <= ' ') goto yy221;
- if (yych <= '!') goto yy194;
+ if (yych <= ' ') goto yy227;
+ if (yych <= '!') goto yy200;
}
}
} else {
if (yych <= ':') {
if (yych <= '$') {
- if (yych <= '#') goto yy194;
- goto yy197;
+ if (yych <= '#') goto yy200;
+ goto yy203;
} else {
- if (yych == '\'') goto yy173;
- goto yy194;
+ if (yych == '\'') goto yy179;
+ goto yy200;
}
} else {
if (yych <= '[') {
- if (yych <= ';') goto yy173;
- goto yy194;
+ if (yych <= ';') goto yy179;
+ goto yy200;
} else {
- if (yych <= '\\') goto yy196;
- if (yych <= ']') goto yy173;
- goto yy194;
+ if (yych <= '\\') goto yy202;
+ if (yych <= ']') goto yy179;
+ goto yy200;
}
}
}
-yy223:
- YYDEBUG(223, *YYCURSOR);
+yy229:
+ YYDEBUG(229, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
- goto yy178;
+ goto yy184;
}
/* *********************************** */
yyc_ST_VALUE:
@@ -2817,28 +2920,28 @@ yyc_ST_VALUE:
162, 162, 162, 162, 162, 162, 162, 162,
162, 162, 162, 162, 162, 162, 162, 162,
};
- YYDEBUG(224, *YYCURSOR);
+ YYDEBUG(230, *YYCURSOR);
YYFILL(6);
yych = *YYCURSOR;
YYDEBUG(-1, yych);
switch (yych) {
- case 0x00: goto yy226;
+ case 0x00: goto yy232;
case '\t':
- case ' ': goto yy230;
- case '\n': goto yy232;
- case '\r': goto yy234;
+ case ' ': goto yy236;
+ case '\n': goto yy238;
+ case '\r': goto yy240;
case '!':
case '&':
case '(':
case ')':
case '^':
case '|':
- case '~': goto yy235;
- case '"': goto yy237;
- case '$': goto yy239;
- case '\'': goto yy240;
- case '-': goto yy241;
- case '.': goto yy242;
+ case '~': goto yy241;
+ case '"': goto yy243;
+ case '$': goto yy245;
+ case '\'': goto yy246;
+ case '-': goto yy247;
+ case '.': goto yy248;
case '0':
case '1':
case '2':
@@ -2848,9 +2951,9 @@ yyc_ST_VALUE:
case '6':
case '7':
case '8':
- case '9': goto yy243;
- case ';': goto yy245;
- case '=': goto yy246;
+ case '9': goto yy249;
+ case ';': goto yy251;
+ case '=': goto yy252;
case 'A':
case 'B':
case 'C':
@@ -2893,1576 +2996,1637 @@ yyc_ST_VALUE:
case 'v':
case 'w':
case 'x':
- case 'z': goto yy248;
+ case 'z': goto yy254;
case 'F':
- case 'f': goto yy250;
+ case 'f': goto yy256;
case 'N':
- case 'n': goto yy251;
+ case 'n': goto yy257;
case 'O':
- case 'o': goto yy252;
+ case 'o': goto yy258;
case 'T':
- case 't': goto yy253;
+ case 't': goto yy259;
case 'Y':
- case 'y': goto yy254;
- default: goto yy228;
+ case 'y': goto yy260;
+ default: goto yy234;
}
-yy226:
- YYDEBUG(226, *YYCURSOR);
+yy232:
+ YYDEBUG(232, *YYCURSOR);
++YYCURSOR;
-yy227:
- YYDEBUG(227, *YYCURSOR);
+yy233:
+ YYDEBUG(233, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 598 "Zend/zend_ini_scanner.l"
+#line 649 "Zend/zend_ini_scanner.l"
{ /* End of option value (if EOF is reached before EOL */
BEGIN(INITIAL);
return END_OF_LINE;
}
-#line 2921 "Zend/zend_ini_scanner.c"
-yy228:
- YYDEBUG(228, *YYCURSOR);
+#line 3024 "Zend/zend_ini_scanner.c"
+yy234:
+ YYDEBUG(234, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy256;
-yy229:
- YYDEBUG(229, *YYCURSOR);
+ goto yy262;
+yy235:
+ YYDEBUG(235, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 517 "Zend/zend_ini_scanner.l"
+#line 568 "Zend/zend_ini_scanner.l"
{ /* Get everything else as option/offset value */
RETURN_TOKEN(TC_STRING, yytext, yyleng);
}
-#line 2934 "Zend/zend_ini_scanner.c"
-yy230:
- YYDEBUG(230, *YYCURSOR);
+#line 3037 "Zend/zend_ini_scanner.c"
+yy236:
+ YYDEBUG(236, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy306;
-yy231:
- YYDEBUG(231, *YYCURSOR);
+ goto yy316;
+yy237:
+ YYDEBUG(237, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 571 "Zend/zend_ini_scanner.l"
+#line 622 "Zend/zend_ini_scanner.l"
{
RETURN_TOKEN(TC_WHITESPACE, yytext, yyleng);
}
-#line 2947 "Zend/zend_ini_scanner.c"
-yy232:
- YYDEBUG(232, *YYCURSOR);
+#line 3050 "Zend/zend_ini_scanner.c"
+yy238:
+ YYDEBUG(238, *YYCURSOR);
++YYCURSOR;
-yy233:
- YYDEBUG(233, *YYCURSOR);
+yy239:
+ YYDEBUG(239, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 489 "Zend/zend_ini_scanner.l"
+#line 540 "Zend/zend_ini_scanner.l"
{ /* End of option value */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
-#line 2960 "Zend/zend_ini_scanner.c"
-yy234:
- YYDEBUG(234, *YYCURSOR);
+#line 3063 "Zend/zend_ini_scanner.c"
+yy240:
+ YYDEBUG(240, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == '\n') goto yy304;
- goto yy233;
-yy235:
- YYDEBUG(235, *YYCURSOR);
+ if (yych == '\n') goto yy314;
+ goto yy239;
+yy241:
+ YYDEBUG(241, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
- goto yy303;
-yy236:
- YYDEBUG(236, *YYCURSOR);
+ goto yy313;
+yy242:
+ YYDEBUG(242, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 507 "Zend/zend_ini_scanner.l"
+#line 558 "Zend/zend_ini_scanner.l"
{ /* Boolean operators */
return yytext[0];
}
-#line 2978 "Zend/zend_ini_scanner.c"
-yy237:
- YYDEBUG(237, *YYCURSOR);
+#line 3081 "Zend/zend_ini_scanner.c"
+yy243:
+ YYDEBUG(243, *YYCURSOR);
++YYCURSOR;
-yy238:
- YYDEBUG(238, *YYCURSOR);
+yy244:
+ YYDEBUG(244, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 525 "Zend/zend_ini_scanner.l"
+#line 576 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string start */
yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
return '"';
}
-#line 2990 "Zend/zend_ini_scanner.c"
-yy239:
- YYDEBUG(239, *YYCURSOR);
+#line 3093 "Zend/zend_ini_scanner.c"
+yy245:
+ YYDEBUG(245, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '\\') {
- if (yych <= 0x00) goto yy227;
- if (yych <= '[') goto yy255;
- goto yy262;
+ if (yych <= 0x00) goto yy233;
+ if (yych <= '[') goto yy261;
+ goto yy268;
} else {
- if (yych == '{') goto yy300;
- goto yy255;
+ if (yych == '{') goto yy310;
+ goto yy261;
}
-yy240:
- YYDEBUG(240, *YYCURSOR);
+yy246:
+ YYDEBUG(246, *YYCURSOR);
yyaccept = 2;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy296;
+ goto yy306;
}
- goto yy227;
-yy241:
- YYDEBUG(241, *YYCURSOR);
+ goto yy233;
+yy247:
+ YYDEBUG(247, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '/') goto yy256;
- if (yych <= '9') goto yy294;
- goto yy256;
-yy242:
- YYDEBUG(242, *YYCURSOR);
+ if (yych <= '/') goto yy262;
+ if (yych <= '9') goto yy304;
+ goto yy262;
+yy248:
+ YYDEBUG(248, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '/') goto yy256;
- if (yych <= '9') goto yy292;
- goto yy256;
-yy243:
- YYDEBUG(243, *YYCURSOR);
+ if (yych <= '/') goto yy262;
+ if (yych <= '9') goto yy302;
+ goto yy262;
+yy249:
+ YYDEBUG(249, *YYCURSOR);
yyaccept = 3;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '/') {
if (yych <= 0x1F) {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy244;
- if (yych <= 0x08) goto yy256;
+ if (yych <= 0x00) goto yy250;
+ if (yych <= 0x08) goto yy262;
} else {
- if (yych != '\r') goto yy256;
+ if (yych != '\r') goto yy262;
}
} else {
if (yych <= ')') {
- if (yych <= '"') goto yy244;
- if (yych <= '%') goto yy256;
+ if (yych <= '"') goto yy250;
+ if (yych <= '%') goto yy262;
} else {
- if (yych == '.') goto yy288;
- goto yy256;
+ if (yych == '.') goto yy298;
+ goto yy262;
}
}
} else {
if (yych <= ']') {
if (yych <= ';') {
- if (yych <= '9') goto yy290;
- if (yych <= ':') goto yy256;
+ if (yych <= '9') goto yy300;
+ if (yych <= ':') goto yy262;
} else {
- if (yych != '=') goto yy256;
+ if (yych != '=') goto yy262;
}
} else {
if (yych <= '|') {
- if (yych <= '^') goto yy244;
- if (yych <= '{') goto yy256;
+ if (yych <= '^') goto yy250;
+ if (yych <= '{') goto yy262;
} else {
- if (yych != '~') goto yy256;
+ if (yych != '~') goto yy262;
}
}
}
-yy244:
- YYDEBUG(244, *YYCURSOR);
+yy250:
+ YYDEBUG(250, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 499 "Zend/zend_ini_scanner.l"
+#line 550 "Zend/zend_ini_scanner.l"
{ /* Get number option value as string */
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
}
-#line 3069 "Zend/zend_ini_scanner.c"
-yy245:
- YYDEBUG(245, *YYCURSOR);
+#line 3172 "Zend/zend_ini_scanner.c"
+yy251:
+ YYDEBUG(251, *YYCURSOR);
yyaccept = 2;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy284;
-yy246:
- YYDEBUG(246, *YYCURSOR);
+ goto yy294;
+yy252:
+ YYDEBUG(252, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(247, *YYCURSOR);
+ YYDEBUG(253, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 511 "Zend/zend_ini_scanner.l"
+#line 562 "Zend/zend_ini_scanner.l"
{ /* Make = used in option value to trigger error */
yyless(0);
BEGIN(INITIAL);
return END_OF_LINE;
}
-#line 3086 "Zend/zend_ini_scanner.c"
-yy248:
- YYDEBUG(248, *YYCURSOR);
+#line 3189 "Zend/zend_ini_scanner.c"
+yy254:
+ YYDEBUG(254, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 4) {
- goto yy257;
+ goto yy263;
}
if (yych <= ':') {
if (yych <= '\r') {
if (yych <= 0x08) {
- if (yych >= 0x01) goto yy256;
+ if (yych >= 0x01) goto yy262;
} else {
- if (yych <= '\n') goto yy249;
- if (yych <= '\f') goto yy256;
+ if (yych <= '\n') goto yy255;
+ if (yych <= '\f') goto yy262;
}
} else {
if (yych <= '"') {
- if (yych <= 0x1F) goto yy256;
+ if (yych <= 0x1F) goto yy262;
} else {
- if (yych <= '%') goto yy256;
- if (yych >= '*') goto yy256;
+ if (yych <= '%') goto yy262;
+ if (yych >= '*') goto yy262;
}
}
} else {
if (yych <= '^') {
if (yych <= '<') {
- if (yych >= '<') goto yy256;
+ if (yych >= '<') goto yy262;
} else {
- if (yych <= '=') goto yy249;
- if (yych <= ']') goto yy256;
+ if (yych <= '=') goto yy255;
+ if (yych <= ']') goto yy262;
}
} else {
if (yych <= '|') {
- if (yych <= '{') goto yy256;
+ if (yych <= '{') goto yy262;
} else {
- if (yych != '~') goto yy256;
+ if (yych != '~') goto yy262;
}
}
}
-yy249:
- YYDEBUG(249, *YYCURSOR);
+yy255:
+ YYDEBUG(255, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 495 "Zend/zend_ini_scanner.l"
+#line 546 "Zend/zend_ini_scanner.l"
{ /* Get constant option value */
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
}
-#line 3133 "Zend/zend_ini_scanner.c"
-yy250:
- YYDEBUG(250, *YYCURSOR);
+#line 3236 "Zend/zend_ini_scanner.c"
+yy256:
+ YYDEBUG(256, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '<') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy255;
+ if (yych <= 0x08) goto yy262;
+ goto yy255;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy255;
+ if (yych <= 0x1F) goto yy262;
+ goto yy255;
}
} else {
if (yych <= '/') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- goto yy256;
+ if (yych <= '%') goto yy262;
+ if (yych <= ')') goto yy255;
+ goto yy262;
} else {
- if (yych <= '9') goto yy257;
- if (yych == ';') goto yy249;
- goto yy256;
+ if (yych <= '9') goto yy263;
+ if (yych == ';') goto yy255;
+ goto yy262;
}
}
} else {
if (yych <= '_') {
if (yych <= 'A') {
- if (yych <= '=') goto yy249;
- if (yych <= '@') goto yy256;
- goto yy280;
+ if (yych <= '=') goto yy255;
+ if (yych <= '@') goto yy262;
+ goto yy290;
} else {
- if (yych <= 'Z') goto yy257;
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- goto yy257;
+ if (yych <= 'Z') goto yy263;
+ if (yych <= ']') goto yy262;
+ if (yych <= '^') goto yy255;
+ goto yy263;
}
} else {
if (yych <= '{') {
- if (yych <= '`') goto yy256;
- if (yych <= 'a') goto yy280;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych <= '`') goto yy262;
+ if (yych <= 'a') goto yy290;
+ if (yych <= 'z') goto yy263;
+ goto yy262;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy262;
+ if (yych <= '~') goto yy255;
+ goto yy262;
}
}
}
-yy251:
- YYDEBUG(251, *YYCURSOR);
+yy257:
+ YYDEBUG(257, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= 'N') {
if (yych <= '%') {
if (yych <= '\f') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- if (yych <= '\n') goto yy249;
- goto yy256;
+ if (yych <= 0x00) goto yy255;
+ if (yych <= 0x08) goto yy262;
+ if (yych <= '\n') goto yy255;
+ goto yy262;
} else {
- if (yych <= '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- if (yych <= '"') goto yy249;
- goto yy256;
+ if (yych <= '\r') goto yy255;
+ if (yych <= 0x1F) goto yy262;
+ if (yych <= '"') goto yy255;
+ goto yy262;
}
} else {
if (yych <= ':') {
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- if (yych <= '9') goto yy257;
- goto yy256;
+ if (yych <= ')') goto yy255;
+ if (yych <= '/') goto yy262;
+ if (yych <= '9') goto yy263;
+ goto yy262;
} else {
if (yych <= '<') {
- if (yych <= ';') goto yy249;
- goto yy256;
+ if (yych <= ';') goto yy255;
+ goto yy262;
} else {
- if (yych <= '=') goto yy249;
- if (yych <= '@') goto yy256;
- goto yy257;
+ if (yych <= '=') goto yy255;
+ if (yych <= '@') goto yy262;
+ goto yy263;
}
}
}
} else {
if (yych <= 'n') {
if (yych <= 'Z') {
- if (yych <= 'O') goto yy276;
- if (yych == 'U') goto yy277;
- goto yy257;
+ if (yych <= 'O') goto yy282;
+ if (yych == 'U') goto yy283;
+ goto yy263;
} else {
if (yych <= '^') {
- if (yych <= ']') goto yy256;
- goto yy249;
+ if (yych <= ']') goto yy262;
+ goto yy255;
} else {
- if (yych == '`') goto yy256;
- goto yy257;
+ if (yych == '`') goto yy262;
+ goto yy263;
}
}
} else {
if (yych <= 'z') {
- if (yych <= 'o') goto yy276;
- if (yych == 'u') goto yy277;
- goto yy257;
+ if (yych <= 'o') goto yy282;
+ if (yych == 'u') goto yy283;
+ goto yy263;
} else {
if (yych <= '|') {
- if (yych <= '{') goto yy256;
- goto yy249;
+ if (yych <= '{') goto yy262;
+ goto yy255;
} else {
- if (yych == '~') goto yy249;
- goto yy256;
+ if (yych == '~') goto yy255;
+ goto yy262;
}
}
}
}
-yy252:
- YYDEBUG(252, *YYCURSOR);
+yy258:
+ YYDEBUG(258, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= 'E') {
if (yych <= '%') {
if (yych <= '\f') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- if (yych <= '\n') goto yy249;
- goto yy256;
+ if (yych <= 0x00) goto yy255;
+ if (yych <= 0x08) goto yy262;
+ if (yych <= '\n') goto yy255;
+ goto yy262;
} else {
- if (yych <= '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- if (yych <= '"') goto yy249;
- goto yy256;
+ if (yych <= '\r') goto yy255;
+ if (yych <= 0x1F) goto yy262;
+ if (yych <= '"') goto yy255;
+ goto yy262;
}
} else {
if (yych <= ':') {
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- if (yych <= '9') goto yy257;
- goto yy256;
+ if (yych <= ')') goto yy255;
+ if (yych <= '/') goto yy262;
+ if (yych <= '9') goto yy263;
+ goto yy262;
} else {
if (yych <= '<') {
- if (yych <= ';') goto yy249;
- goto yy256;
+ if (yych <= ';') goto yy255;
+ goto yy262;
} else {
- if (yych <= '=') goto yy249;
- if (yych <= '@') goto yy256;
- goto yy257;
+ if (yych <= '=') goto yy255;
+ if (yych <= '@') goto yy262;
+ goto yy263;
}
}
}
} else {
if (yych <= 'e') {
if (yych <= 'Z') {
- if (yych <= 'F') goto yy271;
- if (yych == 'N') goto yy265;
- goto yy257;
+ if (yych <= 'F') goto yy277;
+ if (yych == 'N') goto yy271;
+ goto yy263;
} else {
if (yych <= '^') {
- if (yych <= ']') goto yy256;
- goto yy249;
+ if (yych <= ']') goto yy262;
+ goto yy255;
} else {
- if (yych == '`') goto yy256;
- goto yy257;
+ if (yych == '`') goto yy262;
+ goto yy263;
}
}
} else {
if (yych <= 'z') {
- if (yych <= 'f') goto yy271;
- if (yych == 'n') goto yy265;
- goto yy257;
+ if (yych <= 'f') goto yy277;
+ if (yych == 'n') goto yy271;
+ goto yy263;
} else {
if (yych <= '|') {
- if (yych <= '{') goto yy256;
- goto yy249;
+ if (yych <= '{') goto yy262;
+ goto yy255;
} else {
- if (yych == '~') goto yy249;
- goto yy256;
+ if (yych == '~') goto yy255;
+ goto yy262;
}
}
}
}
-yy253:
- YYDEBUG(253, *YYCURSOR);
+yy259:
+ YYDEBUG(259, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy255;
+ if (yych <= 0x08) goto yy262;
+ goto yy255;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy255;
+ if (yych <= 0x1F) goto yy262;
+ goto yy255;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy262;
+ if (yych <= ')') goto yy255;
+ if (yych <= '/') goto yy262;
+ goto yy263;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy255;
+ if (yych <= '<') goto yy262;
+ goto yy255;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych == 'R') goto yy269;
- goto yy257;
+ if (yych <= '@') goto yy262;
+ if (yych == 'R') goto yy275;
+ goto yy263;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy262;
+ if (yych <= '^') goto yy255;
+ if (yych <= '_') goto yy263;
+ goto yy262;
}
} else {
if (yych <= '{') {
- if (yych == 'r') goto yy269;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 'r') goto yy275;
+ if (yych <= 'z') goto yy263;
+ goto yy262;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy262;
+ if (yych <= '~') goto yy255;
+ goto yy262;
}
}
}
-yy254:
- YYDEBUG(254, *YYCURSOR);
+yy260:
+ YYDEBUG(260, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy255;
+ if (yych <= 0x08) goto yy262;
+ goto yy255;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy255;
+ if (yych <= 0x1F) goto yy262;
+ goto yy255;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy262;
+ if (yych <= ')') goto yy255;
+ if (yych <= '/') goto yy262;
+ goto yy263;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy255;
+ if (yych <= '<') goto yy262;
+ goto yy255;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych == 'E') goto yy259;
- goto yy257;
+ if (yych <= '@') goto yy262;
+ if (yych == 'E') goto yy265;
+ goto yy263;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy262;
+ if (yych <= '^') goto yy255;
+ if (yych <= '_') goto yy263;
+ goto yy262;
}
} else {
if (yych <= '{') {
- if (yych == 'e') goto yy259;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 'e') goto yy265;
+ if (yych <= 'z') goto yy263;
+ goto yy262;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy262;
+ if (yych <= '~') goto yy255;
+ goto yy262;
}
}
}
-yy255:
- YYDEBUG(255, *YYCURSOR);
+yy261:
+ YYDEBUG(261, *YYCURSOR);
yyaccept = 0;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy256:
- YYDEBUG(256, *YYCURSOR);
+yy262:
+ YYDEBUG(262, *YYCURSOR);
if (yybm[0+yych] & 2) {
- goto yy255;
+ goto yy261;
}
- if (yych == '$') goto yy260;
- goto yy229;
-yy257:
- YYDEBUG(257, *YYCURSOR);
+ if (yych == '$') goto yy266;
+ goto yy235;
+yy263:
+ YYDEBUG(263, *YYCURSOR);
yyaccept = 4;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(258, *YYCURSOR);
+ YYDEBUG(264, *YYCURSOR);
if (yybm[0+yych] & 4) {
- goto yy257;
+ goto yy263;
}
if (yych <= ')') {
if (yych <= '\r') {
if (yych <= 0x08) {
- if (yych <= 0x00) goto yy249;
- goto yy255;
+ if (yych <= 0x00) goto yy255;
+ goto yy261;
} else {
- if (yych <= '\n') goto yy249;
- if (yych <= '\f') goto yy255;
- goto yy249;
+ if (yych <= '\n') goto yy255;
+ if (yych <= '\f') goto yy261;
+ goto yy255;
}
} else {
if (yych <= '#') {
- if (yych <= 0x1F) goto yy255;
- if (yych <= '"') goto yy249;
- goto yy255;
+ if (yych <= 0x1F) goto yy261;
+ if (yych <= '"') goto yy255;
+ goto yy261;
} else {
- if (yych <= '$') goto yy260;
- if (yych <= '%') goto yy255;
- goto yy249;
+ if (yych <= '$') goto yy266;
+ if (yych <= '%') goto yy261;
+ goto yy255;
}
}
} else {
if (yych <= ']') {
if (yych <= ';') {
- if (yych <= ':') goto yy255;
- goto yy249;
- } else {
- if (yych == '=') goto yy249;
+ if (yych <= ':') goto yy261;
goto yy255;
+ } else {
+ if (yych == '=') goto yy255;
+ goto yy261;
}
} else {
if (yych <= '|') {
- if (yych <= '^') goto yy249;
- if (yych <= '{') goto yy255;
- goto yy249;
- } else {
- if (yych == '~') goto yy249;
+ if (yych <= '^') goto yy255;
+ if (yych <= '{') goto yy261;
goto yy255;
+ } else {
+ if (yych == '~') goto yy255;
+ goto yy261;
}
}
}
-yy259:
- YYDEBUG(259, *YYCURSOR);
+yy265:
+ YYDEBUG(265, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy255;
+ if (yych <= 0x08) goto yy262;
+ goto yy255;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy255;
+ if (yych <= 0x1F) goto yy262;
+ goto yy255;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy262;
+ if (yych <= ')') goto yy255;
+ if (yych <= '/') goto yy262;
+ goto yy263;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy255;
+ if (yych <= '<') goto yy262;
+ goto yy255;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych == 'S') goto yy265;
- goto yy257;
+ if (yych <= '@') goto yy262;
+ if (yych == 'S') goto yy271;
+ goto yy263;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy262;
+ if (yych <= '^') goto yy255;
+ if (yych <= '_') goto yy263;
+ goto yy262;
}
} else {
if (yych <= '{') {
- if (yych == 's') goto yy265;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 's') goto yy271;
+ if (yych <= 'z') goto yy263;
+ goto yy262;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy262;
+ if (yych <= '~') goto yy255;
+ goto yy262;
}
}
}
-yy260:
- YYDEBUG(260, *YYCURSOR);
+yy266:
+ YYDEBUG(266, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
if (yych <= '\\') {
- if (yych <= 0x00) goto yy261;
- if (yych <= '[') goto yy255;
- goto yy262;
+ if (yych <= 0x00) goto yy267;
+ if (yych <= '[') goto yy261;
+ goto yy268;
} else {
- if (yych != '{') goto yy255;
+ if (yych != '{') goto yy261;
}
-yy261:
- YYDEBUG(261, *YYCURSOR);
+yy267:
+ YYDEBUG(267, *YYCURSOR);
YYCURSOR = YYMARKER;
if (yyaccept <= 3) {
if (yyaccept <= 1) {
- if (yyaccept <= 0) {
- goto yy229;
+ if (yyaccept == 0) {
+ goto yy235;
} else {
- goto yy231;
+ goto yy237;
}
} else {
- if (yyaccept <= 2) {
- goto yy227;
+ if (yyaccept == 2) {
+ goto yy233;
} else {
- goto yy244;
+ goto yy250;
}
}
} else {
if (yyaccept <= 5) {
- if (yyaccept <= 4) {
- goto yy249;
+ if (yyaccept == 4) {
+ goto yy255;
} else {
- goto yy266;
+ goto yy272;
}
} else {
- goto yy273;
+ if (yyaccept == 6) {
+ goto yy279;
+ } else {
+ goto yy286;
+ }
}
}
-yy262:
- YYDEBUG(262, *YYCURSOR);
+yy268:
+ YYDEBUG(268, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
if (yybm[0+yych] & 8) {
- goto yy263;
+ goto yy269;
}
- goto yy255;
-yy263:
- YYDEBUG(263, *YYCURSOR);
+ goto yy261;
+yy269:
+ YYDEBUG(269, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(264, *YYCURSOR);
+ YYDEBUG(270, *YYCURSOR);
if (yybm[0+yych] & 8) {
- goto yy263;
+ goto yy269;
}
- if (yych <= 0x00) goto yy229;
- if (yych == '\\') goto yy262;
- goto yy255;
-yy265:
- YYDEBUG(265, *YYCURSOR);
+ if (yych <= 0x00) goto yy235;
+ if (yych == '\\') goto yy268;
+ goto yy261;
+yy271:
+ YYDEBUG(271, *YYCURSOR);
yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 16) {
- goto yy267;
+ goto yy273;
}
if (yych <= ';') {
if (yych <= ' ') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy266;
- if (yych <= '\t') goto yy256;
+ if (yych <= 0x00) goto yy272;
+ if (yych <= '\t') goto yy262;
} else {
- if (yych != '\r') goto yy256;
+ if (yych != '\r') goto yy262;
}
} else {
if (yych <= ')') {
- if (yych <= '"') goto yy266;
- if (yych <= '%') goto yy256;
+ if (yych <= '"') goto yy272;
+ if (yych <= '%') goto yy262;
} else {
- if (yych <= '/') goto yy256;
- if (yych <= '9') goto yy257;
- if (yych <= ':') goto yy256;
+ if (yych <= '/') goto yy262;
+ if (yych <= '9') goto yy263;
+ if (yych <= ':') goto yy262;
}
}
} else {
if (yych <= '_') {
if (yych <= '@') {
- if (yych != '=') goto yy256;
+ if (yych != '=') goto yy262;
} else {
- if (yych <= 'Z') goto yy257;
- if (yych <= ']') goto yy256;
- if (yych >= '_') goto yy257;
+ if (yych <= 'Z') goto yy263;
+ if (yych <= ']') goto yy262;
+ if (yych >= '_') goto yy263;
}
} else {
if (yych <= '{') {
- if (yych <= '`') goto yy256;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych <= '`') goto yy262;
+ if (yych <= 'z') goto yy263;
+ goto yy262;
} else {
- if (yych == '}') goto yy256;
- if (yych >= 0x7F) goto yy256;
+ if (yych == '}') goto yy262;
+ if (yych >= 0x7F) goto yy262;
}
}
}
-yy266:
- YYDEBUG(266, *YYCURSOR);
+yy272:
+ YYDEBUG(272, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 421 "Zend/zend_ini_scanner.l"
+#line 468 "Zend/zend_ini_scanner.l"
{ /* TRUE value (when used outside option value/offset this causes parse error!) */
RETURN_TOKEN(BOOL_TRUE, "1", 1);
}
-#line 3645 "Zend/zend_ini_scanner.c"
-yy267:
- YYDEBUG(267, *YYCURSOR);
+#line 3752 "Zend/zend_ini_scanner.c"
+yy273:
+ YYDEBUG(273, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(268, *YYCURSOR);
+ YYDEBUG(274, *YYCURSOR);
if (yybm[0+yych] & 16) {
- goto yy267;
+ goto yy273;
}
- goto yy266;
-yy269:
- YYDEBUG(269, *YYCURSOR);
+ goto yy272;
+yy275:
+ YYDEBUG(275, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy255;
+ if (yych <= 0x08) goto yy262;
+ goto yy255;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy255;
+ if (yych <= 0x1F) goto yy262;
+ goto yy255;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy262;
+ if (yych <= ')') goto yy255;
+ if (yych <= '/') goto yy262;
+ goto yy263;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy255;
+ if (yych <= '<') goto yy262;
+ goto yy255;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych != 'U') goto yy257;
+ if (yych <= '@') goto yy262;
+ if (yych != 'U') goto yy263;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy262;
+ if (yych <= '^') goto yy255;
+ if (yych <= '_') goto yy263;
+ goto yy262;
}
} else {
if (yych <= '{') {
- if (yych == 'u') goto yy270;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 'u') goto yy276;
+ if (yych <= 'z') goto yy263;
+ goto yy262;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy262;
+ if (yych <= '~') goto yy255;
+ goto yy262;
}
}
}
-yy270:
- YYDEBUG(270, *YYCURSOR);
+yy276:
+ YYDEBUG(276, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy255;
+ if (yych <= 0x08) goto yy262;
+ goto yy255;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy255;
+ if (yych <= 0x1F) goto yy262;
+ goto yy255;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy262;
+ if (yych <= ')') goto yy255;
+ if (yych <= '/') goto yy262;
+ goto yy263;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy255;
+ if (yych <= '<') goto yy262;
+ goto yy255;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych == 'E') goto yy265;
- goto yy257;
+ if (yych <= '@') goto yy262;
+ if (yych == 'E') goto yy271;
+ goto yy263;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy262;
+ if (yych <= '^') goto yy255;
+ if (yych <= '_') goto yy263;
+ goto yy262;
}
} else {
if (yych <= '{') {
- if (yych == 'e') goto yy265;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 'e') goto yy271;
+ if (yych <= 'z') goto yy263;
+ goto yy262;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy262;
+ if (yych <= '~') goto yy255;
+ goto yy262;
}
}
}
-yy271:
- YYDEBUG(271, *YYCURSOR);
+yy277:
+ YYDEBUG(277, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy255;
+ if (yych <= 0x08) goto yy262;
+ goto yy255;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy255;
+ if (yych <= 0x1F) goto yy262;
+ goto yy255;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy262;
+ if (yych <= ')') goto yy255;
+ if (yych <= '/') goto yy262;
+ goto yy263;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy255;
+ if (yych <= '<') goto yy262;
+ goto yy255;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych != 'F') goto yy257;
+ if (yych <= '@') goto yy262;
+ if (yych != 'F') goto yy263;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy262;
+ if (yych <= '^') goto yy255;
+ if (yych <= '_') goto yy263;
+ goto yy262;
}
} else {
if (yych <= '{') {
- if (yych == 'f') goto yy272;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 'f') goto yy278;
+ if (yych <= 'z') goto yy263;
+ goto yy262;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy262;
+ if (yych <= '~') goto yy255;
+ goto yy262;
}
}
}
-yy272:
- YYDEBUG(272, *YYCURSOR);
+yy278:
+ YYDEBUG(278, *YYCURSOR);
yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 4) {
- goto yy257;
+ goto yy263;
}
if (yych <= ')') {
if (yych <= '\f') {
if (yych <= 0x08) {
- if (yych >= 0x01) goto yy256;
+ if (yych >= 0x01) goto yy262;
} else {
- if (yych <= '\t') goto yy274;
- if (yych >= '\v') goto yy256;
+ if (yych <= '\t') goto yy280;
+ if (yych >= '\v') goto yy262;
}
} else {
if (yych <= ' ') {
- if (yych <= '\r') goto yy273;
- if (yych <= 0x1F) goto yy256;
- goto yy274;
+ if (yych <= '\r') goto yy279;
+ if (yych <= 0x1F) goto yy262;
+ goto yy280;
} else {
- if (yych <= '"') goto yy273;
- if (yych <= '%') goto yy256;
+ if (yych <= '"') goto yy279;
+ if (yych <= '%') goto yy262;
}
}
} else {
if (yych <= ']') {
if (yych <= ';') {
- if (yych <= ':') goto yy256;
+ if (yych <= ':') goto yy262;
} else {
- if (yych != '=') goto yy256;
+ if (yych != '=') goto yy262;
}
} else {
if (yych <= '|') {
- if (yych <= '^') goto yy273;
- if (yych <= '{') goto yy256;
+ if (yych <= '^') goto yy279;
+ if (yych <= '{') goto yy262;
} else {
- if (yych != '~') goto yy256;
+ if (yych != '~') goto yy262;
}
}
}
-yy273:
- YYDEBUG(273, *YYCURSOR);
+yy279:
+ YYDEBUG(279, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 425 "Zend/zend_ini_scanner.l"
+#line 472 "Zend/zend_ini_scanner.l"
{ /* FALSE value (when used outside option value/offset this causes parse error!)*/
RETURN_TOKEN(BOOL_FALSE, "", 0);
}
-#line 3855 "Zend/zend_ini_scanner.c"
-yy274:
- YYDEBUG(274, *YYCURSOR);
+#line 3962 "Zend/zend_ini_scanner.c"
+yy280:
+ YYDEBUG(280, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(275, *YYCURSOR);
- if (yych == '\t') goto yy274;
- if (yych == ' ') goto yy274;
- goto yy273;
-yy276:
- YYDEBUG(276, *YYCURSOR);
+ YYDEBUG(281, *YYCURSOR);
+ if (yych == '\t') goto yy280;
+ if (yych == ' ') goto yy280;
+ goto yy279;
+yy282:
+ YYDEBUG(282, *YYCURSOR);
yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '<') {
if (yych <= ' ') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy273;
- if (yych <= 0x08) goto yy256;
- if (yych <= '\t') goto yy274;
- goto yy273;
+ if (yych <= 0x00) goto yy279;
+ if (yych <= 0x08) goto yy262;
+ if (yych <= '\t') goto yy280;
+ goto yy279;
} else {
- if (yych == '\r') goto yy273;
- if (yych <= 0x1F) goto yy256;
- goto yy274;
+ if (yych == '\r') goto yy279;
+ if (yych <= 0x1F) goto yy262;
+ goto yy280;
}
} else {
if (yych <= '/') {
- if (yych <= '"') goto yy273;
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy273;
- goto yy256;
+ if (yych <= '"') goto yy279;
+ if (yych <= '%') goto yy262;
+ if (yych <= ')') goto yy279;
+ goto yy262;
} else {
- if (yych <= '9') goto yy257;
- if (yych == ';') goto yy273;
- goto yy256;
+ if (yych <= '9') goto yy263;
+ if (yych == ';') goto yy279;
+ goto yy262;
}
}
} else {
if (yych <= '_') {
if (yych <= 'N') {
- if (yych <= '=') goto yy273;
- if (yych <= '@') goto yy256;
- if (yych <= 'M') goto yy257;
- goto yy279;
+ if (yych <= '=') goto yy279;
+ if (yych <= '@') goto yy262;
+ if (yych <= 'M') goto yy263;
+ goto yy289;
} else {
- if (yych <= 'Z') goto yy257;
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy273;
- goto yy257;
+ if (yych <= 'Z') goto yy263;
+ if (yych <= ']') goto yy262;
+ if (yych <= '^') goto yy279;
+ goto yy263;
}
} else {
if (yych <= 'z') {
- if (yych <= '`') goto yy256;
- if (yych == 'n') goto yy279;
- goto yy257;
+ if (yych <= '`') goto yy262;
+ if (yych == 'n') goto yy289;
+ goto yy263;
} else {
if (yych <= '|') {
- if (yych <= '{') goto yy256;
- goto yy273;
+ if (yych <= '{') goto yy262;
+ goto yy279;
} else {
- if (yych == '~') goto yy273;
- goto yy256;
+ if (yych == '~') goto yy279;
+ goto yy262;
}
}
}
}
-yy277:
- YYDEBUG(277, *YYCURSOR);
+yy283:
+ YYDEBUG(283, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy255;
+ if (yych <= 0x08) goto yy262;
+ goto yy255;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy255;
+ if (yych <= 0x1F) goto yy262;
+ goto yy255;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy262;
+ if (yych <= ')') goto yy255;
+ if (yych <= '/') goto yy262;
+ goto yy263;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy255;
+ if (yych <= '<') goto yy262;
+ goto yy255;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych != 'L') goto yy257;
+ if (yych <= '@') goto yy262;
+ if (yych != 'L') goto yy263;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy262;
+ if (yych <= '^') goto yy255;
+ if (yych <= '_') goto yy263;
+ goto yy262;
}
} else {
if (yych <= '{') {
- if (yych == 'l') goto yy278;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 'l') goto yy284;
+ if (yych <= 'z') goto yy263;
+ goto yy262;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy262;
+ if (yych <= '~') goto yy255;
+ goto yy262;
}
}
}
-yy278:
- YYDEBUG(278, *YYCURSOR);
+yy284:
+ YYDEBUG(284, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy255;
+ if (yych <= 0x08) goto yy262;
+ goto yy255;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy255;
+ if (yych <= 0x1F) goto yy262;
+ goto yy255;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy262;
+ if (yych <= ')') goto yy255;
+ if (yych <= '/') goto yy262;
+ goto yy263;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy255;
+ if (yych <= '<') goto yy262;
+ goto yy255;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych == 'L') goto yy272;
- goto yy257;
+ if (yych <= '@') goto yy262;
+ if (yych != 'L') goto yy263;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy262;
+ if (yych <= '^') goto yy255;
+ if (yych <= '_') goto yy263;
+ goto yy262;
}
} else {
if (yych <= '{') {
- if (yych == 'l') goto yy272;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 'l') goto yy285;
+ if (yych <= 'z') goto yy263;
+ goto yy262;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy262;
+ if (yych <= '~') goto yy255;
+ goto yy262;
}
}
}
-yy279:
- YYDEBUG(279, *YYCURSOR);
+yy285:
+ YYDEBUG(285, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yybm[0+yych] & 4) {
+ goto yy263;
+ }
+ if (yych <= ')') {
+ if (yych <= '\f') {
+ if (yych <= 0x08) {
+ if (yych >= 0x01) goto yy262;
+ } else {
+ if (yych <= '\t') goto yy287;
+ if (yych >= '\v') goto yy262;
+ }
+ } else {
+ if (yych <= ' ') {
+ if (yych <= '\r') goto yy286;
+ if (yych <= 0x1F) goto yy262;
+ goto yy287;
+ } else {
+ if (yych <= '"') goto yy286;
+ if (yych <= '%') goto yy262;
+ }
+ }
+ } else {
+ if (yych <= ']') {
+ if (yych <= ';') {
+ if (yych <= ':') goto yy262;
+ } else {
+ if (yych != '=') goto yy262;
+ }
+ } else {
+ if (yych <= '|') {
+ if (yych <= '^') goto yy286;
+ if (yych <= '{') goto yy262;
+ } else {
+ if (yych != '~') goto yy262;
+ }
+ }
+ }
+yy286:
+ YYDEBUG(286, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 476 "Zend/zend_ini_scanner.l"
+ {
+ RETURN_TOKEN(NULL_NULL, "", 0);
+}
+#line 4177 "Zend/zend_ini_scanner.c"
+yy287:
+ YYDEBUG(287, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(288, *YYCURSOR);
+ if (yych == '\t') goto yy287;
+ if (yych == ' ') goto yy287;
+ goto yy286;
+yy289:
+ YYDEBUG(289, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy255;
+ if (yych <= 0x08) goto yy262;
+ goto yy255;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy255;
+ if (yych <= 0x1F) goto yy262;
+ goto yy255;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy262;
+ if (yych <= ')') goto yy255;
+ if (yych <= '/') goto yy262;
+ goto yy263;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy255;
+ if (yych <= '<') goto yy262;
+ goto yy255;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych == 'E') goto yy272;
- goto yy257;
+ if (yych <= '@') goto yy262;
+ if (yych == 'E') goto yy278;
+ goto yy263;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy262;
+ if (yych <= '^') goto yy255;
+ if (yych <= '_') goto yy263;
+ goto yy262;
}
} else {
if (yych <= '{') {
- if (yych == 'e') goto yy272;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 'e') goto yy278;
+ if (yych <= 'z') goto yy263;
+ goto yy262;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy262;
+ if (yych <= '~') goto yy255;
+ goto yy262;
}
}
}
-yy280:
- YYDEBUG(280, *YYCURSOR);
+yy290:
+ YYDEBUG(290, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy255;
+ if (yych <= 0x08) goto yy262;
+ goto yy255;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy255;
+ if (yych <= 0x1F) goto yy262;
+ goto yy255;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy262;
+ if (yych <= ')') goto yy255;
+ if (yych <= '/') goto yy262;
+ goto yy263;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy255;
+ if (yych <= '<') goto yy262;
+ goto yy255;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych != 'L') goto yy257;
+ if (yych <= '@') goto yy262;
+ if (yych != 'L') goto yy263;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy262;
+ if (yych <= '^') goto yy255;
+ if (yych <= '_') goto yy263;
+ goto yy262;
}
} else {
if (yych <= '{') {
- if (yych == 'l') goto yy281;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 'l') goto yy291;
+ if (yych <= 'z') goto yy263;
+ goto yy262;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy262;
+ if (yych <= '~') goto yy255;
+ goto yy262;
}
}
}
-yy281:
- YYDEBUG(281, *YYCURSOR);
+yy291:
+ YYDEBUG(291, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy255;
+ if (yych <= 0x08) goto yy262;
+ goto yy255;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy255;
+ if (yych <= 0x1F) goto yy262;
+ goto yy255;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy262;
+ if (yych <= ')') goto yy255;
+ if (yych <= '/') goto yy262;
+ goto yy263;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy255;
+ if (yych <= '<') goto yy262;
+ goto yy255;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych != 'S') goto yy257;
+ if (yych <= '@') goto yy262;
+ if (yych != 'S') goto yy263;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy262;
+ if (yych <= '^') goto yy255;
+ if (yych <= '_') goto yy263;
+ goto yy262;
}
} else {
if (yych <= '{') {
- if (yych == 's') goto yy282;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 's') goto yy292;
+ if (yych <= 'z') goto yy263;
+ goto yy262;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy262;
+ if (yych <= '~') goto yy255;
+ goto yy262;
}
}
}
-yy282:
- YYDEBUG(282, *YYCURSOR);
+yy292:
+ YYDEBUG(292, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '=') {
if (yych <= '"') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy249;
- if (yych <= 0x08) goto yy256;
- goto yy249;
+ if (yych <= 0x00) goto yy255;
+ if (yych <= 0x08) goto yy262;
+ goto yy255;
} else {
- if (yych == '\r') goto yy249;
- if (yych <= 0x1F) goto yy256;
- goto yy249;
+ if (yych == '\r') goto yy255;
+ if (yych <= 0x1F) goto yy262;
+ goto yy255;
}
} else {
if (yych <= '9') {
- if (yych <= '%') goto yy256;
- if (yych <= ')') goto yy249;
- if (yych <= '/') goto yy256;
- goto yy257;
+ if (yych <= '%') goto yy262;
+ if (yych <= ')') goto yy255;
+ if (yych <= '/') goto yy262;
+ goto yy263;
} else {
- if (yych == ';') goto yy249;
- if (yych <= '<') goto yy256;
- goto yy249;
+ if (yych == ';') goto yy255;
+ if (yych <= '<') goto yy262;
+ goto yy255;
}
}
} else {
if (yych <= '`') {
if (yych <= 'Z') {
- if (yych <= '@') goto yy256;
- if (yych == 'E') goto yy272;
- goto yy257;
+ if (yych <= '@') goto yy262;
+ if (yych == 'E') goto yy278;
+ goto yy263;
} else {
- if (yych <= ']') goto yy256;
- if (yych <= '^') goto yy249;
- if (yych <= '_') goto yy257;
- goto yy256;
+ if (yych <= ']') goto yy262;
+ if (yych <= '^') goto yy255;
+ if (yych <= '_') goto yy263;
+ goto yy262;
}
} else {
if (yych <= '{') {
- if (yych == 'e') goto yy272;
- if (yych <= 'z') goto yy257;
- goto yy256;
+ if (yych == 'e') goto yy278;
+ if (yych <= 'z') goto yy263;
+ goto yy262;
} else {
- if (yych == '}') goto yy256;
- if (yych <= '~') goto yy249;
- goto yy256;
+ if (yych == '}') goto yy262;
+ if (yych <= '~') goto yy255;
+ goto yy262;
}
}
}
-yy283:
- YYDEBUG(283, *YYCURSOR);
+yy293:
+ YYDEBUG(293, *YYCURSOR);
++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
-yy284:
- YYDEBUG(284, *YYCURSOR);
+yy294:
+ YYDEBUG(294, *YYCURSOR);
if (yybm[0+yych] & 32) {
- goto yy283;
+ goto yy293;
}
- if (yych >= '\r') goto yy287;
-yy285:
- YYDEBUG(285, *YYCURSOR);
+ if (yych >= '\r') goto yy297;
+yy295:
+ YYDEBUG(295, *YYCURSOR);
++YYCURSOR;
-yy286:
- YYDEBUG(286, *YYCURSOR);
+yy296:
+ YYDEBUG(296, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 585 "Zend/zend_ini_scanner.l"
+#line 636 "Zend/zend_ini_scanner.l"
{ /* Comment */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
-#line 4248 "Zend/zend_ini_scanner.c"
-yy287:
- YYDEBUG(287, *YYCURSOR);
+#line 4412 "Zend/zend_ini_scanner.c"
+yy297:
+ YYDEBUG(297, *YYCURSOR);
yych = *++YYCURSOR;
- if (yych == '\n') goto yy285;
- goto yy286;
-yy288:
- YYDEBUG(288, *YYCURSOR);
+ if (yych == '\n') goto yy295;
+ goto yy296;
+yy298:
+ YYDEBUG(298, *YYCURSOR);
yyaccept = 3;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(289, *YYCURSOR);
+ YYDEBUG(299, *YYCURSOR);
if (yybm[0+yych] & 64) {
- goto yy288;
+ goto yy298;
}
if (yych <= ')') {
if (yych <= '\r') {
if (yych <= 0x08) {
- if (yych <= 0x00) goto yy244;
- goto yy255;
+ if (yych <= 0x00) goto yy250;
+ goto yy261;
} else {
- if (yych <= '\n') goto yy244;
- if (yych <= '\f') goto yy255;
- goto yy244;
+ if (yych <= '\n') goto yy250;
+ if (yych <= '\f') goto yy261;
+ goto yy250;
}
} else {
if (yych <= '#') {
- if (yych <= 0x1F) goto yy255;
- if (yych <= '"') goto yy244;
- goto yy255;
+ if (yych <= 0x1F) goto yy261;
+ if (yych <= '"') goto yy250;
+ goto yy261;
} else {
- if (yych <= '$') goto yy260;
- if (yych <= '%') goto yy255;
- goto yy244;
+ if (yych <= '$') goto yy266;
+ if (yych <= '%') goto yy261;
+ goto yy250;
}
}
} else {
if (yych <= ']') {
if (yych <= ';') {
- if (yych <= ':') goto yy255;
- goto yy244;
+ if (yych <= ':') goto yy261;
+ goto yy250;
} else {
- if (yych == '=') goto yy244;
- goto yy255;
+ if (yych == '=') goto yy250;
+ goto yy261;
}
} else {
if (yych <= '|') {
- if (yych <= '^') goto yy244;
- if (yych <= '{') goto yy255;
- goto yy244;
+ if (yych <= '^') goto yy250;
+ if (yych <= '{') goto yy261;
+ goto yy250;
} else {
- if (yych == '~') goto yy244;
- goto yy255;
+ if (yych == '~') goto yy250;
+ goto yy261;
}
}
}
-yy290:
- YYDEBUG(290, *YYCURSOR);
+yy300:
+ YYDEBUG(300, *YYCURSOR);
yyaccept = 3;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(291, *YYCURSOR);
+ YYDEBUG(301, *YYCURSOR);
if (yych <= '.') {
if (yych <= 0x1F) {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy244;
- if (yych <= 0x08) goto yy255;
- goto yy244;
+ if (yych <= 0x00) goto yy250;
+ if (yych <= 0x08) goto yy261;
+ goto yy250;
} else {
- if (yych == '\r') goto yy244;
- goto yy255;
+ if (yych == '\r') goto yy250;
+ goto yy261;
}
} else {
if (yych <= '$') {
- if (yych <= '"') goto yy244;
- if (yych <= '#') goto yy255;
- goto yy260;
+ if (yych <= '"') goto yy250;
+ if (yych <= '#') goto yy261;
+ goto yy266;
} else {
- if (yych <= '%') goto yy255;
- if (yych <= ')') goto yy244;
- if (yych <= '-') goto yy255;
- goto yy288;
+ if (yych <= '%') goto yy261;
+ if (yych <= ')') goto yy250;
+ if (yych <= '-') goto yy261;
+ goto yy298;
}
}
} else {
if (yych <= '=') {
if (yych <= ':') {
- if (yych <= '/') goto yy255;
- if (yych <= '9') goto yy290;
- goto yy255;
+ if (yych <= '/') goto yy261;
+ if (yych <= '9') goto yy300;
+ goto yy261;
} else {
- if (yych == '<') goto yy255;
- goto yy244;
+ if (yych == '<') goto yy261;
+ goto yy250;
}
} else {
if (yych <= '{') {
- if (yych == '^') goto yy244;
- goto yy255;
+ if (yych == '^') goto yy250;
+ goto yy261;
} else {
- if (yych == '}') goto yy255;
- if (yych <= '~') goto yy244;
- goto yy255;
+ if (yych == '}') goto yy261;
+ if (yych <= '~') goto yy250;
+ goto yy261;
}
}
}
-yy292:
- YYDEBUG(292, *YYCURSOR);
+yy302:
+ YYDEBUG(302, *YYCURSOR);
yyaccept = 3;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(293, *YYCURSOR);
+ YYDEBUG(303, *YYCURSOR);
if (yych <= '/') {
if (yych <= 0x1F) {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy244;
- if (yych <= 0x08) goto yy255;
- goto yy244;
+ if (yych <= 0x00) goto yy250;
+ if (yych <= 0x08) goto yy261;
+ goto yy250;
} else {
- if (yych == '\r') goto yy244;
- goto yy255;
+ if (yych == '\r') goto yy250;
+ goto yy261;
}
} else {
if (yych <= '$') {
- if (yych <= '"') goto yy244;
- if (yych <= '#') goto yy255;
- goto yy260;
+ if (yych <= '"') goto yy250;
+ if (yych <= '#') goto yy261;
+ goto yy266;
} else {
- if (yych <= '%') goto yy255;
- if (yych <= ')') goto yy244;
- goto yy255;
+ if (yych <= '%') goto yy261;
+ if (yych <= ')') goto yy250;
+ goto yy261;
}
}
} else {
if (yych <= ']') {
if (yych <= ';') {
- if (yych <= '9') goto yy292;
- if (yych <= ':') goto yy255;
- goto yy244;
+ if (yych <= '9') goto yy302;
+ if (yych <= ':') goto yy261;
+ goto yy250;
} else {
- if (yych == '=') goto yy244;
- goto yy255;
+ if (yych == '=') goto yy250;
+ goto yy261;
}
} else {
if (yych <= '|') {
- if (yych <= '^') goto yy244;
- if (yych <= '{') goto yy255;
- goto yy244;
+ if (yych <= '^') goto yy250;
+ if (yych <= '{') goto yy261;
+ goto yy250;
} else {
- if (yych == '~') goto yy244;
- goto yy255;
+ if (yych == '~') goto yy250;
+ goto yy261;
}
}
}
-yy294:
- YYDEBUG(294, *YYCURSOR);
+yy304:
+ YYDEBUG(304, *YYCURSOR);
yyaccept = 3;
YYMARKER = ++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(295, *YYCURSOR);
+ YYDEBUG(305, *YYCURSOR);
if (yych <= '/') {
if (yych <= 0x1F) {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy244;
- if (yych <= 0x08) goto yy255;
- goto yy244;
+ if (yych <= 0x00) goto yy250;
+ if (yych <= 0x08) goto yy261;
+ goto yy250;
} else {
- if (yych == '\r') goto yy244;
- goto yy255;
+ if (yych == '\r') goto yy250;
+ goto yy261;
}
} else {
if (yych <= '$') {
- if (yych <= '"') goto yy244;
- if (yych <= '#') goto yy255;
- goto yy260;
+ if (yych <= '"') goto yy250;
+ if (yych <= '#') goto yy261;
+ goto yy266;
} else {
- if (yych <= '%') goto yy255;
- if (yych <= ')') goto yy244;
- goto yy255;
+ if (yych <= '%') goto yy261;
+ if (yych <= ')') goto yy250;
+ goto yy261;
}
}
} else {
if (yych <= ']') {
if (yych <= ';') {
- if (yych <= '9') goto yy294;
- if (yych <= ':') goto yy255;
- goto yy244;
+ if (yych <= '9') goto yy304;
+ if (yych <= ':') goto yy261;
+ goto yy250;
} else {
- if (yych == '=') goto yy244;
- goto yy255;
+ if (yych == '=') goto yy250;
+ goto yy261;
}
} else {
if (yych <= '|') {
- if (yych <= '^') goto yy244;
- if (yych <= '{') goto yy255;
- goto yy244;
+ if (yych <= '^') goto yy250;
+ if (yych <= '{') goto yy261;
+ goto yy250;
} else {
- if (yych == '~') goto yy244;
- goto yy255;
+ if (yych == '~') goto yy250;
+ goto yy261;
}
}
}
-yy296:
- YYDEBUG(296, *YYCURSOR);
+yy306:
+ YYDEBUG(306, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
- YYDEBUG(297, *YYCURSOR);
+ YYDEBUG(307, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy296;
+ goto yy306;
}
- YYDEBUG(298, *YYCURSOR);
+ YYDEBUG(308, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(299, *YYCURSOR);
+ YYDEBUG(309, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 368 "Zend/zend_ini_scanner.l"
+#line 415 "Zend/zend_ini_scanner.l"
{ /* Raw string */
/* Eat leading and trailing single quotes */
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
@@ -4471,66 +4635,66 @@ yy296:
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
-#line 4475 "Zend/zend_ini_scanner.c"
-yy300:
- YYDEBUG(300, *YYCURSOR);
+#line 4639 "Zend/zend_ini_scanner.c"
+yy310:
+ YYDEBUG(310, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(301, *YYCURSOR);
+ YYDEBUG(311, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 401 "Zend/zend_ini_scanner.l"
+#line 448 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME TSRMLS_CC);
return TC_DOLLAR_CURLY;
}
-#line 4486 "Zend/zend_ini_scanner.c"
-yy302:
- YYDEBUG(302, *YYCURSOR);
+#line 4650 "Zend/zend_ini_scanner.c"
+yy312:
+ YYDEBUG(312, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy303:
- YYDEBUG(303, *YYCURSOR);
- if (yych == '\t') goto yy302;
- if (yych == ' ') goto yy302;
- goto yy236;
-yy304:
- YYDEBUG(304, *YYCURSOR);
+yy313:
+ YYDEBUG(313, *YYCURSOR);
+ if (yych == '\t') goto yy312;
+ if (yych == ' ') goto yy312;
+ goto yy242;
+yy314:
+ YYDEBUG(314, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy233;
-yy305:
- YYDEBUG(305, *YYCURSOR);
+ goto yy239;
+yy315:
+ YYDEBUG(315, *YYCURSOR);
yyaccept = 1;
YYMARKER = ++YYCURSOR;
YYFILL(2);
yych = *YYCURSOR;
-yy306:
- YYDEBUG(306, *YYCURSOR);
+yy316:
+ YYDEBUG(316, *YYCURSOR);
if (yych <= 0x1F) {
if (yych <= '\n') {
- if (yych <= 0x08) goto yy231;
- if (yych <= '\t') goto yy305;
- goto yy304;
+ if (yych <= 0x08) goto yy237;
+ if (yych <= '\t') goto yy315;
+ goto yy314;
} else {
- if (yych == '\r') goto yy308;
- goto yy231;
+ if (yych == '\r') goto yy318;
+ goto yy237;
}
} else {
if (yych <= '"') {
- if (yych <= ' ') goto yy305;
- if (yych <= '!') goto yy231;
+ if (yych <= ' ') goto yy315;
+ if (yych <= '!') goto yy237;
} else {
- if (yych == ';') goto yy283;
- goto yy231;
+ if (yych == ';') goto yy293;
+ goto yy237;
}
}
- YYDEBUG(307, *YYCURSOR);
+ YYDEBUG(317, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy238;
-yy308:
- YYDEBUG(308, *YYCURSOR);
+ goto yy244;
+yy318:
+ YYDEBUG(318, *YYCURSOR);
++YYCURSOR;
- if ((yych = *YYCURSOR) == '\n') goto yy304;
- goto yy233;
+ if ((yych = *YYCURSOR) == '\n') goto yy314;
+ goto yy239;
}
/* *********************************** */
yyc_ST_VARNAME:
@@ -4569,51 +4733,51 @@ yyc_ST_VARNAME:
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
};
- YYDEBUG(309, *YYCURSOR);
+ YYDEBUG(319, *YYCURSOR);
YYFILL(2);
yych = *YYCURSOR;
if (yych <= ')') {
if (yych <= '"') {
if (yych <= '\f') {
- if (yych <= 0x08) goto yy311;
- if (yych <= '\n') goto yy313;
+ if (yych <= 0x08) goto yy321;
+ if (yych <= '\n') goto yy323;
} else {
- if (yych <= '\r') goto yy313;
- if (yych >= '!') goto yy313;
+ if (yych <= '\r') goto yy323;
+ if (yych >= '!') goto yy323;
}
} else {
if (yych <= '%') {
- if (yych == '$') goto yy313;
+ if (yych == '$') goto yy323;
} else {
- if (yych != '\'') goto yy313;
+ if (yych != '\'') goto yy323;
}
}
} else {
if (yych <= '[') {
if (yych <= '<') {
- if (yych == ';') goto yy313;
+ if (yych == ';') goto yy323;
} else {
- if (yych <= '=') goto yy313;
- if (yych >= '[') goto yy313;
+ if (yych <= '=') goto yy323;
+ if (yych >= '[') goto yy323;
}
} else {
if (yych <= 'z') {
- if (yych == '^') goto yy313;
+ if (yych == '^') goto yy323;
} else {
- if (yych == '}') goto yy315;
- if (yych <= '~') goto yy313;
+ if (yych == '}') goto yy325;
+ if (yych <= '~') goto yy323;
}
}
}
-yy311:
- YYDEBUG(311, *YYCURSOR);
+yy321:
+ YYDEBUG(321, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
- goto yy318;
-yy312:
- YYDEBUG(312, *YYCURSOR);
+ goto yy328;
+yy322:
+ YYDEBUG(322, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 406 "Zend/zend_ini_scanner.l"
+#line 453 "Zend/zend_ini_scanner.l"
{ /* Variable name */
/* Eat leading whitespace */
EAT_LEADING_WHITESPACE();
@@ -4623,41 +4787,41 @@ yy312:
RETURN_TOKEN(TC_VARNAME, yytext, yyleng);
}
-#line 4627 "Zend/zend_ini_scanner.c"
-yy313:
- YYDEBUG(313, *YYCURSOR);
+#line 4791 "Zend/zend_ini_scanner.c"
+yy323:
+ YYDEBUG(323, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(314, *YYCURSOR);
+ YYDEBUG(324, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 603 "Zend/zend_ini_scanner.l"
+#line 654 "Zend/zend_ini_scanner.l"
{
return 0;
}
-#line 4637 "Zend/zend_ini_scanner.c"
-yy315:
- YYDEBUG(315, *YYCURSOR);
+#line 4801 "Zend/zend_ini_scanner.c"
+yy325:
+ YYDEBUG(325, *YYCURSOR);
++YYCURSOR;
- YYDEBUG(316, *YYCURSOR);
+ YYDEBUG(326, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 416 "Zend/zend_ini_scanner.l"
+#line 463 "Zend/zend_ini_scanner.l"
{ /* Variable end */
yy_pop_state(TSRMLS_C);
return '}';
}
-#line 4648 "Zend/zend_ini_scanner.c"
-yy317:
- YYDEBUG(317, *YYCURSOR);
+#line 4812 "Zend/zend_ini_scanner.c"
+yy327:
+ YYDEBUG(327, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
-yy318:
- YYDEBUG(318, *YYCURSOR);
+yy328:
+ YYDEBUG(328, *YYCURSOR);
if (yybm[0+yych] & 128) {
- goto yy317;
+ goto yy327;
}
- goto yy312;
+ goto yy322;
}
}
-#line 607 "Zend/zend_ini_scanner.l"
+#line 658 "Zend/zend_ini_scanner.l"
}
diff --git a/Zend/zend_ini_scanner.h b/Zend/zend_ini_scanner.h
index 8b4328b8cc..763a78adaf 100644
--- a/Zend/zend_ini_scanner.h
+++ b/Zend/zend_ini_scanner.h
@@ -25,6 +25,7 @@
/* Scanner modes */
#define ZEND_INI_SCANNER_NORMAL 0 /* Normal mode. [DEFAULT] */
#define ZEND_INI_SCANNER_RAW 1 /* Raw mode. Option values are not parsed */
+#define ZEND_INI_SCANNER_TYPED 2 /* Typed mode. */
BEGIN_EXTERN_C()
int zend_ini_scanner_get_lineno(TSRMLS_D);
diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l
index a0a4df7d49..fa586575f4 100644
--- a/Zend/zend_ini_scanner.l
+++ b/Zend/zend_ini_scanner.l
@@ -24,6 +24,7 @@
#include <errno.h>
#include "zend.h"
+#include "zend_API.h"
#include "zend_globals.h"
#include <zend_ini_parser.h>
#include "zend_ini_scanner.h"
@@ -137,9 +138,55 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
Z_TYPE_P(retval) = IS_STRING; \
}
-#define RETURN_TOKEN(type, str, len) { \
- zend_ini_copy_value(ini_lval, str, len); \
- return type; \
+#define RETURN_TOKEN(type, str, len) { \
+ if (SCNG(scanner_mode) == ZEND_INI_SCANNER_TYPED) { \
+ zend_ini_copy_typed_value(ini_lval, type, str, len); \
+ } else { \
+ zend_ini_copy_value(ini_lval, str, len); \
+ } \
+ return type; \
+}
+
+static inline int convert_to_number(zval *retval, const char *str, const int str_len)
+{
+ zend_uchar type;
+ int overflow;
+ long lval;
+ double dval;
+
+ if ((type = is_numeric_string_ex(str, str_len, &lval, &dval, 0, &overflow)) != 0) {
+ if (type == IS_LONG) {
+ ZVAL_LONG(retval, lval);
+ return SUCCESS;
+ } else if (type == IS_DOUBLE && !overflow) {
+ ZVAL_DOUBLE(retval, dval);
+ return SUCCESS;
+ }
+ }
+
+ return FAILURE;
+}
+
+static void zend_ini_copy_typed_value(zval *retval, const int type, const char *str, int len)
+{
+ switch (type) {
+ case BOOL_FALSE:
+ case BOOL_TRUE:
+ ZVAL_BOOL(retval, type == BOOL_TRUE);
+ break;
+
+ case NULL_NULL:
+ ZVAL_NULL(retval);
+ break;
+
+ case TC_NUMBER:
+ if (convert_to_number(retval, str, len) == SUCCESS) {
+ break;
+ }
+ /* intentional fall-through */
+ default:
+ zend_ini_copy_value(retval, str, len);
+ }
}
static void _yy_push_state(int new_state TSRMLS_DC)
@@ -172,7 +219,7 @@ static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC)
static int init_ini_scanner(int scanner_mode, zend_file_handle *fh TSRMLS_DC)
{
/* Sanity check */
- if (scanner_mode != ZEND_INI_SCANNER_NORMAL && scanner_mode != ZEND_INI_SCANNER_RAW) {
+ if (scanner_mode != ZEND_INI_SCANNER_NORMAL && scanner_mode != ZEND_INI_SCANNER_RAW && scanner_mode != ZEND_INI_SCANNER_TYPED) {
zend_error(E_WARNING, "Invalid scanner mode");
return FAILURE;
}
@@ -422,10 +469,14 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
RETURN_TOKEN(BOOL_TRUE, "1", 1);
}
-<INITIAL,ST_VALUE>("false"|"off"|"no"|"none"|"null"){TABS_AND_SPACES}* { /* FALSE value (when used outside option value/offset this causes parse error!)*/
+<INITIAL,ST_VALUE>("false"|"off"|"no"|"none"){TABS_AND_SPACES}* { /* FALSE value (when used outside option value/offset this causes parse error!)*/
RETURN_TOKEN(BOOL_FALSE, "", 0);
}
+<INITIAL,ST_VALUE>("null"){TABS_AND_SPACES}* {
+ RETURN_TOKEN(NULL_NULL, "", 0);
+}
+
<INITIAL>{LABEL} { /* Get option name */
/* Eat leading whitespace */
EAT_LEADING_WHITESPACE();
diff --git a/Zend/zend_ini_scanner_defs.h b/Zend/zend_ini_scanner_defs.h
index 287d7bc1fb..5723954978 100644
--- a/Zend/zend_ini_scanner_defs.h
+++ b/Zend/zend_ini_scanner_defs.h
@@ -1,13 +1,13 @@
-/* Generated by re2c 0.13.5 */
-#line 3 "Zend/zend_ini_scanner_defs.h"
-
-enum YYCONDTYPE {
- yycINITIAL,
- yycST_OFFSET,
- yycST_SECTION_VALUE,
- yycST_VALUE,
- yycST_SECTION_RAW,
- yycST_DOUBLE_QUOTES,
- yycST_VARNAME,
- yycST_RAW,
-};
+/* Generated by re2c 0.13.5 */
+#line 3 "Zend/zend_ini_scanner_defs.h"
+
+enum YYCONDTYPE {
+ yycINITIAL,
+ yycST_OFFSET,
+ yycST_SECTION_VALUE,
+ yycST_VALUE,
+ yycST_SECTION_RAW,
+ yycST_DOUBLE_QUOTES,
+ yycST_VARNAME,
+ yycST_RAW,
+};
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index 2926c8c715..67f1a71aeb 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -72,7 +72,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
%token T_PRINT "print (T_PRINT)"
%right T_YIELD
%token T_YIELD "yield (T_YIELD)"
-%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
+%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
%token T_PLUS_EQUAL "+= (T_PLUS_EQUAL)"
%token T_MINUS_EQUAL "-= (T_MINUS_EQUAL)"
%token T_MUL_EQUAL "*= (T_MUL_EQUAL)"
@@ -109,6 +109,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
%nonassoc T_INSTANCEOF
%token T_INSTANCEOF "instanceof (T_INSTANCEOF)"
%right '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@'
+%right T_POW
%token T_INC "++ (T_INC)"
%token T_DEC "-- (T_DEC)"
%token T_INT_CAST "(int) (T_INT_CAST)"
@@ -212,6 +213,9 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
%token T_NS_C "__NAMESPACE__ (T_NS_C)"
%token T_DIR "__DIR__ (T_DIR)"
%token T_NS_SEPARATOR "\\ (T_NS_SEPARATOR)"
+%token T_ELLIPSIS "... (T_ELLIPSIS)"
+%token T_POW "** (T_POW)"
+%token T_POW_EQUAL "**= (T_POW_EQUAL)"
%% /* Rules */
@@ -240,6 +244,8 @@ top_statement:
| T_NAMESPACE '{' { zend_do_begin_namespace(NULL, 1 TSRMLS_CC); }
top_statement_list '}' { zend_do_end_namespace(TSRMLS_C); }
| T_USE use_declarations ';' { zend_verify_namespace(TSRMLS_C); }
+ | T_USE T_FUNCTION use_function_declarations ';' { zend_verify_namespace(TSRMLS_C); }
+ | T_USE T_CONST use_const_declarations ';' { zend_verify_namespace(TSRMLS_C); }
| constant_declaration ';' { zend_verify_namespace(TSRMLS_C); }
;
@@ -255,6 +261,30 @@ use_declaration:
| T_NS_SEPARATOR namespace_name T_AS T_STRING { zend_do_use(&$2, &$4 TSRMLS_CC); }
;
+use_function_declarations:
+ use_function_declarations ',' use_function_declaration
+ | use_function_declaration
+;
+
+use_function_declaration:
+ namespace_name { zend_do_use_function(&$1, NULL TSRMLS_CC); }
+ | namespace_name T_AS T_STRING { zend_do_use_function(&$1, &$3 TSRMLS_CC); }
+ | T_NS_SEPARATOR namespace_name { zend_do_use_function(&$2, NULL TSRMLS_CC); }
+ | T_NS_SEPARATOR namespace_name T_AS T_STRING { zend_do_use_function(&$2, &$4 TSRMLS_CC); }
+;
+
+use_const_declarations:
+ use_const_declarations ',' use_const_declaration
+ | use_const_declaration
+;
+
+use_const_declaration:
+ namespace_name { zend_do_use_const(&$1, NULL TSRMLS_CC); }
+ | namespace_name T_AS T_STRING { zend_do_use_const(&$1, &$3 TSRMLS_CC); }
+ | T_NS_SEPARATOR namespace_name { zend_do_use_const(&$2, NULL TSRMLS_CC); }
+ | T_NS_SEPARATOR namespace_name T_AS T_STRING { zend_do_use_const(&$2, &$4 TSRMLS_CC); }
+;
+
constant_declaration:
constant_declaration ',' T_STRING '=' static_scalar { zend_do_declare_constant(&$3, &$5 TSRMLS_CC); }
| T_CONST T_STRING '=' static_scalar { zend_do_declare_constant(&$2, &$4 TSRMLS_CC); }
@@ -270,7 +300,7 @@ inner_statement:
statement
| function_declaration_statement
| class_declaration_statement
- | T_HALT_COMPILER '(' ')' ';' { zend_error(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used from the outermost scope"); }
+ | T_HALT_COMPILER '(' ')' ';' { zend_error_noreturn(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used from the outermost scope"); }
;
@@ -371,10 +401,14 @@ class_declaration_statement:
;
is_reference:
- /* empty */ { $$.op_type = ZEND_RETURN_VAL; }
- | '&' { $$.op_type = ZEND_RETURN_REF; }
+ /* empty */ { $$.op_type = 0; }
+ | '&' { $$.op_type = 1; }
;
+is_variadic:
+ /* empty */ { $$.op_type = 0; }
+ | T_ELLIPSIS { $$.op_type = 1; }
+;
unticked_function_declaration_statement:
function is_reference T_STRING { zend_do_begin_function_declaration(&$1, &$3, 0, $2.op_type, NULL TSRMLS_CC); }
@@ -523,14 +557,15 @@ parameter_list:
non_empty_parameter_list:
- optional_class_type T_VARIABLE { $$.op_type = IS_UNUSED; $$.u.op.num=1; zend_do_receive_arg(ZEND_RECV, &$2, &$$, NULL, &$1, 0 TSRMLS_CC); }
- | optional_class_type '&' T_VARIABLE { $$.op_type = IS_UNUSED; $$.u.op.num=1; zend_do_receive_arg(ZEND_RECV, &$3, &$$, NULL, &$1, 1 TSRMLS_CC); }
- | optional_class_type '&' T_VARIABLE '=' static_scalar { $$.op_type = IS_UNUSED; $$.u.op.num=1; zend_do_receive_arg(ZEND_RECV_INIT, &$3, &$$, &$5, &$1, 1 TSRMLS_CC); }
- | optional_class_type T_VARIABLE '=' static_scalar { $$.op_type = IS_UNUSED; $$.u.op.num=1; zend_do_receive_arg(ZEND_RECV_INIT, &$2, &$$, &$4, &$1, 0 TSRMLS_CC); }
- | non_empty_parameter_list ',' optional_class_type T_VARIABLE { $$=$1; $$.u.op.num++; zend_do_receive_arg(ZEND_RECV, &$4, &$$, NULL, &$3, 0 TSRMLS_CC); }
- | non_empty_parameter_list ',' optional_class_type '&' T_VARIABLE { $$=$1; $$.u.op.num++; zend_do_receive_arg(ZEND_RECV, &$5, &$$, NULL, &$3, 1 TSRMLS_CC); }
- | non_empty_parameter_list ',' optional_class_type '&' T_VARIABLE '=' static_scalar { $$=$1; $$.u.op.num++; zend_do_receive_arg(ZEND_RECV_INIT, &$5, &$$, &$7, &$3, 1 TSRMLS_CC); }
- | non_empty_parameter_list ',' optional_class_type T_VARIABLE '=' static_scalar { $$=$1; $$.u.op.num++; zend_do_receive_arg(ZEND_RECV_INIT, &$4, &$$, &$6, &$3, 0 TSRMLS_CC); }
+ parameter
+ | non_empty_parameter_list ',' parameter
+;
+
+parameter:
+ optional_class_type is_reference is_variadic T_VARIABLE
+ { zend_do_receive_param(ZEND_RECV, &$4, NULL, &$1, $2.op_type, $3.op_type TSRMLS_CC); }
+ | optional_class_type is_reference is_variadic T_VARIABLE '=' static_scalar
+ { zend_do_receive_param(ZEND_RECV_INIT, &$4, &$6, &$1, $2.op_type, $3.op_type TSRMLS_CC); }
;
@@ -545,17 +580,20 @@ optional_class_type:
function_call_parameter_list:
'(' ')' { Z_LVAL($$.u.constant) = 0; }
| '(' non_empty_function_call_parameter_list ')' { $$ = $2; }
- | '(' yield_expr ')' { Z_LVAL($$.u.constant) = 1; zend_do_pass_param(&$2, ZEND_SEND_VAL, Z_LVAL($$.u.constant) TSRMLS_CC); }
+ | '(' yield_expr ')' { zend_do_pass_param(&$2, ZEND_SEND_VAL TSRMLS_CC); }
;
non_empty_function_call_parameter_list:
- expr_without_variable { Z_LVAL($$.u.constant) = 1; zend_do_pass_param(&$1, ZEND_SEND_VAL, Z_LVAL($$.u.constant) TSRMLS_CC); }
- | variable { Z_LVAL($$.u.constant) = 1; zend_do_pass_param(&$1, ZEND_SEND_VAR, Z_LVAL($$.u.constant) TSRMLS_CC); }
- | '&' w_variable { Z_LVAL($$.u.constant) = 1; zend_do_pass_param(&$2, ZEND_SEND_REF, Z_LVAL($$.u.constant) TSRMLS_CC); }
- | non_empty_function_call_parameter_list ',' expr_without_variable { Z_LVAL($$.u.constant)=Z_LVAL($1.u.constant)+1; zend_do_pass_param(&$3, ZEND_SEND_VAL, Z_LVAL($$.u.constant) TSRMLS_CC); }
- | non_empty_function_call_parameter_list ',' variable { Z_LVAL($$.u.constant)=Z_LVAL($1.u.constant)+1; zend_do_pass_param(&$3, ZEND_SEND_VAR, Z_LVAL($$.u.constant) TSRMLS_CC); }
- | non_empty_function_call_parameter_list ',' '&' w_variable { Z_LVAL($$.u.constant)=Z_LVAL($1.u.constant)+1; zend_do_pass_param(&$4, ZEND_SEND_REF, Z_LVAL($$.u.constant) TSRMLS_CC); }
+ function_call_parameter
+ | non_empty_function_call_parameter_list ',' function_call_parameter
+;
+
+function_call_parameter:
+ expr_without_variable { zend_do_pass_param(&$1, ZEND_SEND_VAL TSRMLS_CC); }
+ | variable { zend_do_pass_param(&$1, ZEND_SEND_VAR TSRMLS_CC); }
+ | '&' w_variable { zend_do_pass_param(&$2, ZEND_SEND_REF TSRMLS_CC); }
+ | T_ELLIPSIS expr { zend_do_unpack_params(&$2 TSRMLS_CC); }
;
global_var_list:
@@ -629,8 +667,8 @@ trait_precedence:
;
trait_reference_list:
- fully_qualified_class_name { zend_resolve_class_name(&$1, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC); zend_init_list(&$$.u.op.ptr, Z_STRVAL($1.u.constant) TSRMLS_CC); }
- | trait_reference_list ',' fully_qualified_class_name { zend_resolve_class_name(&$3, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC); zend_add_to_list(&$1.u.op.ptr, Z_STRVAL($3.u.constant) TSRMLS_CC); $$ = $1; }
+ fully_qualified_class_name { zend_resolve_class_name(&$1 TSRMLS_CC); zend_init_list(&$$.u.op.ptr, Z_STRVAL($1.u.constant) TSRMLS_CC); }
+ | trait_reference_list ',' fully_qualified_class_name { zend_resolve_class_name(&$3 TSRMLS_CC); zend_add_to_list(&$1.u.op.ptr, Z_STRVAL($3.u.constant) TSRMLS_CC); $$ = $1; }
;
trait_method_reference:
@@ -732,18 +770,19 @@ instance_call:
;
new_expr:
- T_NEW class_name_reference { zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$1, &$2 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$$, &$1, &$4 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
+ T_NEW class_name_reference { zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$1, &$2 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$$, &$1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
;
expr_without_variable:
T_LIST '(' { zend_do_list_init(TSRMLS_C); } assignment_list ')' '=' expr { zend_do_list_end(&$$, &$7 TSRMLS_CC); }
| variable '=' expr { zend_check_writable_variable(&$1); zend_do_assign(&$$, &$1, &$3 TSRMLS_CC); }
| variable '=' '&' variable { zend_check_writable_variable(&$1); zend_do_end_variable_parse(&$4, BP_VAR_W, 1 TSRMLS_CC); zend_do_end_variable_parse(&$1, BP_VAR_W, 0 TSRMLS_CC); zend_do_assign_ref(&$$, &$1, &$4 TSRMLS_CC); }
- | variable '=' '&' T_NEW class_name_reference { zend_error(E_DEPRECATED, "Assigning the return value of new by reference is deprecated"); zend_check_writable_variable(&$1); zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$4, &$5 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$3, &$4, &$7 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); zend_do_end_variable_parse(&$1, BP_VAR_W, 0 TSRMLS_CC); $3.EA = ZEND_PARSED_NEW; zend_do_assign_ref(&$$, &$1, &$3 TSRMLS_CC); }
+ | variable '=' '&' T_NEW class_name_reference { zend_error(E_DEPRECATED, "Assigning the return value of new by reference is deprecated"); zend_check_writable_variable(&$1); zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$4, &$5 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$3, &$4 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); zend_do_end_variable_parse(&$1, BP_VAR_W, 0 TSRMLS_CC); $3.EA = ZEND_PARSED_NEW; zend_do_assign_ref(&$$, &$1, &$3 TSRMLS_CC); }
| T_CLONE expr { zend_do_clone(&$$, &$2 TSRMLS_CC); }
| variable T_PLUS_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(&$1, BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_ADD, &$$, &$1, &$3 TSRMLS_CC); }
| variable T_MINUS_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(&$1, BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_SUB, &$$, &$1, &$3 TSRMLS_CC); }
| variable T_MUL_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(&$1, BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_MUL, &$$, &$1, &$3 TSRMLS_CC); }
+ | variable T_POW_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(&$1, BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_POW, &$$, &$1, &$3 TSRMLS_CC); }
| variable T_DIV_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(&$1, BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_DIV, &$$, &$1, &$3 TSRMLS_CC); }
| variable T_CONCAT_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(&$1, BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_CONCAT, &$$, &$1, &$3 TSRMLS_CC); }
| variable T_MOD_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(&$1, BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_MOD, &$$, &$1, &$3 TSRMLS_CC); }
@@ -768,6 +807,7 @@ expr_without_variable:
| expr '+' expr { zend_do_binary_op(ZEND_ADD, &$$, &$1, &$3 TSRMLS_CC); }
| expr '-' expr { zend_do_binary_op(ZEND_SUB, &$$, &$1, &$3 TSRMLS_CC); }
| expr '*' expr { zend_do_binary_op(ZEND_MUL, &$$, &$1, &$3 TSRMLS_CC); }
+ | expr T_POW expr { zend_do_binary_op(ZEND_POW, &$$, &$1, &$3 TSRMLS_CC); }
| expr '/' expr { zend_do_binary_op(ZEND_DIV, &$$, &$1, &$3 TSRMLS_CC); }
| expr '%' expr { zend_do_binary_op(ZEND_MOD, &$$, &$1, &$3 TSRMLS_CC); }
| expr T_SL expr { zend_do_binary_op(ZEND_SL, &$$, &$1, &$3 TSRMLS_CC); }
@@ -825,13 +865,16 @@ yield_expr:
;
combined_scalar_offset:
- combined_scalar '[' dim_offset ']' { zend_do_begin_variable_parse(TSRMLS_C); fetch_array_dim(&$$, &$1, &$3 TSRMLS_CC); }
- | combined_scalar_offset '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 TSRMLS_CC); }
- | T_CONSTANT_ENCAPSED_STRING '[' dim_offset ']' { $1.EA = 0; zend_do_begin_variable_parse(TSRMLS_C); fetch_array_dim(&$$, &$1, &$3 TSRMLS_CC); }
+ combined_scalar '[' dim_offset ']' { zend_do_begin_variable_parse(TSRMLS_C); fetch_array_dim(&$$, &$1, &$3 TSRMLS_CC); }
+ | combined_scalar_offset '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 TSRMLS_CC); }
+ | T_CONSTANT_ENCAPSED_STRING '[' dim_offset ']' { $1.EA = 0; zend_do_begin_variable_parse(TSRMLS_C); fetch_array_dim(&$$, &$1, &$3 TSRMLS_CC); }
+ | general_constant '[' dim_offset ']' { zend_do_begin_variable_parse(TSRMLS_C); fetch_array_dim(&$$, &$1, &$3 TSRMLS_CC); }
+;
combined_scalar:
- T_ARRAY '(' array_pair_list ')' { $$ = $3; }
- | '[' array_pair_list ']' { $$ = $2; }
+ T_ARRAY '(' array_pair_list ')' { $$ = $3; }
+ | '[' array_pair_list ']' { $$ = $2; }
+;
function:
T_FUNCTION { $$.u.op.opline_num = CG(zend_lineno); }
@@ -851,21 +894,21 @@ lexical_var_list:
function_call:
namespace_name { $$.u.op.opline_num = zend_do_begin_function_call(&$1, 1 TSRMLS_CC); }
- function_call_parameter_list { zend_do_end_function_call(&$1, &$$, &$3, 0, $2.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
+ function_call_parameter_list { zend_do_end_function_call(&$1, &$$, 0, $2.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
| T_NAMESPACE T_NS_SEPARATOR namespace_name { $1.op_type = IS_CONST; ZVAL_EMPTY_STRING(&$1.u.constant); zend_do_build_namespace_name(&$1, &$1, &$3 TSRMLS_CC); $$.u.op.opline_num = zend_do_begin_function_call(&$1, 0 TSRMLS_CC); }
- function_call_parameter_list { zend_do_end_function_call(&$1, &$$, &$5, 0, $4.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
+ function_call_parameter_list { zend_do_end_function_call(&$1, &$$, 0, $4.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
| T_NS_SEPARATOR namespace_name { $$.u.op.opline_num = zend_do_begin_function_call(&$2, 0 TSRMLS_CC); }
- function_call_parameter_list { zend_do_end_function_call(&$2, &$$, &$4, 0, $3.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
+ function_call_parameter_list { zend_do_end_function_call(&$2, &$$, 0, $3.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
| class_name T_PAAMAYIM_NEKUDOTAYIM variable_name { $$.u.op.opline_num = zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); }
- function_call_parameter_list { zend_do_end_function_call($4.u.op.opline_num?NULL:&$3, &$$, &$5, $4.u.op.opline_num, $4.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
+ function_call_parameter_list { zend_do_end_function_call($4.u.op.opline_num?NULL:&$3, &$$, $4.u.op.opline_num, $4.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
| class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { zend_do_end_variable_parse(&$3, BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); }
- function_call_parameter_list { zend_do_end_function_call(NULL, &$$, &$5, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
+ function_call_parameter_list { zend_do_end_function_call(NULL, &$$, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
| variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_name { zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); }
- function_call_parameter_list { zend_do_end_function_call(NULL, &$$, &$5, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
+ function_call_parameter_list { zend_do_end_function_call(NULL, &$$, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
| variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { zend_do_end_variable_parse(&$3, BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); }
- function_call_parameter_list { zend_do_end_function_call(NULL, &$$, &$5, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
+ function_call_parameter_list { zend_do_end_function_call(NULL, &$$, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
| variable_without_objects { zend_do_end_variable_parse(&$1, BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_dynamic_function_call(&$1, 0 TSRMLS_CC); }
- function_call_parameter_list { zend_do_end_function_call(&$1, &$$, &$3, 0, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
+ function_call_parameter_list { zend_do_end_function_call(&$1, &$$, 0, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
;
class_name:
@@ -941,42 +984,83 @@ common_scalar:
| T_START_HEREDOC T_END_HEREDOC { ZVAL_EMPTY_STRING(&$$.u.constant); INIT_PZVAL(&$$.u.constant); $$.op_type = IS_CONST; }
;
-
-static_scalar: /* compile-time evaluated scalars */
- common_scalar { $$ = $1; }
- | static_class_name_scalar { $$ = $1; }
- | namespace_name { zend_do_fetch_constant(&$$, NULL, &$1, ZEND_CT, 1 TSRMLS_CC); }
- | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$.op_type = IS_CONST; ZVAL_EMPTY_STRING(&$$.u.constant); zend_do_build_namespace_name(&$$, &$$, &$3 TSRMLS_CC); $3 = $$; zend_do_fetch_constant(&$$, NULL, &$3, ZEND_CT, 0 TSRMLS_CC); }
- | T_NS_SEPARATOR namespace_name { char *tmp = estrndup(Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); memcpy(&(tmp[1]), Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); tmp[0] = '\\'; efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; ++Z_STRLEN($2.u.constant); zend_do_fetch_constant(&$$, NULL, &$2, ZEND_CT, 0 TSRMLS_CC); }
- | '+' static_scalar { ZVAL_LONG(&$1.u.constant, 0); add_function(&$2.u.constant, &$1.u.constant, &$2.u.constant TSRMLS_CC); $$ = $2; }
- | '-' static_scalar { ZVAL_LONG(&$1.u.constant, 0); sub_function(&$2.u.constant, &$1.u.constant, &$2.u.constant TSRMLS_CC); $$ = $2; }
- | T_ARRAY '(' static_array_pair_list ')' { $$ = $3; Z_TYPE($$.u.constant) = IS_CONSTANT_ARRAY; }
- | '[' static_array_pair_list ']' { $$ = $2; Z_TYPE($$.u.constant) = IS_CONSTANT_ARRAY; }
- | static_class_constant { $$ = $1; }
- | T_CLASS_C { $$ = $1; }
-;
-
static_class_constant:
class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { zend_do_fetch_constant(&$$, &$1, &$3, ZEND_CT, 0 TSRMLS_CC); }
;
-scalar:
- T_STRING_VARNAME { $$ = $1; }
- | class_name_scalar { $$ = $1; }
- | class_constant { $$ = $1; }
+static_scalar: /* compile-time evaluated scalars */
+ static_scalar_value { zend_do_constant_expression(&$$, $1.u.ast TSRMLS_CC); }
+;
+
+static_scalar_value:
+ common_scalar { $$.u.ast = zend_ast_create_constant(&$1.u.constant); }
+ | static_class_name_scalar { $$.u.ast = zend_ast_create_constant(&$1.u.constant); }
+ | namespace_name { zend_do_fetch_constant(&$$, NULL, &$1, ZEND_CT, 1 TSRMLS_CC); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
+ | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$.op_type = IS_CONST; ZVAL_EMPTY_STRING(&$$.u.constant); zend_do_build_namespace_name(&$$, &$$, &$3 TSRMLS_CC); $3 = $$; zend_do_fetch_constant(&$$, NULL, &$3, ZEND_CT, 0 TSRMLS_CC); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
+ | T_NS_SEPARATOR namespace_name { char *tmp = estrndup(Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); memcpy(&(tmp[1]), Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); tmp[0] = '\\'; efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; ++Z_STRLEN($2.u.constant); zend_do_fetch_constant(&$$, NULL, &$2, ZEND_CT, 0 TSRMLS_CC); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
+ | T_ARRAY '(' static_array_pair_list ')' { $$ = $3; }
+ | '[' static_array_pair_list ']' { $$ = $2; }
+ | static_class_constant { $$.u.ast = zend_ast_create_constant(&$1.u.constant); }
+ | T_CLASS_C { $$.u.ast = zend_ast_create_constant(&$1.u.constant); }
+ | static_operation { $$ = $1; }
+;
+
+static_operation:
+ static_scalar_value '[' static_scalar_value ']' { $$.u.ast = zend_ast_create_binary(ZEND_FETCH_DIM_R, $1.u.ast, $3.u.ast); }
+ | static_scalar_value '+' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_ADD, $1.u.ast, $3.u.ast); }
+ | static_scalar_value '-' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_SUB, $1.u.ast, $3.u.ast); }
+ | static_scalar_value '*' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_MUL, $1.u.ast, $3.u.ast); }
+ | static_scalar_value T_POW static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_POW, $1.u.ast, $3.u.ast); }
+ | static_scalar_value '/' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_DIV, $1.u.ast, $3.u.ast); }
+ | static_scalar_value '%' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_MOD, $1.u.ast, $3.u.ast); }
+ | '!' static_scalar_value { $$.u.ast = zend_ast_create_unary(ZEND_BOOL_NOT, $2.u.ast); }
+ | '~' static_scalar_value { $$.u.ast = zend_ast_create_unary(ZEND_BW_NOT, $2.u.ast); }
+ | static_scalar_value '|' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_BW_OR, $1.u.ast, $3.u.ast); }
+ | static_scalar_value '&' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_BW_AND, $1.u.ast, $3.u.ast); }
+ | static_scalar_value '^' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_BW_XOR, $1.u.ast, $3.u.ast); }
+ | static_scalar_value T_SL static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_SL, $1.u.ast, $3.u.ast); }
+ | static_scalar_value T_SR static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_SR, $1.u.ast, $3.u.ast); }
+ | static_scalar_value '.' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_CONCAT, $1.u.ast, $3.u.ast); }
+ | static_scalar_value T_LOGICAL_XOR static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_BOOL_XOR, $1.u.ast, $3.u.ast); }
+ | static_scalar_value T_LOGICAL_AND static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_BOOL_AND, $1.u.ast, $3.u.ast); }
+ | static_scalar_value T_LOGICAL_OR static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_BOOL_OR, $1.u.ast, $3.u.ast); }
+ | static_scalar_value T_BOOLEAN_AND static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_BOOL_AND, $1.u.ast, $3.u.ast); }
+ | static_scalar_value T_BOOLEAN_OR static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_BOOL_OR, $1.u.ast, $3.u.ast); }
+ | static_scalar_value T_IS_IDENTICAL static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_IS_IDENTICAL, $1.u.ast, $3.u.ast); }
+ | static_scalar_value T_IS_NOT_IDENTICAL static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_IS_NOT_IDENTICAL, $1.u.ast, $3.u.ast); }
+ | static_scalar_value T_IS_EQUAL static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_IS_EQUAL, $1.u.ast, $3.u.ast); }
+ | static_scalar_value T_IS_NOT_EQUAL static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_IS_NOT_EQUAL, $1.u.ast, $3.u.ast); }
+ | static_scalar_value '<' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_IS_SMALLER, $1.u.ast, $3.u.ast); }
+ | static_scalar_value '>' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_IS_SMALLER, $3.u.ast, $1.u.ast); }
+ | static_scalar_value T_IS_SMALLER_OR_EQUAL static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_IS_SMALLER_OR_EQUAL, $1.u.ast, $3.u.ast); }
+ | static_scalar_value T_IS_GREATER_OR_EQUAL static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_IS_SMALLER_OR_EQUAL, $3.u.ast, $1.u.ast); }
+ | static_scalar_value '?' ':' static_scalar_value { $$.u.ast = zend_ast_create_ternary(ZEND_SELECT, $1.u.ast, NULL, $4.u.ast); }
+ | static_scalar_value '?' static_scalar_value ':' static_scalar_value { $$.u.ast = zend_ast_create_ternary(ZEND_SELECT, $1.u.ast, $3.u.ast, $5.u.ast); }
+ | '+' static_scalar_value { $$.u.ast = zend_ast_create_unary(ZEND_UNARY_PLUS, $2.u.ast); }
+ | '-' static_scalar_value { $$.u.ast = zend_ast_create_unary(ZEND_UNARY_MINUS, $2.u.ast); }
+ | '(' static_scalar_value ')' { $$ = $2; }
+;
+
+general_constant:
+ class_constant { $$ = $1; }
| namespace_name { zend_do_fetch_constant(&$$, NULL, &$1, ZEND_RT, 1 TSRMLS_CC); }
| T_NAMESPACE T_NS_SEPARATOR namespace_name { $$.op_type = IS_CONST; ZVAL_EMPTY_STRING(&$$.u.constant); zend_do_build_namespace_name(&$$, &$$, &$3 TSRMLS_CC); $3 = $$; zend_do_fetch_constant(&$$, NULL, &$3, ZEND_RT, 0 TSRMLS_CC); }
| T_NS_SEPARATOR namespace_name { char *tmp = estrndup(Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); memcpy(&(tmp[1]), Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); tmp[0] = '\\'; efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; ++Z_STRLEN($2.u.constant); zend_do_fetch_constant(&$$, NULL, &$2, ZEND_RT, 0 TSRMLS_CC); }
- | common_scalar { $$ = $1; }
- | '"' encaps_list '"' { $$ = $2; }
- | T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = $2; }
- | T_CLASS_C { if (Z_TYPE($1.u.constant) == IS_CONSTANT) {zend_do_fetch_constant(&$$, NULL, &$1, ZEND_RT, 1 TSRMLS_CC);} else {$$ = $1;} }
;
+scalar:
+ T_STRING_VARNAME { $$ = $1; }
+ | general_constant { $$ = $1; }
+ | class_name_scalar { $$ = $1; }
+ | common_scalar { $$ = $1; }
+ | '"' encaps_list '"' { $$ = $2; }
+ | T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = $2; }
+ | T_CLASS_C { if (Z_TYPE($1.u.constant) == IS_CONSTANT) {zend_do_fetch_constant(&$$, NULL, &$1, ZEND_RT, 1 TSRMLS_CC);} else {$$ = $1;} }
+;
static_array_pair_list:
- /* empty */ { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); }
- | non_empty_static_array_pair_list possible_comma { $$ = $1; }
+ /* empty */ { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
+ | non_empty_static_array_pair_list possible_comma { zend_ast_dynamic_shrink(&$1.u.ast); $$ = $1; }
;
possible_comma:
@@ -985,10 +1069,10 @@ possible_comma:
;
non_empty_static_array_pair_list:
- non_empty_static_array_pair_list ',' static_scalar T_DOUBLE_ARROW static_scalar { zend_do_add_static_array_element(&$$, &$3, &$5); }
- | non_empty_static_array_pair_list ',' static_scalar { zend_do_add_static_array_element(&$$, NULL, &$3); }
- | static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, &$1, &$3); }
- | static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, NULL, &$1); }
+ non_empty_static_array_pair_list ',' static_scalar_value T_DOUBLE_ARROW static_scalar_value { zend_ast_dynamic_add(&$$.u.ast, $3.u.ast); zend_ast_dynamic_add(&$$.u.ast, $5.u.ast); }
+ | non_empty_static_array_pair_list ',' static_scalar_value { zend_ast_dynamic_add(&$$.u.ast, NULL); zend_ast_dynamic_add(&$$.u.ast, $3.u.ast); }
+ | static_scalar_value T_DOUBLE_ARROW static_scalar_value { $$.u.ast = zend_ast_create_dynamic(ZEND_INIT_ARRAY); zend_ast_dynamic_add(&$$.u.ast, $1.u.ast); zend_ast_dynamic_add(&$$.u.ast, $3.u.ast); }
+ | static_scalar_value { $$.u.ast = zend_ast_create_dynamic(ZEND_INIT_ARRAY); zend_ast_dynamic_add(&$$.u.ast, NULL); zend_ast_dynamic_add(&$$.u.ast, $1.u.ast); }
;
expr:
@@ -1041,7 +1125,7 @@ array_method_dereference:
method:
{ zend_do_pop_object(&$$ TSRMLS_CC); zend_do_begin_method_call(&$$ TSRMLS_CC); }
- function_call_parameter_list { zend_do_end_function_call(&$1, &$$, &$2, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
+ function_call_parameter_list { zend_do_end_function_call(&$1, &$$, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
;
method_or_not:
@@ -1196,7 +1280,7 @@ isset_variables:
isset_variable:
variable { zend_do_isset_or_isempty(ZEND_ISSET, &$$, &$1 TSRMLS_CC); }
- | expr_without_variable { zend_error(E_COMPILE_ERROR, "Cannot use isset() on the result of an expression (you can use \"null !== expression\" instead)"); }
+ | expr_without_variable { zend_error_noreturn(E_COMPILE_ERROR, "Cannot use isset() on the result of an expression (you can use \"null !== expression\" instead)"); }
;
class_constant:
diff --git a/Zend/zend_language_scanner.c b/Zend/zend_language_scanner.c
index 53d8eb27a6..eef35f8cbf 100644
--- a/Zend/zend_language_scanner.c
+++ b/Zend/zend_language_scanner.c
@@ -1,7894 +1,7857 @@
-/* Generated by re2c 0.13.5 on Sun Dec 22 13:03:33 2013 */
-#line 1 "Zend/zend_language_scanner.l"
-/*
- +----------------------------------------------------------------------+
- | Zend Engine |
- +----------------------------------------------------------------------+
- | Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
- +----------------------------------------------------------------------+
- | This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.zend.com/license/2_00.txt. |
- | If you did not receive a copy of the Zend license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@zend.com so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Marcus Boerger <helly@php.net> |
- | Nuno Lopes <nlopess@php.net> |
- | Scott MacVicar <scottmac@php.net> |
- | Flex version authors: |
- | Andi Gutmans <andi@zend.com> |
- | Zeev Suraski <zeev@zend.com> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#if 0
-# define YYDEBUG(s, c) printf("state: %d char: %c\n", s, c)
-#else
-# define YYDEBUG(s, c)
-#endif
-
-#include "zend_language_scanner_defs.h"
-
-#include <errno.h>
-#include "zend.h"
-#ifdef PHP_WIN32
-# include <Winuser.h>
-#endif
-#include "zend_alloc.h"
-#include <zend_language_parser.h>
-#include "zend_compile.h"
-#include "zend_language_scanner.h"
-#include "zend_highlight.h"
-#include "zend_constants.h"
-#include "zend_variables.h"
-#include "zend_operators.h"
-#include "zend_API.h"
-#include "zend_strtod.h"
-#include "zend_exceptions.h"
-#include "tsrm_virtual_cwd.h"
-#include "tsrm_config_common.h"
-
-#define YYCTYPE unsigned char
-#define YYFILL(n) { if ((YYCURSOR + n) >= (YYLIMIT + ZEND_MMAP_AHEAD)) { return 0; } }
-#define YYCURSOR SCNG(yy_cursor)
-#define YYLIMIT SCNG(yy_limit)
-#define YYMARKER SCNG(yy_marker)
-
-#define YYGETCONDITION() SCNG(yy_state)
-#define YYSETCONDITION(s) SCNG(yy_state) = s
-
-#define STATE(name) yyc##name
-
-/* emulate flex constructs */
-#define BEGIN(state) YYSETCONDITION(STATE(state))
-#define YYSTATE YYGETCONDITION()
-#define yytext ((char*)SCNG(yy_text))
-#define yyleng SCNG(yy_leng)
-#define yyless(x) do { YYCURSOR = (unsigned char*)yytext + x; \
- yyleng = (unsigned int)x; } while(0)
-#define yymore() goto yymore_restart
-
-/* perform sanity check. If this message is triggered you should
- increase the ZEND_MMAP_AHEAD value in the zend_streams.h file */
-#define YYMAXFILL 16
-#if ZEND_MMAP_AHEAD < YYMAXFILL
-# error ZEND_MMAP_AHEAD should be greater than or equal to YYMAXFILL
-#endif
-
-#ifdef HAVE_STDARG_H
-# include <stdarg.h>
-#endif
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-/* Globals Macros */
-#define SCNG LANG_SCNG
-#ifdef ZTS
-ZEND_API ts_rsrc_id language_scanner_globals_id;
-#else
-ZEND_API zend_php_scanner_globals language_scanner_globals;
-#endif
-
-#define HANDLE_NEWLINES(s, l) \
-do { \
- char *p = (s), *boundary = p+(l); \
- \
- while (p<boundary) { \
- if (*p == '\n' || (*p == '\r' && (*(p+1) != '\n'))) { \
- CG(zend_lineno)++; \
- } \
- p++; \
- } \
-} while (0)
-
-#define HANDLE_NEWLINE(c) \
-{ \
- if (c == '\n' || c == '\r') { \
- CG(zend_lineno)++; \
- } \
-}
-
-/* To save initial string length after scanning to first variable, CG(doc_comment_len) can be reused */
-#define SET_DOUBLE_QUOTES_SCANNED_LENGTH(len) CG(doc_comment_len) = (len)
-#define GET_DOUBLE_QUOTES_SCANNED_LENGTH() CG(doc_comment_len)
-
-#define IS_LABEL_START(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z') || (c) == '_' || (c) >= 0x7F)
-
-#define ZEND_IS_OCT(c) ((c)>='0' && (c)<='7')
-#define ZEND_IS_HEX(c) (((c)>='0' && (c)<='9') || ((c)>='a' && (c)<='f') || ((c)>='A' && (c)<='F'))
-
-BEGIN_EXTERN_C()
-
-static size_t encoding_filter_script_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
-{
- const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C);
- assert(internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding));
- return zend_multibyte_encoding_converter(to, to_length, from, from_length, internal_encoding, LANG_SCNG(script_encoding) TSRMLS_CC);
-}
-
-static size_t encoding_filter_script_to_intermediate(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
-{
- return zend_multibyte_encoding_converter(to, to_length, from, from_length, zend_multibyte_encoding_utf8, LANG_SCNG(script_encoding) TSRMLS_CC);
-}
-
-static size_t encoding_filter_intermediate_to_script(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
-{
- return zend_multibyte_encoding_converter(to, to_length, from, from_length,
-LANG_SCNG(script_encoding), zend_multibyte_encoding_utf8 TSRMLS_CC);
-}
-
-static size_t encoding_filter_intermediate_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
-{
- const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C);
- assert(internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding));
- return zend_multibyte_encoding_converter(to, to_length, from, from_length,
-internal_encoding, zend_multibyte_encoding_utf8 TSRMLS_CC);
-}
-
-
-static void _yy_push_state(int new_state TSRMLS_DC)
-{
- zend_stack_push(&SCNG(state_stack), (void *) &YYGETCONDITION(), sizeof(int));
- YYSETCONDITION(new_state);
-}
-
-#define yy_push_state(state_and_tsrm) _yy_push_state(yyc##state_and_tsrm)
-
-static void yy_pop_state(TSRMLS_D)
-{
- int *stack_state;
- zend_stack_top(&SCNG(state_stack), (void **) &stack_state);
- YYSETCONDITION(*stack_state);
- zend_stack_del_top(&SCNG(state_stack));
-}
-
-static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC)
-{
- YYCURSOR = (YYCTYPE*)str;
- YYLIMIT = YYCURSOR + len;
- if (!SCNG(yy_start)) {
- SCNG(yy_start) = YYCURSOR;
- }
-}
-
-void startup_scanner(TSRMLS_D)
-{
- CG(parse_error) = 0;
- CG(doc_comment) = NULL;
- CG(doc_comment_len) = 0;
- zend_stack_init(&SCNG(state_stack));
- zend_ptr_stack_init(&SCNG(heredoc_label_stack));
-}
-
-static void heredoc_label_dtor(zend_heredoc_label *heredoc_label) {
- efree(heredoc_label->label);
-}
-
-void shutdown_scanner(TSRMLS_D)
-{
- CG(parse_error) = 0;
- RESET_DOC_COMMENT();
- zend_stack_destroy(&SCNG(state_stack));
- zend_ptr_stack_clean(&SCNG(heredoc_label_stack), (void (*)(void *)) &heredoc_label_dtor, 1);
- zend_ptr_stack_destroy(&SCNG(heredoc_label_stack));
-}
-
-ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
-{
- lex_state->yy_leng = SCNG(yy_leng);
- lex_state->yy_start = SCNG(yy_start);
- lex_state->yy_text = SCNG(yy_text);
- lex_state->yy_cursor = SCNG(yy_cursor);
- lex_state->yy_marker = SCNG(yy_marker);
- lex_state->yy_limit = SCNG(yy_limit);
-
- lex_state->state_stack = SCNG(state_stack);
- zend_stack_init(&SCNG(state_stack));
-
- lex_state->heredoc_label_stack = SCNG(heredoc_label_stack);
- zend_ptr_stack_init(&SCNG(heredoc_label_stack));
-
- lex_state->in = SCNG(yy_in);
- lex_state->yy_state = YYSTATE;
- lex_state->filename = zend_get_compiled_filename(TSRMLS_C);
- lex_state->lineno = CG(zend_lineno);
-
- lex_state->script_org = SCNG(script_org);
- lex_state->script_org_size = SCNG(script_org_size);
- lex_state->script_filtered = SCNG(script_filtered);
- lex_state->script_filtered_size = SCNG(script_filtered_size);
- lex_state->input_filter = SCNG(input_filter);
- lex_state->output_filter = SCNG(output_filter);
- lex_state->script_encoding = SCNG(script_encoding);
-}
-
-ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
-{
- SCNG(yy_leng) = lex_state->yy_leng;
- SCNG(yy_start) = lex_state->yy_start;
- SCNG(yy_text) = lex_state->yy_text;
- SCNG(yy_cursor) = lex_state->yy_cursor;
- SCNG(yy_marker) = lex_state->yy_marker;
- SCNG(yy_limit) = lex_state->yy_limit;
-
- zend_stack_destroy(&SCNG(state_stack));
- SCNG(state_stack) = lex_state->state_stack;
-
- zend_ptr_stack_clean(&SCNG(heredoc_label_stack), (void (*)(void *)) &heredoc_label_dtor, 1);
- zend_ptr_stack_destroy(&SCNG(heredoc_label_stack));
- SCNG(heredoc_label_stack) = lex_state->heredoc_label_stack;
-
- SCNG(yy_in) = lex_state->in;
- YYSETCONDITION(lex_state->yy_state);
- CG(zend_lineno) = lex_state->lineno;
- zend_restore_compiled_filename(lex_state->filename TSRMLS_CC);
-
- if (SCNG(script_filtered)) {
- efree(SCNG(script_filtered));
- SCNG(script_filtered) = NULL;
- }
- SCNG(script_org) = lex_state->script_org;
- SCNG(script_org_size) = lex_state->script_org_size;
- SCNG(script_filtered) = lex_state->script_filtered;
- SCNG(script_filtered_size) = lex_state->script_filtered_size;
- SCNG(input_filter) = lex_state->input_filter;
- SCNG(output_filter) = lex_state->output_filter;
- SCNG(script_encoding) = lex_state->script_encoding;
-
- RESET_DOC_COMMENT();
-}
-
-ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSRMLS_DC)
-{
- zend_llist_del_element(&CG(open_files), file_handle, (int (*)(void *, void *)) zend_compare_file_handles);
- /* zend_file_handle_dtor() operates on the copy, so we have to NULLify the original here */
- file_handle->opened_path = NULL;
- if (file_handle->free_filename) {
- file_handle->filename = NULL;
- }
-}
-
-#define BOM_UTF32_BE "\x00\x00\xfe\xff"
-#define BOM_UTF32_LE "\xff\xfe\x00\x00"
-#define BOM_UTF16_BE "\xfe\xff"
-#define BOM_UTF16_LE "\xff\xfe"
-#define BOM_UTF8 "\xef\xbb\xbf"
-
-static const zend_encoding *zend_multibyte_detect_utf_encoding(const unsigned char *script, size_t script_size TSRMLS_DC)
-{
- const unsigned char *p;
- int wchar_size = 2;
- int le = 0;
-
- /* utf-16 or utf-32? */
- p = script;
- while ((p-script) < script_size) {
- p = memchr(p, 0, script_size-(p-script)-2);
- if (!p) {
- break;
- }
- if (*(p+1) == '\0' && *(p+2) == '\0') {
- wchar_size = 4;
- break;
- }
-
- /* searching for UTF-32 specific byte orders, so this will do */
- p += 4;
- }
-
- /* BE or LE? */
- p = script;
- while ((p-script) < script_size) {
- if (*p == '\0' && *(p+wchar_size-1) != '\0') {
- /* BE */
- le = 0;
- break;
- } else if (*p != '\0' && *(p+wchar_size-1) == '\0') {
- /* LE* */
- le = 1;
- break;
- }
- p += wchar_size;
- }
-
- if (wchar_size == 2) {
- return le ? zend_multibyte_encoding_utf16le : zend_multibyte_encoding_utf16be;
- } else {
- return le ? zend_multibyte_encoding_utf32le : zend_multibyte_encoding_utf32be;
- }
-
- return NULL;
-}
-
-static const zend_encoding* zend_multibyte_detect_unicode(TSRMLS_D)
-{
- const zend_encoding *script_encoding = NULL;
- int bom_size;
- unsigned char *pos1, *pos2;
-
- if (LANG_SCNG(script_org_size) < sizeof(BOM_UTF32_LE)-1) {
- return NULL;
- }
-
- /* check out BOM */
- if (!memcmp(LANG_SCNG(script_org), BOM_UTF32_BE, sizeof(BOM_UTF32_BE)-1)) {
- script_encoding = zend_multibyte_encoding_utf32be;
- bom_size = sizeof(BOM_UTF32_BE)-1;
- } else if (!memcmp(LANG_SCNG(script_org), BOM_UTF32_LE, sizeof(BOM_UTF32_LE)-1)) {
- script_encoding = zend_multibyte_encoding_utf32le;
- bom_size = sizeof(BOM_UTF32_LE)-1;
- } else if (!memcmp(LANG_SCNG(script_org), BOM_UTF16_BE, sizeof(BOM_UTF16_BE)-1)) {
- script_encoding = zend_multibyte_encoding_utf16be;
- bom_size = sizeof(BOM_UTF16_BE)-1;
- } else if (!memcmp(LANG_SCNG(script_org), BOM_UTF16_LE, sizeof(BOM_UTF16_LE)-1)) {
- script_encoding = zend_multibyte_encoding_utf16le;
- bom_size = sizeof(BOM_UTF16_LE)-1;
- } else if (!memcmp(LANG_SCNG(script_org), BOM_UTF8, sizeof(BOM_UTF8)-1)) {
- script_encoding = zend_multibyte_encoding_utf8;
- bom_size = sizeof(BOM_UTF8)-1;
- }
-
- if (script_encoding) {
- /* remove BOM */
- LANG_SCNG(script_org) += bom_size;
- LANG_SCNG(script_org_size) -= bom_size;
-
- return script_encoding;
- }
-
- /* script contains NULL bytes -> auto-detection */
- if ((pos1 = memchr(LANG_SCNG(script_org), 0, LANG_SCNG(script_org_size)))) {
- /* check if the NULL byte is after the __HALT_COMPILER(); */
- pos2 = LANG_SCNG(script_org);
-
- while (pos1 - pos2 >= sizeof("__HALT_COMPILER();")-1) {
- pos2 = memchr(pos2, '_', pos1 - pos2);
- if (!pos2) break;
- pos2++;
- if (strncasecmp((char*)pos2, "_HALT_COMPILER", sizeof("_HALT_COMPILER")-1) == 0) {
- pos2 += sizeof("_HALT_COMPILER")-1;
- while (*pos2 == ' ' ||
- *pos2 == '\t' ||
- *pos2 == '\r' ||
- *pos2 == '\n') {
- pos2++;
- }
- if (*pos2 == '(') {
- pos2++;
- while (*pos2 == ' ' ||
- *pos2 == '\t' ||
- *pos2 == '\r' ||
- *pos2 == '\n') {
- pos2++;
- }
- if (*pos2 == ')') {
- pos2++;
- while (*pos2 == ' ' ||
- *pos2 == '\t' ||
- *pos2 == '\r' ||
- *pos2 == '\n') {
- pos2++;
- }
- if (*pos2 == ';') {
- return NULL;
- }
- }
- }
- }
- }
- /* make best effort if BOM is missing */
- return zend_multibyte_detect_utf_encoding(LANG_SCNG(script_org), LANG_SCNG(script_org_size) TSRMLS_CC);
- }
-
- return NULL;
-}
-
-static const zend_encoding* zend_multibyte_find_script_encoding(TSRMLS_D)
-{
- const zend_encoding *script_encoding;
-
- if (CG(detect_unicode)) {
- /* check out bom(byte order mark) and see if containing wchars */
- script_encoding = zend_multibyte_detect_unicode(TSRMLS_C);
- if (script_encoding != NULL) {
- /* bom or wchar detection is prior to 'script_encoding' option */
- return script_encoding;
- }
- }
-
- /* if no script_encoding specified, just leave alone */
- if (!CG(script_encoding_list) || !CG(script_encoding_list_size)) {
- return NULL;
- }
-
- /* if multiple encodings specified, detect automagically */
- if (CG(script_encoding_list_size) > 1) {
- return zend_multibyte_encoding_detector(LANG_SCNG(script_org), LANG_SCNG(script_org_size), CG(script_encoding_list), CG(script_encoding_list_size) TSRMLS_CC);
- }
-
- return CG(script_encoding_list)[0];
-}
-
-ZEND_API int zend_multibyte_set_filter(const zend_encoding *onetime_encoding TSRMLS_DC)
-{
- const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C);
- const zend_encoding *script_encoding = onetime_encoding ? onetime_encoding: zend_multibyte_find_script_encoding(TSRMLS_C);
-
- if (!script_encoding) {
- return FAILURE;
- }
-
- /* judge input/output filter */
- LANG_SCNG(script_encoding) = script_encoding;
- LANG_SCNG(input_filter) = NULL;
- LANG_SCNG(output_filter) = NULL;
-
- if (!internal_encoding || LANG_SCNG(script_encoding) == internal_encoding) {
- if (!zend_multibyte_check_lexer_compatibility(LANG_SCNG(script_encoding))) {
- /* and if not, work around w/ script_encoding -> utf-8 -> script_encoding conversion */
- LANG_SCNG(input_filter) = encoding_filter_script_to_intermediate;
- LANG_SCNG(output_filter) = encoding_filter_intermediate_to_script;
- } else {
- LANG_SCNG(input_filter) = NULL;
- LANG_SCNG(output_filter) = NULL;
- }
- return SUCCESS;
- }
-
- if (zend_multibyte_check_lexer_compatibility(internal_encoding)) {
- LANG_SCNG(input_filter) = encoding_filter_script_to_internal;
- LANG_SCNG(output_filter) = NULL;
- } else if (zend_multibyte_check_lexer_compatibility(LANG_SCNG(script_encoding))) {
- LANG_SCNG(input_filter) = NULL;
- LANG_SCNG(output_filter) = encoding_filter_script_to_internal;
- } else {
- /* both script and internal encodings are incompatible w/ flex */
- LANG_SCNG(input_filter) = encoding_filter_script_to_intermediate;
- LANG_SCNG(output_filter) = encoding_filter_intermediate_to_internal;
- }
-
- return 0;
-}
-
-ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
-{
- const char *file_path = NULL;
- char *buf;
- size_t size, offset = 0;
-
- /* The shebang line was read, get the current position to obtain the buffer start */
- if (CG(start_lineno) == 2 && file_handle->type == ZEND_HANDLE_FP && file_handle->handle.fp) {
- if ((offset = ftell(file_handle->handle.fp)) == -1) {
- offset = 0;
- }
- }
-
- if (zend_stream_fixup(file_handle, &buf, &size TSRMLS_CC) == FAILURE) {
- return FAILURE;
- }
-
- zend_llist_add_element(&CG(open_files), file_handle);
- if (file_handle->handle.stream.handle >= (void*)file_handle && file_handle->handle.stream.handle <= (void*)(file_handle+1)) {
- zend_file_handle *fh = (zend_file_handle*)zend_llist_get_last(&CG(open_files));
- size_t diff = (char*)file_handle->handle.stream.handle - (char*)file_handle;
- fh->handle.stream.handle = (void*)(((char*)fh) + diff);
- file_handle->handle.stream.handle = fh->handle.stream.handle;
- }
-
- /* Reset the scanner for scanning the new file */
- SCNG(yy_in) = file_handle;
- SCNG(yy_start) = NULL;
-
- if (size != -1) {
- if (CG(multibyte)) {
- SCNG(script_org) = (unsigned char*)buf;
- SCNG(script_org_size) = size;
- SCNG(script_filtered) = NULL;
-
- zend_multibyte_set_filter(NULL TSRMLS_CC);
-
- if (SCNG(input_filter)) {
- if ((size_t)-1 == SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC)) {
- zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script from the detected "
- "encoding \"%s\" to a compatible encoding", zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding)));
- }
- buf = (char*)SCNG(script_filtered);
- size = SCNG(script_filtered_size);
- }
- }
- SCNG(yy_start) = (unsigned char *)buf - offset;
- yy_scan_buffer(buf, size TSRMLS_CC);
- } else {
- zend_error_noreturn(E_COMPILE_ERROR, "zend_stream_mmap() failed");
- }
-
- BEGIN(INITIAL);
-
- if (file_handle->opened_path) {
- file_path = file_handle->opened_path;
- } else {
- file_path = file_handle->filename;
- }
-
- zend_set_compiled_filename(file_path TSRMLS_CC);
-
- if (CG(start_lineno)) {
- CG(zend_lineno) = CG(start_lineno);
- CG(start_lineno) = 0;
- } else {
- CG(zend_lineno) = 1;
- }
-
- RESET_DOC_COMMENT();
- CG(increment_lineno) = 0;
- return SUCCESS;
-}
-END_EXTERN_C()
-
-
-ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSRMLS_DC)
-{
- zend_lex_state original_lex_state;
- zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array));
- zend_op_array *original_active_op_array = CG(active_op_array);
- zend_op_array *retval=NULL;
- int compiler_result;
- zend_bool compilation_successful=0;
- znode retval_znode;
- zend_bool original_in_compilation = CG(in_compilation);
-
- retval_znode.op_type = IS_CONST;
- retval_znode.u.constant.type = IS_LONG;
- retval_znode.u.constant.value.lval = 1;
- Z_UNSET_ISREF(retval_znode.u.constant);
- Z_SET_REFCOUNT(retval_znode.u.constant, 1);
-
- zend_save_lexical_state(&original_lex_state TSRMLS_CC);
-
- retval = op_array; /* success oriented */
-
- if (open_file_for_scanning(file_handle TSRMLS_CC)==FAILURE) {
- if (type==ZEND_REQUIRE) {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename TSRMLS_CC);
- zend_bailout();
- } else {
- zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename TSRMLS_CC);
- }
- compilation_successful=0;
- } else {
- init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE TSRMLS_CC);
- CG(in_compilation) = 1;
- CG(active_op_array) = op_array;
- zend_stack_push(&CG(context_stack), (void *) &CG(context), sizeof(CG(context)));
- zend_init_compiler_context(TSRMLS_C);
- compiler_result = zendparse(TSRMLS_C);
- zend_do_return(&retval_znode, 0 TSRMLS_CC);
- CG(in_compilation) = original_in_compilation;
- if (compiler_result != 0) { /* parser error */
- zend_bailout();
- }
- compilation_successful=1;
- }
-
- if (retval) {
- CG(active_op_array) = original_active_op_array;
- if (compilation_successful) {
- pass_two(op_array TSRMLS_CC);
- zend_release_labels(0 TSRMLS_CC);
- } else {
- efree(op_array);
- retval = NULL;
- }
- }
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
- return retval;
-}
-
-
-zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC)
-{
- zend_file_handle file_handle;
- zval tmp;
- zend_op_array *retval;
- char *opened_path = NULL;
-
- if (filename->type != IS_STRING) {
- tmp = *filename;
- zval_copy_ctor(&tmp);
- convert_to_string(&tmp);
- filename = &tmp;
- }
- file_handle.filename = filename->value.str.val;
- file_handle.free_filename = 0;
- file_handle.type = ZEND_HANDLE_FILENAME;
- file_handle.opened_path = NULL;
- file_handle.handle.fp = NULL;
-
- retval = zend_compile_file(&file_handle, type TSRMLS_CC);
- if (retval && file_handle.handle.stream.handle) {
- int dummy = 1;
-
- if (!file_handle.opened_path) {
- file_handle.opened_path = opened_path = estrndup(filename->value.str.val, filename->value.str.len);
- }
-
- zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL);
-
- if (opened_path) {
- efree(opened_path);
- }
- }
- zend_destroy_file_handle(&file_handle TSRMLS_CC);
-
- if (filename==&tmp) {
- zval_dtor(&tmp);
- }
- return retval;
-}
-
-ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC)
-{
- char *buf;
- size_t size;
-
- /* enforce two trailing NULLs for flex... */
- if (IS_INTERNED(str->value.str.val)) {
- char *tmp = safe_emalloc(1, str->value.str.len, ZEND_MMAP_AHEAD);
- memcpy(tmp, str->value.str.val, str->value.str.len + ZEND_MMAP_AHEAD);
- str->value.str.val = tmp;
- } else {
- str->value.str.val = safe_erealloc(str->value.str.val, 1, str->value.str.len, ZEND_MMAP_AHEAD);
- }
-
- memset(str->value.str.val + str->value.str.len, 0, ZEND_MMAP_AHEAD);
-
- SCNG(yy_in) = NULL;
- SCNG(yy_start) = NULL;
-
- buf = str->value.str.val;
- size = str->value.str.len;
-
- if (CG(multibyte)) {
- SCNG(script_org) = (unsigned char*)buf;
- SCNG(script_org_size) = size;
- SCNG(script_filtered) = NULL;
-
- zend_multibyte_set_filter(zend_multibyte_get_internal_encoding(TSRMLS_C) TSRMLS_CC);
-
- if (SCNG(input_filter)) {
- if ((size_t)-1 == SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC)) {
- zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script from the detected "
- "encoding \"%s\" to a compatible encoding", zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding)));
- }
- buf = (char*)SCNG(script_filtered);
- size = SCNG(script_filtered_size);
- }
- }
-
- yy_scan_buffer(buf, size TSRMLS_CC);
-
- zend_set_compiled_filename(filename TSRMLS_CC);
- CG(zend_lineno) = 1;
- CG(increment_lineno) = 0;
- RESET_DOC_COMMENT();
- return SUCCESS;
-}
-
-
-ZEND_API size_t zend_get_scanned_file_offset(TSRMLS_D)
-{
- size_t offset = SCNG(yy_cursor) - SCNG(yy_start);
- if (SCNG(input_filter)) {
- size_t original_offset = offset, length = 0;
- do {
- unsigned char *p = NULL;
- if ((size_t)-1 == SCNG(input_filter)(&p, &length, SCNG(script_org), offset TSRMLS_CC)) {
- return (size_t)-1;
- }
- efree(p);
- if (length > original_offset) {
- offset--;
- } else if (length < original_offset) {
- offset++;
- }
- } while (original_offset != length);
- }
- return offset;
-}
-
-
-zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
-{
- zend_lex_state original_lex_state;
- zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array));
- zend_op_array *original_active_op_array = CG(active_op_array);
- zend_op_array *retval;
- zval tmp;
- int compiler_result;
- zend_bool original_in_compilation = CG(in_compilation);
-
- if (source_string->value.str.len==0) {
- efree(op_array);
- return NULL;
- }
-
- CG(in_compilation) = 1;
-
- tmp = *source_string;
- zval_copy_ctor(&tmp);
- convert_to_string(&tmp);
- source_string = &tmp;
-
- zend_save_lexical_state(&original_lex_state TSRMLS_CC);
- if (zend_prepare_string_for_scanning(source_string, filename TSRMLS_CC)==FAILURE) {
- efree(op_array);
- retval = NULL;
- } else {
- zend_bool orig_interactive = CG(interactive);
-
- CG(interactive) = 0;
- init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE TSRMLS_CC);
- CG(interactive) = orig_interactive;
- CG(active_op_array) = op_array;
- zend_stack_push(&CG(context_stack), (void *) &CG(context), sizeof(CG(context)));
- zend_init_compiler_context(TSRMLS_C);
- BEGIN(ST_IN_SCRIPTING);
- compiler_result = zendparse(TSRMLS_C);
-
- if (SCNG(script_filtered)) {
- efree(SCNG(script_filtered));
- SCNG(script_filtered) = NULL;
- }
-
- if (compiler_result != 0) {
- CG(active_op_array) = original_active_op_array;
- CG(unclean_shutdown)=1;
- destroy_op_array(op_array TSRMLS_CC);
- efree(op_array);
- retval = NULL;
- } else {
- zend_do_return(NULL, 0 TSRMLS_CC);
- CG(active_op_array) = original_active_op_array;
- pass_two(op_array TSRMLS_CC);
- zend_release_labels(0 TSRMLS_CC);
- retval = op_array;
- }
- }
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
- zval_dtor(&tmp);
- CG(in_compilation) = original_in_compilation;
- return retval;
-}
-
-
-BEGIN_EXTERN_C()
-int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC)
-{
- zend_lex_state original_lex_state;
- zend_file_handle file_handle;
-
- file_handle.type = ZEND_HANDLE_FILENAME;
- file_handle.filename = filename;
- file_handle.free_filename = 0;
- file_handle.opened_path = NULL;
- zend_save_lexical_state(&original_lex_state TSRMLS_CC);
- if (open_file_for_scanning(&file_handle TSRMLS_CC)==FAILURE) {
- zend_message_dispatcher(ZMSG_FAILED_HIGHLIGHT_FOPEN, filename TSRMLS_CC);
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
- return FAILURE;
- }
- zend_highlight(syntax_highlighter_ini TSRMLS_CC);
- if (SCNG(script_filtered)) {
- efree(SCNG(script_filtered));
- SCNG(script_filtered) = NULL;
- }
- zend_destroy_file_handle(&file_handle TSRMLS_CC);
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
- return SUCCESS;
-}
-
-int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC)
-{
- zend_lex_state original_lex_state;
- zval tmp = *str;
-
- str = &tmp;
- zval_copy_ctor(str);
- zend_save_lexical_state(&original_lex_state TSRMLS_CC);
- if (zend_prepare_string_for_scanning(str, str_name TSRMLS_CC)==FAILURE) {
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
- return FAILURE;
- }
- BEGIN(INITIAL);
- zend_highlight(syntax_highlighter_ini TSRMLS_CC);
- if (SCNG(script_filtered)) {
- efree(SCNG(script_filtered));
- SCNG(script_filtered) = NULL;
- }
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
- zval_dtor(str);
- return SUCCESS;
-}
-
-ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, const zend_encoding *old_encoding TSRMLS_DC)
-{
- size_t length;
- unsigned char *new_yy_start;
-
- /* convert and set */
- if (!SCNG(input_filter)) {
- if (SCNG(script_filtered)) {
- efree(SCNG(script_filtered));
- SCNG(script_filtered) = NULL;
- }
- SCNG(script_filtered_size) = 0;
- length = SCNG(script_org_size);
- new_yy_start = SCNG(script_org);
- } else {
- if ((size_t)-1 == SCNG(input_filter)(&new_yy_start, &length, SCNG(script_org), SCNG(script_org_size) TSRMLS_CC)) {
- zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script from the detected "
- "encoding \"%s\" to a compatible encoding", zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding)));
- }
- SCNG(script_filtered) = new_yy_start;
- SCNG(script_filtered_size) = length;
- }
-
- SCNG(yy_cursor) = new_yy_start + (SCNG(yy_cursor) - SCNG(yy_start));
- SCNG(yy_marker) = new_yy_start + (SCNG(yy_marker) - SCNG(yy_start));
- SCNG(yy_text) = new_yy_start + (SCNG(yy_text) - SCNG(yy_start));
- SCNG(yy_limit) = new_yy_start + (SCNG(yy_limit) - SCNG(yy_start));
-
- SCNG(yy_start) = new_yy_start;
-}
-
-
-# define zend_copy_value(zendlval, yytext, yyleng) \
- if (SCNG(output_filter)) { \
- size_t sz = 0; \
- SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); \
- zendlval->value.str.len = sz; \
- } else { \
- zendlval->value.str.val = (char *) estrndup(yytext, yyleng); \
- zendlval->value.str.len = yyleng; \
- }
-
-static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quote_type TSRMLS_DC)
-{
- register char *s, *t;
- char *end;
-
- ZVAL_STRINGL(zendlval, str, len, 1);
-
- /* convert escape sequences */
- s = t = zendlval->value.str.val;
- end = s+zendlval->value.str.len;
- while (s<end) {
- if (*s=='\\') {
- s++;
- if (s >= end) {
- *t++ = '\\';
- break;
- }
-
- switch(*s) {
- case 'n':
- *t++ = '\n';
- zendlval->value.str.len--;
- break;
- case 'r':
- *t++ = '\r';
- zendlval->value.str.len--;
- break;
- case 't':
- *t++ = '\t';
- zendlval->value.str.len--;
- break;
- case 'f':
- *t++ = '\f';
- zendlval->value.str.len--;
- break;
- case 'v':
- *t++ = '\v';
- zendlval->value.str.len--;
- break;
- case 'e':
-#ifdef PHP_WIN32
- *t++ = VK_ESCAPE;
-#else
- *t++ = '\e';
-#endif
- zendlval->value.str.len--;
- break;
- case '"':
- case '`':
- if (*s != quote_type) {
- *t++ = '\\';
- *t++ = *s;
- break;
- }
- case '\\':
- case '$':
- *t++ = *s;
- zendlval->value.str.len--;
- break;
- case 'x':
- case 'X':
- if (ZEND_IS_HEX(*(s+1))) {
- char hex_buf[3] = { 0, 0, 0 };
-
- zendlval->value.str.len--; /* for the 'x' */
-
- hex_buf[0] = *(++s);
- zendlval->value.str.len--;
- if (ZEND_IS_HEX(*(s+1))) {
- hex_buf[1] = *(++s);
- zendlval->value.str.len--;
- }
- *t++ = (char) strtol(hex_buf, NULL, 16);
- } else {
- *t++ = '\\';
- *t++ = *s;
- }
- break;
- default:
- /* check for an octal */
- if (ZEND_IS_OCT(*s)) {
- char octal_buf[4] = { 0, 0, 0, 0 };
-
- octal_buf[0] = *s;
- zendlval->value.str.len--;
- if (ZEND_IS_OCT(*(s+1))) {
- octal_buf[1] = *(++s);
- zendlval->value.str.len--;
- if (ZEND_IS_OCT(*(s+1))) {
- octal_buf[2] = *(++s);
- zendlval->value.str.len--;
- }
- }
- *t++ = (char) strtol(octal_buf, NULL, 8);
- } else {
- *t++ = '\\';
- *t++ = *s;
- }
- break;
- }
- } else {
- *t++ = *s;
- }
-
- if (*s == '\n' || (*s == '\r' && (*(s+1) != '\n'))) {
- CG(zend_lineno)++;
- }
- s++;
- }
- *t = 0;
- if (SCNG(output_filter)) {
- size_t sz = 0;
- s = zendlval->value.str.val;
- SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)s, (size_t)zendlval->value.str.len TSRMLS_CC);
- zendlval->value.str.len = sz;
- efree(s);
- }
-}
-
-
-int lex_scan(zval *zendlval TSRMLS_DC)
-{
-restart:
- SCNG(yy_text) = YYCURSOR;
-
-yymore_restart:
-
-
-#line 1010 "Zend/zend_language_scanner.c"
-{
- YYCTYPE yych;
- unsigned int yyaccept = 0;
- if (YYGETCONDITION() < 5) {
- if (YYGETCONDITION() < 2) {
- if (YYGETCONDITION() < 1) {
- goto yyc_ST_IN_SCRIPTING;
- } else {
- goto yyc_ST_LOOKING_FOR_PROPERTY;
- }
- } else {
- if (YYGETCONDITION() < 3) {
- goto yyc_ST_BACKQUOTE;
- } else {
- if (YYGETCONDITION() < 4) {
- goto yyc_ST_DOUBLE_QUOTES;
- } else {
- goto yyc_ST_HEREDOC;
- }
- }
- }
- } else {
- if (YYGETCONDITION() < 7) {
- if (YYGETCONDITION() < 6) {
- goto yyc_ST_LOOKING_FOR_VARNAME;
- } else {
- goto yyc_ST_VAR_OFFSET;
- }
- } else {
- if (YYGETCONDITION() < 8) {
- goto yyc_INITIAL;
- } else {
- if (YYGETCONDITION() < 9) {
- goto yyc_ST_END_HEREDOC;
- } else {
- goto yyc_ST_NOWDOC;
- }
- }
- }
- }
-/* *********************************** */
-yyc_INITIAL:
- {
- static const unsigned char yybm[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 128, 128, 0, 0, 128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 128, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- };
-
- YYDEBUG(0, *YYCURSOR);
- YYFILL(8);
- yych = *YYCURSOR;
- if (yych != '<') goto yy4;
- YYDEBUG(2, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '?') {
- if (yych == '%') goto yy7;
- if (yych >= '?') goto yy5;
- } else {
- if (yych <= 'S') {
- if (yych >= 'S') goto yy9;
- } else {
- if (yych == 's') goto yy9;
- }
- }
-yy3:
- YYDEBUG(3, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1807 "Zend/zend_language_scanner.l"
- {
- if (YYCURSOR > YYLIMIT) {
- return 0;
- }
-
-inline_char_handler:
-
- while (1) {
- YYCTYPE *ptr = memchr(YYCURSOR, '<', YYLIMIT - YYCURSOR);
-
- YYCURSOR = ptr ? ptr + 1 : YYLIMIT;
-
- if (YYCURSOR < YYLIMIT) {
- switch (*YYCURSOR) {
- case '?':
- if (CG(short_tags) || !strncasecmp((char*)YYCURSOR + 1, "php", 3) || (*(YYCURSOR + 1) == '=')) { /* Assume [ \t\n\r] follows "php" */
- break;
- }
- continue;
- case '%':
- if (CG(asp_tags)) {
- break;
- }
- continue;
- case 's':
- case 'S':
- /* Probably NOT an opening PHP <script> tag, so don't end the HTML chunk yet
- * If it is, the PHP <script> tag rule checks for any HTML scanned before it */
- YYCURSOR--;
- yymore();
- default:
- continue;
- }
-
- YYCURSOR--;
- }
-
- break;
- }
-
-inline_html:
- yyleng = YYCURSOR - SCNG(yy_text);
-
- if (SCNG(output_filter)) {
- int readsize;
- size_t sz = 0;
- readsize = SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC);
- zendlval->value.str.len = sz;
- if (readsize < yyleng) {
- yyless(readsize);
- }
- } else {
- zendlval->value.str.val = (char *) estrndup(yytext, yyleng);
- zendlval->value.str.len = yyleng;
- }
- zendlval->type = IS_STRING;
- HANDLE_NEWLINES(yytext, yyleng);
- return T_INLINE_HTML;
-}
-#line 1169 "Zend/zend_language_scanner.c"
-yy4:
- YYDEBUG(4, *YYCURSOR);
- yych = *++YYCURSOR;
- goto yy3;
-yy5:
- YYDEBUG(5, *YYCURSOR);
- yyaccept = 1;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= 'O') {
- if (yych == '=') goto yy45;
- } else {
- if (yych <= 'P') goto yy47;
- if (yych == 'p') goto yy47;
- }
-yy6:
- YYDEBUG(6, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1795 "Zend/zend_language_scanner.l"
- {
- if (CG(short_tags)) {
- zendlval->value.str.val = yytext; /* no copying - intentional */
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
- BEGIN(ST_IN_SCRIPTING);
- return T_OPEN_TAG;
- } else {
- goto inline_char_handler;
- }
-}
-#line 1199 "Zend/zend_language_scanner.c"
-yy7:
- YYDEBUG(7, *YYCURSOR);
- ++YYCURSOR;
- if ((yych = *YYCURSOR) == '=') goto yy43;
- YYDEBUG(8, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1772 "Zend/zend_language_scanner.l"
- {
- if (CG(asp_tags)) {
- zendlval->value.str.val = yytext; /* no copying - intentional */
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
- BEGIN(ST_IN_SCRIPTING);
- return T_OPEN_TAG;
- } else {
- goto inline_char_handler;
- }
-}
-#line 1218 "Zend/zend_language_scanner.c"
-yy9:
- YYDEBUG(9, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy11;
- if (yych == 'c') goto yy11;
-yy10:
- YYDEBUG(10, *YYCURSOR);
- YYCURSOR = YYMARKER;
- if (yyaccept <= 0) {
- goto yy3;
- } else {
- goto yy6;
- }
-yy11:
- YYDEBUG(11, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy12;
- if (yych != 'r') goto yy10;
-yy12:
- YYDEBUG(12, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy13;
- if (yych != 'i') goto yy10;
-yy13:
- YYDEBUG(13, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'P') goto yy14;
- if (yych != 'p') goto yy10;
-yy14:
- YYDEBUG(14, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy15;
- if (yych != 't') goto yy10;
-yy15:
- YYDEBUG(15, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy10;
- if (yych == 'l') goto yy10;
- goto yy17;
-yy16:
- YYDEBUG(16, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(8);
- yych = *YYCURSOR;
-yy17:
- YYDEBUG(17, *YYCURSOR);
- if (yybm[0+yych] & 128) {
- goto yy16;
- }
- if (yych == 'L') goto yy18;
- if (yych != 'l') goto yy10;
-yy18:
- YYDEBUG(18, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy19;
- if (yych != 'a') goto yy10;
-yy19:
- YYDEBUG(19, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy20;
- if (yych != 'n') goto yy10;
-yy20:
- YYDEBUG(20, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'G') goto yy21;
- if (yych != 'g') goto yy10;
-yy21:
- YYDEBUG(21, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'U') goto yy22;
- if (yych != 'u') goto yy10;
-yy22:
- YYDEBUG(22, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy23;
- if (yych != 'a') goto yy10;
-yy23:
- YYDEBUG(23, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'G') goto yy24;
- if (yych != 'g') goto yy10;
-yy24:
- YYDEBUG(24, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy25;
- if (yych != 'e') goto yy10;
-yy25:
- YYDEBUG(25, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(26, *YYCURSOR);
- if (yych <= '\r') {
- if (yych <= 0x08) goto yy10;
- if (yych <= '\n') goto yy25;
- if (yych <= '\f') goto yy10;
- goto yy25;
- } else {
- if (yych <= ' ') {
- if (yych <= 0x1F) goto yy10;
- goto yy25;
- } else {
- if (yych != '=') goto yy10;
- }
- }
-yy27:
- YYDEBUG(27, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(5);
- yych = *YYCURSOR;
- YYDEBUG(28, *YYCURSOR);
- if (yych <= '!') {
- if (yych <= '\f') {
- if (yych <= 0x08) goto yy10;
- if (yych <= '\n') goto yy27;
- goto yy10;
- } else {
- if (yych <= '\r') goto yy27;
- if (yych == ' ') goto yy27;
- goto yy10;
- }
- } else {
- if (yych <= 'O') {
- if (yych <= '"') goto yy30;
- if (yych == '\'') goto yy31;
- goto yy10;
- } else {
- if (yych <= 'P') goto yy29;
- if (yych != 'p') goto yy10;
- }
- }
-yy29:
- YYDEBUG(29, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'H') goto yy42;
- if (yych == 'h') goto yy42;
- goto yy10;
-yy30:
- YYDEBUG(30, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'P') goto yy39;
- if (yych == 'p') goto yy39;
- goto yy10;
-yy31:
- YYDEBUG(31, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'P') goto yy32;
- if (yych != 'p') goto yy10;
-yy32:
- YYDEBUG(32, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'H') goto yy33;
- if (yych != 'h') goto yy10;
-yy33:
- YYDEBUG(33, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'P') goto yy34;
- if (yych != 'p') goto yy10;
-yy34:
- YYDEBUG(34, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych != '\'') goto yy10;
-yy35:
- YYDEBUG(35, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(36, *YYCURSOR);
- if (yych <= '\r') {
- if (yych <= 0x08) goto yy10;
- if (yych <= '\n') goto yy35;
- if (yych <= '\f') goto yy10;
- goto yy35;
- } else {
- if (yych <= ' ') {
- if (yych <= 0x1F) goto yy10;
- goto yy35;
- } else {
- if (yych != '>') goto yy10;
- }
- }
- YYDEBUG(37, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(38, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1732 "Zend/zend_language_scanner.l"
- {
- YYCTYPE *bracket = (YYCTYPE*)zend_memrchr(yytext, '<', yyleng - (sizeof("script language=php>") - 1));
-
- if (bracket != SCNG(yy_text)) {
- /* Handle previously scanned HTML, as possible <script> tags found are assumed to not be PHP's */
- YYCURSOR = bracket;
- goto inline_html;
- }
-
- HANDLE_NEWLINES(yytext, yyleng);
- zendlval->value.str.val = yytext; /* no copying - intentional */
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
- BEGIN(ST_IN_SCRIPTING);
- return T_OPEN_TAG;
-}
-#line 1421 "Zend/zend_language_scanner.c"
-yy39:
- YYDEBUG(39, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'H') goto yy40;
- if (yych != 'h') goto yy10;
-yy40:
- YYDEBUG(40, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'P') goto yy41;
- if (yych != 'p') goto yy10;
-yy41:
- YYDEBUG(41, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '"') goto yy35;
- goto yy10;
-yy42:
- YYDEBUG(42, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'P') goto yy35;
- if (yych == 'p') goto yy35;
- goto yy10;
-yy43:
- YYDEBUG(43, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(44, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1750 "Zend/zend_language_scanner.l"
- {
- if (CG(asp_tags)) {
- zendlval->value.str.val = yytext; /* no copying - intentional */
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
- BEGIN(ST_IN_SCRIPTING);
- return T_OPEN_TAG_WITH_ECHO;
- } else {
- goto inline_char_handler;
- }
-}
-#line 1460 "Zend/zend_language_scanner.c"
-yy45:
- YYDEBUG(45, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(46, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1763 "Zend/zend_language_scanner.l"
- {
- zendlval->value.str.val = yytext; /* no copying - intentional */
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
- BEGIN(ST_IN_SCRIPTING);
- return T_OPEN_TAG_WITH_ECHO;
-}
-#line 1474 "Zend/zend_language_scanner.c"
-yy47:
- YYDEBUG(47, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'H') goto yy48;
- if (yych != 'h') goto yy10;
-yy48:
- YYDEBUG(48, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'P') goto yy49;
- if (yych != 'p') goto yy10;
-yy49:
- YYDEBUG(49, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= '\f') {
- if (yych <= 0x08) goto yy10;
- if (yych >= '\v') goto yy10;
- } else {
- if (yych <= '\r') goto yy52;
- if (yych != ' ') goto yy10;
- }
-yy50:
- YYDEBUG(50, *YYCURSOR);
- ++YYCURSOR;
-yy51:
- YYDEBUG(51, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1785 "Zend/zend_language_scanner.l"
- {
- zendlval->value.str.val = yytext; /* no copying - intentional */
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
- HANDLE_NEWLINE(yytext[yyleng-1]);
- BEGIN(ST_IN_SCRIPTING);
- return T_OPEN_TAG;
-}
-#line 1510 "Zend/zend_language_scanner.c"
-yy52:
- YYDEBUG(52, *YYCURSOR);
- ++YYCURSOR;
- if ((yych = *YYCURSOR) == '\n') goto yy50;
- goto yy51;
- }
-/* *********************************** */
-yyc_ST_BACKQUOTE:
- {
- static const unsigned char yybm[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 0, 0, 0, 0, 0, 0,
- 0, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 0, 0, 0, 0, 128,
- 0, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 0, 0, 0, 0, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- };
- YYDEBUG(53, *YYCURSOR);
- YYFILL(2);
- yych = *YYCURSOR;
- if (yych <= '_') {
- if (yych != '$') goto yy60;
- } else {
- if (yych <= '`') goto yy58;
- if (yych == '{') goto yy57;
- goto yy60;
- }
- YYDEBUG(55, *YYCURSOR);
- ++YYCURSOR;
- if ((yych = *YYCURSOR) <= '_') {
- if (yych <= '@') goto yy56;
- if (yych <= 'Z') goto yy63;
- if (yych >= '_') goto yy63;
- } else {
- if (yych <= 'z') {
- if (yych >= 'a') goto yy63;
- } else {
- if (yych <= '{') goto yy66;
- if (yych >= 0x7F) goto yy63;
- }
- }
-yy56:
- YYDEBUG(56, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 2258 "Zend/zend_language_scanner.l"
- {
- if (YYCURSOR > YYLIMIT) {
- return 0;
- }
- if (yytext[0] == '\\' && YYCURSOR < YYLIMIT) {
- YYCURSOR++;
- }
-
- while (YYCURSOR < YYLIMIT) {
- switch (*YYCURSOR++) {
- case '`':
- break;
- case '$':
- if (IS_LABEL_START(*YYCURSOR) || *YYCURSOR == '{') {
- break;
- }
- continue;
- case '{':
- if (*YYCURSOR == '$') {
- break;
- }
- continue;
- case '\\':
- if (YYCURSOR < YYLIMIT) {
- YYCURSOR++;
- }
- /* fall through */
- default:
- continue;
- }
-
- YYCURSOR--;
- break;
- }
-
- yyleng = YYCURSOR - SCNG(yy_text);
-
- zend_scan_escape_string(zendlval, yytext, yyleng, '`' TSRMLS_CC);
- return T_ENCAPSED_AND_WHITESPACE;
-}
-#line 1622 "Zend/zend_language_scanner.c"
-yy57:
- YYDEBUG(57, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '$') goto yy61;
- goto yy56;
-yy58:
- YYDEBUG(58, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(59, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 2202 "Zend/zend_language_scanner.l"
- {
- BEGIN(ST_IN_SCRIPTING);
- return '`';
-}
-#line 1638 "Zend/zend_language_scanner.c"
-yy60:
- YYDEBUG(60, *YYCURSOR);
- yych = *++YYCURSOR;
- goto yy56;
-yy61:
- YYDEBUG(61, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(62, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 2189 "Zend/zend_language_scanner.l"
- {
- zendlval->value.lval = (long) '{';
- yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
- yyless(1);
- return T_CURLY_OPEN;
-}
-#line 1655 "Zend/zend_language_scanner.c"
-yy63:
- YYDEBUG(63, *YYCURSOR);
- yyaccept = 0;
- YYMARKER = ++YYCURSOR;
- YYFILL(3);
- yych = *YYCURSOR;
- YYDEBUG(64, *YYCURSOR);
- if (yybm[0+yych] & 128) {
- goto yy63;
- }
- if (yych == '-') goto yy68;
- if (yych == '[') goto yy70;
-yy65:
- YYDEBUG(65, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1889 "Zend/zend_language_scanner.l"
- {
- zend_copy_value(zendlval, (yytext+1), (yyleng-1));
- zendlval->type = IS_STRING;
- return T_VARIABLE;
-}
-#line 1677 "Zend/zend_language_scanner.c"
-yy66:
- YYDEBUG(66, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(67, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1465 "Zend/zend_language_scanner.l"
- {
- yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
- return T_DOLLAR_OPEN_CURLY_BRACES;
-}
-#line 1688 "Zend/zend_language_scanner.c"
-yy68:
- YYDEBUG(68, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '>') goto yy72;
-yy69:
- YYDEBUG(69, *YYCURSOR);
- YYCURSOR = YYMARKER;
- goto yy65;
-yy70:
- YYDEBUG(70, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(71, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1881 "Zend/zend_language_scanner.l"
- {
- yyless(yyleng - 1);
- yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
- zend_copy_value(zendlval, (yytext+1), (yyleng-1));
- zendlval->type = IS_STRING;
- return T_VARIABLE;
-}
-#line 1710 "Zend/zend_language_scanner.c"
-yy72:
- YYDEBUG(72, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= '_') {
- if (yych <= '@') goto yy69;
- if (yych <= 'Z') goto yy73;
- if (yych <= '^') goto yy69;
- } else {
- if (yych <= '`') goto yy69;
- if (yych <= 'z') goto yy73;
- if (yych <= '~') goto yy69;
- }
-yy73:
- YYDEBUG(73, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(74, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1871 "Zend/zend_language_scanner.l"
- {
- yyless(yyleng - 3);
- yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
- zend_copy_value(zendlval, (yytext+1), (yyleng-1));
- zendlval->type = IS_STRING;
- return T_VARIABLE;
-}
-#line 1736 "Zend/zend_language_scanner.c"
- }
-/* *********************************** */
-yyc_ST_DOUBLE_QUOTES:
- {
- static const unsigned char yybm[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 0, 0, 0, 0, 0, 0,
- 0, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 0, 0, 0, 0, 128,
- 0, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 0, 0, 0, 0, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- };
- YYDEBUG(75, *YYCURSOR);
- YYFILL(2);
- yych = *YYCURSOR;
- if (yych <= '#') {
- if (yych == '"') goto yy80;
- goto yy82;
- } else {
- if (yych <= '$') goto yy77;
- if (yych == '{') goto yy79;
- goto yy82;
- }
-yy77:
- YYDEBUG(77, *YYCURSOR);
- ++YYCURSOR;
- if ((yych = *YYCURSOR) <= '_') {
- if (yych <= '@') goto yy78;
- if (yych <= 'Z') goto yy85;
- if (yych >= '_') goto yy85;
- } else {
- if (yych <= 'z') {
- if (yych >= 'a') goto yy85;
- } else {
- if (yych <= '{') goto yy88;
- if (yych >= 0x7F) goto yy85;
- }
- }
-yy78:
- YYDEBUG(78, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 2208 "Zend/zend_language_scanner.l"
- {
- if (GET_DOUBLE_QUOTES_SCANNED_LENGTH()) {
- YYCURSOR += GET_DOUBLE_QUOTES_SCANNED_LENGTH() - 1;
- SET_DOUBLE_QUOTES_SCANNED_LENGTH(0);
-
- goto double_quotes_scan_done;
- }
-
- if (YYCURSOR > YYLIMIT) {
- return 0;
- }
- if (yytext[0] == '\\' && YYCURSOR < YYLIMIT) {
- YYCURSOR++;
- }
-
- while (YYCURSOR < YYLIMIT) {
- switch (*YYCURSOR++) {
- case '"':
- break;
- case '$':
- if (IS_LABEL_START(*YYCURSOR) || *YYCURSOR == '{') {
- break;
- }
- continue;
- case '{':
- if (*YYCURSOR == '$') {
- break;
- }
- continue;
- case '\\':
- if (YYCURSOR < YYLIMIT) {
- YYCURSOR++;
- }
- /* fall through */
- default:
- continue;
- }
-
- YYCURSOR--;
- break;
- }
-
-double_quotes_scan_done:
- yyleng = YYCURSOR - SCNG(yy_text);
-
- zend_scan_escape_string(zendlval, yytext, yyleng, '"' TSRMLS_CC);
- return T_ENCAPSED_AND_WHITESPACE;
-}
-#line 1853 "Zend/zend_language_scanner.c"
-yy79:
- YYDEBUG(79, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '$') goto yy83;
- goto yy78;
-yy80:
- YYDEBUG(80, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(81, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 2197 "Zend/zend_language_scanner.l"
- {
- BEGIN(ST_IN_SCRIPTING);
- return '"';
-}
-#line 1869 "Zend/zend_language_scanner.c"
-yy82:
- YYDEBUG(82, *YYCURSOR);
- yych = *++YYCURSOR;
- goto yy78;
-yy83:
- YYDEBUG(83, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(84, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 2189 "Zend/zend_language_scanner.l"
- {
- zendlval->value.lval = (long) '{';
- yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
- yyless(1);
- return T_CURLY_OPEN;
-}
-#line 1886 "Zend/zend_language_scanner.c"
-yy85:
- YYDEBUG(85, *YYCURSOR);
- yyaccept = 0;
- YYMARKER = ++YYCURSOR;
- YYFILL(3);
- yych = *YYCURSOR;
- YYDEBUG(86, *YYCURSOR);
- if (yybm[0+yych] & 128) {
- goto yy85;
- }
- if (yych == '-') goto yy90;
- if (yych == '[') goto yy92;
-yy87:
- YYDEBUG(87, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1889 "Zend/zend_language_scanner.l"
- {
- zend_copy_value(zendlval, (yytext+1), (yyleng-1));
- zendlval->type = IS_STRING;
- return T_VARIABLE;
-}
-#line 1908 "Zend/zend_language_scanner.c"
-yy88:
- YYDEBUG(88, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(89, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1465 "Zend/zend_language_scanner.l"
- {
- yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
- return T_DOLLAR_OPEN_CURLY_BRACES;
-}
-#line 1919 "Zend/zend_language_scanner.c"
-yy90:
- YYDEBUG(90, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '>') goto yy94;
-yy91:
- YYDEBUG(91, *YYCURSOR);
- YYCURSOR = YYMARKER;
- goto yy87;
-yy92:
- YYDEBUG(92, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(93, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1881 "Zend/zend_language_scanner.l"
- {
- yyless(yyleng - 1);
- yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
- zend_copy_value(zendlval, (yytext+1), (yyleng-1));
- zendlval->type = IS_STRING;
- return T_VARIABLE;
-}
-#line 1941 "Zend/zend_language_scanner.c"
-yy94:
- YYDEBUG(94, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= '_') {
- if (yych <= '@') goto yy91;
- if (yych <= 'Z') goto yy95;
- if (yych <= '^') goto yy91;
- } else {
- if (yych <= '`') goto yy91;
- if (yych <= 'z') goto yy95;
- if (yych <= '~') goto yy91;
- }
-yy95:
- YYDEBUG(95, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(96, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1871 "Zend/zend_language_scanner.l"
- {
- yyless(yyleng - 3);
- yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
- zend_copy_value(zendlval, (yytext+1), (yyleng-1));
- zendlval->type = IS_STRING;
- return T_VARIABLE;
-}
-#line 1967 "Zend/zend_language_scanner.c"
- }
-/* *********************************** */
-yyc_ST_END_HEREDOC:
- YYDEBUG(97, *YYCURSOR);
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(99, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(100, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 2175 "Zend/zend_language_scanner.l"
- {
- zend_heredoc_label *heredoc_label = zend_ptr_stack_pop(&SCNG(heredoc_label_stack));
-
- YYCURSOR += heredoc_label->length - 1;
- yyleng = heredoc_label->length;
-
- heredoc_label_dtor(heredoc_label);
- efree(heredoc_label);
-
- BEGIN(ST_IN_SCRIPTING);
- return T_END_HEREDOC;
-}
-#line 1991 "Zend/zend_language_scanner.c"
-/* *********************************** */
-yyc_ST_HEREDOC:
- {
- static const unsigned char yybm[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 0, 0, 0, 0, 0, 0,
- 0, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 0, 0, 0, 0, 128,
- 0, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 0, 0, 0, 0, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- };
- YYDEBUG(101, *YYCURSOR);
- YYFILL(2);
- yych = *YYCURSOR;
- if (yych == '$') goto yy103;
- if (yych == '{') goto yy105;
- goto yy106;
-yy103:
- YYDEBUG(103, *YYCURSOR);
- ++YYCURSOR;
- if ((yych = *YYCURSOR) <= '_') {
- if (yych <= '@') goto yy104;
- if (yych <= 'Z') goto yy109;
- if (yych >= '_') goto yy109;
- } else {
- if (yych <= 'z') {
- if (yych >= 'a') goto yy109;
- } else {
- if (yych <= '{') goto yy112;
- if (yych >= 0x7F) goto yy109;
- }
- }
-yy104:
- YYDEBUG(104, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 2300 "Zend/zend_language_scanner.l"
- {
- int newline = 0;
-
- zend_heredoc_label *heredoc_label = zend_ptr_stack_top(&SCNG(heredoc_label_stack));
-
- if (YYCURSOR > YYLIMIT) {
- return 0;
- }
-
- YYCURSOR--;
-
- while (YYCURSOR < YYLIMIT) {
- switch (*YYCURSOR++) {
- case '\r':
- if (*YYCURSOR == '\n') {
- YYCURSOR++;
- }
- /* fall through */
- case '\n':
- /* Check for ending label on the next line */
- if (IS_LABEL_START(*YYCURSOR) && heredoc_label->length < YYLIMIT - YYCURSOR && !memcmp(YYCURSOR, heredoc_label->label, heredoc_label->length)) {
- YYCTYPE *end = YYCURSOR + heredoc_label->length;
-
- if (*end == ';') {
- end++;
- }
-
- if (*end == '\n' || *end == '\r') {
- /* newline before label will be subtracted from returned text, but
- * yyleng/yytext will include it, for zend_highlight/strip, tokenizer, etc. */
- if (YYCURSOR[-2] == '\r' && YYCURSOR[-1] == '\n') {
- newline = 2; /* Windows newline */
- } else {
- newline = 1;
- }
-
- CG(increment_lineno) = 1; /* For newline before label */
- BEGIN(ST_END_HEREDOC);
-
- goto heredoc_scan_done;
- }
- }
- continue;
- case '$':
- if (IS_LABEL_START(*YYCURSOR) || *YYCURSOR == '{') {
- break;
- }
- continue;
- case '{':
- if (*YYCURSOR == '$') {
- break;
- }
- continue;
- case '\\':
- if (YYCURSOR < YYLIMIT && *YYCURSOR != '\n' && *YYCURSOR != '\r') {
- YYCURSOR++;
- }
- /* fall through */
- default:
- continue;
- }
-
- YYCURSOR--;
- break;
- }
-
-heredoc_scan_done:
- yyleng = YYCURSOR - SCNG(yy_text);
-
- zend_scan_escape_string(zendlval, yytext, yyleng - newline, 0 TSRMLS_CC);
- return T_ENCAPSED_AND_WHITESPACE;
-}
-#line 2126 "Zend/zend_language_scanner.c"
-yy105:
- YYDEBUG(105, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '$') goto yy107;
- goto yy104;
-yy106:
- YYDEBUG(106, *YYCURSOR);
- yych = *++YYCURSOR;
- goto yy104;
-yy107:
- YYDEBUG(107, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(108, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 2189 "Zend/zend_language_scanner.l"
- {
- zendlval->value.lval = (long) '{';
- yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
- yyless(1);
- return T_CURLY_OPEN;
-}
-#line 2148 "Zend/zend_language_scanner.c"
-yy109:
- YYDEBUG(109, *YYCURSOR);
- yyaccept = 0;
- YYMARKER = ++YYCURSOR;
- YYFILL(3);
- yych = *YYCURSOR;
- YYDEBUG(110, *YYCURSOR);
- if (yybm[0+yych] & 128) {
- goto yy109;
- }
- if (yych == '-') goto yy114;
- if (yych == '[') goto yy116;
-yy111:
- YYDEBUG(111, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1889 "Zend/zend_language_scanner.l"
- {
- zend_copy_value(zendlval, (yytext+1), (yyleng-1));
- zendlval->type = IS_STRING;
- return T_VARIABLE;
-}
-#line 2170 "Zend/zend_language_scanner.c"
-yy112:
- YYDEBUG(112, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(113, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1465 "Zend/zend_language_scanner.l"
- {
- yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
- return T_DOLLAR_OPEN_CURLY_BRACES;
-}
-#line 2181 "Zend/zend_language_scanner.c"
-yy114:
- YYDEBUG(114, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '>') goto yy118;
-yy115:
- YYDEBUG(115, *YYCURSOR);
- YYCURSOR = YYMARKER;
- goto yy111;
-yy116:
- YYDEBUG(116, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(117, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1881 "Zend/zend_language_scanner.l"
- {
- yyless(yyleng - 1);
- yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
- zend_copy_value(zendlval, (yytext+1), (yyleng-1));
- zendlval->type = IS_STRING;
- return T_VARIABLE;
-}
-#line 2203 "Zend/zend_language_scanner.c"
-yy118:
- YYDEBUG(118, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= '_') {
- if (yych <= '@') goto yy115;
- if (yych <= 'Z') goto yy119;
- if (yych <= '^') goto yy115;
- } else {
- if (yych <= '`') goto yy115;
- if (yych <= 'z') goto yy119;
- if (yych <= '~') goto yy115;
- }
-yy119:
- YYDEBUG(119, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(120, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1871 "Zend/zend_language_scanner.l"
- {
- yyless(yyleng - 3);
- yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
- zend_copy_value(zendlval, (yytext+1), (yyleng-1));
- zendlval->type = IS_STRING;
- return T_VARIABLE;
-}
-#line 2229 "Zend/zend_language_scanner.c"
- }
-/* *********************************** */
-yyc_ST_IN_SCRIPTING:
- {
- static const unsigned char yybm[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 192, 64, 0, 0, 64, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 192, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 60, 60, 44, 44, 44, 44, 44, 44,
- 44, 44, 0, 0, 0, 0, 0, 0,
- 0, 36, 36, 36, 36, 36, 36, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 0, 0, 0, 0, 4,
- 0, 36, 36, 36, 36, 36, 36, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 0, 0, 0, 0, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- };
- YYDEBUG(121, *YYCURSOR);
- YYFILL(16);
- yych = *YYCURSOR;
- YYDEBUG(-1, yych);
- switch (yych) {
- case 0x00:
- case 0x01:
- case 0x02:
- case 0x03:
- case 0x04:
- case 0x05:
- case 0x06:
- case 0x07:
- case 0x08:
- case '\v':
- case '\f':
- case 0x0E:
- case 0x0F:
- case 0x10:
- case 0x11:
- case 0x12:
- case 0x13:
- case 0x14:
- case 0x15:
- case 0x16:
- case 0x17:
- case 0x18:
- case 0x19:
- case 0x1A:
- case 0x1B:
- case 0x1C:
- case 0x1D:
- case 0x1E:
- case 0x1F: goto yy184;
- case '\t':
- case '\n':
- case '\r':
- case ' ': goto yy140;
- case '!': goto yy153;
- case '"': goto yy180;
- case '#': goto yy176;
- case '$': goto yy165;
- case '%': goto yy159;
- case '&': goto yy160;
- case '\'': goto yy178;
- case '(': goto yy147;
- case ')':
- case ',':
- case ';':
- case '@':
- case '[':
- case ']':
- case '~': goto yy166;
- case '*': goto yy156;
- case '+': goto yy152;
- case '-': goto yy138;
- case '.': goto yy158;
- case '/': goto yy157;
- case '0': goto yy172;
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy174;
- case ':': goto yy142;
- case '<': goto yy154;
- case '=': goto yy150;
- case '>': goto yy155;
- case '?': goto yy167;
- case 'A':
- case 'a': goto yy133;
- case 'B':
- case 'b': goto yy135;
- case 'C':
- case 'c': goto yy127;
- case 'D':
- case 'd': goto yy125;
- case 'E':
- case 'e': goto yy123;
- case 'F':
- case 'f': goto yy126;
- case 'G':
- case 'g': goto yy136;
- case 'I':
- case 'i': goto yy131;
- case 'L':
- case 'l': goto yy151;
- case 'N':
- case 'n': goto yy145;
- case 'O':
- case 'o': goto yy163;
- case 'P':
- case 'p': goto yy137;
- case 'R':
- case 'r': goto yy128;
- case 'S':
- case 's': goto yy134;
- case 'T':
- case 't': goto yy130;
- case 'U':
- case 'u': goto yy148;
- case 'V':
- case 'v': goto yy146;
- case 'W':
- case 'w': goto yy132;
- case 'X':
- case 'x': goto yy164;
- case 'Y':
- case 'y': goto yy129;
- case '\\': goto yy143;
- case '^': goto yy162;
- case '_': goto yy149;
- case '`': goto yy182;
- case '{': goto yy168;
- case '|': goto yy161;
- case '}': goto yy170;
- default: goto yy175;
- }
-yy123:
- YYDEBUG(123, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(-1, yych);
- switch ((yych = *YYCURSOR)) {
- case 'C':
- case 'c': goto yy735;
- case 'L':
- case 'l': goto yy736;
- case 'M':
- case 'm': goto yy737;
- case 'N':
- case 'n': goto yy738;
- case 'V':
- case 'v': goto yy739;
- case 'X':
- case 'x': goto yy740;
- default: goto yy187;
- }
-yy124:
- YYDEBUG(124, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1912 "Zend/zend_language_scanner.l"
- {
- zend_copy_value(zendlval, yytext, yyleng);
- zendlval->type = IS_STRING;
- return T_STRING;
-}
-#line 2418 "Zend/zend_language_scanner.c"
-yy125:
- YYDEBUG(125, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'O') {
- if (yych <= 'H') {
- if (yych == 'E') goto yy717;
- goto yy187;
- } else {
- if (yych <= 'I') goto yy718;
- if (yych <= 'N') goto yy187;
- goto yy719;
- }
- } else {
- if (yych <= 'h') {
- if (yych == 'e') goto yy717;
- goto yy187;
- } else {
- if (yych <= 'i') goto yy718;
- if (yych == 'o') goto yy719;
- goto yy187;
- }
- }
-yy126:
- YYDEBUG(126, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'U') {
- if (yych <= 'N') {
- if (yych == 'I') goto yy693;
- goto yy187;
- } else {
- if (yych <= 'O') goto yy694;
- if (yych <= 'T') goto yy187;
- goto yy695;
- }
- } else {
- if (yych <= 'n') {
- if (yych == 'i') goto yy693;
- goto yy187;
- } else {
- if (yych <= 'o') goto yy694;
- if (yych == 'u') goto yy695;
- goto yy187;
- }
- }
-yy127:
- YYDEBUG(127, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'O') {
- if (yych <= 'K') {
- if (yych == 'A') goto yy658;
- goto yy187;
- } else {
- if (yych <= 'L') goto yy659;
- if (yych <= 'N') goto yy187;
- goto yy660;
- }
- } else {
- if (yych <= 'k') {
- if (yych == 'a') goto yy658;
- goto yy187;
- } else {
- if (yych <= 'l') goto yy659;
- if (yych == 'o') goto yy660;
- goto yy187;
- }
- }
-yy128:
- YYDEBUG(128, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy640;
- if (yych == 'e') goto yy640;
- goto yy187;
-yy129:
- YYDEBUG(129, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy635;
- if (yych == 'i') goto yy635;
- goto yy187;
-yy130:
- YYDEBUG(130, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'R') {
- if (yych == 'H') goto yy623;
- if (yych <= 'Q') goto yy187;
- goto yy624;
- } else {
- if (yych <= 'h') {
- if (yych <= 'g') goto yy187;
- goto yy623;
- } else {
- if (yych == 'r') goto yy624;
- goto yy187;
- }
- }
-yy131:
- YYDEBUG(131, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'S') {
- if (yych <= 'L') {
- if (yych == 'F') goto yy570;
- goto yy187;
- } else {
- if (yych <= 'M') goto yy572;
- if (yych <= 'N') goto yy573;
- if (yych <= 'R') goto yy187;
- goto yy574;
- }
- } else {
- if (yych <= 'm') {
- if (yych == 'f') goto yy570;
- if (yych <= 'l') goto yy187;
- goto yy572;
- } else {
- if (yych <= 'n') goto yy573;
- if (yych == 's') goto yy574;
- goto yy187;
- }
- }
-yy132:
- YYDEBUG(132, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'H') goto yy565;
- if (yych == 'h') goto yy565;
- goto yy187;
-yy133:
- YYDEBUG(133, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'S') {
- if (yych <= 'M') {
- if (yych == 'B') goto yy547;
- goto yy187;
- } else {
- if (yych <= 'N') goto yy548;
- if (yych <= 'Q') goto yy187;
- if (yych <= 'R') goto yy549;
- goto yy550;
- }
- } else {
- if (yych <= 'n') {
- if (yych == 'b') goto yy547;
- if (yych <= 'm') goto yy187;
- goto yy548;
- } else {
- if (yych <= 'q') goto yy187;
- if (yych <= 'r') goto yy549;
- if (yych <= 's') goto yy550;
- goto yy187;
- }
- }
-yy134:
- YYDEBUG(134, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'W') {
- if (yych == 'T') goto yy535;
- if (yych <= 'V') goto yy187;
- goto yy536;
- } else {
- if (yych <= 't') {
- if (yych <= 's') goto yy187;
- goto yy535;
- } else {
- if (yych == 'w') goto yy536;
- goto yy187;
- }
- }
-yy135:
- YYDEBUG(135, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= ';') {
- if (yych <= '"') {
- if (yych <= '!') goto yy187;
- goto yy527;
- } else {
- if (yych == '\'') goto yy528;
- goto yy187;
- }
- } else {
- if (yych <= 'R') {
- if (yych <= '<') goto yy526;
- if (yych <= 'Q') goto yy187;
- goto yy529;
- } else {
- if (yych == 'r') goto yy529;
- goto yy187;
- }
- }
-yy136:
- YYDEBUG(136, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'O') {
- if (yych == 'L') goto yy516;
- if (yych <= 'N') goto yy187;
- goto yy517;
- } else {
- if (yych <= 'l') {
- if (yych <= 'k') goto yy187;
- goto yy516;
- } else {
- if (yych == 'o') goto yy517;
- goto yy187;
- }
- }
-yy137:
- YYDEBUG(137, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'U') {
- if (yych == 'R') goto yy492;
- if (yych <= 'T') goto yy187;
- goto yy493;
- } else {
- if (yych <= 'r') {
- if (yych <= 'q') goto yy187;
- goto yy492;
- } else {
- if (yych == 'u') goto yy493;
- goto yy187;
- }
- }
-yy138:
- YYDEBUG(138, *YYCURSOR);
- ++YYCURSOR;
- if ((yych = *YYCURSOR) <= '<') {
- if (yych == '-') goto yy488;
- } else {
- if (yych <= '=') goto yy486;
- if (yych <= '>') goto yy490;
- }
-yy139:
- YYDEBUG(139, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1454 "Zend/zend_language_scanner.l"
- {
- return yytext[0];
-}
-#line 2654 "Zend/zend_language_scanner.c"
-yy140:
- YYDEBUG(140, *YYCURSOR);
- ++YYCURSOR;
- yych = *YYCURSOR;
- goto yy485;
-yy141:
- YYDEBUG(141, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1185 "Zend/zend_language_scanner.l"
- {
- zendlval->value.str.val = yytext; /* no copying - intentional */
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
- HANDLE_NEWLINES(yytext, yyleng);
- return T_WHITESPACE;
-}
-#line 2671 "Zend/zend_language_scanner.c"
-yy142:
- YYDEBUG(142, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == ':') goto yy482;
- goto yy139;
-yy143:
- YYDEBUG(143, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(144, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1214 "Zend/zend_language_scanner.l"
- {
- return T_NS_SEPARATOR;
-}
-#line 2686 "Zend/zend_language_scanner.c"
-yy145:
- YYDEBUG(145, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'E') {
- if (yych == 'A') goto yy470;
- if (yych <= 'D') goto yy187;
- goto yy471;
- } else {
- if (yych <= 'a') {
- if (yych <= '`') goto yy187;
- goto yy470;
- } else {
- if (yych == 'e') goto yy471;
- goto yy187;
- }
- }
-yy146:
- YYDEBUG(146, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy467;
- if (yych == 'a') goto yy467;
- goto yy187;
-yy147:
- YYDEBUG(147, *YYCURSOR);
- yyaccept = 1;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= 'S') {
- if (yych <= 'D') {
- if (yych <= ' ') {
- if (yych == '\t') goto yy392;
- if (yych <= 0x1F) goto yy139;
- goto yy392;
- } else {
- if (yych <= '@') goto yy139;
- if (yych == 'C') goto yy139;
- goto yy392;
- }
- } else {
- if (yych <= 'I') {
- if (yych == 'F') goto yy392;
- if (yych <= 'H') goto yy139;
- goto yy392;
- } else {
- if (yych == 'O') goto yy392;
- if (yych <= 'Q') goto yy139;
- goto yy392;
- }
- }
- } else {
- if (yych <= 'f') {
- if (yych <= 'b') {
- if (yych == 'U') goto yy392;
- if (yych <= '`') goto yy139;
- goto yy392;
- } else {
- if (yych == 'd') goto yy392;
- if (yych <= 'e') goto yy139;
- goto yy392;
- }
- } else {
- if (yych <= 'o') {
- if (yych == 'i') goto yy392;
- if (yych <= 'n') goto yy139;
- goto yy392;
- } else {
- if (yych <= 's') {
- if (yych <= 'q') goto yy139;
- goto yy392;
- } else {
- if (yych == 'u') goto yy392;
- goto yy139;
- }
- }
- }
- }
-yy148:
- YYDEBUG(148, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'S') {
- if (yych == 'N') goto yy383;
- if (yych <= 'R') goto yy187;
- goto yy384;
- } else {
- if (yych <= 'n') {
- if (yych <= 'm') goto yy187;
- goto yy383;
- } else {
- if (yych == 's') goto yy384;
- goto yy187;
- }
- }
-yy149:
- YYDEBUG(149, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '_') goto yy301;
- goto yy187;
-yy150:
- YYDEBUG(150, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= '<') goto yy139;
- if (yych <= '=') goto yy295;
- if (yych <= '>') goto yy297;
- goto yy139;
-yy151:
- YYDEBUG(151, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy291;
- if (yych == 'i') goto yy291;
- goto yy187;
-yy152:
- YYDEBUG(152, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '+') goto yy289;
- if (yych == '=') goto yy287;
- goto yy139;
-yy153:
- YYDEBUG(153, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '=') goto yy284;
- goto yy139;
-yy154:
- YYDEBUG(154, *YYCURSOR);
- yyaccept = 1;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= ';') {
- if (yych == '/') goto yy256;
- goto yy139;
- } else {
- if (yych <= '<') goto yy254;
- if (yych <= '=') goto yy257;
- if (yych <= '>') goto yy259;
- goto yy139;
- }
-yy155:
- YYDEBUG(155, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= '<') goto yy139;
- if (yych <= '=') goto yy250;
- if (yych <= '>') goto yy248;
- goto yy139;
-yy156:
- YYDEBUG(156, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '=') goto yy246;
- goto yy139;
-yy157:
- YYDEBUG(157, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= '.') {
- if (yych == '*') goto yy238;
- goto yy139;
- } else {
- if (yych <= '/') goto yy240;
- if (yych == '=') goto yy241;
- goto yy139;
- }
-yy158:
- YYDEBUG(158, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= '/') goto yy139;
- if (yych <= '9') goto yy234;
- if (yych == '=') goto yy236;
- goto yy139;
-yy159:
- YYDEBUG(159, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= '<') goto yy139;
- if (yych <= '=') goto yy230;
- if (yych <= '>') goto yy228;
- goto yy139;
-yy160:
- YYDEBUG(160, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '&') goto yy224;
- if (yych == '=') goto yy226;
- goto yy139;
-yy161:
- YYDEBUG(161, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '=') goto yy222;
- if (yych == '|') goto yy220;
- goto yy139;
-yy162:
- YYDEBUG(162, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '=') goto yy218;
- goto yy139;
-yy163:
- YYDEBUG(163, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy216;
- if (yych == 'r') goto yy216;
- goto yy187;
-yy164:
- YYDEBUG(164, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy213;
- if (yych == 'o') goto yy213;
- goto yy187;
-yy165:
- YYDEBUG(165, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= '_') {
- if (yych <= '@') goto yy139;
- if (yych <= 'Z') goto yy210;
- if (yych <= '^') goto yy139;
- goto yy210;
- } else {
- if (yych <= '`') goto yy139;
- if (yych <= 'z') goto yy210;
- if (yych <= '~') goto yy139;
- goto yy210;
- }
-yy166:
- YYDEBUG(166, *YYCURSOR);
- yych = *++YYCURSOR;
- goto yy139;
-yy167:
- YYDEBUG(167, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '>') goto yy206;
- goto yy139;
-yy168:
- YYDEBUG(168, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(169, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1459 "Zend/zend_language_scanner.l"
- {
- yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
- return '{';
-}
-#line 2919 "Zend/zend_language_scanner.c"
-yy170:
- YYDEBUG(170, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(171, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1471 "Zend/zend_language_scanner.l"
- {
- RESET_DOC_COMMENT();
- if (!zend_stack_is_empty(&SCNG(state_stack))) {
- yy_pop_state(TSRMLS_C);
- }
- return '}';
-}
-#line 2933 "Zend/zend_language_scanner.c"
-yy172:
- YYDEBUG(172, *YYCURSOR);
- yyaccept = 2;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= 'E') {
- if (yych <= '9') {
- if (yych == '.') goto yy188;
- if (yych >= '0') goto yy191;
- } else {
- if (yych == 'B') goto yy199;
- if (yych >= 'E') goto yy193;
- }
- } else {
- if (yych <= 'b') {
- if (yych == 'X') goto yy198;
- if (yych >= 'b') goto yy199;
- } else {
- if (yych <= 'e') {
- if (yych >= 'e') goto yy193;
- } else {
- if (yych == 'x') goto yy198;
- }
- }
- }
-yy173:
- YYDEBUG(173, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1522 "Zend/zend_language_scanner.l"
- {
- if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */
- zendlval->value.lval = strtol(yytext, NULL, 0);
- } else {
- errno = 0;
- zendlval->value.lval = strtol(yytext, NULL, 0);
- if (errno == ERANGE) { /* Overflow */
- if (yytext[0] == '0') { /* octal overflow */
- zendlval->value.dval = zend_oct_strtod(yytext, NULL);
- } else {
- zendlval->value.dval = zend_strtod(yytext, NULL);
- }
- zendlval->type = IS_DOUBLE;
- return T_DNUMBER;
- }
- }
-
- zendlval->type = IS_LONG;
- return T_LNUMBER;
-}
-#line 2982 "Zend/zend_language_scanner.c"
-yy174:
- YYDEBUG(174, *YYCURSOR);
- yyaccept = 2;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '9') {
- if (yych == '.') goto yy188;
- if (yych <= '/') goto yy173;
- goto yy191;
- } else {
- if (yych <= 'E') {
- if (yych <= 'D') goto yy173;
- goto yy193;
- } else {
- if (yych == 'e') goto yy193;
- goto yy173;
- }
- }
-yy175:
- YYDEBUG(175, *YYCURSOR);
- yych = *++YYCURSOR;
- goto yy187;
-yy176:
- YYDEBUG(176, *YYCURSOR);
- ++YYCURSOR;
-yy177:
- YYDEBUG(177, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1919 "Zend/zend_language_scanner.l"
- {
- while (YYCURSOR < YYLIMIT) {
- switch (*YYCURSOR++) {
- case '\r':
- if (*YYCURSOR == '\n') {
- YYCURSOR++;
- }
- /* fall through */
- case '\n':
- CG(zend_lineno)++;
- break;
- case '%':
- if (!CG(asp_tags)) {
- continue;
- }
- /* fall through */
- case '?':
- if (*YYCURSOR == '>') {
- YYCURSOR--;
- break;
- }
- /* fall through */
- default:
- continue;
- }
-
- break;
- }
-
- yyleng = YYCURSOR - SCNG(yy_text);
-
- return T_COMMENT;
-}
-#line 3044 "Zend/zend_language_scanner.c"
-yy178:
- YYDEBUG(178, *YYCURSOR);
- ++YYCURSOR;
-yy179:
- YYDEBUG(179, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 2010 "Zend/zend_language_scanner.l"
- {
- register char *s, *t;
- char *end;
- int bprefix = (yytext[0] != '\'') ? 1 : 0;
-
- while (1) {
- if (YYCURSOR < YYLIMIT) {
- if (*YYCURSOR == '\'') {
- YYCURSOR++;
- yyleng = YYCURSOR - SCNG(yy_text);
-
- break;
- } else if (*YYCURSOR++ == '\\' && YYCURSOR < YYLIMIT) {
- YYCURSOR++;
- }
- } else {
- yyleng = YYLIMIT - SCNG(yy_text);
-
- /* Unclosed single quotes; treat similar to double quotes, but without a separate token
- * for ' (unrecognized by parser), instead of old flex fallback to "Unexpected character..."
- * rule, which continued in ST_IN_SCRIPTING state after the quote */
- return T_ENCAPSED_AND_WHITESPACE;
- }
- }
-
- zendlval->value.str.val = estrndup(yytext+bprefix+1, yyleng-bprefix-2);
- zendlval->value.str.len = yyleng-bprefix-2;
- zendlval->type = IS_STRING;
-
- /* convert escape sequences */
- s = t = zendlval->value.str.val;
- end = s+zendlval->value.str.len;
- while (s<end) {
- if (*s=='\\') {
- s++;
-
- switch(*s) {
- case '\\':
- case '\'':
- *t++ = *s;
- zendlval->value.str.len--;
- break;
- default:
- *t++ = '\\';
- *t++ = *s;
- break;
- }
- } else {
- *t++ = *s;
- }
-
- if (*s == '\n' || (*s == '\r' && (*(s+1) != '\n'))) {
- CG(zend_lineno)++;
- }
- s++;
- }
- *t = 0;
-
- if (SCNG(output_filter)) {
- size_t sz = 0;
- s = zendlval->value.str.val;
- SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)s, (size_t)zendlval->value.str.len TSRMLS_CC);
- zendlval->value.str.len = sz;
- efree(s);
- }
- return T_CONSTANT_ENCAPSED_STRING;
-}
-#line 3119 "Zend/zend_language_scanner.c"
-yy180:
- YYDEBUG(180, *YYCURSOR);
- ++YYCURSOR;
-yy181:
- YYDEBUG(181, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 2079 "Zend/zend_language_scanner.l"
- {
- int bprefix = (yytext[0] != '"') ? 1 : 0;
-
- while (YYCURSOR < YYLIMIT) {
- switch (*YYCURSOR++) {
- case '"':
- yyleng = YYCURSOR - SCNG(yy_text);
- zend_scan_escape_string(zendlval, yytext+bprefix+1, yyleng-bprefix-2, '"' TSRMLS_CC);
- return T_CONSTANT_ENCAPSED_STRING;
- case '$':
- if (IS_LABEL_START(*YYCURSOR) || *YYCURSOR == '{') {
- break;
- }
- continue;
- case '{':
- if (*YYCURSOR == '$') {
- break;
- }
- continue;
- case '\\':
- if (YYCURSOR < YYLIMIT) {
- YYCURSOR++;
- }
- /* fall through */
- default:
- continue;
- }
-
- YYCURSOR--;
- break;
- }
-
- /* Remember how much was scanned to save rescanning */
- SET_DOUBLE_QUOTES_SCANNED_LENGTH(YYCURSOR - SCNG(yy_text) - yyleng);
-
- YYCURSOR = SCNG(yy_text) + yyleng;
-
- BEGIN(ST_DOUBLE_QUOTES);
- return '"';
-}
-#line 3167 "Zend/zend_language_scanner.c"
-yy182:
- YYDEBUG(182, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(183, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 2169 "Zend/zend_language_scanner.l"
- {
- BEGIN(ST_BACKQUOTE);
- return '`';
-}
-#line 3178 "Zend/zend_language_scanner.c"
-yy184:
- YYDEBUG(184, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(185, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 2432 "Zend/zend_language_scanner.l"
- {
- if (YYCURSOR > YYLIMIT) {
- return 0;
- }
-
- zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
- goto restart;
-}
-#line 3193 "Zend/zend_language_scanner.c"
-yy186:
- YYDEBUG(186, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
-yy187:
- YYDEBUG(187, *YYCURSOR);
- if (yybm[0+yych] & 4) {
- goto yy186;
- }
- goto yy124;
-yy188:
- YYDEBUG(188, *YYCURSOR);
- yyaccept = 3;
- YYMARKER = ++YYCURSOR;
- YYFILL(3);
- yych = *YYCURSOR;
- YYDEBUG(189, *YYCURSOR);
- if (yybm[0+yych] & 8) {
- goto yy188;
- }
- if (yych == 'E') goto yy193;
- if (yych == 'e') goto yy193;
-yy190:
- YYDEBUG(190, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1587 "Zend/zend_language_scanner.l"
- {
- zendlval->value.dval = zend_strtod(yytext, NULL);
- zendlval->type = IS_DOUBLE;
- return T_DNUMBER;
-}
-#line 3226 "Zend/zend_language_scanner.c"
-yy191:
- YYDEBUG(191, *YYCURSOR);
- yyaccept = 2;
- YYMARKER = ++YYCURSOR;
- YYFILL(3);
- yych = *YYCURSOR;
- YYDEBUG(192, *YYCURSOR);
- if (yych <= '9') {
- if (yych == '.') goto yy188;
- if (yych <= '/') goto yy173;
- goto yy191;
- } else {
- if (yych <= 'E') {
- if (yych <= 'D') goto yy173;
- } else {
- if (yych != 'e') goto yy173;
- }
- }
-yy193:
- YYDEBUG(193, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= ',') {
- if (yych == '+') goto yy195;
- } else {
- if (yych <= '-') goto yy195;
- if (yych <= '/') goto yy194;
- if (yych <= '9') goto yy196;
- }
-yy194:
- YYDEBUG(194, *YYCURSOR);
- YYCURSOR = YYMARKER;
- if (yyaccept <= 2) {
- if (yyaccept <= 1) {
- if (yyaccept <= 0) {
- goto yy124;
- } else {
- goto yy139;
- }
- } else {
- goto yy173;
- }
- } else {
- if (yyaccept <= 4) {
- if (yyaccept <= 3) {
- goto yy190;
- } else {
- goto yy239;
- }
- } else {
- goto yy255;
- }
- }
-yy195:
- YYDEBUG(195, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= '/') goto yy194;
- if (yych >= ':') goto yy194;
-yy196:
- YYDEBUG(196, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(197, *YYCURSOR);
- if (yych <= '/') goto yy190;
- if (yych <= '9') goto yy196;
- goto yy190;
-yy198:
- YYDEBUG(198, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yybm[0+yych] & 32) {
- goto yy203;
- }
- goto yy194;
-yy199:
- YYDEBUG(199, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yybm[0+yych] & 16) {
- goto yy200;
- }
- goto yy194;
-yy200:
- YYDEBUG(200, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(201, *YYCURSOR);
- if (yybm[0+yych] & 16) {
- goto yy200;
- }
- YYDEBUG(202, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1497 "Zend/zend_language_scanner.l"
- {
- char *bin = yytext + 2; /* Skip "0b" */
- int len = yyleng - 2;
-
- /* Skip any leading 0s */
- while (*bin == '0') {
- ++bin;
- --len;
- }
-
- if (len < SIZEOF_LONG * 8) {
- if (len == 0) {
- zendlval->value.lval = 0;
- } else {
- zendlval->value.lval = strtol(bin, NULL, 2);
- }
- zendlval->type = IS_LONG;
- return T_LNUMBER;
- } else {
- zendlval->value.dval = zend_bin_strtod(bin, NULL);
- zendlval->type = IS_DOUBLE;
- return T_DNUMBER;
- }
-}
-#line 3343 "Zend/zend_language_scanner.c"
-yy203:
- YYDEBUG(203, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(204, *YYCURSOR);
- if (yybm[0+yych] & 32) {
- goto yy203;
- }
- YYDEBUG(205, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1543 "Zend/zend_language_scanner.l"
- {
- char *hex = yytext + 2; /* Skip "0x" */
- int len = yyleng - 2;
-
- /* Skip any leading 0s */
- while (*hex == '0') {
- hex++;
- len--;
- }
-
- if (len < SIZEOF_LONG * 2 || (len == SIZEOF_LONG * 2 && *hex <= '7')) {
- if (len == 0) {
- zendlval->value.lval = 0;
- } else {
- zendlval->value.lval = strtol(hex, NULL, 16);
- }
- zendlval->type = IS_LONG;
- return T_LNUMBER;
- } else {
- zendlval->value.dval = zend_hex_strtod(hex, NULL);
- zendlval->type = IS_DOUBLE;
- return T_DNUMBER;
- }
-}
-#line 3380 "Zend/zend_language_scanner.c"
-yy206:
- YYDEBUG(206, *YYCURSOR);
- ++YYCURSOR;
- if ((yych = *YYCURSOR) == '\n') goto yy208;
- if (yych == '\r') goto yy209;
-yy207:
- YYDEBUG(207, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1987 "Zend/zend_language_scanner.l"
- {
- zendlval->value.str.val = yytext; /* no copying - intentional */
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
- BEGIN(INITIAL);
- return T_CLOSE_TAG; /* implicit ';' at php-end tag */
-}
-#line 3397 "Zend/zend_language_scanner.c"
-yy208:
- YYDEBUG(208, *YYCURSOR);
- yych = *++YYCURSOR;
- goto yy207;
-yy209:
- YYDEBUG(209, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '\n') goto yy208;
- goto yy207;
-yy210:
- YYDEBUG(210, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(211, *YYCURSOR);
- if (yych <= '^') {
- if (yych <= '9') {
- if (yych >= '0') goto yy210;
- } else {
- if (yych <= '@') goto yy212;
- if (yych <= 'Z') goto yy210;
- }
- } else {
- if (yych <= '`') {
- if (yych <= '_') goto yy210;
- } else {
- if (yych <= 'z') goto yy210;
- if (yych >= 0x7F) goto yy210;
- }
- }
-yy212:
- YYDEBUG(212, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1889 "Zend/zend_language_scanner.l"
- {
- zend_copy_value(zendlval, (yytext+1), (yyleng-1));
- zendlval->type = IS_STRING;
- return T_VARIABLE;
-}
-#line 3437 "Zend/zend_language_scanner.c"
-yy213:
- YYDEBUG(213, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy214;
- if (yych != 'r') goto yy187;
-yy214:
- YYDEBUG(214, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(215, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1442 "Zend/zend_language_scanner.l"
- {
- return T_LOGICAL_XOR;
-}
-#line 3455 "Zend/zend_language_scanner.c"
-yy216:
- YYDEBUG(216, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(217, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1434 "Zend/zend_language_scanner.l"
- {
- return T_LOGICAL_OR;
-}
-#line 3468 "Zend/zend_language_scanner.c"
-yy218:
- YYDEBUG(218, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(219, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1422 "Zend/zend_language_scanner.l"
- {
- return T_XOR_EQUAL;
-}
-#line 3478 "Zend/zend_language_scanner.c"
-yy220:
- YYDEBUG(220, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(221, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1426 "Zend/zend_language_scanner.l"
- {
- return T_BOOLEAN_OR;
-}
-#line 3488 "Zend/zend_language_scanner.c"
-yy222:
- YYDEBUG(222, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(223, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1418 "Zend/zend_language_scanner.l"
- {
- return T_OR_EQUAL;
-}
-#line 3498 "Zend/zend_language_scanner.c"
-yy224:
- YYDEBUG(224, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(225, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1430 "Zend/zend_language_scanner.l"
- {
- return T_BOOLEAN_AND;
-}
-#line 3508 "Zend/zend_language_scanner.c"
-yy226:
- YYDEBUG(226, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(227, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1414 "Zend/zend_language_scanner.l"
- {
- return T_AND_EQUAL;
-}
-#line 3518 "Zend/zend_language_scanner.c"
-yy228:
- YYDEBUG(228, *YYCURSOR);
- ++YYCURSOR;
- if ((yych = *YYCURSOR) == '\n') goto yy232;
- if (yych == '\r') goto yy233;
-yy229:
- YYDEBUG(229, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1996 "Zend/zend_language_scanner.l"
- {
- if (CG(asp_tags)) {
- BEGIN(INITIAL);
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
- zendlval->value.str.val = yytext; /* no copying - intentional */
- return T_CLOSE_TAG; /* implicit ';' at php-end tag */
- } else {
- yyless(1);
- return yytext[0];
- }
-}
-#line 3540 "Zend/zend_language_scanner.c"
-yy230:
- YYDEBUG(230, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(231, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1402 "Zend/zend_language_scanner.l"
- {
- return T_MOD_EQUAL;
-}
-#line 3550 "Zend/zend_language_scanner.c"
-yy232:
- YYDEBUG(232, *YYCURSOR);
- yych = *++YYCURSOR;
- goto yy229;
-yy233:
- YYDEBUG(233, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '\n') goto yy232;
- goto yy229;
-yy234:
- YYDEBUG(234, *YYCURSOR);
- yyaccept = 3;
- YYMARKER = ++YYCURSOR;
- YYFILL(3);
- yych = *YYCURSOR;
- YYDEBUG(235, *YYCURSOR);
- if (yych <= 'D') {
- if (yych <= '/') goto yy190;
- if (yych <= '9') goto yy234;
- goto yy190;
- } else {
- if (yych <= 'E') goto yy193;
- if (yych == 'e') goto yy193;
- goto yy190;
- }
-yy236:
- YYDEBUG(236, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(237, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1398 "Zend/zend_language_scanner.l"
- {
- return T_CONCAT_EQUAL;
-}
-#line 3585 "Zend/zend_language_scanner.c"
-yy238:
- YYDEBUG(238, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == '*') goto yy243;
-yy239:
- YYDEBUG(239, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1953 "Zend/zend_language_scanner.l"
- {
- int doc_com;
-
- if (yyleng > 2) {
- doc_com = 1;
- RESET_DOC_COMMENT();
- } else {
- doc_com = 0;
- }
-
- while (YYCURSOR < YYLIMIT) {
- if (*YYCURSOR++ == '*' && *YYCURSOR == '/') {
- break;
- }
- }
-
- if (YYCURSOR < YYLIMIT) {
- YYCURSOR++;
- } else {
- zend_error(E_COMPILE_WARNING, "Unterminated comment starting line %d", CG(zend_lineno));
- }
-
- yyleng = YYCURSOR - SCNG(yy_text);
- HANDLE_NEWLINES(yytext, yyleng);
-
- if (doc_com) {
- CG(doc_comment) = estrndup(yytext, yyleng);
- CG(doc_comment_len) = yyleng;
- return T_DOC_COMMENT;
- }
-
- return T_COMMENT;
-}
-#line 3628 "Zend/zend_language_scanner.c"
-yy240:
- YYDEBUG(240, *YYCURSOR);
- yych = *++YYCURSOR;
- goto yy177;
-yy241:
- YYDEBUG(241, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(242, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1394 "Zend/zend_language_scanner.l"
- {
- return T_DIV_EQUAL;
-}
-#line 3642 "Zend/zend_language_scanner.c"
-yy243:
- YYDEBUG(243, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yybm[0+yych] & 64) {
- goto yy244;
- }
- goto yy194;
-yy244:
- YYDEBUG(244, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(245, *YYCURSOR);
- if (yybm[0+yych] & 64) {
- goto yy244;
- }
- goto yy239;
-yy246:
- YYDEBUG(246, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(247, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1390 "Zend/zend_language_scanner.l"
- {
- return T_MUL_EQUAL;
-}
-#line 3669 "Zend/zend_language_scanner.c"
-yy248:
- YYDEBUG(248, *YYCURSOR);
- ++YYCURSOR;
- if ((yych = *YYCURSOR) == '=') goto yy252;
- YYDEBUG(249, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1450 "Zend/zend_language_scanner.l"
- {
- return T_SR;
-}
-#line 3680 "Zend/zend_language_scanner.c"
-yy250:
- YYDEBUG(250, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(251, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1378 "Zend/zend_language_scanner.l"
- {
- return T_IS_GREATER_OR_EQUAL;
-}
-#line 3690 "Zend/zend_language_scanner.c"
-yy252:
- YYDEBUG(252, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(253, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1410 "Zend/zend_language_scanner.l"
- {
- return T_SR_EQUAL;
-}
-#line 3700 "Zend/zend_language_scanner.c"
-yy254:
- YYDEBUG(254, *YYCURSOR);
- yyaccept = 5;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= ';') goto yy255;
- if (yych <= '<') goto yy270;
- if (yych <= '=') goto yy268;
-yy255:
- YYDEBUG(255, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1446 "Zend/zend_language_scanner.l"
- {
- return T_SL;
-}
-#line 3715 "Zend/zend_language_scanner.c"
-yy256:
- YYDEBUG(256, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'S') goto yy261;
- if (yych == 's') goto yy261;
- goto yy194;
-yy257:
- YYDEBUG(257, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(258, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1374 "Zend/zend_language_scanner.l"
- {
- return T_IS_SMALLER_OR_EQUAL;
-}
-#line 3731 "Zend/zend_language_scanner.c"
-yy259:
- YYDEBUG(259, *YYCURSOR);
- ++YYCURSOR;
-yy260:
- YYDEBUG(260, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1370 "Zend/zend_language_scanner.l"
- {
- return T_IS_NOT_EQUAL;
-}
-#line 3742 "Zend/zend_language_scanner.c"
-yy261:
- YYDEBUG(261, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy262;
- if (yych != 'c') goto yy194;
-yy262:
- YYDEBUG(262, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy263;
- if (yych != 'r') goto yy194;
-yy263:
- YYDEBUG(263, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy264;
- if (yych != 'i') goto yy194;
-yy264:
- YYDEBUG(264, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'P') goto yy265;
- if (yych != 'p') goto yy194;
-yy265:
- YYDEBUG(265, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy266;
- if (yych != 't') goto yy194;
-yy266:
- YYDEBUG(266, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(3);
- yych = *YYCURSOR;
- YYDEBUG(267, *YYCURSOR);
- if (yych <= '\r') {
- if (yych <= 0x08) goto yy194;
- if (yych <= '\n') goto yy266;
- if (yych <= '\f') goto yy194;
- goto yy266;
- } else {
- if (yych <= ' ') {
- if (yych <= 0x1F) goto yy194;
- goto yy266;
- } else {
- if (yych == '>') goto yy206;
- goto yy194;
- }
- }
-yy268:
- YYDEBUG(268, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(269, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1406 "Zend/zend_language_scanner.l"
- {
- return T_SL_EQUAL;
-}
-#line 3797 "Zend/zend_language_scanner.c"
-yy270:
- YYDEBUG(270, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(2);
- yych = *YYCURSOR;
- YYDEBUG(271, *YYCURSOR);
- if (yybm[0+yych] & 128) {
- goto yy270;
- }
- if (yych <= 'Z') {
- if (yych <= '&') {
- if (yych == '"') goto yy275;
- goto yy194;
- } else {
- if (yych <= '\'') goto yy274;
- if (yych <= '@') goto yy194;
- }
- } else {
- if (yych <= '`') {
- if (yych != '_') goto yy194;
- } else {
- if (yych <= 'z') goto yy272;
- if (yych <= '~') goto yy194;
- }
- }
-yy272:
- YYDEBUG(272, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(2);
- yych = *YYCURSOR;
- YYDEBUG(273, *YYCURSOR);
- if (yych <= '@') {
- if (yych <= '\f') {
- if (yych == '\n') goto yy279;
- goto yy194;
- } else {
- if (yych <= '\r') goto yy281;
- if (yych <= '/') goto yy194;
- if (yych <= '9') goto yy272;
- goto yy194;
- }
- } else {
- if (yych <= '_') {
- if (yych <= 'Z') goto yy272;
- if (yych <= '^') goto yy194;
- goto yy272;
- } else {
- if (yych <= '`') goto yy194;
- if (yych <= 'z') goto yy272;
- if (yych <= '~') goto yy194;
- goto yy272;
- }
- }
-yy274:
- YYDEBUG(274, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '\'') goto yy194;
- if (yych <= '/') goto yy283;
- if (yych <= '9') goto yy194;
- goto yy283;
-yy275:
- YYDEBUG(275, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '"') goto yy194;
- if (yych <= '/') goto yy277;
- if (yych <= '9') goto yy194;
- goto yy277;
-yy276:
- YYDEBUG(276, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(3);
- yych = *YYCURSOR;
-yy277:
- YYDEBUG(277, *YYCURSOR);
- if (yych <= 'Z') {
- if (yych <= '/') {
- if (yych != '"') goto yy194;
- } else {
- if (yych <= '9') goto yy276;
- if (yych <= '@') goto yy194;
- goto yy276;
- }
- } else {
- if (yych <= '`') {
- if (yych == '_') goto yy276;
- goto yy194;
- } else {
- if (yych <= 'z') goto yy276;
- if (yych <= '~') goto yy194;
- goto yy276;
- }
- }
-yy278:
- YYDEBUG(278, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '\n') goto yy279;
- if (yych == '\r') goto yy281;
- goto yy194;
-yy279:
- YYDEBUG(279, *YYCURSOR);
- ++YYCURSOR;
-yy280:
- YYDEBUG(280, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 2121 "Zend/zend_language_scanner.l"
- {
- char *s;
- int bprefix = (yytext[0] != '<') ? 1 : 0;
- zend_heredoc_label *heredoc_label = emalloc(sizeof(zend_heredoc_label));
-
- CG(zend_lineno)++;
- heredoc_label->length = yyleng-bprefix-3-1-(yytext[yyleng-2]=='\r'?1:0);
- s = yytext+bprefix+3;
- while ((*s == ' ') || (*s == '\t')) {
- s++;
- heredoc_label->length--;
- }
-
- if (*s == '\'') {
- s++;
- heredoc_label->length -= 2;
-
- BEGIN(ST_NOWDOC);
- } else {
- if (*s == '"') {
- s++;
- heredoc_label->length -= 2;
- }
-
- BEGIN(ST_HEREDOC);
- }
-
- heredoc_label->label = estrndup(s, heredoc_label->length);
-
- /* Check for ending label on the next line */
- if (heredoc_label->length < YYLIMIT - YYCURSOR && !memcmp(YYCURSOR, s, heredoc_label->length)) {
- YYCTYPE *end = YYCURSOR + heredoc_label->length;
-
- if (*end == ';') {
- end++;
- }
-
- if (*end == '\n' || *end == '\r') {
- BEGIN(ST_END_HEREDOC);
- }
- }
-
- zend_ptr_stack_push(&SCNG(heredoc_label_stack), (void *) heredoc_label);
-
- return T_START_HEREDOC;
-}
-#line 3949 "Zend/zend_language_scanner.c"
-yy281:
- YYDEBUG(281, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '\n') goto yy279;
- goto yy280;
-yy282:
- YYDEBUG(282, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(3);
- yych = *YYCURSOR;
-yy283:
- YYDEBUG(283, *YYCURSOR);
- if (yych <= 'Z') {
- if (yych <= '/') {
- if (yych == '\'') goto yy278;
- goto yy194;
- } else {
- if (yych <= '9') goto yy282;
- if (yych <= '@') goto yy194;
- goto yy282;
- }
- } else {
- if (yych <= '`') {
- if (yych == '_') goto yy282;
- goto yy194;
- } else {
- if (yych <= 'z') goto yy282;
- if (yych <= '~') goto yy194;
- goto yy282;
- }
- }
-yy284:
- YYDEBUG(284, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych != '=') goto yy260;
- YYDEBUG(285, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(286, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1362 "Zend/zend_language_scanner.l"
- {
- return T_IS_NOT_IDENTICAL;
-}
-#line 3993 "Zend/zend_language_scanner.c"
-yy287:
- YYDEBUG(287, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(288, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1382 "Zend/zend_language_scanner.l"
- {
- return T_PLUS_EQUAL;
-}
-#line 4003 "Zend/zend_language_scanner.c"
-yy289:
- YYDEBUG(289, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(290, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1350 "Zend/zend_language_scanner.l"
- {
- return T_INC;
-}
-#line 4013 "Zend/zend_language_scanner.c"
-yy291:
- YYDEBUG(291, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'S') goto yy292;
- if (yych != 's') goto yy187;
-yy292:
- YYDEBUG(292, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy293;
- if (yych != 't') goto yy187;
-yy293:
- YYDEBUG(293, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(294, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1338 "Zend/zend_language_scanner.l"
- {
- return T_LIST;
-}
-#line 4036 "Zend/zend_language_scanner.c"
-yy295:
- YYDEBUG(295, *YYCURSOR);
- ++YYCURSOR;
- if ((yych = *YYCURSOR) == '=') goto yy299;
- YYDEBUG(296, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1366 "Zend/zend_language_scanner.l"
- {
- return T_IS_EQUAL;
-}
-#line 4047 "Zend/zend_language_scanner.c"
-yy297:
- YYDEBUG(297, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(298, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1334 "Zend/zend_language_scanner.l"
- {
- return T_DOUBLE_ARROW;
-}
-#line 4057 "Zend/zend_language_scanner.c"
-yy299:
- YYDEBUG(299, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(300, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1358 "Zend/zend_language_scanner.l"
- {
- return T_IS_IDENTICAL;
-}
-#line 4067 "Zend/zend_language_scanner.c"
-yy301:
- YYDEBUG(301, *YYCURSOR);
- yych = *++YYCURSOR;
- YYDEBUG(-1, yych);
- switch (yych) {
- case 'C':
- case 'c': goto yy303;
- case 'D':
- case 'd': goto yy308;
- case 'F':
- case 'f': goto yy305;
- case 'H':
- case 'h': goto yy302;
- case 'L':
- case 'l': goto yy307;
- case 'M':
- case 'm': goto yy306;
- case 'N':
- case 'n': goto yy309;
- case 'T':
- case 't': goto yy304;
- default: goto yy187;
- }
-yy302:
- YYDEBUG(302, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy370;
- if (yych == 'a') goto yy370;
- goto yy187;
-yy303:
- YYDEBUG(303, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy363;
- if (yych == 'l') goto yy363;
- goto yy187;
-yy304:
- YYDEBUG(304, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy356;
- if (yych == 'r') goto yy356;
- goto yy187;
-yy305:
- YYDEBUG(305, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'U') {
- if (yych == 'I') goto yy340;
- if (yych <= 'T') goto yy187;
- goto yy341;
- } else {
- if (yych <= 'i') {
- if (yych <= 'h') goto yy187;
- goto yy340;
- } else {
- if (yych == 'u') goto yy341;
- goto yy187;
- }
- }
-yy306:
- YYDEBUG(306, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy332;
- if (yych == 'e') goto yy332;
- goto yy187;
-yy307:
- YYDEBUG(307, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy326;
- if (yych == 'i') goto yy326;
- goto yy187;
-yy308:
- YYDEBUG(308, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy321;
- if (yych == 'i') goto yy321;
- goto yy187;
-yy309:
- YYDEBUG(309, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy310;
- if (yych != 'a') goto yy187;
-yy310:
- YYDEBUG(310, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'M') goto yy311;
- if (yych != 'm') goto yy187;
-yy311:
- YYDEBUG(311, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy312;
- if (yych != 'e') goto yy187;
-yy312:
- YYDEBUG(312, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'S') goto yy313;
- if (yych != 's') goto yy187;
-yy313:
- YYDEBUG(313, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'P') goto yy314;
- if (yych != 'p') goto yy187;
-yy314:
- YYDEBUG(314, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy315;
- if (yych != 'a') goto yy187;
-yy315:
- YYDEBUG(315, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy316;
- if (yych != 'c') goto yy187;
-yy316:
- YYDEBUG(316, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy317;
- if (yych != 'e') goto yy187;
-yy317:
- YYDEBUG(317, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych != '_') goto yy187;
- YYDEBUG(318, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych != '_') goto yy187;
- YYDEBUG(319, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(320, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1722 "Zend/zend_language_scanner.l"
- {
- if (CG(current_namespace)) {
- *zendlval = *CG(current_namespace);
- zval_copy_ctor(zendlval);
- } else {
- ZVAL_EMPTY_STRING(zendlval);
- }
- return T_NS_C;
-}
-#line 4207 "Zend/zend_language_scanner.c"
-yy321:
- YYDEBUG(321, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy322;
- if (yych != 'r') goto yy187;
-yy322:
- YYDEBUG(322, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych != '_') goto yy187;
- YYDEBUG(323, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych != '_') goto yy187;
- YYDEBUG(324, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(325, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1695 "Zend/zend_language_scanner.l"
- {
- char *filename = zend_get_compiled_filename(TSRMLS_C);
- const size_t filename_len = strlen(filename);
- char *dirname;
-
- if (!filename) {
- filename = "";
- }
-
- dirname = estrndup(filename, filename_len);
- zend_dirname(dirname, filename_len);
-
- if (strcmp(dirname, ".") == 0) {
- dirname = erealloc(dirname, MAXPATHLEN);
-#if HAVE_GETCWD
- VCWD_GETCWD(dirname, MAXPATHLEN);
-#elif HAVE_GETWD
- VCWD_GETWD(dirname);
-#endif
- }
-
- zendlval->value.str.len = strlen(dirname);
- zendlval->value.str.val = dirname;
- zendlval->type = IS_STRING;
- return T_DIR;
-}
-#line 4254 "Zend/zend_language_scanner.c"
-yy326:
- YYDEBUG(326, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy327;
- if (yych != 'n') goto yy187;
-yy327:
- YYDEBUG(327, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy328;
- if (yych != 'e') goto yy187;
-yy328:
- YYDEBUG(328, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych != '_') goto yy187;
- YYDEBUG(329, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych != '_') goto yy187;
- YYDEBUG(330, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(331, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1677 "Zend/zend_language_scanner.l"
- {
- zendlval->value.lval = CG(zend_lineno);
- zendlval->type = IS_LONG;
- return T_LINE;
-}
-#line 4285 "Zend/zend_language_scanner.c"
-yy332:
- YYDEBUG(332, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy333;
- if (yych != 't') goto yy187;
-yy333:
- YYDEBUG(333, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'H') goto yy334;
- if (yych != 'h') goto yy187;
-yy334:
- YYDEBUG(334, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy335;
- if (yych != 'o') goto yy187;
-yy335:
- YYDEBUG(335, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'D') goto yy336;
- if (yych != 'd') goto yy187;
-yy336:
- YYDEBUG(336, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych != '_') goto yy187;
- YYDEBUG(337, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych != '_') goto yy187;
- YYDEBUG(338, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(339, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1656 "Zend/zend_language_scanner.l"
- {
- const char *class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL;
- const char *func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL;
- size_t len = 0;
-
- if (class_name) {
- len += strlen(class_name) + 2;
- }
- if (func_name) {
- len += strlen(func_name);
- }
-
- zendlval->value.str.len = zend_spprintf(&zendlval->value.str.val, 0, "%s%s%s",
- class_name ? class_name : "",
- class_name && func_name ? "::" : "",
- func_name ? func_name : ""
- );
- zendlval->type = IS_STRING;
- return T_METHOD_C;
-}
-#line 4341 "Zend/zend_language_scanner.c"
-yy340:
- YYDEBUG(340, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy351;
- if (yych == 'l') goto yy351;
- goto yy187;
-yy341:
- YYDEBUG(341, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy342;
- if (yych != 'n') goto yy187;
-yy342:
- YYDEBUG(342, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy343;
- if (yych != 'c') goto yy187;
-yy343:
- YYDEBUG(343, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy344;
- if (yych != 't') goto yy187;
-yy344:
- YYDEBUG(344, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy345;
- if (yych != 'i') goto yy187;
-yy345:
- YYDEBUG(345, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy346;
- if (yych != 'o') goto yy187;
-yy346:
- YYDEBUG(346, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy347;
- if (yych != 'n') goto yy187;
-yy347:
- YYDEBUG(347, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych != '_') goto yy187;
- YYDEBUG(348, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych != '_') goto yy187;
- YYDEBUG(349, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(350, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1640 "Zend/zend_language_scanner.l"
- {
- const char *func_name = NULL;
-
- if (CG(active_op_array)) {
- func_name = CG(active_op_array)->function_name;
- }
-
- if (!func_name) {
- func_name = "";
- }
- zendlval->value.str.len = strlen(func_name);
- zendlval->value.str.val = estrndup(func_name, zendlval->value.str.len);
- zendlval->type = IS_STRING;
- return T_FUNC_C;
-}
-#line 4408 "Zend/zend_language_scanner.c"
-yy351:
- YYDEBUG(351, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy352;
- if (yych != 'e') goto yy187;
-yy352:
- YYDEBUG(352, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych != '_') goto yy187;
- YYDEBUG(353, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych != '_') goto yy187;
- YYDEBUG(354, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(355, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1683 "Zend/zend_language_scanner.l"
- {
- char *filename = zend_get_compiled_filename(TSRMLS_C);
-
- if (!filename) {
- filename = "";
- }
- zendlval->value.str.len = strlen(filename);
- zendlval->value.str.val = estrndup(filename, zendlval->value.str.len);
- zendlval->type = IS_STRING;
- return T_FILE;
-}
-#line 4440 "Zend/zend_language_scanner.c"
-yy356:
- YYDEBUG(356, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy357;
- if (yych != 'a') goto yy187;
-yy357:
- YYDEBUG(357, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy358;
- if (yych != 'i') goto yy187;
-yy358:
- YYDEBUG(358, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy359;
- if (yych != 't') goto yy187;
-yy359:
- YYDEBUG(359, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych != '_') goto yy187;
- YYDEBUG(360, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych != '_') goto yy187;
- YYDEBUG(361, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(362, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1620 "Zend/zend_language_scanner.l"
- {
- const char *trait_name = NULL;
-
- if (CG(active_class_entry)
- && (ZEND_ACC_TRAIT ==
- (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT))) {
- trait_name = CG(active_class_entry)->name;
- }
-
- if (!trait_name) {
- trait_name = "";
- }
-
- zendlval->value.str.len = strlen(trait_name);
- zendlval->value.str.val = estrndup(trait_name, zendlval->value.str.len);
- zendlval->type = IS_STRING;
-
- return T_TRAIT_C;
-}
-#line 4490 "Zend/zend_language_scanner.c"
-yy363:
- YYDEBUG(363, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy364;
- if (yych != 'a') goto yy187;
-yy364:
- YYDEBUG(364, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'S') goto yy365;
- if (yych != 's') goto yy187;
-yy365:
- YYDEBUG(365, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'S') goto yy366;
- if (yych != 's') goto yy187;
-yy366:
- YYDEBUG(366, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych != '_') goto yy187;
- YYDEBUG(367, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych != '_') goto yy187;
- YYDEBUG(368, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(369, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1593 "Zend/zend_language_scanner.l"
- {
- const char *class_name = NULL;
-
- if (CG(active_class_entry)
- && (ZEND_ACC_TRAIT ==
- (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT))) {
- /* We create a special __CLASS__ constant that is going to be resolved
- at run-time */
- zendlval->value.str.len = sizeof("__CLASS__")-1;
- zendlval->value.str.val = estrndup("__CLASS__", zendlval->value.str.len);
- zendlval->type = IS_CONSTANT;
- } else {
- if (CG(active_class_entry)) {
- class_name = CG(active_class_entry)->name;
- }
-
- if (!class_name) {
- class_name = "";
- }
-
- zendlval->value.str.len = strlen(class_name);
- zendlval->value.str.val = estrndup(class_name, zendlval->value.str.len);
- zendlval->type = IS_STRING;
- }
- return T_CLASS_C;
-}
-#line 4547 "Zend/zend_language_scanner.c"
-yy370:
- YYDEBUG(370, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy371;
- if (yych != 'l') goto yy187;
-yy371:
- YYDEBUG(371, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy372;
- if (yych != 't') goto yy187;
-yy372:
- YYDEBUG(372, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych != '_') goto yy187;
- YYDEBUG(373, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy374;
- if (yych != 'c') goto yy187;
-yy374:
- YYDEBUG(374, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy375;
- if (yych != 'o') goto yy187;
-yy375:
- YYDEBUG(375, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'M') goto yy376;
- if (yych != 'm') goto yy187;
-yy376:
- YYDEBUG(376, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'P') goto yy377;
- if (yych != 'p') goto yy187;
-yy377:
- YYDEBUG(377, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy378;
- if (yych != 'i') goto yy187;
-yy378:
- YYDEBUG(378, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy379;
- if (yych != 'l') goto yy187;
-yy379:
- YYDEBUG(379, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy380;
- if (yych != 'e') goto yy187;
-yy380:
- YYDEBUG(380, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy381;
- if (yych != 'r') goto yy187;
-yy381:
- YYDEBUG(381, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(382, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1302 "Zend/zend_language_scanner.l"
- {
- return T_HALT_COMPILER;
-}
-#line 4613 "Zend/zend_language_scanner.c"
-yy383:
- YYDEBUG(383, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'S') goto yy387;
- if (yych == 's') goto yy387;
- goto yy187;
-yy384:
- YYDEBUG(384, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy385;
- if (yych != 'e') goto yy187;
-yy385:
- YYDEBUG(385, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(386, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1282 "Zend/zend_language_scanner.l"
- {
- return T_USE;
-}
-#line 4637 "Zend/zend_language_scanner.c"
-yy387:
- YYDEBUG(387, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy388;
- if (yych != 'e') goto yy187;
-yy388:
- YYDEBUG(388, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy389;
- if (yych != 't') goto yy187;
-yy389:
- YYDEBUG(389, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(390, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1330 "Zend/zend_language_scanner.l"
- {
- return T_UNSET;
-}
-#line 4660 "Zend/zend_language_scanner.c"
-yy391:
- YYDEBUG(391, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(7);
- yych = *YYCURSOR;
-yy392:
- YYDEBUG(392, *YYCURSOR);
- if (yych <= 'S') {
- if (yych <= 'D') {
- if (yych <= ' ') {
- if (yych == '\t') goto yy391;
- if (yych <= 0x1F) goto yy194;
- goto yy391;
- } else {
- if (yych <= 'A') {
- if (yych <= '@') goto yy194;
- goto yy396;
- } else {
- if (yych <= 'B') goto yy394;
- if (yych <= 'C') goto yy194;
- goto yy399;
- }
- }
- } else {
- if (yych <= 'I') {
- if (yych == 'F') goto yy400;
- if (yych <= 'H') goto yy194;
- goto yy401;
- } else {
- if (yych <= 'O') {
- if (yych <= 'N') goto yy194;
- goto yy395;
- } else {
- if (yych <= 'Q') goto yy194;
- if (yych <= 'R') goto yy398;
- goto yy397;
- }
- }
- }
- } else {
- if (yych <= 'f') {
- if (yych <= 'a') {
- if (yych == 'U') goto yy393;
- if (yych <= '`') goto yy194;
- goto yy396;
- } else {
- if (yych <= 'c') {
- if (yych <= 'b') goto yy394;
- goto yy194;
- } else {
- if (yych <= 'd') goto yy399;
- if (yych <= 'e') goto yy194;
- goto yy400;
- }
- }
- } else {
- if (yych <= 'q') {
- if (yych <= 'i') {
- if (yych <= 'h') goto yy194;
- goto yy401;
- } else {
- if (yych == 'o') goto yy395;
- goto yy194;
- }
- } else {
- if (yych <= 's') {
- if (yych <= 'r') goto yy398;
- goto yy397;
- } else {
- if (yych != 'u') goto yy194;
- }
- }
- }
- }
-yy393:
- YYDEBUG(393, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy460;
- if (yych == 'n') goto yy460;
- goto yy194;
-yy394:
- YYDEBUG(394, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'O') {
- if (yych == 'I') goto yy447;
- if (yych <= 'N') goto yy194;
- goto yy448;
- } else {
- if (yych <= 'i') {
- if (yych <= 'h') goto yy194;
- goto yy447;
- } else {
- if (yych == 'o') goto yy448;
- goto yy194;
- }
- }
-yy395:
- YYDEBUG(395, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'B') goto yy439;
- if (yych == 'b') goto yy439;
- goto yy194;
-yy396:
- YYDEBUG(396, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy432;
- if (yych == 'r') goto yy432;
- goto yy194;
-yy397:
- YYDEBUG(397, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy424;
- if (yych == 't') goto yy424;
- goto yy194;
-yy398:
- YYDEBUG(398, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy422;
- if (yych == 'e') goto yy422;
- goto yy194;
-yy399:
- YYDEBUG(399, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy418;
- if (yych == 'o') goto yy418;
- goto yy194;
-yy400:
- YYDEBUG(400, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy411;
- if (yych == 'l') goto yy411;
- goto yy194;
-yy401:
- YYDEBUG(401, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy402;
- if (yych != 'n') goto yy194;
-yy402:
- YYDEBUG(402, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy403;
- if (yych != 't') goto yy194;
-yy403:
- YYDEBUG(403, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy404;
- if (yych != 'e') goto yy406;
-yy404:
- YYDEBUG(404, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'G') goto yy409;
- if (yych == 'g') goto yy409;
- goto yy194;
-yy405:
- YYDEBUG(405, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
-yy406:
- YYDEBUG(406, *YYCURSOR);
- if (yych <= 0x1F) {
- if (yych == '\t') goto yy405;
- goto yy194;
- } else {
- if (yych <= ' ') goto yy405;
- if (yych != ')') goto yy194;
- }
- YYDEBUG(407, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(408, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1230 "Zend/zend_language_scanner.l"
- {
- return T_INT_CAST;
-}
-#line 4836 "Zend/zend_language_scanner.c"
-yy409:
- YYDEBUG(409, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy410;
- if (yych != 'e') goto yy194;
-yy410:
- YYDEBUG(410, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy405;
- if (yych == 'r') goto yy405;
- goto yy194;
-yy411:
- YYDEBUG(411, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy412;
- if (yych != 'o') goto yy194;
-yy412:
- YYDEBUG(412, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy413;
- if (yych != 'a') goto yy194;
-yy413:
- YYDEBUG(413, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy414;
- if (yych != 't') goto yy194;
-yy414:
- YYDEBUG(414, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(415, *YYCURSOR);
- if (yych <= 0x1F) {
- if (yych == '\t') goto yy414;
- goto yy194;
- } else {
- if (yych <= ' ') goto yy414;
- if (yych != ')') goto yy194;
- }
- YYDEBUG(416, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(417, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1234 "Zend/zend_language_scanner.l"
- {
- return T_DOUBLE_CAST;
-}
-#line 4884 "Zend/zend_language_scanner.c"
-yy418:
- YYDEBUG(418, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'U') goto yy419;
- if (yych != 'u') goto yy194;
-yy419:
- YYDEBUG(419, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'B') goto yy420;
- if (yych != 'b') goto yy194;
-yy420:
- YYDEBUG(420, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy421;
- if (yych != 'l') goto yy194;
-yy421:
- YYDEBUG(421, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy414;
- if (yych == 'e') goto yy414;
- goto yy194;
-yy422:
- YYDEBUG(422, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy423;
- if (yych != 'a') goto yy194;
-yy423:
- YYDEBUG(423, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy414;
- if (yych == 'l') goto yy414;
- goto yy194;
-yy424:
- YYDEBUG(424, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy425;
- if (yych != 'r') goto yy194;
-yy425:
- YYDEBUG(425, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy426;
- if (yych != 'i') goto yy194;
-yy426:
- YYDEBUG(426, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy427;
- if (yych != 'n') goto yy194;
-yy427:
- YYDEBUG(427, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'G') goto yy428;
- if (yych != 'g') goto yy194;
-yy428:
- YYDEBUG(428, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(429, *YYCURSOR);
- if (yych <= 0x1F) {
- if (yych == '\t') goto yy428;
- goto yy194;
- } else {
- if (yych <= ' ') goto yy428;
- if (yych != ')') goto yy194;
- }
- YYDEBUG(430, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(431, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1238 "Zend/zend_language_scanner.l"
- {
- return T_STRING_CAST;
-}
-#line 4958 "Zend/zend_language_scanner.c"
-yy432:
- YYDEBUG(432, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy433;
- if (yych != 'r') goto yy194;
-yy433:
- YYDEBUG(433, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy434;
- if (yych != 'a') goto yy194;
-yy434:
- YYDEBUG(434, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'Y') goto yy435;
- if (yych != 'y') goto yy194;
-yy435:
- YYDEBUG(435, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(436, *YYCURSOR);
- if (yych <= 0x1F) {
- if (yych == '\t') goto yy435;
- goto yy194;
- } else {
- if (yych <= ' ') goto yy435;
- if (yych != ')') goto yy194;
- }
- YYDEBUG(437, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(438, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1242 "Zend/zend_language_scanner.l"
- {
- return T_ARRAY_CAST;
-}
-#line 4995 "Zend/zend_language_scanner.c"
-yy439:
- YYDEBUG(439, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'J') goto yy440;
- if (yych != 'j') goto yy194;
-yy440:
- YYDEBUG(440, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy441;
- if (yych != 'e') goto yy194;
-yy441:
- YYDEBUG(441, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy442;
- if (yych != 'c') goto yy194;
-yy442:
- YYDEBUG(442, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy443;
- if (yych != 't') goto yy194;
-yy443:
- YYDEBUG(443, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(444, *YYCURSOR);
- if (yych <= 0x1F) {
- if (yych == '\t') goto yy443;
- goto yy194;
- } else {
- if (yych <= ' ') goto yy443;
- if (yych != ')') goto yy194;
- }
- YYDEBUG(445, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(446, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1246 "Zend/zend_language_scanner.l"
- {
- return T_OBJECT_CAST;
-}
-#line 5037 "Zend/zend_language_scanner.c"
-yy447:
- YYDEBUG(447, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy457;
- if (yych == 'n') goto yy457;
- goto yy194;
-yy448:
- YYDEBUG(448, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy449;
- if (yych != 'o') goto yy194;
-yy449:
- YYDEBUG(449, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy450;
- if (yych != 'l') goto yy194;
-yy450:
- YYDEBUG(450, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy455;
- if (yych == 'e') goto yy455;
- goto yy452;
-yy451:
- YYDEBUG(451, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
-yy452:
- YYDEBUG(452, *YYCURSOR);
- if (yych <= 0x1F) {
- if (yych == '\t') goto yy451;
- goto yy194;
- } else {
- if (yych <= ' ') goto yy451;
- if (yych != ')') goto yy194;
- }
- YYDEBUG(453, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(454, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1250 "Zend/zend_language_scanner.l"
- {
- return T_BOOL_CAST;
-}
-#line 5082 "Zend/zend_language_scanner.c"
-yy455:
- YYDEBUG(455, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy456;
- if (yych != 'a') goto yy194;
-yy456:
- YYDEBUG(456, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy451;
- if (yych == 'n') goto yy451;
- goto yy194;
-yy457:
- YYDEBUG(457, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy458;
- if (yych != 'a') goto yy194;
-yy458:
- YYDEBUG(458, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy459;
- if (yych != 'r') goto yy194;
-yy459:
- YYDEBUG(459, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'Y') goto yy428;
- if (yych == 'y') goto yy428;
- goto yy194;
-yy460:
- YYDEBUG(460, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'S') goto yy461;
- if (yych != 's') goto yy194;
-yy461:
- YYDEBUG(461, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy462;
- if (yych != 'e') goto yy194;
-yy462:
- YYDEBUG(462, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy463;
- if (yych != 't') goto yy194;
-yy463:
- YYDEBUG(463, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(464, *YYCURSOR);
- if (yych <= 0x1F) {
- if (yych == '\t') goto yy463;
- goto yy194;
- } else {
- if (yych <= ' ') goto yy463;
- if (yych != ')') goto yy194;
- }
- YYDEBUG(465, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(466, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1254 "Zend/zend_language_scanner.l"
- {
- return T_UNSET_CAST;
-}
-#line 5146 "Zend/zend_language_scanner.c"
-yy467:
- YYDEBUG(467, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy468;
- if (yych != 'r') goto yy187;
-yy468:
- YYDEBUG(468, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(469, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1226 "Zend/zend_language_scanner.l"
- {
- return T_VAR;
-}
-#line 5164 "Zend/zend_language_scanner.c"
-yy470:
- YYDEBUG(470, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'M') goto yy474;
- if (yych == 'm') goto yy474;
- goto yy187;
-yy471:
- YYDEBUG(471, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'W') goto yy472;
- if (yych != 'w') goto yy187;
-yy472:
- YYDEBUG(472, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(473, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1218 "Zend/zend_language_scanner.l"
- {
- return T_NEW;
-}
-#line 5188 "Zend/zend_language_scanner.c"
-yy474:
- YYDEBUG(474, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy475;
- if (yych != 'e') goto yy187;
-yy475:
- YYDEBUG(475, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'S') goto yy476;
- if (yych != 's') goto yy187;
-yy476:
- YYDEBUG(476, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'P') goto yy477;
- if (yych != 'p') goto yy187;
-yy477:
- YYDEBUG(477, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy478;
- if (yych != 'a') goto yy187;
-yy478:
- YYDEBUG(478, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy479;
- if (yych != 'c') goto yy187;
-yy479:
- YYDEBUG(479, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy480;
- if (yych != 'e') goto yy187;
-yy480:
- YYDEBUG(480, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(481, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1278 "Zend/zend_language_scanner.l"
- {
- return T_NAMESPACE;
-}
-#line 5231 "Zend/zend_language_scanner.c"
-yy482:
- YYDEBUG(482, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(483, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1210 "Zend/zend_language_scanner.l"
- {
- return T_PAAMAYIM_NEKUDOTAYIM;
-}
-#line 5241 "Zend/zend_language_scanner.c"
-yy484:
- YYDEBUG(484, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
-yy485:
- YYDEBUG(485, *YYCURSOR);
- if (yych <= '\f') {
- if (yych <= 0x08) goto yy141;
- if (yych <= '\n') goto yy484;
- goto yy141;
- } else {
- if (yych <= '\r') goto yy484;
- if (yych == ' ') goto yy484;
- goto yy141;
- }
-yy486:
- YYDEBUG(486, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(487, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1386 "Zend/zend_language_scanner.l"
- {
- return T_MINUS_EQUAL;
-}
-#line 5267 "Zend/zend_language_scanner.c"
-yy488:
- YYDEBUG(488, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(489, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1354 "Zend/zend_language_scanner.l"
- {
- return T_DEC;
-}
-#line 5277 "Zend/zend_language_scanner.c"
-yy490:
- YYDEBUG(490, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(491, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1180 "Zend/zend_language_scanner.l"
- {
- yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
- return T_OBJECT_OPERATOR;
-}
-#line 5288 "Zend/zend_language_scanner.c"
-yy492:
- YYDEBUG(492, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'O') {
- if (yych == 'I') goto yy499;
- if (yych <= 'N') goto yy187;
- goto yy500;
- } else {
- if (yych <= 'i') {
- if (yych <= 'h') goto yy187;
- goto yy499;
- } else {
- if (yych == 'o') goto yy500;
- goto yy187;
- }
- }
-yy493:
- YYDEBUG(493, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'B') goto yy494;
- if (yych != 'b') goto yy187;
-yy494:
- YYDEBUG(494, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy495;
- if (yych != 'l') goto yy187;
-yy495:
- YYDEBUG(495, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy496;
- if (yych != 'i') goto yy187;
-yy496:
- YYDEBUG(496, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy497;
- if (yych != 'c') goto yy187;
-yy497:
- YYDEBUG(497, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(498, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1326 "Zend/zend_language_scanner.l"
- {
- return T_PUBLIC;
-}
-#line 5337 "Zend/zend_language_scanner.c"
-yy499:
- YYDEBUG(499, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'V') {
- if (yych == 'N') goto yy508;
- if (yych <= 'U') goto yy187;
- goto yy509;
- } else {
- if (yych <= 'n') {
- if (yych <= 'm') goto yy187;
- goto yy508;
- } else {
- if (yych == 'v') goto yy509;
- goto yy187;
- }
- }
-yy500:
- YYDEBUG(500, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy501;
- if (yych != 't') goto yy187;
-yy501:
- YYDEBUG(501, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy502;
- if (yych != 'e') goto yy187;
-yy502:
- YYDEBUG(502, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy503;
- if (yych != 'c') goto yy187;
-yy503:
- YYDEBUG(503, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy504;
- if (yych != 't') goto yy187;
-yy504:
- YYDEBUG(504, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy505;
- if (yych != 'e') goto yy187;
-yy505:
- YYDEBUG(505, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'D') goto yy506;
- if (yych != 'd') goto yy187;
-yy506:
- YYDEBUG(506, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(507, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1322 "Zend/zend_language_scanner.l"
- {
- return T_PROTECTED;
-}
-#line 5396 "Zend/zend_language_scanner.c"
-yy508:
- YYDEBUG(508, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy514;
- if (yych == 't') goto yy514;
- goto yy187;
-yy509:
- YYDEBUG(509, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy510;
- if (yych != 'a') goto yy187;
-yy510:
- YYDEBUG(510, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy511;
- if (yych != 't') goto yy187;
-yy511:
- YYDEBUG(511, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy512;
- if (yych != 'e') goto yy187;
-yy512:
- YYDEBUG(512, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(513, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1318 "Zend/zend_language_scanner.l"
- {
- return T_PRIVATE;
-}
-#line 5430 "Zend/zend_language_scanner.c"
-yy514:
- YYDEBUG(514, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(515, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1156 "Zend/zend_language_scanner.l"
- {
- return T_PRINT;
-}
-#line 5443 "Zend/zend_language_scanner.c"
-yy516:
- YYDEBUG(516, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy521;
- if (yych == 'o') goto yy521;
- goto yy187;
-yy517:
- YYDEBUG(517, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy518;
- if (yych != 't') goto yy187;
-yy518:
- YYDEBUG(518, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy519;
- if (yych != 'o') goto yy187;
-yy519:
- YYDEBUG(519, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(520, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1148 "Zend/zend_language_scanner.l"
- {
- return T_GOTO;
-}
-#line 5472 "Zend/zend_language_scanner.c"
-yy521:
- YYDEBUG(521, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'B') goto yy522;
- if (yych != 'b') goto yy187;
-yy522:
- YYDEBUG(522, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy523;
- if (yych != 'a') goto yy187;
-yy523:
- YYDEBUG(523, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy524;
- if (yych != 'l') goto yy187;
-yy524:
- YYDEBUG(524, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(525, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1290 "Zend/zend_language_scanner.l"
- {
- return T_GLOBAL;
-}
-#line 5500 "Zend/zend_language_scanner.c"
-yy526:
- YYDEBUG(526, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '<') goto yy534;
- goto yy194;
-yy527:
- YYDEBUG(527, *YYCURSOR);
- yych = *++YYCURSOR;
- goto yy181;
-yy528:
- YYDEBUG(528, *YYCURSOR);
- yych = *++YYCURSOR;
- goto yy179;
-yy529:
- YYDEBUG(529, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy530;
- if (yych != 'e') goto yy187;
-yy530:
- YYDEBUG(530, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy531;
- if (yych != 'a') goto yy187;
-yy531:
- YYDEBUG(531, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'K') goto yy532;
- if (yych != 'k') goto yy187;
-yy532:
- YYDEBUG(532, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(533, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1140 "Zend/zend_language_scanner.l"
- {
- return T_BREAK;
-}
-#line 5541 "Zend/zend_language_scanner.c"
-yy534:
- YYDEBUG(534, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '<') goto yy270;
- goto yy194;
-yy535:
- YYDEBUG(535, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy542;
- if (yych == 'a') goto yy542;
- goto yy187;
-yy536:
- YYDEBUG(536, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy537;
- if (yych != 'i') goto yy187;
-yy537:
- YYDEBUG(537, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy538;
- if (yych != 't') goto yy187;
-yy538:
- YYDEBUG(538, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy539;
- if (yych != 'c') goto yy187;
-yy539:
- YYDEBUG(539, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'H') goto yy540;
- if (yych != 'h') goto yy187;
-yy540:
- YYDEBUG(540, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(541, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1124 "Zend/zend_language_scanner.l"
- {
- return T_SWITCH;
-}
-#line 5585 "Zend/zend_language_scanner.c"
-yy542:
- YYDEBUG(542, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy543;
- if (yych != 't') goto yy187;
-yy543:
- YYDEBUG(543, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy544;
- if (yych != 'i') goto yy187;
-yy544:
- YYDEBUG(544, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy545;
- if (yych != 'c') goto yy187;
-yy545:
- YYDEBUG(545, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(546, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1306 "Zend/zend_language_scanner.l"
- {
- return T_STATIC;
-}
-#line 5613 "Zend/zend_language_scanner.c"
-yy547:
- YYDEBUG(547, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'S') goto yy558;
- if (yych == 's') goto yy558;
- goto yy187;
-yy548:
- YYDEBUG(548, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'D') goto yy556;
- if (yych == 'd') goto yy556;
- goto yy187;
-yy549:
- YYDEBUG(549, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy552;
- if (yych == 'r') goto yy552;
- goto yy187;
-yy550:
- YYDEBUG(550, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(551, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1120 "Zend/zend_language_scanner.l"
- {
- return T_AS;
-}
-#line 5644 "Zend/zend_language_scanner.c"
-yy552:
- YYDEBUG(552, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy553;
- if (yych != 'a') goto yy187;
-yy553:
- YYDEBUG(553, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'Y') goto yy554;
- if (yych != 'y') goto yy187;
-yy554:
- YYDEBUG(554, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(555, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1342 "Zend/zend_language_scanner.l"
- {
- return T_ARRAY;
-}
-#line 5667 "Zend/zend_language_scanner.c"
-yy556:
- YYDEBUG(556, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(557, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1438 "Zend/zend_language_scanner.l"
- {
- return T_LOGICAL_AND;
-}
-#line 5680 "Zend/zend_language_scanner.c"
-yy558:
- YYDEBUG(558, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy559;
- if (yych != 't') goto yy187;
-yy559:
- YYDEBUG(559, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy560;
- if (yych != 'r') goto yy187;
-yy560:
- YYDEBUG(560, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy561;
- if (yych != 'a') goto yy187;
-yy561:
- YYDEBUG(561, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy562;
- if (yych != 'c') goto yy187;
-yy562:
- YYDEBUG(562, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy563;
- if (yych != 't') goto yy187;
-yy563:
- YYDEBUG(563, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(564, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1310 "Zend/zend_language_scanner.l"
- {
- return T_ABSTRACT;
-}
-#line 5718 "Zend/zend_language_scanner.c"
-yy565:
- YYDEBUG(565, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy566;
- if (yych != 'i') goto yy187;
-yy566:
- YYDEBUG(566, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy567;
- if (yych != 'l') goto yy187;
-yy567:
- YYDEBUG(567, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy568;
- if (yych != 'e') goto yy187;
-yy568:
- YYDEBUG(568, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(569, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1080 "Zend/zend_language_scanner.l"
- {
- return T_WHILE;
-}
-#line 5746 "Zend/zend_language_scanner.c"
-yy570:
- YYDEBUG(570, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(571, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1064 "Zend/zend_language_scanner.l"
- {
- return T_IF;
-}
-#line 5759 "Zend/zend_language_scanner.c"
-yy572:
- YYDEBUG(572, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'P') goto yy614;
- if (yych == 'p') goto yy614;
- goto yy187;
-yy573:
- YYDEBUG(573, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'T') {
- if (yych <= 'C') {
- if (yych <= 'B') goto yy187;
- goto yy581;
- } else {
- if (yych <= 'R') goto yy187;
- if (yych <= 'S') goto yy579;
- goto yy580;
- }
- } else {
- if (yych <= 'r') {
- if (yych == 'c') goto yy581;
- goto yy187;
- } else {
- if (yych <= 's') goto yy579;
- if (yych <= 't') goto yy580;
- goto yy187;
- }
- }
-yy574:
- YYDEBUG(574, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'S') goto yy575;
- if (yych != 's') goto yy187;
-yy575:
- YYDEBUG(575, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy576;
- if (yych != 'e') goto yy187;
-yy576:
- YYDEBUG(576, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy577;
- if (yych != 't') goto yy187;
-yy577:
- YYDEBUG(577, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(578, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1294 "Zend/zend_language_scanner.l"
- {
- return T_ISSET;
-}
-#line 5815 "Zend/zend_language_scanner.c"
-yy579:
- YYDEBUG(579, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy600;
- if (yych == 't') goto yy600;
- goto yy187;
-yy580:
- YYDEBUG(580, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy593;
- if (yych == 'e') goto yy593;
- goto yy187;
-yy581:
- YYDEBUG(581, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy582;
- if (yych != 'l') goto yy187;
-yy582:
- YYDEBUG(582, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'U') goto yy583;
- if (yych != 'u') goto yy187;
-yy583:
- YYDEBUG(583, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'D') goto yy584;
- if (yych != 'd') goto yy187;
-yy584:
- YYDEBUG(584, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy585;
- if (yych != 'e') goto yy187;
-yy585:
- YYDEBUG(585, *YYCURSOR);
- ++YYCURSOR;
- if ((yych = *YYCURSOR) <= '^') {
- if (yych <= '9') {
- if (yych >= '0') goto yy186;
- } else {
- if (yych <= '@') goto yy586;
- if (yych <= 'Z') goto yy186;
- }
- } else {
- if (yych <= '`') {
- if (yych <= '_') goto yy587;
- } else {
- if (yych <= 'z') goto yy186;
- if (yych >= 0x7F) goto yy186;
- }
- }
-yy586:
- YYDEBUG(586, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1262 "Zend/zend_language_scanner.l"
- {
- return T_INCLUDE;
-}
-#line 5873 "Zend/zend_language_scanner.c"
-yy587:
- YYDEBUG(587, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy588;
- if (yych != 'o') goto yy187;
-yy588:
- YYDEBUG(588, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy589;
- if (yych != 'n') goto yy187;
-yy589:
- YYDEBUG(589, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy590;
- if (yych != 'c') goto yy187;
-yy590:
- YYDEBUG(590, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy591;
- if (yych != 'e') goto yy187;
-yy591:
- YYDEBUG(591, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(592, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1266 "Zend/zend_language_scanner.l"
- {
- return T_INCLUDE_ONCE;
-}
-#line 5906 "Zend/zend_language_scanner.c"
-yy593:
- YYDEBUG(593, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy594;
- if (yych != 'r') goto yy187;
-yy594:
- YYDEBUG(594, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'F') goto yy595;
- if (yych != 'f') goto yy187;
-yy595:
- YYDEBUG(595, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy596;
- if (yych != 'a') goto yy187;
-yy596:
- YYDEBUG(596, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy597;
- if (yych != 'c') goto yy187;
-yy597:
- YYDEBUG(597, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy598;
- if (yych != 'e') goto yy187;
-yy598:
- YYDEBUG(598, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(599, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1164 "Zend/zend_language_scanner.l"
- {
- return T_INTERFACE;
-}
-#line 5944 "Zend/zend_language_scanner.c"
-yy600:
- YYDEBUG(600, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'E') {
- if (yych == 'A') goto yy601;
- if (yych <= 'D') goto yy187;
- goto yy602;
- } else {
- if (yych <= 'a') {
- if (yych <= '`') goto yy187;
- } else {
- if (yych == 'e') goto yy602;
- goto yy187;
- }
- }
-yy601:
- YYDEBUG(601, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy608;
- if (yych == 'n') goto yy608;
- goto yy187;
-yy602:
- YYDEBUG(602, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy603;
- if (yych != 'a') goto yy187;
-yy603:
- YYDEBUG(603, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'D') goto yy604;
- if (yych != 'd') goto yy187;
-yy604:
- YYDEBUG(604, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy605;
- if (yych != 'o') goto yy187;
-yy605:
- YYDEBUG(605, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'F') goto yy606;
- if (yych != 'f') goto yy187;
-yy606:
- YYDEBUG(606, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(607, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1286 "Zend/zend_language_scanner.l"
- {
- return T_INSTEADOF;
-}
-#line 5998 "Zend/zend_language_scanner.c"
-yy608:
- YYDEBUG(608, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy609;
- if (yych != 'c') goto yy187;
-yy609:
- YYDEBUG(609, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy610;
- if (yych != 'e') goto yy187;
-yy610:
- YYDEBUG(610, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy611;
- if (yych != 'o') goto yy187;
-yy611:
- YYDEBUG(611, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'F') goto yy612;
- if (yych != 'f') goto yy187;
-yy612:
- YYDEBUG(612, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(613, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1116 "Zend/zend_language_scanner.l"
- {
- return T_INSTANCEOF;
-}
-#line 6031 "Zend/zend_language_scanner.c"
-yy614:
- YYDEBUG(614, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy615;
- if (yych != 'l') goto yy187;
-yy615:
- YYDEBUG(615, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy616;
- if (yych != 'e') goto yy187;
-yy616:
- YYDEBUG(616, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'M') goto yy617;
- if (yych != 'm') goto yy187;
-yy617:
- YYDEBUG(617, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy618;
- if (yych != 'e') goto yy187;
-yy618:
- YYDEBUG(618, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy619;
- if (yych != 'n') goto yy187;
-yy619:
- YYDEBUG(619, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy620;
- if (yych != 't') goto yy187;
-yy620:
- YYDEBUG(620, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'S') goto yy621;
- if (yych != 's') goto yy187;
-yy621:
- YYDEBUG(621, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(622, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1176 "Zend/zend_language_scanner.l"
- {
- return T_IMPLEMENTS;
-}
-#line 6079 "Zend/zend_language_scanner.c"
-yy623:
- YYDEBUG(623, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy631;
- if (yych == 'r') goto yy631;
- goto yy187;
-yy624:
- YYDEBUG(624, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'Y') {
- if (yych == 'A') goto yy627;
- if (yych <= 'X') goto yy187;
- } else {
- if (yych <= 'a') {
- if (yych <= '`') goto yy187;
- goto yy627;
- } else {
- if (yych != 'y') goto yy187;
- }
- }
- YYDEBUG(625, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(626, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1048 "Zend/zend_language_scanner.l"
- {
- return T_TRY;
-}
-#line 6111 "Zend/zend_language_scanner.c"
-yy627:
- YYDEBUG(627, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy628;
- if (yych != 'i') goto yy187;
-yy628:
- YYDEBUG(628, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy629;
- if (yych != 't') goto yy187;
-yy629:
- YYDEBUG(629, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(630, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1168 "Zend/zend_language_scanner.l"
- {
- return T_TRAIT;
-}
-#line 6134 "Zend/zend_language_scanner.c"
-yy631:
- YYDEBUG(631, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy632;
- if (yych != 'o') goto yy187;
-yy632:
- YYDEBUG(632, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'W') goto yy633;
- if (yych != 'w') goto yy187;
-yy633:
- YYDEBUG(633, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(634, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1060 "Zend/zend_language_scanner.l"
- {
- return T_THROW;
-}
-#line 6157 "Zend/zend_language_scanner.c"
-yy635:
- YYDEBUG(635, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy636;
- if (yych != 'e') goto yy187;
-yy636:
- YYDEBUG(636, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy637;
- if (yych != 'l') goto yy187;
-yy637:
- YYDEBUG(637, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'D') goto yy638;
- if (yych != 'd') goto yy187;
-yy638:
- YYDEBUG(638, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(639, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1044 "Zend/zend_language_scanner.l"
- {
- return T_YIELD;
-}
-#line 6185 "Zend/zend_language_scanner.c"
-yy640:
- YYDEBUG(640, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'T') {
- if (yych == 'Q') goto yy642;
- if (yych <= 'S') goto yy187;
- } else {
- if (yych <= 'q') {
- if (yych <= 'p') goto yy187;
- goto yy642;
- } else {
- if (yych != 't') goto yy187;
- }
- }
- YYDEBUG(641, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'U') goto yy654;
- if (yych == 'u') goto yy654;
- goto yy187;
-yy642:
- YYDEBUG(642, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'U') goto yy643;
- if (yych != 'u') goto yy187;
-yy643:
- YYDEBUG(643, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy644;
- if (yych != 'i') goto yy187;
-yy644:
- YYDEBUG(644, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy645;
- if (yych != 'r') goto yy187;
-yy645:
- YYDEBUG(645, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy646;
- if (yych != 'e') goto yy187;
-yy646:
- YYDEBUG(646, *YYCURSOR);
- ++YYCURSOR;
- if ((yych = *YYCURSOR) <= '^') {
- if (yych <= '9') {
- if (yych >= '0') goto yy186;
- } else {
- if (yych <= '@') goto yy647;
- if (yych <= 'Z') goto yy186;
- }
- } else {
- if (yych <= '`') {
- if (yych <= '_') goto yy648;
- } else {
- if (yych <= 'z') goto yy186;
- if (yych >= 0x7F) goto yy186;
- }
- }
-yy647:
- YYDEBUG(647, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1270 "Zend/zend_language_scanner.l"
- {
- return T_REQUIRE;
-}
-#line 6250 "Zend/zend_language_scanner.c"
-yy648:
- YYDEBUG(648, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy649;
- if (yych != 'o') goto yy187;
-yy649:
- YYDEBUG(649, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy650;
- if (yych != 'n') goto yy187;
-yy650:
- YYDEBUG(650, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy651;
- if (yych != 'c') goto yy187;
-yy651:
- YYDEBUG(651, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy652;
- if (yych != 'e') goto yy187;
-yy652:
- YYDEBUG(652, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(653, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1274 "Zend/zend_language_scanner.l"
- {
- return T_REQUIRE_ONCE;
-}
-#line 6283 "Zend/zend_language_scanner.c"
-yy654:
- YYDEBUG(654, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy655;
- if (yych != 'r') goto yy187;
-yy655:
- YYDEBUG(655, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy656;
- if (yych != 'n') goto yy187;
-yy656:
- YYDEBUG(656, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(657, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1040 "Zend/zend_language_scanner.l"
- {
- return T_RETURN;
-}
-#line 6306 "Zend/zend_language_scanner.c"
-yy658:
- YYDEBUG(658, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'T') {
- if (yych <= 'L') {
- if (yych <= 'K') goto yy187;
- goto yy681;
- } else {
- if (yych <= 'R') goto yy187;
- if (yych <= 'S') goto yy680;
- goto yy679;
- }
- } else {
- if (yych <= 'r') {
- if (yych == 'l') goto yy681;
- goto yy187;
- } else {
- if (yych <= 's') goto yy680;
- if (yych <= 't') goto yy679;
- goto yy187;
- }
- }
-yy659:
- YYDEBUG(659, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'O') {
- if (yych == 'A') goto yy671;
- if (yych <= 'N') goto yy187;
- goto yy672;
- } else {
- if (yych <= 'a') {
- if (yych <= '`') goto yy187;
- goto yy671;
- } else {
- if (yych == 'o') goto yy672;
- goto yy187;
- }
- }
-yy660:
- YYDEBUG(660, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy661;
- if (yych != 'n') goto yy187;
-yy661:
- YYDEBUG(661, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'T') {
- if (yych <= 'R') goto yy187;
- if (yych >= 'T') goto yy663;
- } else {
- if (yych <= 'r') goto yy187;
- if (yych <= 's') goto yy662;
- if (yych <= 't') goto yy663;
- goto yy187;
- }
-yy662:
- YYDEBUG(662, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy669;
- if (yych == 't') goto yy669;
- goto yy187;
-yy663:
- YYDEBUG(663, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy664;
- if (yych != 'i') goto yy187;
-yy664:
- YYDEBUG(664, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy665;
- if (yych != 'n') goto yy187;
-yy665:
- YYDEBUG(665, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'U') goto yy666;
- if (yych != 'u') goto yy187;
-yy666:
- YYDEBUG(666, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy667;
- if (yych != 'e') goto yy187;
-yy667:
- YYDEBUG(667, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(668, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1144 "Zend/zend_language_scanner.l"
- {
- return T_CONTINUE;
-}
-#line 6400 "Zend/zend_language_scanner.c"
-yy669:
- YYDEBUG(669, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(670, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1036 "Zend/zend_language_scanner.l"
- {
- return T_CONST;
-}
-#line 6413 "Zend/zend_language_scanner.c"
-yy671:
- YYDEBUG(671, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'S') goto yy676;
- if (yych == 's') goto yy676;
- goto yy187;
-yy672:
- YYDEBUG(672, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy673;
- if (yych != 'n') goto yy187;
-yy673:
- YYDEBUG(673, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy674;
- if (yych != 'e') goto yy187;
-yy674:
- YYDEBUG(674, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(675, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1222 "Zend/zend_language_scanner.l"
- {
- return T_CLONE;
-}
-#line 6442 "Zend/zend_language_scanner.c"
-yy676:
- YYDEBUG(676, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'S') goto yy677;
- if (yych != 's') goto yy187;
-yy677:
- YYDEBUG(677, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(678, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1160 "Zend/zend_language_scanner.l"
- {
- return T_CLASS;
-}
-#line 6460 "Zend/zend_language_scanner.c"
-yy679:
- YYDEBUG(679, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy690;
- if (yych == 'c') goto yy690;
- goto yy187;
-yy680:
- YYDEBUG(680, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy688;
- if (yych == 'e') goto yy688;
- goto yy187;
-yy681:
- YYDEBUG(681, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy682;
- if (yych != 'l') goto yy187;
-yy682:
- YYDEBUG(682, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy683;
- if (yych != 'a') goto yy187;
-yy683:
- YYDEBUG(683, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'B') goto yy684;
- if (yych != 'b') goto yy187;
-yy684:
- YYDEBUG(684, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy685;
- if (yych != 'l') goto yy187;
-yy685:
- YYDEBUG(685, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy686;
- if (yych != 'e') goto yy187;
-yy686:
- YYDEBUG(686, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(687, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1346 "Zend/zend_language_scanner.l"
- {
- return T_CALLABLE;
-}
-#line 6510 "Zend/zend_language_scanner.c"
-yy688:
- YYDEBUG(688, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(689, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1132 "Zend/zend_language_scanner.l"
- {
- return T_CASE;
-}
-#line 6523 "Zend/zend_language_scanner.c"
-yy690:
- YYDEBUG(690, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'H') goto yy691;
- if (yych != 'h') goto yy187;
-yy691:
- YYDEBUG(691, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(692, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1052 "Zend/zend_language_scanner.l"
- {
- return T_CATCH;
-}
-#line 6541 "Zend/zend_language_scanner.c"
-yy693:
- YYDEBUG(693, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy710;
- if (yych == 'n') goto yy710;
- goto yy187;
-yy694:
- YYDEBUG(694, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy703;
- if (yych == 'r') goto yy703;
- goto yy187;
-yy695:
- YYDEBUG(695, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy696;
- if (yych != 'n') goto yy187;
-yy696:
- YYDEBUG(696, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy697;
- if (yych != 'c') goto yy187;
-yy697:
- YYDEBUG(697, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy698;
- if (yych != 't') goto yy187;
-yy698:
- YYDEBUG(698, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy699;
- if (yych != 'i') goto yy187;
-yy699:
- YYDEBUG(699, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy700;
- if (yych != 'o') goto yy187;
-yy700:
- YYDEBUG(700, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy701;
- if (yych != 'n') goto yy187;
-yy701:
- YYDEBUG(701, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(702, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1032 "Zend/zend_language_scanner.l"
- {
- return T_FUNCTION;
-}
-#line 6596 "Zend/zend_language_scanner.c"
-yy703:
- YYDEBUG(703, *YYCURSOR);
- ++YYCURSOR;
- if ((yych = *YYCURSOR) <= '^') {
- if (yych <= '@') {
- if (yych <= '/') goto yy704;
- if (yych <= '9') goto yy186;
- } else {
- if (yych == 'E') goto yy705;
- if (yych <= 'Z') goto yy186;
- }
- } else {
- if (yych <= 'd') {
- if (yych != '`') goto yy186;
- } else {
- if (yych <= 'e') goto yy705;
- if (yych <= 'z') goto yy186;
- if (yych >= 0x7F) goto yy186;
- }
- }
-yy704:
- YYDEBUG(704, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1092 "Zend/zend_language_scanner.l"
- {
- return T_FOR;
-}
-#line 6624 "Zend/zend_language_scanner.c"
-yy705:
- YYDEBUG(705, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy706;
- if (yych != 'a') goto yy187;
-yy706:
- YYDEBUG(706, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy707;
- if (yych != 'c') goto yy187;
-yy707:
- YYDEBUG(707, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'H') goto yy708;
- if (yych != 'h') goto yy187;
-yy708:
- YYDEBUG(708, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(709, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1100 "Zend/zend_language_scanner.l"
- {
- return T_FOREACH;
-}
-#line 6652 "Zend/zend_language_scanner.c"
-yy710:
- YYDEBUG(710, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy711;
- if (yych != 'a') goto yy187;
-yy711:
- YYDEBUG(711, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy712;
- if (yych != 'l') goto yy187;
-yy712:
- YYDEBUG(712, *YYCURSOR);
- ++YYCURSOR;
- if ((yych = *YYCURSOR) <= '^') {
- if (yych <= '@') {
- if (yych <= '/') goto yy713;
- if (yych <= '9') goto yy186;
- } else {
- if (yych == 'L') goto yy714;
- if (yych <= 'Z') goto yy186;
- }
- } else {
- if (yych <= 'k') {
- if (yych != '`') goto yy186;
- } else {
- if (yych <= 'l') goto yy714;
- if (yych <= 'z') goto yy186;
- if (yych >= 0x7F) goto yy186;
- }
- }
-yy713:
- YYDEBUG(713, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1314 "Zend/zend_language_scanner.l"
- {
- return T_FINAL;
-}
-#line 6690 "Zend/zend_language_scanner.c"
-yy714:
- YYDEBUG(714, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'Y') goto yy715;
- if (yych != 'y') goto yy187;
-yy715:
- YYDEBUG(715, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(716, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1056 "Zend/zend_language_scanner.l"
- {
- return T_FINALLY;
-}
-#line 6708 "Zend/zend_language_scanner.c"
-yy717:
- YYDEBUG(717, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'F') {
- if (yych == 'C') goto yy723;
- if (yych <= 'E') goto yy187;
- goto yy724;
- } else {
- if (yych <= 'c') {
- if (yych <= 'b') goto yy187;
- goto yy723;
- } else {
- if (yych == 'f') goto yy724;
- goto yy187;
- }
- }
-yy718:
- YYDEBUG(718, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy721;
- if (yych == 'e') goto yy721;
- goto yy187;
-yy719:
- YYDEBUG(719, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(720, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1088 "Zend/zend_language_scanner.l"
- {
- return T_DO;
-}
-#line 6743 "Zend/zend_language_scanner.c"
-yy721:
- YYDEBUG(721, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(722, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1028 "Zend/zend_language_scanner.l"
- {
- return T_EXIT;
-}
-#line 6756 "Zend/zend_language_scanner.c"
-yy723:
- YYDEBUG(723, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy730;
- if (yych == 'l') goto yy730;
- goto yy187;
-yy724:
- YYDEBUG(724, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy725;
- if (yych != 'a') goto yy187;
-yy725:
- YYDEBUG(725, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'U') goto yy726;
- if (yych != 'u') goto yy187;
-yy726:
- YYDEBUG(726, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy727;
- if (yych != 'l') goto yy187;
-yy727:
- YYDEBUG(727, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy728;
- if (yych != 't') goto yy187;
-yy728:
- YYDEBUG(728, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(729, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1136 "Zend/zend_language_scanner.l"
- {
- return T_DEFAULT;
-}
-#line 6795 "Zend/zend_language_scanner.c"
-yy730:
- YYDEBUG(730, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy731;
- if (yych != 'a') goto yy187;
-yy731:
- YYDEBUG(731, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy732;
- if (yych != 'r') goto yy187;
-yy732:
- YYDEBUG(732, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy733;
- if (yych != 'e') goto yy187;
-yy733:
- YYDEBUG(733, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(734, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1108 "Zend/zend_language_scanner.l"
- {
- return T_DECLARE;
-}
-#line 6823 "Zend/zend_language_scanner.c"
-yy735:
- YYDEBUG(735, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'H') goto yy797;
- if (yych == 'h') goto yy797;
- goto yy187;
-yy736:
- YYDEBUG(736, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'S') goto yy791;
- if (yych == 's') goto yy791;
- goto yy187;
-yy737:
- YYDEBUG(737, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'P') goto yy787;
- if (yych == 'p') goto yy787;
- goto yy187;
-yy738:
- YYDEBUG(738, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'D') goto yy753;
- if (yych == 'd') goto yy753;
- goto yy187;
-yy739:
- YYDEBUG(739, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy750;
- if (yych == 'a') goto yy750;
- goto yy187;
-yy740:
- YYDEBUG(740, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= 'T') {
- if (yych == 'I') goto yy741;
- if (yych <= 'S') goto yy187;
- goto yy742;
- } else {
- if (yych <= 'i') {
- if (yych <= 'h') goto yy187;
- } else {
- if (yych == 't') goto yy742;
- goto yy187;
- }
- }
-yy741:
- YYDEBUG(741, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy748;
- if (yych == 't') goto yy748;
- goto yy187;
-yy742:
- YYDEBUG(742, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy743;
- if (yych != 'e') goto yy187;
-yy743:
- YYDEBUG(743, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy744;
- if (yych != 'n') goto yy187;
-yy744:
- YYDEBUG(744, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'D') goto yy745;
- if (yych != 'd') goto yy187;
-yy745:
- YYDEBUG(745, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'S') goto yy746;
- if (yych != 's') goto yy187;
-yy746:
- YYDEBUG(746, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(747, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1172 "Zend/zend_language_scanner.l"
- {
- return T_EXTENDS;
-}
-#line 6907 "Zend/zend_language_scanner.c"
-yy748:
- YYDEBUG(748, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(749, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1024 "Zend/zend_language_scanner.l"
- {
- return T_EXIT;
-}
-#line 6920 "Zend/zend_language_scanner.c"
-yy750:
- YYDEBUG(750, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy751;
- if (yych != 'l') goto yy187;
-yy751:
- YYDEBUG(751, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(752, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1258 "Zend/zend_language_scanner.l"
- {
- return T_EVAL;
-}
-#line 6938 "Zend/zend_language_scanner.c"
-yy753:
- YYDEBUG(753, *YYCURSOR);
- yych = *++YYCURSOR;
- YYDEBUG(-1, yych);
- switch (yych) {
- case 'D':
- case 'd': goto yy754;
- case 'F':
- case 'f': goto yy755;
- case 'I':
- case 'i': goto yy756;
- case 'S':
- case 's': goto yy757;
- case 'W':
- case 'w': goto yy758;
- default: goto yy187;
- }
-yy754:
- YYDEBUG(754, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy780;
- if (yych == 'e') goto yy780;
- goto yy187;
-yy755:
- YYDEBUG(755, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy772;
- if (yych == 'o') goto yy772;
- goto yy187;
-yy756:
- YYDEBUG(756, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'F') goto yy770;
- if (yych == 'f') goto yy770;
- goto yy187;
-yy757:
- YYDEBUG(757, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'W') goto yy764;
- if (yych == 'w') goto yy764;
- goto yy187;
-yy758:
- YYDEBUG(758, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'H') goto yy759;
- if (yych != 'h') goto yy187;
-yy759:
- YYDEBUG(759, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy760;
- if (yych != 'i') goto yy187;
-yy760:
- YYDEBUG(760, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy761;
- if (yych != 'l') goto yy187;
-yy761:
- YYDEBUG(761, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy762;
- if (yych != 'e') goto yy187;
-yy762:
- YYDEBUG(762, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(763, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1084 "Zend/zend_language_scanner.l"
- {
- return T_ENDWHILE;
-}
-#line 7012 "Zend/zend_language_scanner.c"
-yy764:
- YYDEBUG(764, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy765;
- if (yych != 'i') goto yy187;
-yy765:
- YYDEBUG(765, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy766;
- if (yych != 't') goto yy187;
-yy766:
- YYDEBUG(766, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy767;
- if (yych != 'c') goto yy187;
-yy767:
- YYDEBUG(767, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'H') goto yy768;
- if (yych != 'h') goto yy187;
-yy768:
- YYDEBUG(768, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(769, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1128 "Zend/zend_language_scanner.l"
- {
- return T_ENDSWITCH;
-}
-#line 7045 "Zend/zend_language_scanner.c"
-yy770:
- YYDEBUG(770, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(771, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1072 "Zend/zend_language_scanner.l"
- {
- return T_ENDIF;
-}
-#line 7058 "Zend/zend_language_scanner.c"
-yy772:
- YYDEBUG(772, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy773;
- if (yych != 'r') goto yy187;
-yy773:
- YYDEBUG(773, *YYCURSOR);
- ++YYCURSOR;
- if ((yych = *YYCURSOR) <= '^') {
- if (yych <= '@') {
- if (yych <= '/') goto yy774;
- if (yych <= '9') goto yy186;
- } else {
- if (yych == 'E') goto yy775;
- if (yych <= 'Z') goto yy186;
- }
- } else {
- if (yych <= 'd') {
- if (yych != '`') goto yy186;
- } else {
- if (yych <= 'e') goto yy775;
- if (yych <= 'z') goto yy186;
- if (yych >= 0x7F) goto yy186;
- }
- }
-yy774:
- YYDEBUG(774, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1096 "Zend/zend_language_scanner.l"
- {
- return T_ENDFOR;
-}
-#line 7091 "Zend/zend_language_scanner.c"
-yy775:
- YYDEBUG(775, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy776;
- if (yych != 'a') goto yy187;
-yy776:
- YYDEBUG(776, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy777;
- if (yych != 'c') goto yy187;
-yy777:
- YYDEBUG(777, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'H') goto yy778;
- if (yych != 'h') goto yy187;
-yy778:
- YYDEBUG(778, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(779, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1104 "Zend/zend_language_scanner.l"
- {
- return T_ENDFOREACH;
-}
-#line 7119 "Zend/zend_language_scanner.c"
-yy780:
- YYDEBUG(780, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy781;
- if (yych != 'c') goto yy187;
-yy781:
- YYDEBUG(781, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy782;
- if (yych != 'l') goto yy187;
-yy782:
- YYDEBUG(782, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy783;
- if (yych != 'a') goto yy187;
-yy783:
- YYDEBUG(783, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy784;
- if (yych != 'r') goto yy187;
-yy784:
- YYDEBUG(784, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy785;
- if (yych != 'e') goto yy187;
-yy785:
- YYDEBUG(785, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(786, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1112 "Zend/zend_language_scanner.l"
- {
- return T_ENDDECLARE;
-}
-#line 7157 "Zend/zend_language_scanner.c"
-yy787:
- YYDEBUG(787, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy788;
- if (yych != 't') goto yy187;
-yy788:
- YYDEBUG(788, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'Y') goto yy789;
- if (yych != 'y') goto yy187;
-yy789:
- YYDEBUG(789, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(790, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1298 "Zend/zend_language_scanner.l"
- {
- return T_EMPTY;
-}
-#line 7180 "Zend/zend_language_scanner.c"
-yy791:
- YYDEBUG(791, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy792;
- if (yych != 'e') goto yy187;
-yy792:
- YYDEBUG(792, *YYCURSOR);
- ++YYCURSOR;
- if ((yych = *YYCURSOR) <= '^') {
- if (yych <= '@') {
- if (yych <= '/') goto yy793;
- if (yych <= '9') goto yy186;
- } else {
- if (yych == 'I') goto yy794;
- if (yych <= 'Z') goto yy186;
- }
- } else {
- if (yych <= 'h') {
- if (yych != '`') goto yy186;
- } else {
- if (yych <= 'i') goto yy794;
- if (yych <= 'z') goto yy186;
- if (yych >= 0x7F) goto yy186;
- }
- }
-yy793:
- YYDEBUG(793, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1076 "Zend/zend_language_scanner.l"
- {
- return T_ELSE;
-}
-#line 7213 "Zend/zend_language_scanner.c"
-yy794:
- YYDEBUG(794, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'F') goto yy795;
- if (yych != 'f') goto yy187;
-yy795:
- YYDEBUG(795, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(796, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1068 "Zend/zend_language_scanner.l"
- {
- return T_ELSEIF;
-}
-#line 7231 "Zend/zend_language_scanner.c"
-yy797:
- YYDEBUG(797, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy798;
- if (yych != 'o') goto yy187;
-yy798:
- YYDEBUG(798, *YYCURSOR);
- ++YYCURSOR;
- if (yybm[0+(yych = *YYCURSOR)] & 4) {
- goto yy186;
- }
- YYDEBUG(799, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1152 "Zend/zend_language_scanner.l"
- {
- return T_ECHO;
-}
-#line 7249 "Zend/zend_language_scanner.c"
- }
-/* *********************************** */
-yyc_ST_LOOKING_FOR_PROPERTY:
- {
- static const unsigned char yybm[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 128, 128, 0, 0, 128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 128, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 0, 0, 0, 0, 0, 0,
- 0, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 0, 0, 0, 0, 64,
- 0, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 0, 0, 0, 0, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- };
- YYDEBUG(800, *YYCURSOR);
- YYFILL(2);
- yych = *YYCURSOR;
- if (yych <= '-') {
- if (yych <= '\r') {
- if (yych <= 0x08) goto yy808;
- if (yych <= '\n') goto yy802;
- if (yych <= '\f') goto yy808;
- } else {
- if (yych == ' ') goto yy802;
- if (yych <= ',') goto yy808;
- goto yy804;
- }
- } else {
- if (yych <= '_') {
- if (yych <= '@') goto yy808;
- if (yych <= 'Z') goto yy806;
- if (yych <= '^') goto yy808;
- goto yy806;
- } else {
- if (yych <= '`') goto yy808;
- if (yych <= 'z') goto yy806;
- if (yych <= '~') goto yy808;
- goto yy806;
- }
- }
-yy802:
- YYDEBUG(802, *YYCURSOR);
- ++YYCURSOR;
- yych = *YYCURSOR;
- goto yy814;
-yy803:
- YYDEBUG(803, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1185 "Zend/zend_language_scanner.l"
- {
- zendlval->value.str.val = yytext; /* no copying - intentional */
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
- HANDLE_NEWLINES(yytext, yyleng);
- return T_WHITESPACE;
-}
-#line 7330 "Zend/zend_language_scanner.c"
-yy804:
- YYDEBUG(804, *YYCURSOR);
- ++YYCURSOR;
- if ((yych = *YYCURSOR) == '>') goto yy811;
-yy805:
- YYDEBUG(805, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1204 "Zend/zend_language_scanner.l"
- {
- yyless(0);
- yy_pop_state(TSRMLS_C);
- goto restart;
-}
-#line 7344 "Zend/zend_language_scanner.c"
-yy806:
- YYDEBUG(806, *YYCURSOR);
- ++YYCURSOR;
- yych = *YYCURSOR;
- goto yy810;
-yy807:
- YYDEBUG(807, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1197 "Zend/zend_language_scanner.l"
- {
- yy_pop_state(TSRMLS_C);
- zend_copy_value(zendlval, yytext, yyleng);
- zendlval->type = IS_STRING;
- return T_STRING;
-}
-#line 7360 "Zend/zend_language_scanner.c"
-yy808:
- YYDEBUG(808, *YYCURSOR);
- yych = *++YYCURSOR;
- goto yy805;
-yy809:
- YYDEBUG(809, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
-yy810:
- YYDEBUG(810, *YYCURSOR);
- if (yybm[0+yych] & 64) {
- goto yy809;
- }
- goto yy807;
-yy811:
- YYDEBUG(811, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(812, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1193 "Zend/zend_language_scanner.l"
- {
- return T_OBJECT_OPERATOR;
-}
-#line 7385 "Zend/zend_language_scanner.c"
-yy813:
- YYDEBUG(813, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
-yy814:
- YYDEBUG(814, *YYCURSOR);
- if (yybm[0+yych] & 128) {
- goto yy813;
- }
- goto yy803;
- }
-/* *********************************** */
-yyc_ST_LOOKING_FOR_VARNAME:
- {
- static const unsigned char yybm[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 0, 0, 0, 0, 0, 0,
- 0, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 0, 0, 0, 0, 128,
- 0, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 0, 0, 0, 0, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- };
- YYDEBUG(815, *YYCURSOR);
- YYFILL(2);
- yych = *YYCURSOR;
- if (yych <= '_') {
- if (yych <= '@') goto yy819;
- if (yych <= 'Z') goto yy817;
- if (yych <= '^') goto yy819;
- } else {
- if (yych <= '`') goto yy819;
- if (yych <= 'z') goto yy817;
- if (yych <= '~') goto yy819;
- }
-yy817:
- YYDEBUG(817, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '_') {
- if (yych <= '@') {
- if (yych <= '/') goto yy818;
- if (yych <= '9') goto yy821;
- } else {
- if (yych <= '[') goto yy821;
- if (yych >= '_') goto yy821;
- }
- } else {
- if (yych <= '|') {
- if (yych <= '`') goto yy818;
- if (yych <= 'z') goto yy821;
- } else {
- if (yych != '~') goto yy821;
- }
- }
-yy818:
- YYDEBUG(818, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1490 "Zend/zend_language_scanner.l"
- {
- yyless(0);
- yy_pop_state(TSRMLS_C);
- yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
- goto restart;
-}
-#line 7477 "Zend/zend_language_scanner.c"
-yy819:
- YYDEBUG(819, *YYCURSOR);
- yych = *++YYCURSOR;
- goto yy818;
-yy820:
- YYDEBUG(820, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
-yy821:
- YYDEBUG(821, *YYCURSOR);
- if (yybm[0+yych] & 128) {
- goto yy820;
- }
- if (yych == '[') goto yy823;
- if (yych == '}') goto yy823;
- YYDEBUG(822, *YYCURSOR);
- YYCURSOR = YYMARKER;
- goto yy818;
-yy823:
- YYDEBUG(823, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(824, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1480 "Zend/zend_language_scanner.l"
- {
- yyless(yyleng - 1);
- zend_copy_value(zendlval, yytext, yyleng);
- zendlval->type = IS_STRING;
- yy_pop_state(TSRMLS_C);
- yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
- return T_STRING_VARNAME;
-}
-#line 7511 "Zend/zend_language_scanner.c"
- }
-/* *********************************** */
-yyc_ST_NOWDOC:
- YYDEBUG(825, *YYCURSOR);
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(827, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(828, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 2374 "Zend/zend_language_scanner.l"
- {
- int newline = 0;
-
- zend_heredoc_label *heredoc_label = zend_ptr_stack_top(&SCNG(heredoc_label_stack));
-
- if (YYCURSOR > YYLIMIT) {
- return 0;
- }
-
- YYCURSOR--;
-
- while (YYCURSOR < YYLIMIT) {
- switch (*YYCURSOR++) {
- case '\r':
- if (*YYCURSOR == '\n') {
- YYCURSOR++;
- }
- /* fall through */
- case '\n':
- /* Check for ending label on the next line */
- if (IS_LABEL_START(*YYCURSOR) && heredoc_label->length < YYLIMIT - YYCURSOR && !memcmp(YYCURSOR, heredoc_label->label, heredoc_label->length)) {
- YYCTYPE *end = YYCURSOR + heredoc_label->length;
-
- if (*end == ';') {
- end++;
- }
-
- if (*end == '\n' || *end == '\r') {
- /* newline before label will be subtracted from returned text, but
- * yyleng/yytext will include it, for zend_highlight/strip, tokenizer, etc. */
- if (YYCURSOR[-2] == '\r' && YYCURSOR[-1] == '\n') {
- newline = 2; /* Windows newline */
- } else {
- newline = 1;
- }
-
- CG(increment_lineno) = 1; /* For newline before label */
- BEGIN(ST_END_HEREDOC);
-
- goto nowdoc_scan_done;
- }
- }
- /* fall through */
- default:
- continue;
- }
- }
-
-nowdoc_scan_done:
- yyleng = YYCURSOR - SCNG(yy_text);
-
- zend_copy_value(zendlval, yytext, yyleng - newline);
- zendlval->type = IS_STRING;
- HANDLE_NEWLINES(yytext, yyleng - newline);
- return T_ENCAPSED_AND_WHITESPACE;
-}
-#line 7579 "Zend/zend_language_scanner.c"
-/* *********************************** */
-yyc_ST_VAR_OFFSET:
- {
- static const unsigned char yybm[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 240, 240, 112, 112, 112, 112, 112, 112,
- 112, 112, 0, 0, 0, 0, 0, 0,
- 0, 80, 80, 80, 80, 80, 80, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 0, 0, 0, 0, 16,
- 0, 80, 80, 80, 80, 80, 80, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 0, 0, 0, 0, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- };
- YYDEBUG(829, *YYCURSOR);
- YYFILL(3);
- yych = *YYCURSOR;
- if (yych <= '/') {
- if (yych <= ' ') {
- if (yych <= '\f') {
- if (yych <= 0x08) goto yy843;
- if (yych <= '\n') goto yy839;
- goto yy843;
- } else {
- if (yych <= '\r') goto yy839;
- if (yych <= 0x1F) goto yy843;
- goto yy839;
- }
- } else {
- if (yych <= '$') {
- if (yych <= '"') goto yy838;
- if (yych <= '#') goto yy839;
- goto yy834;
- } else {
- if (yych == '\'') goto yy839;
- goto yy838;
- }
- }
- } else {
- if (yych <= '\\') {
- if (yych <= '@') {
- if (yych <= '0') goto yy831;
- if (yych <= '9') goto yy833;
- goto yy838;
- } else {
- if (yych <= 'Z') goto yy841;
- if (yych <= '[') goto yy838;
- goto yy839;
- }
- } else {
- if (yych <= '_') {
- if (yych <= ']') goto yy836;
- if (yych <= '^') goto yy838;
- goto yy841;
- } else {
- if (yych <= '`') goto yy838;
- if (yych <= 'z') goto yy841;
- if (yych <= '~') goto yy838;
- goto yy841;
- }
- }
- }
-yy831:
- YYDEBUG(831, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= 'W') {
- if (yych <= '9') {
- if (yych >= '0') goto yy855;
- } else {
- if (yych == 'B') goto yy852;
- }
- } else {
- if (yych <= 'b') {
- if (yych <= 'X') goto yy854;
- if (yych >= 'b') goto yy852;
- } else {
- if (yych == 'x') goto yy854;
- }
- }
-yy832:
- YYDEBUG(832, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1568 "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)) {
- zendlval->value.lval = strtol(yytext, NULL, 10);
- zendlval->type = IS_LONG;
- } else {
- zendlval->value.str.val = (char *)estrndup(yytext, yyleng);
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
- }
- return T_NUM_STRING;
-}
-#line 7698 "Zend/zend_language_scanner.c"
-yy833:
- YYDEBUG(833, *YYCURSOR);
- yych = *++YYCURSOR;
- goto yy851;
-yy834:
- YYDEBUG(834, *YYCURSOR);
- ++YYCURSOR;
- if ((yych = *YYCURSOR) <= '_') {
- if (yych <= '@') goto yy835;
- if (yych <= 'Z') goto yy847;
- if (yych >= '_') goto yy847;
- } else {
- if (yych <= '`') goto yy835;
- if (yych <= 'z') goto yy847;
- if (yych >= 0x7F) goto yy847;
- }
-yy835:
- YYDEBUG(835, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1900 "Zend/zend_language_scanner.l"
- {
- /* Only '[' can be valid, but returning other tokens will allow a more explicit parse error */
- return yytext[0];
-}
-#line 7723 "Zend/zend_language_scanner.c"
-yy836:
- YYDEBUG(836, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(837, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1895 "Zend/zend_language_scanner.l"
- {
- yy_pop_state(TSRMLS_C);
- return ']';
-}
-#line 7734 "Zend/zend_language_scanner.c"
-yy838:
- YYDEBUG(838, *YYCURSOR);
- yych = *++YYCURSOR;
- goto yy835;
-yy839:
- YYDEBUG(839, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(840, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1905 "Zend/zend_language_scanner.l"
- {
- /* Invalid rule to return a more explicit parse error with proper line number */
- yyless(0);
- yy_pop_state(TSRMLS_C);
- return T_ENCAPSED_AND_WHITESPACE;
-}
-#line 7751 "Zend/zend_language_scanner.c"
-yy841:
- YYDEBUG(841, *YYCURSOR);
- ++YYCURSOR;
- yych = *YYCURSOR;
- goto yy846;
-yy842:
- YYDEBUG(842, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1912 "Zend/zend_language_scanner.l"
- {
- zend_copy_value(zendlval, yytext, yyleng);
- zendlval->type = IS_STRING;
- return T_STRING;
-}
-#line 7766 "Zend/zend_language_scanner.c"
-yy843:
- YYDEBUG(843, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(844, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 2432 "Zend/zend_language_scanner.l"
- {
- if (YYCURSOR > YYLIMIT) {
- return 0;
- }
-
- zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
- goto restart;
-}
-#line 7781 "Zend/zend_language_scanner.c"
-yy845:
- YYDEBUG(845, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
-yy846:
- YYDEBUG(846, *YYCURSOR);
- if (yybm[0+yych] & 16) {
- goto yy845;
- }
- goto yy842;
-yy847:
- YYDEBUG(847, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(848, *YYCURSOR);
- if (yych <= '^') {
- if (yych <= '9') {
- if (yych >= '0') goto yy847;
- } else {
- if (yych <= '@') goto yy849;
- if (yych <= 'Z') goto yy847;
- }
- } else {
- if (yych <= '`') {
- if (yych <= '_') goto yy847;
- } else {
- if (yych <= 'z') goto yy847;
- if (yych >= 0x7F) goto yy847;
- }
- }
-yy849:
- YYDEBUG(849, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1889 "Zend/zend_language_scanner.l"
- {
- zend_copy_value(zendlval, (yytext+1), (yyleng-1));
- zendlval->type = IS_STRING;
- return T_VARIABLE;
-}
-#line 7823 "Zend/zend_language_scanner.c"
-yy850:
- YYDEBUG(850, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
-yy851:
- YYDEBUG(851, *YYCURSOR);
- if (yybm[0+yych] & 32) {
- goto yy850;
- }
- goto yy832;
-yy852:
- YYDEBUG(852, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yybm[0+yych] & 128) {
- goto yy860;
- }
-yy853:
- YYDEBUG(853, *YYCURSOR);
- YYCURSOR = YYMARKER;
- goto yy832;
-yy854:
- YYDEBUG(854, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yybm[0+yych] & 64) {
- goto yy858;
- }
- goto yy853;
-yy855:
- YYDEBUG(855, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(856, *YYCURSOR);
- if (yych <= '/') goto yy857;
- if (yych <= '9') goto yy855;
-yy857:
- YYDEBUG(857, *YYCURSOR);
- yyleng = YYCURSOR - SCNG(yy_text);
-#line 1580 "Zend/zend_language_scanner.l"
- { /* Offset must be treated as a string */
- zendlval->value.str.val = (char *)estrndup(yytext, yyleng);
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
- return T_NUM_STRING;
-}
-#line 7870 "Zend/zend_language_scanner.c"
-yy858:
- YYDEBUG(858, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(859, *YYCURSOR);
- if (yybm[0+yych] & 64) {
- goto yy858;
- }
- goto yy857;
-yy860:
- YYDEBUG(860, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(861, *YYCURSOR);
- if (yybm[0+yych] & 128) {
- goto yy860;
- }
- goto yy857;
- }
-}
-#line 2441 "Zend/zend_language_scanner.l"
-
-}
+/* Generated by re2c 0.13.5 */
+#line 1 "Zend/zend_language_scanner.l"
+/*
+ +----------------------------------------------------------------------+
+ | Zend Engine |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 2.00 of the Zend license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.zend.com/license/2_00.txt. |
+ | If you did not receive a copy of the Zend license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@zend.com so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Marcus Boerger <helly@php.net> |
+ | Nuno Lopes <nlopess@php.net> |
+ | Scott MacVicar <scottmac@php.net> |
+ | Flex version authors: |
+ | Andi Gutmans <andi@zend.com> |
+ | Zeev Suraski <zeev@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id$ */
+
+#if 0
+# define YYDEBUG(s, c) printf("state: %d char: %c\n", s, c)
+#else
+# define YYDEBUG(s, c)
+#endif
+
+#include "zend_language_scanner_defs.h"
+
+#include <errno.h>
+#include "zend.h"
+#ifdef PHP_WIN32
+# include <Winuser.h>
+#endif
+#include "zend_alloc.h"
+#include <zend_language_parser.h>
+#include "zend_compile.h"
+#include "zend_language_scanner.h"
+#include "zend_highlight.h"
+#include "zend_constants.h"
+#include "zend_variables.h"
+#include "zend_operators.h"
+#include "zend_API.h"
+#include "zend_strtod.h"
+#include "zend_exceptions.h"
+#include "zend_virtual_cwd.h"
+#include "tsrm_config_common.h"
+
+#define YYCTYPE unsigned char
+#define YYFILL(n) { if ((YYCURSOR + n) >= (YYLIMIT + ZEND_MMAP_AHEAD)) { return 0; } }
+#define YYCURSOR SCNG(yy_cursor)
+#define YYLIMIT SCNG(yy_limit)
+#define YYMARKER SCNG(yy_marker)
+
+#define YYGETCONDITION() SCNG(yy_state)
+#define YYSETCONDITION(s) SCNG(yy_state) = s
+
+#define STATE(name) yyc##name
+
+/* emulate flex constructs */
+#define BEGIN(state) YYSETCONDITION(STATE(state))
+#define YYSTATE YYGETCONDITION()
+#define yytext ((char*)SCNG(yy_text))
+#define yyleng SCNG(yy_leng)
+#define yyless(x) do { YYCURSOR = (unsigned char*)yytext + x; \
+ yyleng = (unsigned int)x; } while(0)
+#define yymore() goto yymore_restart
+
+/* perform sanity check. If this message is triggered you should
+ increase the ZEND_MMAP_AHEAD value in the zend_streams.h file */
+#define YYMAXFILL 16
+#if ZEND_MMAP_AHEAD < YYMAXFILL
+# error ZEND_MMAP_AHEAD should be greater than or equal to YYMAXFILL
+#endif
+
+#ifdef HAVE_STDARG_H
+# include <stdarg.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+/* Globals Macros */
+#define SCNG LANG_SCNG
+#ifdef ZTS
+ZEND_API ts_rsrc_id language_scanner_globals_id;
+#else
+ZEND_API zend_php_scanner_globals language_scanner_globals;
+#endif
+
+#define HANDLE_NEWLINES(s, l) \
+do { \
+ char *p = (s), *boundary = p+(l); \
+ \
+ while (p<boundary) { \
+ if (*p == '\n' || (*p == '\r' && (*(p+1) != '\n'))) { \
+ CG(zend_lineno)++; \
+ } \
+ p++; \
+ } \
+} while (0)
+
+#define HANDLE_NEWLINE(c) \
+{ \
+ if (c == '\n' || c == '\r') { \
+ CG(zend_lineno)++; \
+ } \
+}
+
+/* To save initial string length after scanning to first variable, CG(doc_comment_len) can be reused */
+#define SET_DOUBLE_QUOTES_SCANNED_LENGTH(len) CG(doc_comment_len) = (len)
+#define GET_DOUBLE_QUOTES_SCANNED_LENGTH() CG(doc_comment_len)
+
+#define IS_LABEL_START(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z') || (c) == '_' || (c) >= 0x7F)
+
+#define ZEND_IS_OCT(c) ((c)>='0' && (c)<='7')
+#define ZEND_IS_HEX(c) (((c)>='0' && (c)<='9') || ((c)>='a' && (c)<='f') || ((c)>='A' && (c)<='F'))
+
+BEGIN_EXTERN_C()
+
+static size_t encoding_filter_script_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
+{
+ const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C);
+ assert(internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding));
+ return zend_multibyte_encoding_converter(to, to_length, from, from_length, internal_encoding, LANG_SCNG(script_encoding) TSRMLS_CC);
+}
+
+static size_t encoding_filter_script_to_intermediate(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
+{
+ return zend_multibyte_encoding_converter(to, to_length, from, from_length, zend_multibyte_encoding_utf8, LANG_SCNG(script_encoding) TSRMLS_CC);
+}
+
+static size_t encoding_filter_intermediate_to_script(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
+{
+ return zend_multibyte_encoding_converter(to, to_length, from, from_length,
+LANG_SCNG(script_encoding), zend_multibyte_encoding_utf8 TSRMLS_CC);
+}
+
+static size_t encoding_filter_intermediate_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
+{
+ const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C);
+ assert(internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding));
+ return zend_multibyte_encoding_converter(to, to_length, from, from_length,
+internal_encoding, zend_multibyte_encoding_utf8 TSRMLS_CC);
+}
+
+
+static void _yy_push_state(int new_state TSRMLS_DC)
+{
+ zend_stack_push(&SCNG(state_stack), (void *) &YYGETCONDITION(), sizeof(int));
+ YYSETCONDITION(new_state);
+}
+
+#define yy_push_state(state_and_tsrm) _yy_push_state(yyc##state_and_tsrm)
+
+static void yy_pop_state(TSRMLS_D)
+{
+ int *stack_state;
+ zend_stack_top(&SCNG(state_stack), (void **) &stack_state);
+ YYSETCONDITION(*stack_state);
+ zend_stack_del_top(&SCNG(state_stack));
+}
+
+static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC)
+{
+ YYCURSOR = (YYCTYPE*)str;
+ YYLIMIT = YYCURSOR + len;
+ if (!SCNG(yy_start)) {
+ SCNG(yy_start) = YYCURSOR;
+ }
+}
+
+void startup_scanner(TSRMLS_D)
+{
+ CG(parse_error) = 0;
+ CG(doc_comment) = NULL;
+ CG(doc_comment_len) = 0;
+ zend_stack_init(&SCNG(state_stack));
+ zend_ptr_stack_init(&SCNG(heredoc_label_stack));
+}
+
+static void heredoc_label_dtor(zend_heredoc_label *heredoc_label) {
+ efree(heredoc_label->label);
+}
+
+void shutdown_scanner(TSRMLS_D)
+{
+ CG(parse_error) = 0;
+ RESET_DOC_COMMENT();
+ zend_stack_destroy(&SCNG(state_stack));
+ zend_ptr_stack_clean(&SCNG(heredoc_label_stack), (void (*)(void *)) &heredoc_label_dtor, 1);
+ zend_ptr_stack_destroy(&SCNG(heredoc_label_stack));
+}
+
+ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
+{
+ lex_state->yy_leng = SCNG(yy_leng);
+ lex_state->yy_start = SCNG(yy_start);
+ lex_state->yy_text = SCNG(yy_text);
+ lex_state->yy_cursor = SCNG(yy_cursor);
+ lex_state->yy_marker = SCNG(yy_marker);
+ lex_state->yy_limit = SCNG(yy_limit);
+
+ lex_state->state_stack = SCNG(state_stack);
+ zend_stack_init(&SCNG(state_stack));
+
+ lex_state->heredoc_label_stack = SCNG(heredoc_label_stack);
+ zend_ptr_stack_init(&SCNG(heredoc_label_stack));
+
+ lex_state->in = SCNG(yy_in);
+ lex_state->yy_state = YYSTATE;
+ lex_state->filename = zend_get_compiled_filename(TSRMLS_C);
+ lex_state->lineno = CG(zend_lineno);
+
+ lex_state->script_org = SCNG(script_org);
+ lex_state->script_org_size = SCNG(script_org_size);
+ lex_state->script_filtered = SCNG(script_filtered);
+ lex_state->script_filtered_size = SCNG(script_filtered_size);
+ lex_state->input_filter = SCNG(input_filter);
+ lex_state->output_filter = SCNG(output_filter);
+ lex_state->script_encoding = SCNG(script_encoding);
+}
+
+ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
+{
+ SCNG(yy_leng) = lex_state->yy_leng;
+ SCNG(yy_start) = lex_state->yy_start;
+ SCNG(yy_text) = lex_state->yy_text;
+ SCNG(yy_cursor) = lex_state->yy_cursor;
+ SCNG(yy_marker) = lex_state->yy_marker;
+ SCNG(yy_limit) = lex_state->yy_limit;
+
+ zend_stack_destroy(&SCNG(state_stack));
+ SCNG(state_stack) = lex_state->state_stack;
+
+ zend_ptr_stack_clean(&SCNG(heredoc_label_stack), (void (*)(void *)) &heredoc_label_dtor, 1);
+ zend_ptr_stack_destroy(&SCNG(heredoc_label_stack));
+ SCNG(heredoc_label_stack) = lex_state->heredoc_label_stack;
+
+ SCNG(yy_in) = lex_state->in;
+ YYSETCONDITION(lex_state->yy_state);
+ CG(zend_lineno) = lex_state->lineno;
+ zend_restore_compiled_filename(lex_state->filename TSRMLS_CC);
+
+ if (SCNG(script_filtered)) {
+ efree(SCNG(script_filtered));
+ SCNG(script_filtered) = NULL;
+ }
+ SCNG(script_org) = lex_state->script_org;
+ SCNG(script_org_size) = lex_state->script_org_size;
+ SCNG(script_filtered) = lex_state->script_filtered;
+ SCNG(script_filtered_size) = lex_state->script_filtered_size;
+ SCNG(input_filter) = lex_state->input_filter;
+ SCNG(output_filter) = lex_state->output_filter;
+ SCNG(script_encoding) = lex_state->script_encoding;
+
+ RESET_DOC_COMMENT();
+}
+
+ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSRMLS_DC)
+{
+ zend_llist_del_element(&CG(open_files), file_handle, (int (*)(void *, void *)) zend_compare_file_handles);
+ /* zend_file_handle_dtor() operates on the copy, so we have to NULLify the original here */
+ file_handle->opened_path = NULL;
+ if (file_handle->free_filename) {
+ file_handle->filename = NULL;
+ }
+}
+
+#define BOM_UTF32_BE "\x00\x00\xfe\xff"
+#define BOM_UTF32_LE "\xff\xfe\x00\x00"
+#define BOM_UTF16_BE "\xfe\xff"
+#define BOM_UTF16_LE "\xff\xfe"
+#define BOM_UTF8 "\xef\xbb\xbf"
+
+static const zend_encoding *zend_multibyte_detect_utf_encoding(const unsigned char *script, size_t script_size TSRMLS_DC)
+{
+ const unsigned char *p;
+ int wchar_size = 2;
+ int le = 0;
+
+ /* utf-16 or utf-32? */
+ p = script;
+ while ((p-script) < script_size) {
+ p = memchr(p, 0, script_size-(p-script)-2);
+ if (!p) {
+ break;
+ }
+ if (*(p+1) == '\0' && *(p+2) == '\0') {
+ wchar_size = 4;
+ break;
+ }
+
+ /* searching for UTF-32 specific byte orders, so this will do */
+ p += 4;
+ }
+
+ /* BE or LE? */
+ p = script;
+ while ((p-script) < script_size) {
+ if (*p == '\0' && *(p+wchar_size-1) != '\0') {
+ /* BE */
+ le = 0;
+ break;
+ } else if (*p != '\0' && *(p+wchar_size-1) == '\0') {
+ /* LE* */
+ le = 1;
+ break;
+ }
+ p += wchar_size;
+ }
+
+ if (wchar_size == 2) {
+ return le ? zend_multibyte_encoding_utf16le : zend_multibyte_encoding_utf16be;
+ } else {
+ return le ? zend_multibyte_encoding_utf32le : zend_multibyte_encoding_utf32be;
+ }
+
+ return NULL;
+}
+
+static const zend_encoding* zend_multibyte_detect_unicode(TSRMLS_D)
+{
+ const zend_encoding *script_encoding = NULL;
+ int bom_size;
+ unsigned char *pos1, *pos2;
+
+ if (LANG_SCNG(script_org_size) < sizeof(BOM_UTF32_LE)-1) {
+ return NULL;
+ }
+
+ /* check out BOM */
+ if (!memcmp(LANG_SCNG(script_org), BOM_UTF32_BE, sizeof(BOM_UTF32_BE)-1)) {
+ script_encoding = zend_multibyte_encoding_utf32be;
+ bom_size = sizeof(BOM_UTF32_BE)-1;
+ } else if (!memcmp(LANG_SCNG(script_org), BOM_UTF32_LE, sizeof(BOM_UTF32_LE)-1)) {
+ script_encoding = zend_multibyte_encoding_utf32le;
+ bom_size = sizeof(BOM_UTF32_LE)-1;
+ } else if (!memcmp(LANG_SCNG(script_org), BOM_UTF16_BE, sizeof(BOM_UTF16_BE)-1)) {
+ script_encoding = zend_multibyte_encoding_utf16be;
+ bom_size = sizeof(BOM_UTF16_BE)-1;
+ } else if (!memcmp(LANG_SCNG(script_org), BOM_UTF16_LE, sizeof(BOM_UTF16_LE)-1)) {
+ script_encoding = zend_multibyte_encoding_utf16le;
+ bom_size = sizeof(BOM_UTF16_LE)-1;
+ } else if (!memcmp(LANG_SCNG(script_org), BOM_UTF8, sizeof(BOM_UTF8)-1)) {
+ script_encoding = zend_multibyte_encoding_utf8;
+ bom_size = sizeof(BOM_UTF8)-1;
+ }
+
+ if (script_encoding) {
+ /* remove BOM */
+ LANG_SCNG(script_org) += bom_size;
+ LANG_SCNG(script_org_size) -= bom_size;
+
+ return script_encoding;
+ }
+
+ /* script contains NULL bytes -> auto-detection */
+ if ((pos1 = memchr(LANG_SCNG(script_org), 0, LANG_SCNG(script_org_size)))) {
+ /* check if the NULL byte is after the __HALT_COMPILER(); */
+ pos2 = LANG_SCNG(script_org);
+
+ while (pos1 - pos2 >= sizeof("__HALT_COMPILER();")-1) {
+ pos2 = memchr(pos2, '_', pos1 - pos2);
+ if (!pos2) break;
+ pos2++;
+ if (strncasecmp((char*)pos2, "_HALT_COMPILER", sizeof("_HALT_COMPILER")-1) == 0) {
+ pos2 += sizeof("_HALT_COMPILER")-1;
+ while (*pos2 == ' ' ||
+ *pos2 == '\t' ||
+ *pos2 == '\r' ||
+ *pos2 == '\n') {
+ pos2++;
+ }
+ if (*pos2 == '(') {
+ pos2++;
+ while (*pos2 == ' ' ||
+ *pos2 == '\t' ||
+ *pos2 == '\r' ||
+ *pos2 == '\n') {
+ pos2++;
+ }
+ if (*pos2 == ')') {
+ pos2++;
+ while (*pos2 == ' ' ||
+ *pos2 == '\t' ||
+ *pos2 == '\r' ||
+ *pos2 == '\n') {
+ pos2++;
+ }
+ if (*pos2 == ';') {
+ return NULL;
+ }
+ }
+ }
+ }
+ }
+ /* make best effort if BOM is missing */
+ return zend_multibyte_detect_utf_encoding(LANG_SCNG(script_org), LANG_SCNG(script_org_size) TSRMLS_CC);
+ }
+
+ return NULL;
+}
+
+static const zend_encoding* zend_multibyte_find_script_encoding(TSRMLS_D)
+{
+ const zend_encoding *script_encoding;
+
+ if (CG(detect_unicode)) {
+ /* check out bom(byte order mark) and see if containing wchars */
+ script_encoding = zend_multibyte_detect_unicode(TSRMLS_C);
+ if (script_encoding != NULL) {
+ /* bom or wchar detection is prior to 'script_encoding' option */
+ return script_encoding;
+ }
+ }
+
+ /* if no script_encoding specified, just leave alone */
+ if (!CG(script_encoding_list) || !CG(script_encoding_list_size)) {
+ return NULL;
+ }
+
+ /* if multiple encodings specified, detect automagically */
+ if (CG(script_encoding_list_size) > 1) {
+ return zend_multibyte_encoding_detector(LANG_SCNG(script_org), LANG_SCNG(script_org_size), CG(script_encoding_list), CG(script_encoding_list_size) TSRMLS_CC);
+ }
+
+ return CG(script_encoding_list)[0];
+}
+
+ZEND_API int zend_multibyte_set_filter(const zend_encoding *onetime_encoding TSRMLS_DC)
+{
+ const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C);
+ const zend_encoding *script_encoding = onetime_encoding ? onetime_encoding: zend_multibyte_find_script_encoding(TSRMLS_C);
+
+ if (!script_encoding) {
+ return FAILURE;
+ }
+
+ /* judge input/output filter */
+ LANG_SCNG(script_encoding) = script_encoding;
+ LANG_SCNG(input_filter) = NULL;
+ LANG_SCNG(output_filter) = NULL;
+
+ if (!internal_encoding || LANG_SCNG(script_encoding) == internal_encoding) {
+ if (!zend_multibyte_check_lexer_compatibility(LANG_SCNG(script_encoding))) {
+ /* and if not, work around w/ script_encoding -> utf-8 -> script_encoding conversion */
+ LANG_SCNG(input_filter) = encoding_filter_script_to_intermediate;
+ LANG_SCNG(output_filter) = encoding_filter_intermediate_to_script;
+ } else {
+ LANG_SCNG(input_filter) = NULL;
+ LANG_SCNG(output_filter) = NULL;
+ }
+ return SUCCESS;
+ }
+
+ if (zend_multibyte_check_lexer_compatibility(internal_encoding)) {
+ LANG_SCNG(input_filter) = encoding_filter_script_to_internal;
+ LANG_SCNG(output_filter) = NULL;
+ } else if (zend_multibyte_check_lexer_compatibility(LANG_SCNG(script_encoding))) {
+ LANG_SCNG(input_filter) = NULL;
+ LANG_SCNG(output_filter) = encoding_filter_script_to_internal;
+ } else {
+ /* both script and internal encodings are incompatible w/ flex */
+ LANG_SCNG(input_filter) = encoding_filter_script_to_intermediate;
+ LANG_SCNG(output_filter) = encoding_filter_intermediate_to_internal;
+ }
+
+ return 0;
+}
+
+ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
+{
+ const char *file_path = NULL;
+ char *buf;
+ size_t size, offset = 0;
+
+ /* The shebang line was read, get the current position to obtain the buffer start */
+ if (CG(start_lineno) == 2 && file_handle->type == ZEND_HANDLE_FP && file_handle->handle.fp) {
+ if ((offset = ftell(file_handle->handle.fp)) == -1) {
+ offset = 0;
+ }
+ }
+
+ if (zend_stream_fixup(file_handle, &buf, &size TSRMLS_CC) == FAILURE) {
+ return FAILURE;
+ }
+
+ zend_llist_add_element(&CG(open_files), file_handle);
+ if (file_handle->handle.stream.handle >= (void*)file_handle && file_handle->handle.stream.handle <= (void*)(file_handle+1)) {
+ zend_file_handle *fh = (zend_file_handle*)zend_llist_get_last(&CG(open_files));
+ size_t diff = (char*)file_handle->handle.stream.handle - (char*)file_handle;
+ fh->handle.stream.handle = (void*)(((char*)fh) + diff);
+ file_handle->handle.stream.handle = fh->handle.stream.handle;
+ }
+
+ /* Reset the scanner for scanning the new file */
+ SCNG(yy_in) = file_handle;
+ SCNG(yy_start) = NULL;
+
+ if (size != -1) {
+ if (CG(multibyte)) {
+ SCNG(script_org) = (unsigned char*)buf;
+ SCNG(script_org_size) = size;
+ SCNG(script_filtered) = NULL;
+
+ zend_multibyte_set_filter(NULL TSRMLS_CC);
+
+ if (SCNG(input_filter)) {
+ if ((size_t)-1 == SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC)) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script from the detected "
+ "encoding \"%s\" to a compatible encoding", zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding)));
+ }
+ buf = (char*)SCNG(script_filtered);
+ size = SCNG(script_filtered_size);
+ }
+ }
+ SCNG(yy_start) = (unsigned char *)buf - offset;
+ yy_scan_buffer(buf, size TSRMLS_CC);
+ } else {
+ zend_error_noreturn(E_COMPILE_ERROR, "zend_stream_mmap() failed");
+ }
+
+ BEGIN(INITIAL);
+
+ if (file_handle->opened_path) {
+ file_path = file_handle->opened_path;
+ } else {
+ file_path = file_handle->filename;
+ }
+
+ zend_set_compiled_filename(file_path TSRMLS_CC);
+
+ if (CG(start_lineno)) {
+ CG(zend_lineno) = CG(start_lineno);
+ CG(start_lineno) = 0;
+ } else {
+ CG(zend_lineno) = 1;
+ }
+
+ RESET_DOC_COMMENT();
+ CG(increment_lineno) = 0;
+ return SUCCESS;
+}
+END_EXTERN_C()
+
+
+ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSRMLS_DC)
+{
+ zend_lex_state original_lex_state;
+ zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array));
+ zend_op_array *original_active_op_array = CG(active_op_array);
+ zend_op_array *retval=NULL;
+ int compiler_result;
+ zend_bool compilation_successful=0;
+ znode retval_znode;
+ zend_bool original_in_compilation = CG(in_compilation);
+
+ retval_znode.op_type = IS_CONST;
+ INIT_PZVAL(&retval_znode.u.constant);
+ ZVAL_LONG(&retval_znode.u.constant, 1);
+
+ zend_save_lexical_state(&original_lex_state TSRMLS_CC);
+
+ retval = op_array; /* success oriented */
+
+ if (open_file_for_scanning(file_handle TSRMLS_CC)==FAILURE) {
+ if (type==ZEND_REQUIRE) {
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename TSRMLS_CC);
+ zend_bailout();
+ } else {
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename TSRMLS_CC);
+ }
+ compilation_successful=0;
+ } else {
+ init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE TSRMLS_CC);
+ CG(in_compilation) = 1;
+ CG(active_op_array) = op_array;
+ zend_stack_push(&CG(context_stack), (void *) &CG(context), sizeof(CG(context)));
+ zend_init_compiler_context(TSRMLS_C);
+ compiler_result = zendparse(TSRMLS_C);
+ zend_do_return(&retval_znode, 0 TSRMLS_CC);
+ CG(in_compilation) = original_in_compilation;
+ if (compiler_result != 0) { /* parser error */
+ zend_bailout();
+ }
+ compilation_successful=1;
+ }
+
+ if (retval) {
+ CG(active_op_array) = original_active_op_array;
+ if (compilation_successful) {
+ pass_two(op_array TSRMLS_CC);
+ zend_release_labels(0 TSRMLS_CC);
+ } else {
+ efree(op_array);
+ retval = NULL;
+ }
+ }
+ zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ return retval;
+}
+
+
+zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC)
+{
+ zend_file_handle file_handle;
+ zval tmp;
+ zend_op_array *retval;
+ char *opened_path = NULL;
+
+ if (filename->type != IS_STRING) {
+ tmp = *filename;
+ zval_copy_ctor(&tmp);
+ convert_to_string(&tmp);
+ filename = &tmp;
+ }
+ file_handle.filename = Z_STRVAL_P(filename);
+ file_handle.free_filename = 0;
+ file_handle.type = ZEND_HANDLE_FILENAME;
+ file_handle.opened_path = NULL;
+ file_handle.handle.fp = NULL;
+
+ retval = zend_compile_file(&file_handle, type TSRMLS_CC);
+ if (retval && file_handle.handle.stream.handle) {
+ int dummy = 1;
+
+ if (!file_handle.opened_path) {
+ file_handle.opened_path = opened_path = estrndup(Z_STRVAL_P(filename), Z_STRLEN_P(filename));
+ }
+
+ zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL);
+
+ if (opened_path) {
+ efree(opened_path);
+ }
+ }
+ zend_destroy_file_handle(&file_handle TSRMLS_CC);
+
+ if (filename==&tmp) {
+ zval_dtor(&tmp);
+ }
+ return retval;
+}
+
+ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC)
+{
+ char *buf;
+ size_t size;
+
+ /* enforce ZEND_MMAP_AHEAD trailing NULLs for flex... */
+ Z_STRVAL_P(str) = str_erealloc(Z_STRVAL_P(str), Z_STRLEN_P(str) + ZEND_MMAP_AHEAD);
+ memset(Z_STRVAL_P(str) + Z_STRLEN_P(str), 0, ZEND_MMAP_AHEAD);
+
+ SCNG(yy_in) = NULL;
+ SCNG(yy_start) = NULL;
+
+ buf = Z_STRVAL_P(str);
+ size = Z_STRLEN_P(str);
+
+ if (CG(multibyte)) {
+ SCNG(script_org) = (unsigned char*)buf;
+ SCNG(script_org_size) = size;
+ SCNG(script_filtered) = NULL;
+
+ zend_multibyte_set_filter(zend_multibyte_get_internal_encoding(TSRMLS_C) TSRMLS_CC);
+
+ if (SCNG(input_filter)) {
+ if ((size_t)-1 == SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC)) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script from the detected "
+ "encoding \"%s\" to a compatible encoding", zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding)));
+ }
+ buf = (char*)SCNG(script_filtered);
+ size = SCNG(script_filtered_size);
+ }
+ }
+
+ yy_scan_buffer(buf, size TSRMLS_CC);
+
+ zend_set_compiled_filename(filename TSRMLS_CC);
+ CG(zend_lineno) = 1;
+ CG(increment_lineno) = 0;
+ RESET_DOC_COMMENT();
+ return SUCCESS;
+}
+
+
+ZEND_API size_t zend_get_scanned_file_offset(TSRMLS_D)
+{
+ size_t offset = SCNG(yy_cursor) - SCNG(yy_start);
+ if (SCNG(input_filter)) {
+ size_t original_offset = offset, length = 0;
+ do {
+ unsigned char *p = NULL;
+ if ((size_t)-1 == SCNG(input_filter)(&p, &length, SCNG(script_org), offset TSRMLS_CC)) {
+ return (size_t)-1;
+ }
+ efree(p);
+ if (length > original_offset) {
+ offset--;
+ } else if (length < original_offset) {
+ offset++;
+ }
+ } while (original_offset != length);
+ }
+ return offset;
+}
+
+
+zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
+{
+ zend_lex_state original_lex_state;
+ zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array));
+ zend_op_array *original_active_op_array = CG(active_op_array);
+ zend_op_array *retval;
+ zval tmp;
+ int compiler_result;
+ zend_bool original_in_compilation = CG(in_compilation);
+
+ if (Z_STRLEN_P(source_string)==0) {
+ efree(op_array);
+ return NULL;
+ }
+
+ CG(in_compilation) = 1;
+
+ tmp = *source_string;
+ zval_copy_ctor(&tmp);
+ convert_to_string(&tmp);
+ source_string = &tmp;
+
+ zend_save_lexical_state(&original_lex_state TSRMLS_CC);
+ if (zend_prepare_string_for_scanning(source_string, filename TSRMLS_CC)==FAILURE) {
+ efree(op_array);
+ retval = NULL;
+ } else {
+ zend_bool orig_interactive = CG(interactive);
+
+ CG(interactive) = 0;
+ init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE TSRMLS_CC);
+ CG(interactive) = orig_interactive;
+ CG(active_op_array) = op_array;
+ zend_stack_push(&CG(context_stack), (void *) &CG(context), sizeof(CG(context)));
+ zend_init_compiler_context(TSRMLS_C);
+ BEGIN(ST_IN_SCRIPTING);
+ compiler_result = zendparse(TSRMLS_C);
+
+ if (SCNG(script_filtered)) {
+ efree(SCNG(script_filtered));
+ SCNG(script_filtered) = NULL;
+ }
+
+ if (compiler_result != 0) {
+ CG(active_op_array) = original_active_op_array;
+ CG(unclean_shutdown)=1;
+ destroy_op_array(op_array TSRMLS_CC);
+ efree(op_array);
+ retval = NULL;
+ } else {
+ zend_do_return(NULL, 0 TSRMLS_CC);
+ CG(active_op_array) = original_active_op_array;
+ pass_two(op_array TSRMLS_CC);
+ zend_release_labels(0 TSRMLS_CC);
+ retval = op_array;
+ }
+ }
+ zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ zval_dtor(&tmp);
+ CG(in_compilation) = original_in_compilation;
+ return retval;
+}
+
+
+BEGIN_EXTERN_C()
+int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC)
+{
+ zend_lex_state original_lex_state;
+ zend_file_handle file_handle;
+
+ file_handle.type = ZEND_HANDLE_FILENAME;
+ file_handle.filename = filename;
+ file_handle.free_filename = 0;
+ file_handle.opened_path = NULL;
+ zend_save_lexical_state(&original_lex_state TSRMLS_CC);
+ if (open_file_for_scanning(&file_handle TSRMLS_CC)==FAILURE) {
+ zend_message_dispatcher(ZMSG_FAILED_HIGHLIGHT_FOPEN, filename TSRMLS_CC);
+ zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ return FAILURE;
+ }
+ zend_highlight(syntax_highlighter_ini TSRMLS_CC);
+ if (SCNG(script_filtered)) {
+ efree(SCNG(script_filtered));
+ SCNG(script_filtered) = NULL;
+ }
+ zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ return SUCCESS;
+}
+
+int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC)
+{
+ zend_lex_state original_lex_state;
+ zval tmp = *str;
+
+ str = &tmp;
+ zval_copy_ctor(str);
+ zend_save_lexical_state(&original_lex_state TSRMLS_CC);
+ if (zend_prepare_string_for_scanning(str, str_name TSRMLS_CC)==FAILURE) {
+ zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ return FAILURE;
+ }
+ BEGIN(INITIAL);
+ zend_highlight(syntax_highlighter_ini TSRMLS_CC);
+ if (SCNG(script_filtered)) {
+ efree(SCNG(script_filtered));
+ SCNG(script_filtered) = NULL;
+ }
+ zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ zval_dtor(str);
+ return SUCCESS;
+}
+
+ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, const zend_encoding *old_encoding TSRMLS_DC)
+{
+ size_t length;
+ unsigned char *new_yy_start;
+
+ /* convert and set */
+ if (!SCNG(input_filter)) {
+ if (SCNG(script_filtered)) {
+ efree(SCNG(script_filtered));
+ SCNG(script_filtered) = NULL;
+ }
+ SCNG(script_filtered_size) = 0;
+ length = SCNG(script_org_size);
+ new_yy_start = SCNG(script_org);
+ } else {
+ if ((size_t)-1 == SCNG(input_filter)(&new_yy_start, &length, SCNG(script_org), SCNG(script_org_size) TSRMLS_CC)) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script from the detected "
+ "encoding \"%s\" to a compatible encoding", zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding)));
+ }
+ SCNG(script_filtered) = new_yy_start;
+ SCNG(script_filtered_size) = length;
+ }
+
+ SCNG(yy_cursor) = new_yy_start + (SCNG(yy_cursor) - SCNG(yy_start));
+ SCNG(yy_marker) = new_yy_start + (SCNG(yy_marker) - SCNG(yy_start));
+ SCNG(yy_text) = new_yy_start + (SCNG(yy_text) - SCNG(yy_start));
+ SCNG(yy_limit) = new_yy_start + (SCNG(yy_limit) - SCNG(yy_start));
+
+ SCNG(yy_start) = new_yy_start;
+}
+
+
+# define zend_copy_value(zendlval, yytext, yyleng) \
+ if (SCNG(output_filter)) { \
+ size_t sz = 0; \
+ SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); \
+ Z_STRLEN_P(zendlval) = sz; \
+ } else { \
+ Z_STRVAL_P(zendlval) = (char *) estrndup(yytext, yyleng); \
+ Z_STRLEN_P(zendlval) = yyleng; \
+ }
+
+static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quote_type TSRMLS_DC)
+{
+ register char *s, *t;
+ char *end;
+
+ ZVAL_STRINGL(zendlval, str, len, 1);
+
+ /* convert escape sequences */
+ s = t = Z_STRVAL_P(zendlval);
+ end = s+Z_STRLEN_P(zendlval);
+ while (s<end) {
+ if (*s=='\\') {
+ s++;
+ if (s >= end) {
+ *t++ = '\\';
+ break;
+ }
+
+ switch(*s) {
+ case 'n':
+ *t++ = '\n';
+ Z_STRLEN_P(zendlval)--;
+ break;
+ case 'r':
+ *t++ = '\r';
+ Z_STRLEN_P(zendlval)--;
+ break;
+ case 't':
+ *t++ = '\t';
+ Z_STRLEN_P(zendlval)--;
+ break;
+ case 'f':
+ *t++ = '\f';
+ Z_STRLEN_P(zendlval)--;
+ break;
+ case 'v':
+ *t++ = '\v';
+ Z_STRLEN_P(zendlval)--;
+ break;
+ case 'e':
+#ifdef PHP_WIN32
+ *t++ = VK_ESCAPE;
+#else
+ *t++ = '\e';
+#endif
+ Z_STRLEN_P(zendlval)--;
+ break;
+ case '"':
+ case '`':
+ if (*s != quote_type) {
+ *t++ = '\\';
+ *t++ = *s;
+ break;
+ }
+ case '\\':
+ case '$':
+ *t++ = *s;
+ Z_STRLEN_P(zendlval)--;
+ break;
+ case 'x':
+ case 'X':
+ if (ZEND_IS_HEX(*(s+1))) {
+ char hex_buf[3] = { 0, 0, 0 };
+
+ Z_STRLEN_P(zendlval)--; /* for the 'x' */
+
+ hex_buf[0] = *(++s);
+ Z_STRLEN_P(zendlval)--;
+ if (ZEND_IS_HEX(*(s+1))) {
+ hex_buf[1] = *(++s);
+ Z_STRLEN_P(zendlval)--;
+ }
+ *t++ = (char) strtol(hex_buf, NULL, 16);
+ } else {
+ *t++ = '\\';
+ *t++ = *s;
+ }
+ break;
+ default:
+ /* check for an octal */
+ if (ZEND_IS_OCT(*s)) {
+ char octal_buf[4] = { 0, 0, 0, 0 };
+
+ octal_buf[0] = *s;
+ Z_STRLEN_P(zendlval)--;
+ if (ZEND_IS_OCT(*(s+1))) {
+ octal_buf[1] = *(++s);
+ Z_STRLEN_P(zendlval)--;
+ if (ZEND_IS_OCT(*(s+1))) {
+ octal_buf[2] = *(++s);
+ Z_STRLEN_P(zendlval)--;
+ }
+ }
+ *t++ = (char) strtol(octal_buf, NULL, 8);
+ } else {
+ *t++ = '\\';
+ *t++ = *s;
+ }
+ break;
+ }
+ } else {
+ *t++ = *s;
+ }
+
+ if (*s == '\n' || (*s == '\r' && (*(s+1) != '\n'))) {
+ CG(zend_lineno)++;
+ }
+ s++;
+ }
+ *t = 0;
+ if (SCNG(output_filter)) {
+ size_t sz = 0;
+ s = Z_STRVAL_P(zendlval);
+ SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC);
+ Z_STRLEN_P(zendlval) = sz;
+ efree(s);
+ }
+}
+
+
+int lex_scan(zval *zendlval TSRMLS_DC)
+{
+restart:
+ SCNG(yy_text) = YYCURSOR;
+
+yymore_restart:
+
+
+#line 1001 "Zend/zend_language_scanner.c"
+{
+ YYCTYPE yych;
+ unsigned int yyaccept = 0;
+ if (YYGETCONDITION() < 5) {
+ if (YYGETCONDITION() < 2) {
+ if (YYGETCONDITION() < 1) {
+ goto yyc_ST_IN_SCRIPTING;
+ } else {
+ goto yyc_ST_LOOKING_FOR_PROPERTY;
+ }
+ } else {
+ if (YYGETCONDITION() < 3) {
+ goto yyc_ST_BACKQUOTE;
+ } else {
+ if (YYGETCONDITION() < 4) {
+ goto yyc_ST_DOUBLE_QUOTES;
+ } else {
+ goto yyc_ST_HEREDOC;
+ }
+ }
+ }
+ } else {
+ if (YYGETCONDITION() < 7) {
+ if (YYGETCONDITION() < 6) {
+ goto yyc_ST_LOOKING_FOR_VARNAME;
+ } else {
+ goto yyc_ST_VAR_OFFSET;
+ }
+ } else {
+ if (YYGETCONDITION() < 8) {
+ goto yyc_INITIAL;
+ } else {
+ if (YYGETCONDITION() < 9) {
+ goto yyc_ST_END_HEREDOC;
+ } else {
+ goto yyc_ST_NOWDOC;
+ }
+ }
+ }
+ }
+/* *********************************** */
+yyc_INITIAL:
+ {
+ static const unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 128, 128, 0, 0, 128, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 128, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ };
+
+ YYDEBUG(0, *YYCURSOR);
+ YYFILL(8);
+ yych = *YYCURSOR;
+ if (yych != '<') goto yy4;
+ YYDEBUG(2, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '?') {
+ if (yych == '%') goto yy7;
+ if (yych >= '?') goto yy5;
+ } else {
+ if (yych <= 'S') {
+ if (yych >= 'S') goto yy9;
+ } else {
+ if (yych == 's') goto yy9;
+ }
+ }
+yy3:
+ YYDEBUG(3, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1749 "Zend/zend_language_scanner.l"
+ {
+ if (YYCURSOR > YYLIMIT) {
+ return 0;
+ }
+
+inline_char_handler:
+
+ while (1) {
+ YYCTYPE *ptr = memchr(YYCURSOR, '<', YYLIMIT - YYCURSOR);
+
+ YYCURSOR = ptr ? ptr + 1 : YYLIMIT;
+
+ if (YYCURSOR < YYLIMIT) {
+ switch (*YYCURSOR) {
+ case '?':
+ if (CG(short_tags) || !strncasecmp((char*)YYCURSOR + 1, "php", 3) || (*(YYCURSOR + 1) == '=')) { /* Assume [ \t\n\r] follows "php" */
+ break;
+ }
+ continue;
+ case '%':
+ if (CG(asp_tags)) {
+ break;
+ }
+ continue;
+ case 's':
+ case 'S':
+ /* Probably NOT an opening PHP <script> tag, so don't end the HTML chunk yet
+ * If it is, the PHP <script> tag rule checks for any HTML scanned before it */
+ YYCURSOR--;
+ yymore();
+ default:
+ continue;
+ }
+
+ YYCURSOR--;
+ }
+
+ break;
+ }
+
+inline_html:
+ yyleng = YYCURSOR - SCNG(yy_text);
+
+ if (SCNG(output_filter)) {
+ int readsize;
+ size_t sz = 0;
+ readsize = SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC);
+ Z_STRLEN_P(zendlval) = sz;
+ if (readsize < yyleng) {
+ yyless(readsize);
+ }
+ } else {
+ Z_STRVAL_P(zendlval) = (char *) estrndup(yytext, yyleng);
+ Z_STRLEN_P(zendlval) = yyleng;
+ }
+ zendlval->type = IS_STRING;
+ HANDLE_NEWLINES(yytext, yyleng);
+ return T_INLINE_HTML;
+}
+#line 1160 "Zend/zend_language_scanner.c"
+yy4:
+ YYDEBUG(4, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy3;
+yy5:
+ YYDEBUG(5, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= 'O') {
+ if (yych == '=') goto yy45;
+ } else {
+ if (yych <= 'P') goto yy47;
+ if (yych == 'p') goto yy47;
+ }
+yy6:
+ YYDEBUG(6, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1739 "Zend/zend_language_scanner.l"
+ {
+ if (CG(short_tags)) {
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
+ BEGIN(ST_IN_SCRIPTING);
+ return T_OPEN_TAG;
+ } else {
+ goto inline_char_handler;
+ }
+}
+#line 1188 "Zend/zend_language_scanner.c"
+yy7:
+ YYDEBUG(7, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) == '=') goto yy43;
+ YYDEBUG(8, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1720 "Zend/zend_language_scanner.l"
+ {
+ if (CG(asp_tags)) {
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
+ BEGIN(ST_IN_SCRIPTING);
+ return T_OPEN_TAG;
+ } else {
+ goto inline_char_handler;
+ }
+}
+#line 1205 "Zend/zend_language_scanner.c"
+yy9:
+ YYDEBUG(9, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy11;
+ if (yych == 'c') goto yy11;
+yy10:
+ YYDEBUG(10, *YYCURSOR);
+ YYCURSOR = YYMARKER;
+ if (yyaccept <= 0) {
+ goto yy3;
+ } else {
+ goto yy6;
+ }
+yy11:
+ YYDEBUG(11, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy12;
+ if (yych != 'r') goto yy10;
+yy12:
+ YYDEBUG(12, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'I') goto yy13;
+ if (yych != 'i') goto yy10;
+yy13:
+ YYDEBUG(13, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'P') goto yy14;
+ if (yych != 'p') goto yy10;
+yy14:
+ YYDEBUG(14, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy15;
+ if (yych != 't') goto yy10;
+yy15:
+ YYDEBUG(15, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy10;
+ if (yych == 'l') goto yy10;
+ goto yy17;
+yy16:
+ YYDEBUG(16, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(8);
+ yych = *YYCURSOR;
+yy17:
+ YYDEBUG(17, *YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy16;
+ }
+ if (yych == 'L') goto yy18;
+ if (yych != 'l') goto yy10;
+yy18:
+ YYDEBUG(18, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy19;
+ if (yych != 'a') goto yy10;
+yy19:
+ YYDEBUG(19, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy20;
+ if (yych != 'n') goto yy10;
+yy20:
+ YYDEBUG(20, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'G') goto yy21;
+ if (yych != 'g') goto yy10;
+yy21:
+ YYDEBUG(21, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'U') goto yy22;
+ if (yych != 'u') goto yy10;
+yy22:
+ YYDEBUG(22, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy23;
+ if (yych != 'a') goto yy10;
+yy23:
+ YYDEBUG(23, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'G') goto yy24;
+ if (yych != 'g') goto yy10;
+yy24:
+ YYDEBUG(24, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy25;
+ if (yych != 'e') goto yy10;
+yy25:
+ YYDEBUG(25, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(26, *YYCURSOR);
+ if (yych <= '\r') {
+ if (yych <= 0x08) goto yy10;
+ if (yych <= '\n') goto yy25;
+ if (yych <= '\f') goto yy10;
+ goto yy25;
+ } else {
+ if (yych <= ' ') {
+ if (yych <= 0x1F) goto yy10;
+ goto yy25;
+ } else {
+ if (yych != '=') goto yy10;
+ }
+ }
+yy27:
+ YYDEBUG(27, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(5);
+ yych = *YYCURSOR;
+ YYDEBUG(28, *YYCURSOR);
+ if (yych <= '!') {
+ if (yych <= '\f') {
+ if (yych <= 0x08) goto yy10;
+ if (yych <= '\n') goto yy27;
+ goto yy10;
+ } else {
+ if (yych <= '\r') goto yy27;
+ if (yych == ' ') goto yy27;
+ goto yy10;
+ }
+ } else {
+ if (yych <= 'O') {
+ if (yych <= '"') goto yy30;
+ if (yych == '\'') goto yy31;
+ goto yy10;
+ } else {
+ if (yych <= 'P') goto yy29;
+ if (yych != 'p') goto yy10;
+ }
+ }
+yy29:
+ YYDEBUG(29, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'H') goto yy42;
+ if (yych == 'h') goto yy42;
+ goto yy10;
+yy30:
+ YYDEBUG(30, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'P') goto yy39;
+ if (yych == 'p') goto yy39;
+ goto yy10;
+yy31:
+ YYDEBUG(31, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'P') goto yy32;
+ if (yych != 'p') goto yy10;
+yy32:
+ YYDEBUG(32, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'H') goto yy33;
+ if (yych != 'h') goto yy10;
+yy33:
+ YYDEBUG(33, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'P') goto yy34;
+ if (yych != 'p') goto yy10;
+yy34:
+ YYDEBUG(34, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych != '\'') goto yy10;
+yy35:
+ YYDEBUG(35, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(36, *YYCURSOR);
+ if (yych <= '\r') {
+ if (yych <= 0x08) goto yy10;
+ if (yych <= '\n') goto yy35;
+ if (yych <= '\f') goto yy10;
+ goto yy35;
+ } else {
+ if (yych <= ' ') {
+ if (yych <= 0x1F) goto yy10;
+ goto yy35;
+ } else {
+ if (yych != '>') goto yy10;
+ }
+ }
+ YYDEBUG(37, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(38, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1686 "Zend/zend_language_scanner.l"
+ {
+ YYCTYPE *bracket = (YYCTYPE*)zend_memrchr(yytext, '<', yyleng - (sizeof("script language=php>") - 1));
+
+ if (bracket != SCNG(yy_text)) {
+ /* Handle previously scanned HTML, as possible <script> tags found are assumed to not be PHP's */
+ YYCURSOR = bracket;
+ goto inline_html;
+ }
+
+ HANDLE_NEWLINES(yytext, yyleng);
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
+ BEGIN(ST_IN_SCRIPTING);
+ return T_OPEN_TAG;
+}
+#line 1406 "Zend/zend_language_scanner.c"
+yy39:
+ YYDEBUG(39, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'H') goto yy40;
+ if (yych != 'h') goto yy10;
+yy40:
+ YYDEBUG(40, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'P') goto yy41;
+ if (yych != 'p') goto yy10;
+yy41:
+ YYDEBUG(41, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '"') goto yy35;
+ goto yy10;
+yy42:
+ YYDEBUG(42, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'P') goto yy35;
+ if (yych == 'p') goto yy35;
+ goto yy10;
+yy43:
+ YYDEBUG(43, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(44, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1702 "Zend/zend_language_scanner.l"
+ {
+ if (CG(asp_tags)) {
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
+ BEGIN(ST_IN_SCRIPTING);
+ return T_OPEN_TAG_WITH_ECHO;
+ } else {
+ goto inline_char_handler;
+ }
+}
+#line 1443 "Zend/zend_language_scanner.c"
+yy45:
+ YYDEBUG(45, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(46, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1713 "Zend/zend_language_scanner.l"
+ {
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
+ BEGIN(ST_IN_SCRIPTING);
+ return T_OPEN_TAG_WITH_ECHO;
+}
+#line 1455 "Zend/zend_language_scanner.c"
+yy47:
+ YYDEBUG(47, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'H') goto yy48;
+ if (yych != 'h') goto yy10;
+yy48:
+ YYDEBUG(48, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'P') goto yy49;
+ if (yych != 'p') goto yy10;
+yy49:
+ YYDEBUG(49, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= '\f') {
+ if (yych <= 0x08) goto yy10;
+ if (yych >= '\v') goto yy10;
+ } else {
+ if (yych <= '\r') goto yy52;
+ if (yych != ' ') goto yy10;
+ }
+yy50:
+ YYDEBUG(50, *YYCURSOR);
+ ++YYCURSOR;
+yy51:
+ YYDEBUG(51, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1731 "Zend/zend_language_scanner.l"
+ {
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
+ HANDLE_NEWLINE(yytext[yyleng-1]);
+ BEGIN(ST_IN_SCRIPTING);
+ return T_OPEN_TAG;
+}
+#line 1489 "Zend/zend_language_scanner.c"
+yy52:
+ YYDEBUG(52, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) == '\n') goto yy50;
+ goto yy51;
+ }
+/* *********************************** */
+yyc_ST_BACKQUOTE:
+ {
+ static const unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 0, 0, 0, 0, 0, 0,
+ 0, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 0, 0, 0, 0, 128,
+ 0, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 0, 0, 0, 0, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ };
+ YYDEBUG(53, *YYCURSOR);
+ YYFILL(2);
+ yych = *YYCURSOR;
+ if (yych <= '_') {
+ if (yych != '$') goto yy60;
+ } else {
+ if (yych <= '`') goto yy58;
+ if (yych == '{') goto yy57;
+ goto yy60;
+ }
+ YYDEBUG(55, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) <= '_') {
+ if (yych <= '@') goto yy56;
+ if (yych <= 'Z') goto yy63;
+ if (yych >= '_') goto yy63;
+ } else {
+ if (yych <= 'z') {
+ if (yych >= 'a') goto yy63;
+ } else {
+ if (yych <= '{') goto yy66;
+ if (yych >= 0x7F) goto yy63;
+ }
+ }
+yy56:
+ YYDEBUG(56, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 2194 "Zend/zend_language_scanner.l"
+ {
+ if (YYCURSOR > YYLIMIT) {
+ return 0;
+ }
+ if (yytext[0] == '\\' && YYCURSOR < YYLIMIT) {
+ YYCURSOR++;
+ }
+
+ while (YYCURSOR < YYLIMIT) {
+ switch (*YYCURSOR++) {
+ case '`':
+ break;
+ case '$':
+ if (IS_LABEL_START(*YYCURSOR) || *YYCURSOR == '{') {
+ break;
+ }
+ continue;
+ case '{':
+ if (*YYCURSOR == '$') {
+ break;
+ }
+ continue;
+ case '\\':
+ if (YYCURSOR < YYLIMIT) {
+ YYCURSOR++;
+ }
+ /* fall through */
+ default:
+ continue;
+ }
+
+ YYCURSOR--;
+ break;
+ }
+
+ yyleng = YYCURSOR - SCNG(yy_text);
+
+ zend_scan_escape_string(zendlval, yytext, yyleng, '`' TSRMLS_CC);
+ return T_ENCAPSED_AND_WHITESPACE;
+}
+#line 1601 "Zend/zend_language_scanner.c"
+yy57:
+ YYDEBUG(57, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '$') goto yy61;
+ goto yy56;
+yy58:
+ YYDEBUG(58, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(59, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 2138 "Zend/zend_language_scanner.l"
+ {
+ BEGIN(ST_IN_SCRIPTING);
+ return '`';
+}
+#line 1617 "Zend/zend_language_scanner.c"
+yy60:
+ YYDEBUG(60, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy56;
+yy61:
+ YYDEBUG(61, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(62, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 2125 "Zend/zend_language_scanner.l"
+ {
+ Z_LVAL_P(zendlval) = (long) '{';
+ yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
+ yyless(1);
+ return T_CURLY_OPEN;
+}
+#line 1634 "Zend/zend_language_scanner.c"
+yy63:
+ YYDEBUG(63, *YYCURSOR);
+ yyaccept = 0;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(3);
+ yych = *YYCURSOR;
+ YYDEBUG(64, *YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy63;
+ }
+ if (yych == '-') goto yy68;
+ if (yych == '[') goto yy70;
+yy65:
+ YYDEBUG(65, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1831 "Zend/zend_language_scanner.l"
+ {
+ zend_copy_value(zendlval, (yytext+1), (yyleng-1));
+ zendlval->type = IS_STRING;
+ return T_VARIABLE;
+}
+#line 1656 "Zend/zend_language_scanner.c"
+yy66:
+ YYDEBUG(66, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(67, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1465 "Zend/zend_language_scanner.l"
+ {
+ yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
+ return T_DOLLAR_OPEN_CURLY_BRACES;
+}
+#line 1667 "Zend/zend_language_scanner.c"
+yy68:
+ YYDEBUG(68, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '>') goto yy72;
+yy69:
+ YYDEBUG(69, *YYCURSOR);
+ YYCURSOR = YYMARKER;
+ goto yy65;
+yy70:
+ YYDEBUG(70, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(71, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1823 "Zend/zend_language_scanner.l"
+ {
+ yyless(yyleng - 1);
+ yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
+ zend_copy_value(zendlval, (yytext+1), (yyleng-1));
+ zendlval->type = IS_STRING;
+ return T_VARIABLE;
+}
+#line 1689 "Zend/zend_language_scanner.c"
+yy72:
+ YYDEBUG(72, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= '_') {
+ if (yych <= '@') goto yy69;
+ if (yych <= 'Z') goto yy73;
+ if (yych <= '^') goto yy69;
+ } else {
+ if (yych <= '`') goto yy69;
+ if (yych <= 'z') goto yy73;
+ if (yych <= '~') goto yy69;
+ }
+yy73:
+ YYDEBUG(73, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(74, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1813 "Zend/zend_language_scanner.l"
+ {
+ yyless(yyleng - 3);
+ yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
+ zend_copy_value(zendlval, (yytext+1), (yyleng-1));
+ zendlval->type = IS_STRING;
+ return T_VARIABLE;
+}
+#line 1715 "Zend/zend_language_scanner.c"
+ }
+/* *********************************** */
+yyc_ST_DOUBLE_QUOTES:
+ {
+ static const unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 0, 0, 0, 0, 0, 0,
+ 0, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 0, 0, 0, 0, 128,
+ 0, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 0, 0, 0, 0, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ };
+ YYDEBUG(75, *YYCURSOR);
+ YYFILL(2);
+ yych = *YYCURSOR;
+ if (yych <= '#') {
+ if (yych == '"') goto yy80;
+ goto yy82;
+ } else {
+ if (yych <= '$') goto yy77;
+ if (yych == '{') goto yy79;
+ goto yy82;
+ }
+yy77:
+ YYDEBUG(77, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) <= '_') {
+ if (yych <= '@') goto yy78;
+ if (yych <= 'Z') goto yy85;
+ if (yych >= '_') goto yy85;
+ } else {
+ if (yych <= 'z') {
+ if (yych >= 'a') goto yy85;
+ } else {
+ if (yych <= '{') goto yy88;
+ if (yych >= 0x7F) goto yy85;
+ }
+ }
+yy78:
+ YYDEBUG(78, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 2144 "Zend/zend_language_scanner.l"
+ {
+ if (GET_DOUBLE_QUOTES_SCANNED_LENGTH()) {
+ YYCURSOR += GET_DOUBLE_QUOTES_SCANNED_LENGTH() - 1;
+ SET_DOUBLE_QUOTES_SCANNED_LENGTH(0);
+
+ goto double_quotes_scan_done;
+ }
+
+ if (YYCURSOR > YYLIMIT) {
+ return 0;
+ }
+ if (yytext[0] == '\\' && YYCURSOR < YYLIMIT) {
+ YYCURSOR++;
+ }
+
+ while (YYCURSOR < YYLIMIT) {
+ switch (*YYCURSOR++) {
+ case '"':
+ break;
+ case '$':
+ if (IS_LABEL_START(*YYCURSOR) || *YYCURSOR == '{') {
+ break;
+ }
+ continue;
+ case '{':
+ if (*YYCURSOR == '$') {
+ break;
+ }
+ continue;
+ case '\\':
+ if (YYCURSOR < YYLIMIT) {
+ YYCURSOR++;
+ }
+ /* fall through */
+ default:
+ continue;
+ }
+
+ YYCURSOR--;
+ break;
+ }
+
+double_quotes_scan_done:
+ yyleng = YYCURSOR - SCNG(yy_text);
+
+ zend_scan_escape_string(zendlval, yytext, yyleng, '"' TSRMLS_CC);
+ return T_ENCAPSED_AND_WHITESPACE;
+}
+#line 1832 "Zend/zend_language_scanner.c"
+yy79:
+ YYDEBUG(79, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '$') goto yy83;
+ goto yy78;
+yy80:
+ YYDEBUG(80, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(81, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 2133 "Zend/zend_language_scanner.l"
+ {
+ BEGIN(ST_IN_SCRIPTING);
+ return '"';
+}
+#line 1848 "Zend/zend_language_scanner.c"
+yy82:
+ YYDEBUG(82, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy78;
+yy83:
+ YYDEBUG(83, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(84, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 2125 "Zend/zend_language_scanner.l"
+ {
+ Z_LVAL_P(zendlval) = (long) '{';
+ yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
+ yyless(1);
+ return T_CURLY_OPEN;
+}
+#line 1865 "Zend/zend_language_scanner.c"
+yy85:
+ YYDEBUG(85, *YYCURSOR);
+ yyaccept = 0;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(3);
+ yych = *YYCURSOR;
+ YYDEBUG(86, *YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy85;
+ }
+ if (yych == '-') goto yy90;
+ if (yych == '[') goto yy92;
+yy87:
+ YYDEBUG(87, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1831 "Zend/zend_language_scanner.l"
+ {
+ zend_copy_value(zendlval, (yytext+1), (yyleng-1));
+ zendlval->type = IS_STRING;
+ return T_VARIABLE;
+}
+#line 1887 "Zend/zend_language_scanner.c"
+yy88:
+ YYDEBUG(88, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(89, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1465 "Zend/zend_language_scanner.l"
+ {
+ yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
+ return T_DOLLAR_OPEN_CURLY_BRACES;
+}
+#line 1898 "Zend/zend_language_scanner.c"
+yy90:
+ YYDEBUG(90, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '>') goto yy94;
+yy91:
+ YYDEBUG(91, *YYCURSOR);
+ YYCURSOR = YYMARKER;
+ goto yy87;
+yy92:
+ YYDEBUG(92, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(93, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1823 "Zend/zend_language_scanner.l"
+ {
+ yyless(yyleng - 1);
+ yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
+ zend_copy_value(zendlval, (yytext+1), (yyleng-1));
+ zendlval->type = IS_STRING;
+ return T_VARIABLE;
+}
+#line 1920 "Zend/zend_language_scanner.c"
+yy94:
+ YYDEBUG(94, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= '_') {
+ if (yych <= '@') goto yy91;
+ if (yych <= 'Z') goto yy95;
+ if (yych <= '^') goto yy91;
+ } else {
+ if (yych <= '`') goto yy91;
+ if (yych <= 'z') goto yy95;
+ if (yych <= '~') goto yy91;
+ }
+yy95:
+ YYDEBUG(95, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(96, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1813 "Zend/zend_language_scanner.l"
+ {
+ yyless(yyleng - 3);
+ yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
+ zend_copy_value(zendlval, (yytext+1), (yyleng-1));
+ zendlval->type = IS_STRING;
+ return T_VARIABLE;
+}
+#line 1946 "Zend/zend_language_scanner.c"
+ }
+/* *********************************** */
+yyc_ST_END_HEREDOC:
+ YYDEBUG(97, *YYCURSOR);
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(99, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(100, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 2111 "Zend/zend_language_scanner.l"
+ {
+ zend_heredoc_label *heredoc_label = zend_ptr_stack_pop(&SCNG(heredoc_label_stack));
+
+ YYCURSOR += heredoc_label->length - 1;
+ yyleng = heredoc_label->length;
+
+ heredoc_label_dtor(heredoc_label);
+ efree(heredoc_label);
+
+ BEGIN(ST_IN_SCRIPTING);
+ return T_END_HEREDOC;
+}
+#line 1970 "Zend/zend_language_scanner.c"
+/* *********************************** */
+yyc_ST_HEREDOC:
+ {
+ static const unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 0, 0, 0, 0, 0, 0,
+ 0, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 0, 0, 0, 0, 128,
+ 0, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 0, 0, 0, 0, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ };
+ YYDEBUG(101, *YYCURSOR);
+ YYFILL(2);
+ yych = *YYCURSOR;
+ if (yych == '$') goto yy103;
+ if (yych == '{') goto yy105;
+ goto yy106;
+yy103:
+ YYDEBUG(103, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) <= '_') {
+ if (yych <= '@') goto yy104;
+ if (yych <= 'Z') goto yy109;
+ if (yych >= '_') goto yy109;
+ } else {
+ if (yych <= 'z') {
+ if (yych >= 'a') goto yy109;
+ } else {
+ if (yych <= '{') goto yy112;
+ if (yych >= 0x7F) goto yy109;
+ }
+ }
+yy104:
+ YYDEBUG(104, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 2236 "Zend/zend_language_scanner.l"
+ {
+ int newline = 0;
+
+ zend_heredoc_label *heredoc_label = zend_ptr_stack_top(&SCNG(heredoc_label_stack));
+
+ if (YYCURSOR > YYLIMIT) {
+ return 0;
+ }
+
+ YYCURSOR--;
+
+ while (YYCURSOR < YYLIMIT) {
+ switch (*YYCURSOR++) {
+ case '\r':
+ if (*YYCURSOR == '\n') {
+ YYCURSOR++;
+ }
+ /* fall through */
+ case '\n':
+ /* Check for ending label on the next line */
+ if (IS_LABEL_START(*YYCURSOR) && heredoc_label->length < YYLIMIT - YYCURSOR && !memcmp(YYCURSOR, heredoc_label->label, heredoc_label->length)) {
+ YYCTYPE *end = YYCURSOR + heredoc_label->length;
+
+ if (*end == ';') {
+ end++;
+ }
+
+ if (*end == '\n' || *end == '\r') {
+ /* newline before label will be subtracted from returned text, but
+ * yyleng/yytext will include it, for zend_highlight/strip, tokenizer, etc. */
+ if (YYCURSOR[-2] == '\r' && YYCURSOR[-1] == '\n') {
+ newline = 2; /* Windows newline */
+ } else {
+ newline = 1;
+ }
+
+ CG(increment_lineno) = 1; /* For newline before label */
+ BEGIN(ST_END_HEREDOC);
+
+ goto heredoc_scan_done;
+ }
+ }
+ continue;
+ case '$':
+ if (IS_LABEL_START(*YYCURSOR) || *YYCURSOR == '{') {
+ break;
+ }
+ continue;
+ case '{':
+ if (*YYCURSOR == '$') {
+ break;
+ }
+ continue;
+ case '\\':
+ if (YYCURSOR < YYLIMIT && *YYCURSOR != '\n' && *YYCURSOR != '\r') {
+ YYCURSOR++;
+ }
+ /* fall through */
+ default:
+ continue;
+ }
+
+ YYCURSOR--;
+ break;
+ }
+
+heredoc_scan_done:
+ yyleng = YYCURSOR - SCNG(yy_text);
+
+ zend_scan_escape_string(zendlval, yytext, yyleng - newline, 0 TSRMLS_CC);
+ return T_ENCAPSED_AND_WHITESPACE;
+}
+#line 2105 "Zend/zend_language_scanner.c"
+yy105:
+ YYDEBUG(105, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '$') goto yy107;
+ goto yy104;
+yy106:
+ YYDEBUG(106, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy104;
+yy107:
+ YYDEBUG(107, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(108, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 2125 "Zend/zend_language_scanner.l"
+ {
+ Z_LVAL_P(zendlval) = (long) '{';
+ yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
+ yyless(1);
+ return T_CURLY_OPEN;
+}
+#line 2127 "Zend/zend_language_scanner.c"
+yy109:
+ YYDEBUG(109, *YYCURSOR);
+ yyaccept = 0;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(3);
+ yych = *YYCURSOR;
+ YYDEBUG(110, *YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy109;
+ }
+ if (yych == '-') goto yy114;
+ if (yych == '[') goto yy116;
+yy111:
+ YYDEBUG(111, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1831 "Zend/zend_language_scanner.l"
+ {
+ zend_copy_value(zendlval, (yytext+1), (yyleng-1));
+ zendlval->type = IS_STRING;
+ return T_VARIABLE;
+}
+#line 2149 "Zend/zend_language_scanner.c"
+yy112:
+ YYDEBUG(112, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(113, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1465 "Zend/zend_language_scanner.l"
+ {
+ yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
+ return T_DOLLAR_OPEN_CURLY_BRACES;
+}
+#line 2160 "Zend/zend_language_scanner.c"
+yy114:
+ YYDEBUG(114, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '>') goto yy118;
+yy115:
+ YYDEBUG(115, *YYCURSOR);
+ YYCURSOR = YYMARKER;
+ goto yy111;
+yy116:
+ YYDEBUG(116, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(117, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1823 "Zend/zend_language_scanner.l"
+ {
+ yyless(yyleng - 1);
+ yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
+ zend_copy_value(zendlval, (yytext+1), (yyleng-1));
+ zendlval->type = IS_STRING;
+ return T_VARIABLE;
+}
+#line 2182 "Zend/zend_language_scanner.c"
+yy118:
+ YYDEBUG(118, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= '_') {
+ if (yych <= '@') goto yy115;
+ if (yych <= 'Z') goto yy119;
+ if (yych <= '^') goto yy115;
+ } else {
+ if (yych <= '`') goto yy115;
+ if (yych <= 'z') goto yy119;
+ if (yych <= '~') goto yy115;
+ }
+yy119:
+ YYDEBUG(119, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(120, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1813 "Zend/zend_language_scanner.l"
+ {
+ yyless(yyleng - 3);
+ yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
+ zend_copy_value(zendlval, (yytext+1), (yyleng-1));
+ zendlval->type = IS_STRING;
+ return T_VARIABLE;
+}
+#line 2208 "Zend/zend_language_scanner.c"
+ }
+/* *********************************** */
+yyc_ST_IN_SCRIPTING:
+ {
+ static const unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 192, 64, 0, 0, 64, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 192, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 60, 60, 44, 44, 44, 44, 44, 44,
+ 44, 44, 0, 0, 0, 0, 0, 0,
+ 0, 36, 36, 36, 36, 36, 36, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 0, 0, 0, 0, 4,
+ 0, 36, 36, 36, 36, 36, 36, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 0, 0, 0, 0, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ };
+ YYDEBUG(121, *YYCURSOR);
+ YYFILL(16);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch (yych) {
+ case 0x00:
+ case 0x01:
+ case 0x02:
+ case 0x03:
+ case 0x04:
+ case 0x05:
+ case 0x06:
+ case 0x07:
+ case 0x08:
+ case '\v':
+ case '\f':
+ case 0x0E:
+ case 0x0F:
+ case 0x10:
+ case 0x11:
+ case 0x12:
+ case 0x13:
+ case 0x14:
+ case 0x15:
+ case 0x16:
+ case 0x17:
+ case 0x18:
+ case 0x19:
+ case 0x1A:
+ case 0x1B:
+ case 0x1C:
+ case 0x1D:
+ case 0x1E:
+ case 0x1F: goto yy184;
+ case '\t':
+ case '\n':
+ case '\r':
+ case ' ': goto yy140;
+ case '!': goto yy154;
+ case '"': goto yy180;
+ case '#': goto yy176;
+ case '$': goto yy165;
+ case '%': goto yy159;
+ case '&': goto yy160;
+ case '\'': goto yy178;
+ case '(': goto yy148;
+ case ')':
+ case ',':
+ case ';':
+ case '@':
+ case '[':
+ case ']':
+ case '~': goto yy166;
+ case '*': goto yy157;
+ case '+': goto yy153;
+ case '-': goto yy138;
+ case '.': goto yy145;
+ case '/': goto yy158;
+ case '0': goto yy172;
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy174;
+ case ':': goto yy142;
+ case '<': goto yy155;
+ case '=': goto yy151;
+ case '>': goto yy156;
+ case '?': goto yy167;
+ case 'A':
+ case 'a': goto yy133;
+ case 'B':
+ case 'b': goto yy135;
+ case 'C':
+ case 'c': goto yy127;
+ case 'D':
+ case 'd': goto yy125;
+ case 'E':
+ case 'e': goto yy123;
+ case 'F':
+ case 'f': goto yy126;
+ case 'G':
+ case 'g': goto yy136;
+ case 'I':
+ case 'i': goto yy131;
+ case 'L':
+ case 'l': goto yy152;
+ case 'N':
+ case 'n': goto yy146;
+ case 'O':
+ case 'o': goto yy163;
+ case 'P':
+ case 'p': goto yy137;
+ case 'R':
+ case 'r': goto yy128;
+ case 'S':
+ case 's': goto yy134;
+ case 'T':
+ case 't': goto yy130;
+ case 'U':
+ case 'u': goto yy149;
+ case 'V':
+ case 'v': goto yy147;
+ case 'W':
+ case 'w': goto yy132;
+ case 'X':
+ case 'x': goto yy164;
+ case 'Y':
+ case 'y': goto yy129;
+ case '\\': goto yy143;
+ case '^': goto yy162;
+ case '_': goto yy150;
+ case '`': goto yy182;
+ case '{': goto yy168;
+ case '|': goto yy161;
+ case '}': goto yy170;
+ default: goto yy175;
+ }
+yy123:
+ YYDEBUG(123, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch ((yych = *YYCURSOR)) {
+ case 'C':
+ case 'c': goto yy742;
+ case 'L':
+ case 'l': goto yy743;
+ case 'M':
+ case 'm': goto yy744;
+ case 'N':
+ case 'n': goto yy745;
+ case 'V':
+ case 'v': goto yy746;
+ case 'X':
+ case 'x': goto yy747;
+ default: goto yy187;
+ }
+yy124:
+ YYDEBUG(124, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1854 "Zend/zend_language_scanner.l"
+ {
+ zend_copy_value(zendlval, yytext, yyleng);
+ zendlval->type = IS_STRING;
+ return T_STRING;
+}
+#line 2397 "Zend/zend_language_scanner.c"
+yy125:
+ YYDEBUG(125, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'O') {
+ if (yych <= 'H') {
+ if (yych == 'E') goto yy724;
+ goto yy187;
+ } else {
+ if (yych <= 'I') goto yy725;
+ if (yych <= 'N') goto yy187;
+ goto yy726;
+ }
+ } else {
+ if (yych <= 'h') {
+ if (yych == 'e') goto yy724;
+ goto yy187;
+ } else {
+ if (yych <= 'i') goto yy725;
+ if (yych == 'o') goto yy726;
+ goto yy187;
+ }
+ }
+yy126:
+ YYDEBUG(126, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'U') {
+ if (yych <= 'N') {
+ if (yych == 'I') goto yy700;
+ goto yy187;
+ } else {
+ if (yych <= 'O') goto yy701;
+ if (yych <= 'T') goto yy187;
+ goto yy702;
+ }
+ } else {
+ if (yych <= 'n') {
+ if (yych == 'i') goto yy700;
+ goto yy187;
+ } else {
+ if (yych <= 'o') goto yy701;
+ if (yych == 'u') goto yy702;
+ goto yy187;
+ }
+ }
+yy127:
+ YYDEBUG(127, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'O') {
+ if (yych <= 'K') {
+ if (yych == 'A') goto yy665;
+ goto yy187;
+ } else {
+ if (yych <= 'L') goto yy666;
+ if (yych <= 'N') goto yy187;
+ goto yy667;
+ }
+ } else {
+ if (yych <= 'k') {
+ if (yych == 'a') goto yy665;
+ goto yy187;
+ } else {
+ if (yych <= 'l') goto yy666;
+ if (yych == 'o') goto yy667;
+ goto yy187;
+ }
+ }
+yy128:
+ YYDEBUG(128, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy647;
+ if (yych == 'e') goto yy647;
+ goto yy187;
+yy129:
+ YYDEBUG(129, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'I') goto yy642;
+ if (yych == 'i') goto yy642;
+ goto yy187;
+yy130:
+ YYDEBUG(130, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'R') {
+ if (yych == 'H') goto yy630;
+ if (yych <= 'Q') goto yy187;
+ goto yy631;
+ } else {
+ if (yych <= 'h') {
+ if (yych <= 'g') goto yy187;
+ goto yy630;
+ } else {
+ if (yych == 'r') goto yy631;
+ goto yy187;
+ }
+ }
+yy131:
+ YYDEBUG(131, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'S') {
+ if (yych <= 'L') {
+ if (yych == 'F') goto yy577;
+ goto yy187;
+ } else {
+ if (yych <= 'M') goto yy579;
+ if (yych <= 'N') goto yy580;
+ if (yych <= 'R') goto yy187;
+ goto yy581;
+ }
+ } else {
+ if (yych <= 'm') {
+ if (yych == 'f') goto yy577;
+ if (yych <= 'l') goto yy187;
+ goto yy579;
+ } else {
+ if (yych <= 'n') goto yy580;
+ if (yych == 's') goto yy581;
+ goto yy187;
+ }
+ }
+yy132:
+ YYDEBUG(132, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'H') goto yy572;
+ if (yych == 'h') goto yy572;
+ goto yy187;
+yy133:
+ YYDEBUG(133, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'S') {
+ if (yych <= 'M') {
+ if (yych == 'B') goto yy554;
+ goto yy187;
+ } else {
+ if (yych <= 'N') goto yy555;
+ if (yych <= 'Q') goto yy187;
+ if (yych <= 'R') goto yy556;
+ goto yy557;
+ }
+ } else {
+ if (yych <= 'n') {
+ if (yych == 'b') goto yy554;
+ if (yych <= 'm') goto yy187;
+ goto yy555;
+ } else {
+ if (yych <= 'q') goto yy187;
+ if (yych <= 'r') goto yy556;
+ if (yych <= 's') goto yy557;
+ goto yy187;
+ }
+ }
+yy134:
+ YYDEBUG(134, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'W') {
+ if (yych == 'T') goto yy542;
+ if (yych <= 'V') goto yy187;
+ goto yy543;
+ } else {
+ if (yych <= 't') {
+ if (yych <= 's') goto yy187;
+ goto yy542;
+ } else {
+ if (yych == 'w') goto yy543;
+ goto yy187;
+ }
+ }
+yy135:
+ YYDEBUG(135, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= ';') {
+ if (yych <= '"') {
+ if (yych <= '!') goto yy187;
+ goto yy534;
+ } else {
+ if (yych == '\'') goto yy535;
+ goto yy187;
+ }
+ } else {
+ if (yych <= 'R') {
+ if (yych <= '<') goto yy533;
+ if (yych <= 'Q') goto yy187;
+ goto yy536;
+ } else {
+ if (yych == 'r') goto yy536;
+ goto yy187;
+ }
+ }
+yy136:
+ YYDEBUG(136, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'O') {
+ if (yych == 'L') goto yy523;
+ if (yych <= 'N') goto yy187;
+ goto yy524;
+ } else {
+ if (yych <= 'l') {
+ if (yych <= 'k') goto yy187;
+ goto yy523;
+ } else {
+ if (yych == 'o') goto yy524;
+ goto yy187;
+ }
+ }
+yy137:
+ YYDEBUG(137, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'U') {
+ if (yych == 'R') goto yy499;
+ if (yych <= 'T') goto yy187;
+ goto yy500;
+ } else {
+ if (yych <= 'r') {
+ if (yych <= 'q') goto yy187;
+ goto yy499;
+ } else {
+ if (yych == 'u') goto yy500;
+ goto yy187;
+ }
+ }
+yy138:
+ YYDEBUG(138, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) <= '<') {
+ if (yych == '-') goto yy495;
+ } else {
+ if (yych <= '=') goto yy493;
+ if (yych <= '>') goto yy497;
+ }
+yy139:
+ YYDEBUG(139, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1454 "Zend/zend_language_scanner.l"
+ {
+ return yytext[0];
+}
+#line 2633 "Zend/zend_language_scanner.c"
+yy140:
+ YYDEBUG(140, *YYCURSOR);
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy492;
+yy141:
+ YYDEBUG(141, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1175 "Zend/zend_language_scanner.l"
+ {
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
+ HANDLE_NEWLINES(yytext, yyleng);
+ return T_WHITESPACE;
+}
+#line 2648 "Zend/zend_language_scanner.c"
+yy142:
+ YYDEBUG(142, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == ':') goto yy489;
+ goto yy139;
+yy143:
+ YYDEBUG(143, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(144, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1202 "Zend/zend_language_scanner.l"
+ {
+ return T_NS_SEPARATOR;
+}
+#line 2663 "Zend/zend_language_scanner.c"
+yy145:
+ YYDEBUG(145, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '/') {
+ if (yych == '.') goto yy486;
+ goto yy139;
+ } else {
+ if (yych <= '9') goto yy482;
+ if (yych == '=') goto yy484;
+ goto yy139;
+ }
+yy146:
+ YYDEBUG(146, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'E') {
+ if (yych == 'A') goto yy470;
+ if (yych <= 'D') goto yy187;
+ goto yy471;
+ } else {
+ if (yych <= 'a') {
+ if (yych <= '`') goto yy187;
+ goto yy470;
+ } else {
+ if (yych == 'e') goto yy471;
+ goto yy187;
+ }
+ }
+yy147:
+ YYDEBUG(147, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy467;
+ if (yych == 'a') goto yy467;
+ goto yy187;
+yy148:
+ YYDEBUG(148, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= 'S') {
+ if (yych <= 'D') {
+ if (yych <= ' ') {
+ if (yych == '\t') goto yy392;
+ if (yych <= 0x1F) goto yy139;
+ goto yy392;
+ } else {
+ if (yych <= '@') goto yy139;
+ if (yych == 'C') goto yy139;
+ goto yy392;
+ }
+ } else {
+ if (yych <= 'I') {
+ if (yych == 'F') goto yy392;
+ if (yych <= 'H') goto yy139;
+ goto yy392;
+ } else {
+ if (yych == 'O') goto yy392;
+ if (yych <= 'Q') goto yy139;
+ goto yy392;
+ }
+ }
+ } else {
+ if (yych <= 'f') {
+ if (yych <= 'b') {
+ if (yych == 'U') goto yy392;
+ if (yych <= '`') goto yy139;
+ goto yy392;
+ } else {
+ if (yych == 'd') goto yy392;
+ if (yych <= 'e') goto yy139;
+ goto yy392;
+ }
+ } else {
+ if (yych <= 'o') {
+ if (yych == 'i') goto yy392;
+ if (yych <= 'n') goto yy139;
+ goto yy392;
+ } else {
+ if (yych <= 's') {
+ if (yych <= 'q') goto yy139;
+ goto yy392;
+ } else {
+ if (yych == 'u') goto yy392;
+ goto yy139;
+ }
+ }
+ }
+ }
+yy149:
+ YYDEBUG(149, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'S') {
+ if (yych == 'N') goto yy383;
+ if (yych <= 'R') goto yy187;
+ goto yy384;
+ } else {
+ if (yych <= 'n') {
+ if (yych <= 'm') goto yy187;
+ goto yy383;
+ } else {
+ if (yych == 's') goto yy384;
+ goto yy187;
+ }
+ }
+yy150:
+ YYDEBUG(150, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '_') goto yy301;
+ goto yy187;
+yy151:
+ YYDEBUG(151, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= '<') goto yy139;
+ if (yych <= '=') goto yy295;
+ if (yych <= '>') goto yy297;
+ goto yy139;
+yy152:
+ YYDEBUG(152, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'I') goto yy291;
+ if (yych == 'i') goto yy291;
+ goto yy187;
+yy153:
+ YYDEBUG(153, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '+') goto yy289;
+ if (yych == '=') goto yy287;
+ goto yy139;
+yy154:
+ YYDEBUG(154, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '=') goto yy284;
+ goto yy139;
+yy155:
+ YYDEBUG(155, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= ';') {
+ if (yych == '/') goto yy256;
+ goto yy139;
+ } else {
+ if (yych <= '<') goto yy254;
+ if (yych <= '=') goto yy257;
+ if (yych <= '>') goto yy259;
+ goto yy139;
+ }
+yy156:
+ YYDEBUG(156, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= '<') goto yy139;
+ if (yych <= '=') goto yy250;
+ if (yych <= '>') goto yy248;
+ goto yy139;
+yy157:
+ YYDEBUG(157, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '*') goto yy242;
+ if (yych == '=') goto yy244;
+ goto yy139;
+yy158:
+ YYDEBUG(158, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= '.') {
+ if (yych == '*') goto yy234;
+ goto yy139;
+ } else {
+ if (yych <= '/') goto yy236;
+ if (yych == '=') goto yy237;
+ goto yy139;
+ }
+yy159:
+ YYDEBUG(159, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= '<') goto yy139;
+ if (yych <= '=') goto yy230;
+ if (yych <= '>') goto yy228;
+ goto yy139;
+yy160:
+ YYDEBUG(160, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '&') goto yy224;
+ if (yych == '=') goto yy226;
+ goto yy139;
+yy161:
+ YYDEBUG(161, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '=') goto yy222;
+ if (yych == '|') goto yy220;
+ goto yy139;
+yy162:
+ YYDEBUG(162, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '=') goto yy218;
+ goto yy139;
+yy163:
+ YYDEBUG(163, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy216;
+ if (yych == 'r') goto yy216;
+ goto yy187;
+yy164:
+ YYDEBUG(164, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'O') goto yy213;
+ if (yych == 'o') goto yy213;
+ goto yy187;
+yy165:
+ YYDEBUG(165, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= '_') {
+ if (yych <= '@') goto yy139;
+ if (yych <= 'Z') goto yy210;
+ if (yych <= '^') goto yy139;
+ goto yy210;
+ } else {
+ if (yych <= '`') goto yy139;
+ if (yych <= 'z') goto yy210;
+ if (yych <= '~') goto yy139;
+ goto yy210;
+ }
+yy166:
+ YYDEBUG(166, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy139;
+yy167:
+ YYDEBUG(167, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '>') goto yy206;
+ goto yy139;
+yy168:
+ YYDEBUG(168, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(169, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1459 "Zend/zend_language_scanner.l"
+ {
+ yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
+ return '{';
+}
+#line 2902 "Zend/zend_language_scanner.c"
+yy170:
+ YYDEBUG(170, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(171, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1471 "Zend/zend_language_scanner.l"
+ {
+ RESET_DOC_COMMENT();
+ if (!zend_stack_is_empty(&SCNG(state_stack))) {
+ yy_pop_state(TSRMLS_C);
+ }
+ return '}';
+}
+#line 2916 "Zend/zend_language_scanner.c"
+yy172:
+ YYDEBUG(172, *YYCURSOR);
+ yyaccept = 2;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= 'E') {
+ if (yych <= '9') {
+ if (yych == '.') goto yy188;
+ if (yych >= '0') goto yy191;
+ } else {
+ if (yych == 'B') goto yy199;
+ if (yych >= 'E') goto yy193;
+ }
+ } else {
+ if (yych <= 'b') {
+ if (yych == 'X') goto yy198;
+ if (yych >= 'b') goto yy199;
+ } else {
+ if (yych <= 'e') {
+ if (yych >= 'e') goto yy193;
+ } else {
+ if (yych == 'x') goto yy198;
+ }
+ }
+ }
+yy173:
+ YYDEBUG(173, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1521 "Zend/zend_language_scanner.l"
+ {
+ if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */
+ Z_LVAL_P(zendlval) = strtol(yytext, NULL, 0);
+ } else {
+ errno = 0;
+ Z_LVAL_P(zendlval) = strtol(yytext, NULL, 0);
+ if (errno == ERANGE) { /* Overflow */
+ if (yytext[0] == '0') { /* octal overflow */
+ Z_DVAL_P(zendlval) = zend_oct_strtod(yytext, NULL);
+ } else {
+ Z_DVAL_P(zendlval) = zend_strtod(yytext, NULL);
+ }
+ zendlval->type = IS_DOUBLE;
+ return T_DNUMBER;
+ }
+ }
+
+ zendlval->type = IS_LONG;
+ return T_LNUMBER;
+}
+#line 2965 "Zend/zend_language_scanner.c"
+yy174:
+ YYDEBUG(174, *YYCURSOR);
+ yyaccept = 2;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '9') {
+ if (yych == '.') goto yy188;
+ if (yych <= '/') goto yy173;
+ goto yy191;
+ } else {
+ if (yych <= 'E') {
+ if (yych <= 'D') goto yy173;
+ goto yy193;
+ } else {
+ if (yych == 'e') goto yy193;
+ goto yy173;
+ }
+ }
+yy175:
+ YYDEBUG(175, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy187;
+yy176:
+ YYDEBUG(176, *YYCURSOR);
+ ++YYCURSOR;
+yy177:
+ YYDEBUG(177, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1861 "Zend/zend_language_scanner.l"
+ {
+ while (YYCURSOR < YYLIMIT) {
+ switch (*YYCURSOR++) {
+ case '\r':
+ if (*YYCURSOR == '\n') {
+ YYCURSOR++;
+ }
+ /* fall through */
+ case '\n':
+ CG(zend_lineno)++;
+ break;
+ case '%':
+ if (!CG(asp_tags)) {
+ continue;
+ }
+ /* fall through */
+ case '?':
+ if (*YYCURSOR == '>') {
+ YYCURSOR--;
+ break;
+ }
+ /* fall through */
+ default:
+ continue;
+ }
+
+ break;
+ }
+
+ yyleng = YYCURSOR - SCNG(yy_text);
+
+ return T_COMMENT;
+}
+#line 3027 "Zend/zend_language_scanner.c"
+yy178:
+ YYDEBUG(178, *YYCURSOR);
+ ++YYCURSOR;
+yy179:
+ YYDEBUG(179, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1948 "Zend/zend_language_scanner.l"
+ {
+ register char *s, *t;
+ char *end;
+ int bprefix = (yytext[0] != '\'') ? 1 : 0;
+
+ while (1) {
+ if (YYCURSOR < YYLIMIT) {
+ if (*YYCURSOR == '\'') {
+ YYCURSOR++;
+ yyleng = YYCURSOR - SCNG(yy_text);
+
+ break;
+ } else if (*YYCURSOR++ == '\\' && YYCURSOR < YYLIMIT) {
+ YYCURSOR++;
+ }
+ } else {
+ yyleng = YYLIMIT - SCNG(yy_text);
+
+ /* Unclosed single quotes; treat similar to double quotes, but without a separate token
+ * for ' (unrecognized by parser), instead of old flex fallback to "Unexpected character..."
+ * rule, which continued in ST_IN_SCRIPTING state after the quote */
+ return T_ENCAPSED_AND_WHITESPACE;
+ }
+ }
+
+ ZVAL_STRINGL(zendlval, yytext+bprefix+1, yyleng-bprefix-2, 1);
+
+ /* convert escape sequences */
+ s = t = Z_STRVAL_P(zendlval);
+ end = s+Z_STRLEN_P(zendlval);
+ while (s<end) {
+ if (*s=='\\') {
+ s++;
+
+ switch(*s) {
+ case '\\':
+ case '\'':
+ *t++ = *s;
+ Z_STRLEN_P(zendlval)--;
+ break;
+ default:
+ *t++ = '\\';
+ *t++ = *s;
+ break;
+ }
+ } else {
+ *t++ = *s;
+ }
+
+ if (*s == '\n' || (*s == '\r' && (*(s+1) != '\n'))) {
+ CG(zend_lineno)++;
+ }
+ s++;
+ }
+ *t = 0;
+
+ if (SCNG(output_filter)) {
+ size_t sz = 0;
+ s = Z_STRVAL_P(zendlval);
+ SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC);
+ Z_STRLEN_P(zendlval) = sz;
+ efree(s);
+ }
+ return T_CONSTANT_ENCAPSED_STRING;
+}
+#line 3100 "Zend/zend_language_scanner.c"
+yy180:
+ YYDEBUG(180, *YYCURSOR);
+ ++YYCURSOR;
+yy181:
+ YYDEBUG(181, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 2015 "Zend/zend_language_scanner.l"
+ {
+ int bprefix = (yytext[0] != '"') ? 1 : 0;
+
+ while (YYCURSOR < YYLIMIT) {
+ switch (*YYCURSOR++) {
+ case '"':
+ yyleng = YYCURSOR - SCNG(yy_text);
+ zend_scan_escape_string(zendlval, yytext+bprefix+1, yyleng-bprefix-2, '"' TSRMLS_CC);
+ return T_CONSTANT_ENCAPSED_STRING;
+ case '$':
+ if (IS_LABEL_START(*YYCURSOR) || *YYCURSOR == '{') {
+ break;
+ }
+ continue;
+ case '{':
+ if (*YYCURSOR == '$') {
+ break;
+ }
+ continue;
+ case '\\':
+ if (YYCURSOR < YYLIMIT) {
+ YYCURSOR++;
+ }
+ /* fall through */
+ default:
+ continue;
+ }
+
+ YYCURSOR--;
+ break;
+ }
+
+ /* Remember how much was scanned to save rescanning */
+ SET_DOUBLE_QUOTES_SCANNED_LENGTH(YYCURSOR - SCNG(yy_text) - yyleng);
+
+ YYCURSOR = SCNG(yy_text) + yyleng;
+
+ BEGIN(ST_DOUBLE_QUOTES);
+ return '"';
+}
+#line 3148 "Zend/zend_language_scanner.c"
+yy182:
+ YYDEBUG(182, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(183, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 2105 "Zend/zend_language_scanner.l"
+ {
+ BEGIN(ST_BACKQUOTE);
+ return '`';
+}
+#line 3159 "Zend/zend_language_scanner.c"
+yy184:
+ YYDEBUG(184, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(185, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 2368 "Zend/zend_language_scanner.l"
+ {
+ if (YYCURSOR > YYLIMIT) {
+ return 0;
+ }
+
+ zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
+ goto restart;
+}
+#line 3174 "Zend/zend_language_scanner.c"
+yy186:
+ YYDEBUG(186, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+yy187:
+ YYDEBUG(187, *YYCURSOR);
+ if (yybm[0+yych] & 4) {
+ goto yy186;
+ }
+ goto yy124;
+yy188:
+ YYDEBUG(188, *YYCURSOR);
+ yyaccept = 3;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(3);
+ yych = *YYCURSOR;
+ YYDEBUG(189, *YYCURSOR);
+ if (yybm[0+yych] & 8) {
+ goto yy188;
+ }
+ if (yych == 'E') goto yy193;
+ if (yych == 'e') goto yy193;
+yy190:
+ YYDEBUG(190, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1580 "Zend/zend_language_scanner.l"
+ {
+ ZVAL_DOUBLE(zendlval, zend_strtod(yytext, NULL));
+ return T_DNUMBER;
+}
+#line 3206 "Zend/zend_language_scanner.c"
+yy191:
+ YYDEBUG(191, *YYCURSOR);
+ yyaccept = 2;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(3);
+ yych = *YYCURSOR;
+ YYDEBUG(192, *YYCURSOR);
+ if (yych <= '9') {
+ if (yych == '.') goto yy188;
+ if (yych <= '/') goto yy173;
+ goto yy191;
+ } else {
+ if (yych <= 'E') {
+ if (yych <= 'D') goto yy173;
+ } else {
+ if (yych != 'e') goto yy173;
+ }
+ }
+yy193:
+ YYDEBUG(193, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= ',') {
+ if (yych == '+') goto yy195;
+ } else {
+ if (yych <= '-') goto yy195;
+ if (yych <= '/') goto yy194;
+ if (yych <= '9') goto yy196;
+ }
+yy194:
+ YYDEBUG(194, *YYCURSOR);
+ YYCURSOR = YYMARKER;
+ if (yyaccept <= 2) {
+ if (yyaccept <= 1) {
+ if (yyaccept <= 0) {
+ goto yy124;
+ } else {
+ goto yy139;
+ }
+ } else {
+ goto yy173;
+ }
+ } else {
+ if (yyaccept <= 4) {
+ if (yyaccept <= 3) {
+ goto yy190;
+ } else {
+ goto yy235;
+ }
+ } else {
+ goto yy255;
+ }
+ }
+yy195:
+ YYDEBUG(195, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= '/') goto yy194;
+ if (yych >= ':') goto yy194;
+yy196:
+ YYDEBUG(196, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(197, *YYCURSOR);
+ if (yych <= '/') goto yy190;
+ if (yych <= '9') goto yy196;
+ goto yy190;
+yy198:
+ YYDEBUG(198, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yybm[0+yych] & 32) {
+ goto yy203;
+ }
+ goto yy194;
+yy199:
+ YYDEBUG(199, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yybm[0+yych] & 16) {
+ goto yy200;
+ }
+ goto yy194;
+yy200:
+ YYDEBUG(200, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(201, *YYCURSOR);
+ if (yybm[0+yych] & 16) {
+ goto yy200;
+ }
+ YYDEBUG(202, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1497 "Zend/zend_language_scanner.l"
+ {
+ char *bin = yytext + 2; /* Skip "0b" */
+ int len = yyleng - 2;
+
+ /* Skip any leading 0s */
+ while (*bin == '0') {
+ ++bin;
+ --len;
+ }
+
+ if (len < SIZEOF_LONG * 8) {
+ if (len == 0) {
+ Z_LVAL_P(zendlval) = 0;
+ } else {
+ Z_LVAL_P(zendlval) = strtol(bin, NULL, 2);
+ }
+ zendlval->type = IS_LONG;
+ return T_LNUMBER;
+ } else {
+ ZVAL_DOUBLE(zendlval, zend_bin_strtod(bin, NULL));
+ return T_DNUMBER;
+ }
+}
+#line 3322 "Zend/zend_language_scanner.c"
+yy203:
+ YYDEBUG(203, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(204, *YYCURSOR);
+ if (yybm[0+yych] & 32) {
+ goto yy203;
+ }
+ YYDEBUG(205, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1542 "Zend/zend_language_scanner.l"
+ {
+ char *hex = yytext + 2; /* Skip "0x" */
+ int len = yyleng - 2;
+
+ /* Skip any leading 0s */
+ while (*hex == '0') {
+ hex++;
+ len--;
+ }
+
+ if (len < SIZEOF_LONG * 2 || (len == SIZEOF_LONG * 2 && *hex <= '7')) {
+ if (len == 0) {
+ Z_LVAL_P(zendlval) = 0;
+ } else {
+ Z_LVAL_P(zendlval) = strtol(hex, NULL, 16);
+ }
+ zendlval->type = IS_LONG;
+ return T_LNUMBER;
+ } else {
+ ZVAL_DOUBLE(zendlval, zend_hex_strtod(hex, NULL));
+ return T_DNUMBER;
+ }
+}
+#line 3358 "Zend/zend_language_scanner.c"
+yy206:
+ YYDEBUG(206, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) == '\n') goto yy208;
+ if (yych == '\r') goto yy209;
+yy207:
+ YYDEBUG(207, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1929 "Zend/zend_language_scanner.l"
+ {
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
+ BEGIN(INITIAL);
+ return T_CLOSE_TAG; /* implicit ';' at php-end tag */
+}
+#line 3373 "Zend/zend_language_scanner.c"
+yy208:
+ YYDEBUG(208, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy207;
+yy209:
+ YYDEBUG(209, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '\n') goto yy208;
+ goto yy207;
+yy210:
+ YYDEBUG(210, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(211, *YYCURSOR);
+ if (yych <= '^') {
+ if (yych <= '9') {
+ if (yych >= '0') goto yy210;
+ } else {
+ if (yych <= '@') goto yy212;
+ if (yych <= 'Z') goto yy210;
+ }
+ } else {
+ if (yych <= '`') {
+ if (yych <= '_') goto yy210;
+ } else {
+ if (yych <= 'z') goto yy210;
+ if (yych >= 0x7F) goto yy210;
+ }
+ }
+yy212:
+ YYDEBUG(212, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1831 "Zend/zend_language_scanner.l"
+ {
+ zend_copy_value(zendlval, (yytext+1), (yyleng-1));
+ zendlval->type = IS_STRING;
+ return T_VARIABLE;
+}
+#line 3413 "Zend/zend_language_scanner.c"
+yy213:
+ YYDEBUG(213, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy214;
+ if (yych != 'r') goto yy187;
+yy214:
+ YYDEBUG(214, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(215, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1442 "Zend/zend_language_scanner.l"
+ {
+ return T_LOGICAL_XOR;
+}
+#line 3431 "Zend/zend_language_scanner.c"
+yy216:
+ YYDEBUG(216, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(217, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1434 "Zend/zend_language_scanner.l"
+ {
+ return T_LOGICAL_OR;
+}
+#line 3444 "Zend/zend_language_scanner.c"
+yy218:
+ YYDEBUG(218, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(219, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1422 "Zend/zend_language_scanner.l"
+ {
+ return T_XOR_EQUAL;
+}
+#line 3454 "Zend/zend_language_scanner.c"
+yy220:
+ YYDEBUG(220, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(221, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1426 "Zend/zend_language_scanner.l"
+ {
+ return T_BOOLEAN_OR;
+}
+#line 3464 "Zend/zend_language_scanner.c"
+yy222:
+ YYDEBUG(222, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(223, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1418 "Zend/zend_language_scanner.l"
+ {
+ return T_OR_EQUAL;
+}
+#line 3474 "Zend/zend_language_scanner.c"
+yy224:
+ YYDEBUG(224, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(225, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1430 "Zend/zend_language_scanner.l"
+ {
+ return T_BOOLEAN_AND;
+}
+#line 3484 "Zend/zend_language_scanner.c"
+yy226:
+ YYDEBUG(226, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(227, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1414 "Zend/zend_language_scanner.l"
+ {
+ return T_AND_EQUAL;
+}
+#line 3494 "Zend/zend_language_scanner.c"
+yy228:
+ YYDEBUG(228, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) == '\n') goto yy232;
+ if (yych == '\r') goto yy233;
+yy229:
+ YYDEBUG(229, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1936 "Zend/zend_language_scanner.l"
+ {
+ if (CG(asp_tags)) {
+ BEGIN(INITIAL);
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
+ return T_CLOSE_TAG; /* implicit ';' at php-end tag */
+ } else {
+ yyless(1);
+ return yytext[0];
+ }
+}
+#line 3514 "Zend/zend_language_scanner.c"
+yy230:
+ YYDEBUG(230, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(231, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1402 "Zend/zend_language_scanner.l"
+ {
+ return T_MOD_EQUAL;
+}
+#line 3524 "Zend/zend_language_scanner.c"
+yy232:
+ YYDEBUG(232, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy229;
+yy233:
+ YYDEBUG(233, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '\n') goto yy232;
+ goto yy229;
+yy234:
+ YYDEBUG(234, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych == '*') goto yy239;
+yy235:
+ YYDEBUG(235, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1895 "Zend/zend_language_scanner.l"
+ {
+ int doc_com;
+
+ if (yyleng > 2) {
+ doc_com = 1;
+ RESET_DOC_COMMENT();
+ } else {
+ doc_com = 0;
+ }
+
+ while (YYCURSOR < YYLIMIT) {
+ if (*YYCURSOR++ == '*' && *YYCURSOR == '/') {
+ break;
+ }
+ }
+
+ if (YYCURSOR < YYLIMIT) {
+ YYCURSOR++;
+ } else {
+ zend_error(E_COMPILE_WARNING, "Unterminated comment starting line %d", CG(zend_lineno));
+ }
+
+ yyleng = YYCURSOR - SCNG(yy_text);
+ HANDLE_NEWLINES(yytext, yyleng);
+
+ if (doc_com) {
+ CG(doc_comment) = estrndup(yytext, yyleng);
+ CG(doc_comment_len) = yyleng;
+ return T_DOC_COMMENT;
+ }
+
+ return T_COMMENT;
+}
+#line 3576 "Zend/zend_language_scanner.c"
+yy236:
+ YYDEBUG(236, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy177;
+yy237:
+ YYDEBUG(237, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(238, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1394 "Zend/zend_language_scanner.l"
+ {
+ return T_DIV_EQUAL;
+}
+#line 3590 "Zend/zend_language_scanner.c"
+yy239:
+ YYDEBUG(239, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yybm[0+yych] & 64) {
+ goto yy240;
+ }
+ goto yy194;
+yy240:
+ YYDEBUG(240, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(241, *YYCURSOR);
+ if (yybm[0+yych] & 64) {
+ goto yy240;
+ }
+ goto yy235;
+yy242:
+ YYDEBUG(242, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) == '=') goto yy246;
+ YYDEBUG(243, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1386 "Zend/zend_language_scanner.l"
+ {
+ return T_POW;
+}
+#line 3618 "Zend/zend_language_scanner.c"
+yy244:
+ YYDEBUG(244, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(245, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1382 "Zend/zend_language_scanner.l"
+ {
+ return T_MUL_EQUAL;
+}
+#line 3628 "Zend/zend_language_scanner.c"
+yy246:
+ YYDEBUG(246, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(247, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1390 "Zend/zend_language_scanner.l"
+ {
+ return T_POW_EQUAL;
+}
+#line 3638 "Zend/zend_language_scanner.c"
+yy248:
+ YYDEBUG(248, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) == '=') goto yy252;
+ YYDEBUG(249, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1450 "Zend/zend_language_scanner.l"
+ {
+ return T_SR;
+}
+#line 3649 "Zend/zend_language_scanner.c"
+yy250:
+ YYDEBUG(250, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(251, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1370 "Zend/zend_language_scanner.l"
+ {
+ return T_IS_GREATER_OR_EQUAL;
+}
+#line 3659 "Zend/zend_language_scanner.c"
+yy252:
+ YYDEBUG(252, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(253, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1410 "Zend/zend_language_scanner.l"
+ {
+ return T_SR_EQUAL;
+}
+#line 3669 "Zend/zend_language_scanner.c"
+yy254:
+ YYDEBUG(254, *YYCURSOR);
+ yyaccept = 5;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= ';') goto yy255;
+ if (yych <= '<') goto yy270;
+ if (yych <= '=') goto yy268;
+yy255:
+ YYDEBUG(255, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1446 "Zend/zend_language_scanner.l"
+ {
+ return T_SL;
+}
+#line 3684 "Zend/zend_language_scanner.c"
+yy256:
+ YYDEBUG(256, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'S') goto yy261;
+ if (yych == 's') goto yy261;
+ goto yy194;
+yy257:
+ YYDEBUG(257, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(258, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1366 "Zend/zend_language_scanner.l"
+ {
+ return T_IS_SMALLER_OR_EQUAL;
+}
+#line 3700 "Zend/zend_language_scanner.c"
+yy259:
+ YYDEBUG(259, *YYCURSOR);
+ ++YYCURSOR;
+yy260:
+ YYDEBUG(260, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1362 "Zend/zend_language_scanner.l"
+ {
+ return T_IS_NOT_EQUAL;
+}
+#line 3711 "Zend/zend_language_scanner.c"
+yy261:
+ YYDEBUG(261, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy262;
+ if (yych != 'c') goto yy194;
+yy262:
+ YYDEBUG(262, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy263;
+ if (yych != 'r') goto yy194;
+yy263:
+ YYDEBUG(263, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'I') goto yy264;
+ if (yych != 'i') goto yy194;
+yy264:
+ YYDEBUG(264, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'P') goto yy265;
+ if (yych != 'p') goto yy194;
+yy265:
+ YYDEBUG(265, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy266;
+ if (yych != 't') goto yy194;
+yy266:
+ YYDEBUG(266, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(3);
+ yych = *YYCURSOR;
+ YYDEBUG(267, *YYCURSOR);
+ if (yych <= '\r') {
+ if (yych <= 0x08) goto yy194;
+ if (yych <= '\n') goto yy266;
+ if (yych <= '\f') goto yy194;
+ goto yy266;
+ } else {
+ if (yych <= ' ') {
+ if (yych <= 0x1F) goto yy194;
+ goto yy266;
+ } else {
+ if (yych == '>') goto yy206;
+ goto yy194;
+ }
+ }
+yy268:
+ YYDEBUG(268, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(269, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1406 "Zend/zend_language_scanner.l"
+ {
+ return T_SL_EQUAL;
+}
+#line 3766 "Zend/zend_language_scanner.c"
+yy270:
+ YYDEBUG(270, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(2);
+ yych = *YYCURSOR;
+ YYDEBUG(271, *YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy270;
+ }
+ if (yych <= 'Z') {
+ if (yych <= '&') {
+ if (yych == '"') goto yy275;
+ goto yy194;
+ } else {
+ if (yych <= '\'') goto yy274;
+ if (yych <= '@') goto yy194;
+ }
+ } else {
+ if (yych <= '`') {
+ if (yych != '_') goto yy194;
+ } else {
+ if (yych <= 'z') goto yy272;
+ if (yych <= '~') goto yy194;
+ }
+ }
+yy272:
+ YYDEBUG(272, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(2);
+ yych = *YYCURSOR;
+ YYDEBUG(273, *YYCURSOR);
+ if (yych <= '@') {
+ if (yych <= '\f') {
+ if (yych == '\n') goto yy279;
+ goto yy194;
+ } else {
+ if (yych <= '\r') goto yy281;
+ if (yych <= '/') goto yy194;
+ if (yych <= '9') goto yy272;
+ goto yy194;
+ }
+ } else {
+ if (yych <= '_') {
+ if (yych <= 'Z') goto yy272;
+ if (yych <= '^') goto yy194;
+ goto yy272;
+ } else {
+ if (yych <= '`') goto yy194;
+ if (yych <= 'z') goto yy272;
+ if (yych <= '~') goto yy194;
+ goto yy272;
+ }
+ }
+yy274:
+ YYDEBUG(274, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '\'') goto yy194;
+ if (yych <= '/') goto yy283;
+ if (yych <= '9') goto yy194;
+ goto yy283;
+yy275:
+ YYDEBUG(275, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '"') goto yy194;
+ if (yych <= '/') goto yy277;
+ if (yych <= '9') goto yy194;
+ goto yy277;
+yy276:
+ YYDEBUG(276, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(3);
+ yych = *YYCURSOR;
+yy277:
+ YYDEBUG(277, *YYCURSOR);
+ if (yych <= 'Z') {
+ if (yych <= '/') {
+ if (yych != '"') goto yy194;
+ } else {
+ if (yych <= '9') goto yy276;
+ if (yych <= '@') goto yy194;
+ goto yy276;
+ }
+ } else {
+ if (yych <= '`') {
+ if (yych == '_') goto yy276;
+ goto yy194;
+ } else {
+ if (yych <= 'z') goto yy276;
+ if (yych <= '~') goto yy194;
+ goto yy276;
+ }
+ }
+yy278:
+ YYDEBUG(278, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '\n') goto yy279;
+ if (yych == '\r') goto yy281;
+ goto yy194;
+yy279:
+ YYDEBUG(279, *YYCURSOR);
+ ++YYCURSOR;
+yy280:
+ YYDEBUG(280, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 2057 "Zend/zend_language_scanner.l"
+ {
+ char *s;
+ int bprefix = (yytext[0] != '<') ? 1 : 0;
+ zend_heredoc_label *heredoc_label = emalloc(sizeof(zend_heredoc_label));
+
+ CG(zend_lineno)++;
+ heredoc_label->length = yyleng-bprefix-3-1-(yytext[yyleng-2]=='\r'?1:0);
+ s = yytext+bprefix+3;
+ while ((*s == ' ') || (*s == '\t')) {
+ s++;
+ heredoc_label->length--;
+ }
+
+ if (*s == '\'') {
+ s++;
+ heredoc_label->length -= 2;
+
+ BEGIN(ST_NOWDOC);
+ } else {
+ if (*s == '"') {
+ s++;
+ heredoc_label->length -= 2;
+ }
+
+ BEGIN(ST_HEREDOC);
+ }
+
+ heredoc_label->label = estrndup(s, heredoc_label->length);
+
+ /* Check for ending label on the next line */
+ if (heredoc_label->length < YYLIMIT - YYCURSOR && !memcmp(YYCURSOR, s, heredoc_label->length)) {
+ YYCTYPE *end = YYCURSOR + heredoc_label->length;
+
+ if (*end == ';') {
+ end++;
+ }
+
+ if (*end == '\n' || *end == '\r') {
+ BEGIN(ST_END_HEREDOC);
+ }
+ }
+
+ zend_ptr_stack_push(&SCNG(heredoc_label_stack), (void *) heredoc_label);
+
+ return T_START_HEREDOC;
+}
+#line 3918 "Zend/zend_language_scanner.c"
+yy281:
+ YYDEBUG(281, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '\n') goto yy279;
+ goto yy280;
+yy282:
+ YYDEBUG(282, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(3);
+ yych = *YYCURSOR;
+yy283:
+ YYDEBUG(283, *YYCURSOR);
+ if (yych <= 'Z') {
+ if (yych <= '/') {
+ if (yych == '\'') goto yy278;
+ goto yy194;
+ } else {
+ if (yych <= '9') goto yy282;
+ if (yych <= '@') goto yy194;
+ goto yy282;
+ }
+ } else {
+ if (yych <= '`') {
+ if (yych == '_') goto yy282;
+ goto yy194;
+ } else {
+ if (yych <= 'z') goto yy282;
+ if (yych <= '~') goto yy194;
+ goto yy282;
+ }
+ }
+yy284:
+ YYDEBUG(284, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych != '=') goto yy260;
+ YYDEBUG(285, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(286, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1354 "Zend/zend_language_scanner.l"
+ {
+ return T_IS_NOT_IDENTICAL;
+}
+#line 3962 "Zend/zend_language_scanner.c"
+yy287:
+ YYDEBUG(287, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(288, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1374 "Zend/zend_language_scanner.l"
+ {
+ return T_PLUS_EQUAL;
+}
+#line 3972 "Zend/zend_language_scanner.c"
+yy289:
+ YYDEBUG(289, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(290, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1342 "Zend/zend_language_scanner.l"
+ {
+ return T_INC;
+}
+#line 3982 "Zend/zend_language_scanner.c"
+yy291:
+ YYDEBUG(291, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'S') goto yy292;
+ if (yych != 's') goto yy187;
+yy292:
+ YYDEBUG(292, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy293;
+ if (yych != 't') goto yy187;
+yy293:
+ YYDEBUG(293, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(294, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1330 "Zend/zend_language_scanner.l"
+ {
+ return T_LIST;
+}
+#line 4005 "Zend/zend_language_scanner.c"
+yy295:
+ YYDEBUG(295, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) == '=') goto yy299;
+ YYDEBUG(296, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1358 "Zend/zend_language_scanner.l"
+ {
+ return T_IS_EQUAL;
+}
+#line 4016 "Zend/zend_language_scanner.c"
+yy297:
+ YYDEBUG(297, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(298, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1326 "Zend/zend_language_scanner.l"
+ {
+ return T_DOUBLE_ARROW;
+}
+#line 4026 "Zend/zend_language_scanner.c"
+yy299:
+ YYDEBUG(299, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(300, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1350 "Zend/zend_language_scanner.l"
+ {
+ return T_IS_IDENTICAL;
+}
+#line 4036 "Zend/zend_language_scanner.c"
+yy301:
+ YYDEBUG(301, *YYCURSOR);
+ yych = *++YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch (yych) {
+ case 'C':
+ case 'c': goto yy303;
+ case 'D':
+ case 'd': goto yy308;
+ case 'F':
+ case 'f': goto yy305;
+ case 'H':
+ case 'h': goto yy302;
+ case 'L':
+ case 'l': goto yy307;
+ case 'M':
+ case 'm': goto yy306;
+ case 'N':
+ case 'n': goto yy309;
+ case 'T':
+ case 't': goto yy304;
+ default: goto yy187;
+ }
+yy302:
+ YYDEBUG(302, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy370;
+ if (yych == 'a') goto yy370;
+ goto yy187;
+yy303:
+ YYDEBUG(303, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy363;
+ if (yych == 'l') goto yy363;
+ goto yy187;
+yy304:
+ YYDEBUG(304, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy356;
+ if (yych == 'r') goto yy356;
+ goto yy187;
+yy305:
+ YYDEBUG(305, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'U') {
+ if (yych == 'I') goto yy340;
+ if (yych <= 'T') goto yy187;
+ goto yy341;
+ } else {
+ if (yych <= 'i') {
+ if (yych <= 'h') goto yy187;
+ goto yy340;
+ } else {
+ if (yych == 'u') goto yy341;
+ goto yy187;
+ }
+ }
+yy306:
+ YYDEBUG(306, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy332;
+ if (yych == 'e') goto yy332;
+ goto yy187;
+yy307:
+ YYDEBUG(307, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'I') goto yy326;
+ if (yych == 'i') goto yy326;
+ goto yy187;
+yy308:
+ YYDEBUG(308, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'I') goto yy321;
+ if (yych == 'i') goto yy321;
+ goto yy187;
+yy309:
+ YYDEBUG(309, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy310;
+ if (yych != 'a') goto yy187;
+yy310:
+ YYDEBUG(310, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'M') goto yy311;
+ if (yych != 'm') goto yy187;
+yy311:
+ YYDEBUG(311, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy312;
+ if (yych != 'e') goto yy187;
+yy312:
+ YYDEBUG(312, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'S') goto yy313;
+ if (yych != 's') goto yy187;
+yy313:
+ YYDEBUG(313, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'P') goto yy314;
+ if (yych != 'p') goto yy187;
+yy314:
+ YYDEBUG(314, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy315;
+ if (yych != 'a') goto yy187;
+yy315:
+ YYDEBUG(315, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy316;
+ if (yych != 'c') goto yy187;
+yy316:
+ YYDEBUG(316, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy317;
+ if (yych != 'e') goto yy187;
+yy317:
+ YYDEBUG(317, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych != '_') goto yy187;
+ YYDEBUG(318, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych != '_') goto yy187;
+ YYDEBUG(319, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(320, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1676 "Zend/zend_language_scanner.l"
+ {
+ if (CG(current_namespace)) {
+ *zendlval = *CG(current_namespace);
+ zval_copy_ctor(zendlval);
+ } else {
+ ZVAL_EMPTY_STRING(zendlval);
+ }
+ return T_NS_C;
+}
+#line 4176 "Zend/zend_language_scanner.c"
+yy321:
+ YYDEBUG(321, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy322;
+ if (yych != 'r') goto yy187;
+yy322:
+ YYDEBUG(322, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych != '_') goto yy187;
+ YYDEBUG(323, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych != '_') goto yy187;
+ YYDEBUG(324, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(325, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1651 "Zend/zend_language_scanner.l"
+ {
+ char *filename = zend_get_compiled_filename(TSRMLS_C);
+ const size_t filename_len = strlen(filename);
+ char *dirname;
+
+ if (!filename) {
+ filename = "";
+ }
+
+ dirname = estrndup(filename, filename_len);
+ zend_dirname(dirname, filename_len);
+
+ if (strcmp(dirname, ".") == 0) {
+ dirname = erealloc(dirname, MAXPATHLEN);
+#if HAVE_GETCWD
+ VCWD_GETCWD(dirname, MAXPATHLEN);
+#elif HAVE_GETWD
+ VCWD_GETWD(dirname);
+#endif
+ }
+
+ ZVAL_STRING(zendlval, dirname, 0);
+ return T_DIR;
+}
+#line 4221 "Zend/zend_language_scanner.c"
+yy326:
+ YYDEBUG(326, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy327;
+ if (yych != 'n') goto yy187;
+yy327:
+ YYDEBUG(327, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy328;
+ if (yych != 'e') goto yy187;
+yy328:
+ YYDEBUG(328, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych != '_') goto yy187;
+ YYDEBUG(329, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych != '_') goto yy187;
+ YYDEBUG(330, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(331, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1636 "Zend/zend_language_scanner.l"
+ {
+ ZVAL_LONG(zendlval, CG(zend_lineno));
+ return T_LINE;
+}
+#line 4251 "Zend/zend_language_scanner.c"
+yy332:
+ YYDEBUG(332, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy333;
+ if (yych != 't') goto yy187;
+yy333:
+ YYDEBUG(333, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'H') goto yy334;
+ if (yych != 'h') goto yy187;
+yy334:
+ YYDEBUG(334, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'O') goto yy335;
+ if (yych != 'o') goto yy187;
+yy335:
+ YYDEBUG(335, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'D') goto yy336;
+ if (yych != 'd') goto yy187;
+yy336:
+ YYDEBUG(336, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych != '_') goto yy187;
+ YYDEBUG(337, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych != '_') goto yy187;
+ YYDEBUG(338, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(339, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1623 "Zend/zend_language_scanner.l"
+ {
+ const char *class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL;
+ const char *func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL;
+
+ Z_STRLEN_P(zendlval) = zend_spprintf(&Z_STRVAL_P(zendlval), 0, "%s%s%s",
+ class_name ? class_name : "",
+ class_name && func_name ? "::" : "",
+ func_name ? func_name : ""
+ );
+ zendlval->type = IS_STRING;
+ return T_METHOD_C;
+}
+#line 4299 "Zend/zend_language_scanner.c"
+yy340:
+ YYDEBUG(340, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy351;
+ if (yych == 'l') goto yy351;
+ goto yy187;
+yy341:
+ YYDEBUG(341, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy342;
+ if (yych != 'n') goto yy187;
+yy342:
+ YYDEBUG(342, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy343;
+ if (yych != 'c') goto yy187;
+yy343:
+ YYDEBUG(343, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy344;
+ if (yych != 't') goto yy187;
+yy344:
+ YYDEBUG(344, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'I') goto yy345;
+ if (yych != 'i') goto yy187;
+yy345:
+ YYDEBUG(345, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'O') goto yy346;
+ if (yych != 'o') goto yy187;
+yy346:
+ YYDEBUG(346, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy347;
+ if (yych != 'n') goto yy187;
+yy347:
+ YYDEBUG(347, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych != '_') goto yy187;
+ YYDEBUG(348, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych != '_') goto yy187;
+ YYDEBUG(349, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(350, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1613 "Zend/zend_language_scanner.l"
+ {
+ zend_op_array *op_array = CG(active_op_array);
+ if (op_array && op_array->function_name) {
+ ZVAL_STRING(zendlval, op_array->function_name, 1);
+ } else {
+ ZVAL_EMPTY_STRING(zendlval);
+ }
+ return T_FUNC_C;
+}
+#line 4360 "Zend/zend_language_scanner.c"
+yy351:
+ YYDEBUG(351, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy352;
+ if (yych != 'e') goto yy187;
+yy352:
+ YYDEBUG(352, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych != '_') goto yy187;
+ YYDEBUG(353, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych != '_') goto yy187;
+ YYDEBUG(354, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(355, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1641 "Zend/zend_language_scanner.l"
+ {
+ char *filename = zend_get_compiled_filename(TSRMLS_C);
+
+ if (!filename) {
+ filename = "";
+ }
+ ZVAL_STRING(zendlval, filename, 1);
+ return T_FILE;
+}
+#line 4390 "Zend/zend_language_scanner.c"
+yy356:
+ YYDEBUG(356, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy357;
+ if (yych != 'a') goto yy187;
+yy357:
+ YYDEBUG(357, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'I') goto yy358;
+ if (yych != 'i') goto yy187;
+yy358:
+ YYDEBUG(358, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy359;
+ if (yych != 't') goto yy187;
+yy359:
+ YYDEBUG(359, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych != '_') goto yy187;
+ YYDEBUG(360, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych != '_') goto yy187;
+ YYDEBUG(361, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(362, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1603 "Zend/zend_language_scanner.l"
+ {
+ zend_class_entry *ce = CG(active_class_entry);
+ if (ce && ce->name && ZEND_ACC_TRAIT == (ce->ce_flags & ZEND_ACC_TRAIT)) {
+ ZVAL_STRINGL(zendlval, ce->name, ce->name_length, 1);
+ } else {
+ ZVAL_EMPTY_STRING(zendlval);
+ }
+ return T_TRAIT_C;
+}
+#line 4430 "Zend/zend_language_scanner.c"
+yy363:
+ YYDEBUG(363, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy364;
+ if (yych != 'a') goto yy187;
+yy364:
+ YYDEBUG(364, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'S') goto yy365;
+ if (yych != 's') goto yy187;
+yy365:
+ YYDEBUG(365, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'S') goto yy366;
+ if (yych != 's') goto yy187;
+yy366:
+ YYDEBUG(366, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych != '_') goto yy187;
+ YYDEBUG(367, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych != '_') goto yy187;
+ YYDEBUG(368, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(369, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1585 "Zend/zend_language_scanner.l"
+ {
+ zend_class_entry *ce = CG(active_class_entry);
+ if (ce && ZEND_ACC_TRAIT == (ce->ce_flags & ZEND_ACC_TRAIT)) {
+ /* We create a special __CLASS__ constant that is going to be resolved
+ at run-time */
+ Z_STRLEN_P(zendlval) = sizeof("__CLASS__")-1;
+ Z_STRVAL_P(zendlval) = estrndup("__CLASS__", Z_STRLEN_P(zendlval));
+ zendlval->type = IS_CONSTANT;
+ } else {
+ if (ce && ce->name) {
+ ZVAL_STRINGL(zendlval, ce->name, ce->name_length, 1);
+ } else {
+ ZVAL_EMPTY_STRING(zendlval);
+ }
+ }
+ return T_CLASS_C;
+}
+#line 4478 "Zend/zend_language_scanner.c"
+yy370:
+ YYDEBUG(370, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy371;
+ if (yych != 'l') goto yy187;
+yy371:
+ YYDEBUG(371, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy372;
+ if (yych != 't') goto yy187;
+yy372:
+ YYDEBUG(372, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych != '_') goto yy187;
+ YYDEBUG(373, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy374;
+ if (yych != 'c') goto yy187;
+yy374:
+ YYDEBUG(374, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'O') goto yy375;
+ if (yych != 'o') goto yy187;
+yy375:
+ YYDEBUG(375, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'M') goto yy376;
+ if (yych != 'm') goto yy187;
+yy376:
+ YYDEBUG(376, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'P') goto yy377;
+ if (yych != 'p') goto yy187;
+yy377:
+ YYDEBUG(377, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'I') goto yy378;
+ if (yych != 'i') goto yy187;
+yy378:
+ YYDEBUG(378, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy379;
+ if (yych != 'l') goto yy187;
+yy379:
+ YYDEBUG(379, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy380;
+ if (yych != 'e') goto yy187;
+yy380:
+ YYDEBUG(380, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy381;
+ if (yych != 'r') goto yy187;
+yy381:
+ YYDEBUG(381, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(382, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1294 "Zend/zend_language_scanner.l"
+ {
+ return T_HALT_COMPILER;
+}
+#line 4544 "Zend/zend_language_scanner.c"
+yy383:
+ YYDEBUG(383, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'S') goto yy387;
+ if (yych == 's') goto yy387;
+ goto yy187;
+yy384:
+ YYDEBUG(384, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy385;
+ if (yych != 'e') goto yy187;
+yy385:
+ YYDEBUG(385, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(386, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1274 "Zend/zend_language_scanner.l"
+ {
+ return T_USE;
+}
+#line 4568 "Zend/zend_language_scanner.c"
+yy387:
+ YYDEBUG(387, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy388;
+ if (yych != 'e') goto yy187;
+yy388:
+ YYDEBUG(388, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy389;
+ if (yych != 't') goto yy187;
+yy389:
+ YYDEBUG(389, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(390, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1322 "Zend/zend_language_scanner.l"
+ {
+ return T_UNSET;
+}
+#line 4591 "Zend/zend_language_scanner.c"
+yy391:
+ YYDEBUG(391, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(7);
+ yych = *YYCURSOR;
+yy392:
+ YYDEBUG(392, *YYCURSOR);
+ if (yych <= 'S') {
+ if (yych <= 'D') {
+ if (yych <= ' ') {
+ if (yych == '\t') goto yy391;
+ if (yych <= 0x1F) goto yy194;
+ goto yy391;
+ } else {
+ if (yych <= 'A') {
+ if (yych <= '@') goto yy194;
+ goto yy396;
+ } else {
+ if (yych <= 'B') goto yy394;
+ if (yych <= 'C') goto yy194;
+ goto yy399;
+ }
+ }
+ } else {
+ if (yych <= 'I') {
+ if (yych == 'F') goto yy400;
+ if (yych <= 'H') goto yy194;
+ goto yy401;
+ } else {
+ if (yych <= 'O') {
+ if (yych <= 'N') goto yy194;
+ goto yy395;
+ } else {
+ if (yych <= 'Q') goto yy194;
+ if (yych <= 'R') goto yy398;
+ goto yy397;
+ }
+ }
+ }
+ } else {
+ if (yych <= 'f') {
+ if (yych <= 'a') {
+ if (yych == 'U') goto yy393;
+ if (yych <= '`') goto yy194;
+ goto yy396;
+ } else {
+ if (yych <= 'c') {
+ if (yych <= 'b') goto yy394;
+ goto yy194;
+ } else {
+ if (yych <= 'd') goto yy399;
+ if (yych <= 'e') goto yy194;
+ goto yy400;
+ }
+ }
+ } else {
+ if (yych <= 'q') {
+ if (yych <= 'i') {
+ if (yych <= 'h') goto yy194;
+ goto yy401;
+ } else {
+ if (yych == 'o') goto yy395;
+ goto yy194;
+ }
+ } else {
+ if (yych <= 's') {
+ if (yych <= 'r') goto yy398;
+ goto yy397;
+ } else {
+ if (yych != 'u') goto yy194;
+ }
+ }
+ }
+ }
+yy393:
+ YYDEBUG(393, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy460;
+ if (yych == 'n') goto yy460;
+ goto yy194;
+yy394:
+ YYDEBUG(394, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'O') {
+ if (yych == 'I') goto yy447;
+ if (yych <= 'N') goto yy194;
+ goto yy448;
+ } else {
+ if (yych <= 'i') {
+ if (yych <= 'h') goto yy194;
+ goto yy447;
+ } else {
+ if (yych == 'o') goto yy448;
+ goto yy194;
+ }
+ }
+yy395:
+ YYDEBUG(395, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'B') goto yy439;
+ if (yych == 'b') goto yy439;
+ goto yy194;
+yy396:
+ YYDEBUG(396, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy432;
+ if (yych == 'r') goto yy432;
+ goto yy194;
+yy397:
+ YYDEBUG(397, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy424;
+ if (yych == 't') goto yy424;
+ goto yy194;
+yy398:
+ YYDEBUG(398, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy422;
+ if (yych == 'e') goto yy422;
+ goto yy194;
+yy399:
+ YYDEBUG(399, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'O') goto yy418;
+ if (yych == 'o') goto yy418;
+ goto yy194;
+yy400:
+ YYDEBUG(400, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy411;
+ if (yych == 'l') goto yy411;
+ goto yy194;
+yy401:
+ YYDEBUG(401, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy402;
+ if (yych != 'n') goto yy194;
+yy402:
+ YYDEBUG(402, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy403;
+ if (yych != 't') goto yy194;
+yy403:
+ YYDEBUG(403, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy404;
+ if (yych != 'e') goto yy406;
+yy404:
+ YYDEBUG(404, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'G') goto yy409;
+ if (yych == 'g') goto yy409;
+ goto yy194;
+yy405:
+ YYDEBUG(405, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+yy406:
+ YYDEBUG(406, *YYCURSOR);
+ if (yych <= 0x1F) {
+ if (yych == '\t') goto yy405;
+ goto yy194;
+ } else {
+ if (yych <= ' ') goto yy405;
+ if (yych != ')') goto yy194;
+ }
+ YYDEBUG(407, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(408, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1222 "Zend/zend_language_scanner.l"
+ {
+ return T_INT_CAST;
+}
+#line 4767 "Zend/zend_language_scanner.c"
+yy409:
+ YYDEBUG(409, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy410;
+ if (yych != 'e') goto yy194;
+yy410:
+ YYDEBUG(410, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy405;
+ if (yych == 'r') goto yy405;
+ goto yy194;
+yy411:
+ YYDEBUG(411, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'O') goto yy412;
+ if (yych != 'o') goto yy194;
+yy412:
+ YYDEBUG(412, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy413;
+ if (yych != 'a') goto yy194;
+yy413:
+ YYDEBUG(413, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy414;
+ if (yych != 't') goto yy194;
+yy414:
+ YYDEBUG(414, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(415, *YYCURSOR);
+ if (yych <= 0x1F) {
+ if (yych == '\t') goto yy414;
+ goto yy194;
+ } else {
+ if (yych <= ' ') goto yy414;
+ if (yych != ')') goto yy194;
+ }
+ YYDEBUG(416, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(417, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1226 "Zend/zend_language_scanner.l"
+ {
+ return T_DOUBLE_CAST;
+}
+#line 4815 "Zend/zend_language_scanner.c"
+yy418:
+ YYDEBUG(418, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'U') goto yy419;
+ if (yych != 'u') goto yy194;
+yy419:
+ YYDEBUG(419, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'B') goto yy420;
+ if (yych != 'b') goto yy194;
+yy420:
+ YYDEBUG(420, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy421;
+ if (yych != 'l') goto yy194;
+yy421:
+ YYDEBUG(421, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy414;
+ if (yych == 'e') goto yy414;
+ goto yy194;
+yy422:
+ YYDEBUG(422, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy423;
+ if (yych != 'a') goto yy194;
+yy423:
+ YYDEBUG(423, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy414;
+ if (yych == 'l') goto yy414;
+ goto yy194;
+yy424:
+ YYDEBUG(424, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy425;
+ if (yych != 'r') goto yy194;
+yy425:
+ YYDEBUG(425, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'I') goto yy426;
+ if (yych != 'i') goto yy194;
+yy426:
+ YYDEBUG(426, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy427;
+ if (yych != 'n') goto yy194;
+yy427:
+ YYDEBUG(427, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'G') goto yy428;
+ if (yych != 'g') goto yy194;
+yy428:
+ YYDEBUG(428, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(429, *YYCURSOR);
+ if (yych <= 0x1F) {
+ if (yych == '\t') goto yy428;
+ goto yy194;
+ } else {
+ if (yych <= ' ') goto yy428;
+ if (yych != ')') goto yy194;
+ }
+ YYDEBUG(430, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(431, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1230 "Zend/zend_language_scanner.l"
+ {
+ return T_STRING_CAST;
+}
+#line 4889 "Zend/zend_language_scanner.c"
+yy432:
+ YYDEBUG(432, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy433;
+ if (yych != 'r') goto yy194;
+yy433:
+ YYDEBUG(433, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy434;
+ if (yych != 'a') goto yy194;
+yy434:
+ YYDEBUG(434, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'Y') goto yy435;
+ if (yych != 'y') goto yy194;
+yy435:
+ YYDEBUG(435, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(436, *YYCURSOR);
+ if (yych <= 0x1F) {
+ if (yych == '\t') goto yy435;
+ goto yy194;
+ } else {
+ if (yych <= ' ') goto yy435;
+ if (yych != ')') goto yy194;
+ }
+ YYDEBUG(437, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(438, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1234 "Zend/zend_language_scanner.l"
+ {
+ return T_ARRAY_CAST;
+}
+#line 4926 "Zend/zend_language_scanner.c"
+yy439:
+ YYDEBUG(439, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'J') goto yy440;
+ if (yych != 'j') goto yy194;
+yy440:
+ YYDEBUG(440, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy441;
+ if (yych != 'e') goto yy194;
+yy441:
+ YYDEBUG(441, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy442;
+ if (yych != 'c') goto yy194;
+yy442:
+ YYDEBUG(442, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy443;
+ if (yych != 't') goto yy194;
+yy443:
+ YYDEBUG(443, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(444, *YYCURSOR);
+ if (yych <= 0x1F) {
+ if (yych == '\t') goto yy443;
+ goto yy194;
+ } else {
+ if (yych <= ' ') goto yy443;
+ if (yych != ')') goto yy194;
+ }
+ YYDEBUG(445, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(446, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1238 "Zend/zend_language_scanner.l"
+ {
+ return T_OBJECT_CAST;
+}
+#line 4968 "Zend/zend_language_scanner.c"
+yy447:
+ YYDEBUG(447, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy457;
+ if (yych == 'n') goto yy457;
+ goto yy194;
+yy448:
+ YYDEBUG(448, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'O') goto yy449;
+ if (yych != 'o') goto yy194;
+yy449:
+ YYDEBUG(449, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy450;
+ if (yych != 'l') goto yy194;
+yy450:
+ YYDEBUG(450, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy455;
+ if (yych == 'e') goto yy455;
+ goto yy452;
+yy451:
+ YYDEBUG(451, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+yy452:
+ YYDEBUG(452, *YYCURSOR);
+ if (yych <= 0x1F) {
+ if (yych == '\t') goto yy451;
+ goto yy194;
+ } else {
+ if (yych <= ' ') goto yy451;
+ if (yych != ')') goto yy194;
+ }
+ YYDEBUG(453, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(454, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1242 "Zend/zend_language_scanner.l"
+ {
+ return T_BOOL_CAST;
+}
+#line 5013 "Zend/zend_language_scanner.c"
+yy455:
+ YYDEBUG(455, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy456;
+ if (yych != 'a') goto yy194;
+yy456:
+ YYDEBUG(456, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy451;
+ if (yych == 'n') goto yy451;
+ goto yy194;
+yy457:
+ YYDEBUG(457, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy458;
+ if (yych != 'a') goto yy194;
+yy458:
+ YYDEBUG(458, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy459;
+ if (yych != 'r') goto yy194;
+yy459:
+ YYDEBUG(459, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'Y') goto yy428;
+ if (yych == 'y') goto yy428;
+ goto yy194;
+yy460:
+ YYDEBUG(460, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'S') goto yy461;
+ if (yych != 's') goto yy194;
+yy461:
+ YYDEBUG(461, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy462;
+ if (yych != 'e') goto yy194;
+yy462:
+ YYDEBUG(462, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy463;
+ if (yych != 't') goto yy194;
+yy463:
+ YYDEBUG(463, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(464, *YYCURSOR);
+ if (yych <= 0x1F) {
+ if (yych == '\t') goto yy463;
+ goto yy194;
+ } else {
+ if (yych <= ' ') goto yy463;
+ if (yych != ')') goto yy194;
+ }
+ YYDEBUG(465, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(466, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1246 "Zend/zend_language_scanner.l"
+ {
+ return T_UNSET_CAST;
+}
+#line 5077 "Zend/zend_language_scanner.c"
+yy467:
+ YYDEBUG(467, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy468;
+ if (yych != 'r') goto yy187;
+yy468:
+ YYDEBUG(468, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(469, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1218 "Zend/zend_language_scanner.l"
+ {
+ return T_VAR;
+}
+#line 5095 "Zend/zend_language_scanner.c"
+yy470:
+ YYDEBUG(470, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'M') goto yy474;
+ if (yych == 'm') goto yy474;
+ goto yy187;
+yy471:
+ YYDEBUG(471, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'W') goto yy472;
+ if (yych != 'w') goto yy187;
+yy472:
+ YYDEBUG(472, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(473, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1210 "Zend/zend_language_scanner.l"
+ {
+ return T_NEW;
+}
+#line 5119 "Zend/zend_language_scanner.c"
+yy474:
+ YYDEBUG(474, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy475;
+ if (yych != 'e') goto yy187;
+yy475:
+ YYDEBUG(475, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'S') goto yy476;
+ if (yych != 's') goto yy187;
+yy476:
+ YYDEBUG(476, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'P') goto yy477;
+ if (yych != 'p') goto yy187;
+yy477:
+ YYDEBUG(477, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy478;
+ if (yych != 'a') goto yy187;
+yy478:
+ YYDEBUG(478, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy479;
+ if (yych != 'c') goto yy187;
+yy479:
+ YYDEBUG(479, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy480;
+ if (yych != 'e') goto yy187;
+yy480:
+ YYDEBUG(480, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(481, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1270 "Zend/zend_language_scanner.l"
+ {
+ return T_NAMESPACE;
+}
+#line 5162 "Zend/zend_language_scanner.c"
+yy482:
+ YYDEBUG(482, *YYCURSOR);
+ yyaccept = 3;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(3);
+ yych = *YYCURSOR;
+ YYDEBUG(483, *YYCURSOR);
+ if (yych <= 'D') {
+ if (yych <= '/') goto yy190;
+ if (yych <= '9') goto yy482;
+ goto yy190;
+ } else {
+ if (yych <= 'E') goto yy193;
+ if (yych == 'e') goto yy193;
+ goto yy190;
+ }
+yy484:
+ YYDEBUG(484, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(485, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1398 "Zend/zend_language_scanner.l"
+ {
+ return T_CONCAT_EQUAL;
+}
+#line 5188 "Zend/zend_language_scanner.c"
+yy486:
+ YYDEBUG(486, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych != '.') goto yy194;
+ YYDEBUG(487, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(488, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1206 "Zend/zend_language_scanner.l"
+ {
+ return T_ELLIPSIS;
+}
+#line 5201 "Zend/zend_language_scanner.c"
+yy489:
+ YYDEBUG(489, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(490, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1198 "Zend/zend_language_scanner.l"
+ {
+ return T_PAAMAYIM_NEKUDOTAYIM;
+}
+#line 5211 "Zend/zend_language_scanner.c"
+yy491:
+ YYDEBUG(491, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+yy492:
+ YYDEBUG(492, *YYCURSOR);
+ if (yych <= '\f') {
+ if (yych <= 0x08) goto yy141;
+ if (yych <= '\n') goto yy491;
+ goto yy141;
+ } else {
+ if (yych <= '\r') goto yy491;
+ if (yych == ' ') goto yy491;
+ goto yy141;
+ }
+yy493:
+ YYDEBUG(493, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(494, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1378 "Zend/zend_language_scanner.l"
+ {
+ return T_MINUS_EQUAL;
+}
+#line 5237 "Zend/zend_language_scanner.c"
+yy495:
+ YYDEBUG(495, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(496, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1346 "Zend/zend_language_scanner.l"
+ {
+ return T_DEC;
+}
+#line 5247 "Zend/zend_language_scanner.c"
+yy497:
+ YYDEBUG(497, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(498, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1170 "Zend/zend_language_scanner.l"
+ {
+ yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
+ return T_OBJECT_OPERATOR;
+}
+#line 5258 "Zend/zend_language_scanner.c"
+yy499:
+ YYDEBUG(499, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'O') {
+ if (yych == 'I') goto yy506;
+ if (yych <= 'N') goto yy187;
+ goto yy507;
+ } else {
+ if (yych <= 'i') {
+ if (yych <= 'h') goto yy187;
+ goto yy506;
+ } else {
+ if (yych == 'o') goto yy507;
+ goto yy187;
+ }
+ }
+yy500:
+ YYDEBUG(500, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'B') goto yy501;
+ if (yych != 'b') goto yy187;
+yy501:
+ YYDEBUG(501, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy502;
+ if (yych != 'l') goto yy187;
+yy502:
+ YYDEBUG(502, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'I') goto yy503;
+ if (yych != 'i') goto yy187;
+yy503:
+ YYDEBUG(503, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy504;
+ if (yych != 'c') goto yy187;
+yy504:
+ YYDEBUG(504, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(505, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1318 "Zend/zend_language_scanner.l"
+ {
+ return T_PUBLIC;
+}
+#line 5307 "Zend/zend_language_scanner.c"
+yy506:
+ YYDEBUG(506, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'V') {
+ if (yych == 'N') goto yy515;
+ if (yych <= 'U') goto yy187;
+ goto yy516;
+ } else {
+ if (yych <= 'n') {
+ if (yych <= 'm') goto yy187;
+ goto yy515;
+ } else {
+ if (yych == 'v') goto yy516;
+ goto yy187;
+ }
+ }
+yy507:
+ YYDEBUG(507, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy508;
+ if (yych != 't') goto yy187;
+yy508:
+ YYDEBUG(508, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy509;
+ if (yych != 'e') goto yy187;
+yy509:
+ YYDEBUG(509, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy510;
+ if (yych != 'c') goto yy187;
+yy510:
+ YYDEBUG(510, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy511;
+ if (yych != 't') goto yy187;
+yy511:
+ YYDEBUG(511, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy512;
+ if (yych != 'e') goto yy187;
+yy512:
+ YYDEBUG(512, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'D') goto yy513;
+ if (yych != 'd') goto yy187;
+yy513:
+ YYDEBUG(513, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(514, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1314 "Zend/zend_language_scanner.l"
+ {
+ return T_PROTECTED;
+}
+#line 5366 "Zend/zend_language_scanner.c"
+yy515:
+ YYDEBUG(515, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy521;
+ if (yych == 't') goto yy521;
+ goto yy187;
+yy516:
+ YYDEBUG(516, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy517;
+ if (yych != 'a') goto yy187;
+yy517:
+ YYDEBUG(517, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy518;
+ if (yych != 't') goto yy187;
+yy518:
+ YYDEBUG(518, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy519;
+ if (yych != 'e') goto yy187;
+yy519:
+ YYDEBUG(519, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(520, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1310 "Zend/zend_language_scanner.l"
+ {
+ return T_PRIVATE;
+}
+#line 5400 "Zend/zend_language_scanner.c"
+yy521:
+ YYDEBUG(521, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(522, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1146 "Zend/zend_language_scanner.l"
+ {
+ return T_PRINT;
+}
+#line 5413 "Zend/zend_language_scanner.c"
+yy523:
+ YYDEBUG(523, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'O') goto yy528;
+ if (yych == 'o') goto yy528;
+ goto yy187;
+yy524:
+ YYDEBUG(524, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy525;
+ if (yych != 't') goto yy187;
+yy525:
+ YYDEBUG(525, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'O') goto yy526;
+ if (yych != 'o') goto yy187;
+yy526:
+ YYDEBUG(526, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(527, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1138 "Zend/zend_language_scanner.l"
+ {
+ return T_GOTO;
+}
+#line 5442 "Zend/zend_language_scanner.c"
+yy528:
+ YYDEBUG(528, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'B') goto yy529;
+ if (yych != 'b') goto yy187;
+yy529:
+ YYDEBUG(529, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy530;
+ if (yych != 'a') goto yy187;
+yy530:
+ YYDEBUG(530, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy531;
+ if (yych != 'l') goto yy187;
+yy531:
+ YYDEBUG(531, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(532, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1282 "Zend/zend_language_scanner.l"
+ {
+ return T_GLOBAL;
+}
+#line 5470 "Zend/zend_language_scanner.c"
+yy533:
+ YYDEBUG(533, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '<') goto yy541;
+ goto yy194;
+yy534:
+ YYDEBUG(534, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy181;
+yy535:
+ YYDEBUG(535, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy179;
+yy536:
+ YYDEBUG(536, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy537;
+ if (yych != 'e') goto yy187;
+yy537:
+ YYDEBUG(537, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy538;
+ if (yych != 'a') goto yy187;
+yy538:
+ YYDEBUG(538, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'K') goto yy539;
+ if (yych != 'k') goto yy187;
+yy539:
+ YYDEBUG(539, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(540, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1130 "Zend/zend_language_scanner.l"
+ {
+ return T_BREAK;
+}
+#line 5511 "Zend/zend_language_scanner.c"
+yy541:
+ YYDEBUG(541, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '<') goto yy270;
+ goto yy194;
+yy542:
+ YYDEBUG(542, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy549;
+ if (yych == 'a') goto yy549;
+ goto yy187;
+yy543:
+ YYDEBUG(543, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'I') goto yy544;
+ if (yych != 'i') goto yy187;
+yy544:
+ YYDEBUG(544, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy545;
+ if (yych != 't') goto yy187;
+yy545:
+ YYDEBUG(545, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy546;
+ if (yych != 'c') goto yy187;
+yy546:
+ YYDEBUG(546, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'H') goto yy547;
+ if (yych != 'h') goto yy187;
+yy547:
+ YYDEBUG(547, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(548, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1114 "Zend/zend_language_scanner.l"
+ {
+ return T_SWITCH;
+}
+#line 5555 "Zend/zend_language_scanner.c"
+yy549:
+ YYDEBUG(549, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy550;
+ if (yych != 't') goto yy187;
+yy550:
+ YYDEBUG(550, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'I') goto yy551;
+ if (yych != 'i') goto yy187;
+yy551:
+ YYDEBUG(551, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy552;
+ if (yych != 'c') goto yy187;
+yy552:
+ YYDEBUG(552, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(553, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1298 "Zend/zend_language_scanner.l"
+ {
+ return T_STATIC;
+}
+#line 5583 "Zend/zend_language_scanner.c"
+yy554:
+ YYDEBUG(554, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'S') goto yy565;
+ if (yych == 's') goto yy565;
+ goto yy187;
+yy555:
+ YYDEBUG(555, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'D') goto yy563;
+ if (yych == 'd') goto yy563;
+ goto yy187;
+yy556:
+ YYDEBUG(556, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy559;
+ if (yych == 'r') goto yy559;
+ goto yy187;
+yy557:
+ YYDEBUG(557, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(558, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1110 "Zend/zend_language_scanner.l"
+ {
+ return T_AS;
+}
+#line 5614 "Zend/zend_language_scanner.c"
+yy559:
+ YYDEBUG(559, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy560;
+ if (yych != 'a') goto yy187;
+yy560:
+ YYDEBUG(560, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'Y') goto yy561;
+ if (yych != 'y') goto yy187;
+yy561:
+ YYDEBUG(561, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(562, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1334 "Zend/zend_language_scanner.l"
+ {
+ return T_ARRAY;
+}
+#line 5637 "Zend/zend_language_scanner.c"
+yy563:
+ YYDEBUG(563, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(564, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1438 "Zend/zend_language_scanner.l"
+ {
+ return T_LOGICAL_AND;
+}
+#line 5650 "Zend/zend_language_scanner.c"
+yy565:
+ YYDEBUG(565, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy566;
+ if (yych != 't') goto yy187;
+yy566:
+ YYDEBUG(566, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy567;
+ if (yych != 'r') goto yy187;
+yy567:
+ YYDEBUG(567, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy568;
+ if (yych != 'a') goto yy187;
+yy568:
+ YYDEBUG(568, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy569;
+ if (yych != 'c') goto yy187;
+yy569:
+ YYDEBUG(569, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy570;
+ if (yych != 't') goto yy187;
+yy570:
+ YYDEBUG(570, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(571, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1302 "Zend/zend_language_scanner.l"
+ {
+ return T_ABSTRACT;
+}
+#line 5688 "Zend/zend_language_scanner.c"
+yy572:
+ YYDEBUG(572, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'I') goto yy573;
+ if (yych != 'i') goto yy187;
+yy573:
+ YYDEBUG(573, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy574;
+ if (yych != 'l') goto yy187;
+yy574:
+ YYDEBUG(574, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy575;
+ if (yych != 'e') goto yy187;
+yy575:
+ YYDEBUG(575, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(576, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1070 "Zend/zend_language_scanner.l"
+ {
+ return T_WHILE;
+}
+#line 5716 "Zend/zend_language_scanner.c"
+yy577:
+ YYDEBUG(577, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(578, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1054 "Zend/zend_language_scanner.l"
+ {
+ return T_IF;
+}
+#line 5729 "Zend/zend_language_scanner.c"
+yy579:
+ YYDEBUG(579, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'P') goto yy621;
+ if (yych == 'p') goto yy621;
+ goto yy187;
+yy580:
+ YYDEBUG(580, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'T') {
+ if (yych <= 'C') {
+ if (yych <= 'B') goto yy187;
+ goto yy588;
+ } else {
+ if (yych <= 'R') goto yy187;
+ if (yych <= 'S') goto yy586;
+ goto yy587;
+ }
+ } else {
+ if (yych <= 'r') {
+ if (yych == 'c') goto yy588;
+ goto yy187;
+ } else {
+ if (yych <= 's') goto yy586;
+ if (yych <= 't') goto yy587;
+ goto yy187;
+ }
+ }
+yy581:
+ YYDEBUG(581, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'S') goto yy582;
+ if (yych != 's') goto yy187;
+yy582:
+ YYDEBUG(582, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy583;
+ if (yych != 'e') goto yy187;
+yy583:
+ YYDEBUG(583, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy584;
+ if (yych != 't') goto yy187;
+yy584:
+ YYDEBUG(584, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(585, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1286 "Zend/zend_language_scanner.l"
+ {
+ return T_ISSET;
+}
+#line 5785 "Zend/zend_language_scanner.c"
+yy586:
+ YYDEBUG(586, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy607;
+ if (yych == 't') goto yy607;
+ goto yy187;
+yy587:
+ YYDEBUG(587, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy600;
+ if (yych == 'e') goto yy600;
+ goto yy187;
+yy588:
+ YYDEBUG(588, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy589;
+ if (yych != 'l') goto yy187;
+yy589:
+ YYDEBUG(589, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'U') goto yy590;
+ if (yych != 'u') goto yy187;
+yy590:
+ YYDEBUG(590, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'D') goto yy591;
+ if (yych != 'd') goto yy187;
+yy591:
+ YYDEBUG(591, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy592;
+ if (yych != 'e') goto yy187;
+yy592:
+ YYDEBUG(592, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) <= '^') {
+ if (yych <= '9') {
+ if (yych >= '0') goto yy186;
+ } else {
+ if (yych <= '@') goto yy593;
+ if (yych <= 'Z') goto yy186;
+ }
+ } else {
+ if (yych <= '`') {
+ if (yych <= '_') goto yy594;
+ } else {
+ if (yych <= 'z') goto yy186;
+ if (yych >= 0x7F) goto yy186;
+ }
+ }
+yy593:
+ YYDEBUG(593, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1254 "Zend/zend_language_scanner.l"
+ {
+ return T_INCLUDE;
+}
+#line 5843 "Zend/zend_language_scanner.c"
+yy594:
+ YYDEBUG(594, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'O') goto yy595;
+ if (yych != 'o') goto yy187;
+yy595:
+ YYDEBUG(595, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy596;
+ if (yych != 'n') goto yy187;
+yy596:
+ YYDEBUG(596, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy597;
+ if (yych != 'c') goto yy187;
+yy597:
+ YYDEBUG(597, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy598;
+ if (yych != 'e') goto yy187;
+yy598:
+ YYDEBUG(598, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(599, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1258 "Zend/zend_language_scanner.l"
+ {
+ return T_INCLUDE_ONCE;
+}
+#line 5876 "Zend/zend_language_scanner.c"
+yy600:
+ YYDEBUG(600, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy601;
+ if (yych != 'r') goto yy187;
+yy601:
+ YYDEBUG(601, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'F') goto yy602;
+ if (yych != 'f') goto yy187;
+yy602:
+ YYDEBUG(602, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy603;
+ if (yych != 'a') goto yy187;
+yy603:
+ YYDEBUG(603, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy604;
+ if (yych != 'c') goto yy187;
+yy604:
+ YYDEBUG(604, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy605;
+ if (yych != 'e') goto yy187;
+yy605:
+ YYDEBUG(605, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(606, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1154 "Zend/zend_language_scanner.l"
+ {
+ return T_INTERFACE;
+}
+#line 5914 "Zend/zend_language_scanner.c"
+yy607:
+ YYDEBUG(607, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'E') {
+ if (yych == 'A') goto yy608;
+ if (yych <= 'D') goto yy187;
+ goto yy609;
+ } else {
+ if (yych <= 'a') {
+ if (yych <= '`') goto yy187;
+ } else {
+ if (yych == 'e') goto yy609;
+ goto yy187;
+ }
+ }
+yy608:
+ YYDEBUG(608, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy615;
+ if (yych == 'n') goto yy615;
+ goto yy187;
+yy609:
+ YYDEBUG(609, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy610;
+ if (yych != 'a') goto yy187;
+yy610:
+ YYDEBUG(610, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'D') goto yy611;
+ if (yych != 'd') goto yy187;
+yy611:
+ YYDEBUG(611, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'O') goto yy612;
+ if (yych != 'o') goto yy187;
+yy612:
+ YYDEBUG(612, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'F') goto yy613;
+ if (yych != 'f') goto yy187;
+yy613:
+ YYDEBUG(613, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(614, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1278 "Zend/zend_language_scanner.l"
+ {
+ return T_INSTEADOF;
+}
+#line 5968 "Zend/zend_language_scanner.c"
+yy615:
+ YYDEBUG(615, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy616;
+ if (yych != 'c') goto yy187;
+yy616:
+ YYDEBUG(616, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy617;
+ if (yych != 'e') goto yy187;
+yy617:
+ YYDEBUG(617, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'O') goto yy618;
+ if (yych != 'o') goto yy187;
+yy618:
+ YYDEBUG(618, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'F') goto yy619;
+ if (yych != 'f') goto yy187;
+yy619:
+ YYDEBUG(619, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(620, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1106 "Zend/zend_language_scanner.l"
+ {
+ return T_INSTANCEOF;
+}
+#line 6001 "Zend/zend_language_scanner.c"
+yy621:
+ YYDEBUG(621, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy622;
+ if (yych != 'l') goto yy187;
+yy622:
+ YYDEBUG(622, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy623;
+ if (yych != 'e') goto yy187;
+yy623:
+ YYDEBUG(623, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'M') goto yy624;
+ if (yych != 'm') goto yy187;
+yy624:
+ YYDEBUG(624, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy625;
+ if (yych != 'e') goto yy187;
+yy625:
+ YYDEBUG(625, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy626;
+ if (yych != 'n') goto yy187;
+yy626:
+ YYDEBUG(626, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy627;
+ if (yych != 't') goto yy187;
+yy627:
+ YYDEBUG(627, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'S') goto yy628;
+ if (yych != 's') goto yy187;
+yy628:
+ YYDEBUG(628, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(629, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1166 "Zend/zend_language_scanner.l"
+ {
+ return T_IMPLEMENTS;
+}
+#line 6049 "Zend/zend_language_scanner.c"
+yy630:
+ YYDEBUG(630, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy638;
+ if (yych == 'r') goto yy638;
+ goto yy187;
+yy631:
+ YYDEBUG(631, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'Y') {
+ if (yych == 'A') goto yy634;
+ if (yych <= 'X') goto yy187;
+ } else {
+ if (yych <= 'a') {
+ if (yych <= '`') goto yy187;
+ goto yy634;
+ } else {
+ if (yych != 'y') goto yy187;
+ }
+ }
+ YYDEBUG(632, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(633, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1038 "Zend/zend_language_scanner.l"
+ {
+ return T_TRY;
+}
+#line 6081 "Zend/zend_language_scanner.c"
+yy634:
+ YYDEBUG(634, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'I') goto yy635;
+ if (yych != 'i') goto yy187;
+yy635:
+ YYDEBUG(635, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy636;
+ if (yych != 't') goto yy187;
+yy636:
+ YYDEBUG(636, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(637, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1158 "Zend/zend_language_scanner.l"
+ {
+ return T_TRAIT;
+}
+#line 6104 "Zend/zend_language_scanner.c"
+yy638:
+ YYDEBUG(638, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'O') goto yy639;
+ if (yych != 'o') goto yy187;
+yy639:
+ YYDEBUG(639, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'W') goto yy640;
+ if (yych != 'w') goto yy187;
+yy640:
+ YYDEBUG(640, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(641, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1050 "Zend/zend_language_scanner.l"
+ {
+ return T_THROW;
+}
+#line 6127 "Zend/zend_language_scanner.c"
+yy642:
+ YYDEBUG(642, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy643;
+ if (yych != 'e') goto yy187;
+yy643:
+ YYDEBUG(643, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy644;
+ if (yych != 'l') goto yy187;
+yy644:
+ YYDEBUG(644, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'D') goto yy645;
+ if (yych != 'd') goto yy187;
+yy645:
+ YYDEBUG(645, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(646, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1034 "Zend/zend_language_scanner.l"
+ {
+ return T_YIELD;
+}
+#line 6155 "Zend/zend_language_scanner.c"
+yy647:
+ YYDEBUG(647, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'T') {
+ if (yych == 'Q') goto yy649;
+ if (yych <= 'S') goto yy187;
+ } else {
+ if (yych <= 'q') {
+ if (yych <= 'p') goto yy187;
+ goto yy649;
+ } else {
+ if (yych != 't') goto yy187;
+ }
+ }
+ YYDEBUG(648, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'U') goto yy661;
+ if (yych == 'u') goto yy661;
+ goto yy187;
+yy649:
+ YYDEBUG(649, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'U') goto yy650;
+ if (yych != 'u') goto yy187;
+yy650:
+ YYDEBUG(650, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'I') goto yy651;
+ if (yych != 'i') goto yy187;
+yy651:
+ YYDEBUG(651, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy652;
+ if (yych != 'r') goto yy187;
+yy652:
+ YYDEBUG(652, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy653;
+ if (yych != 'e') goto yy187;
+yy653:
+ YYDEBUG(653, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) <= '^') {
+ if (yych <= '9') {
+ if (yych >= '0') goto yy186;
+ } else {
+ if (yych <= '@') goto yy654;
+ if (yych <= 'Z') goto yy186;
+ }
+ } else {
+ if (yych <= '`') {
+ if (yych <= '_') goto yy655;
+ } else {
+ if (yych <= 'z') goto yy186;
+ if (yych >= 0x7F) goto yy186;
+ }
+ }
+yy654:
+ YYDEBUG(654, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1262 "Zend/zend_language_scanner.l"
+ {
+ return T_REQUIRE;
+}
+#line 6220 "Zend/zend_language_scanner.c"
+yy655:
+ YYDEBUG(655, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'O') goto yy656;
+ if (yych != 'o') goto yy187;
+yy656:
+ YYDEBUG(656, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy657;
+ if (yych != 'n') goto yy187;
+yy657:
+ YYDEBUG(657, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy658;
+ if (yych != 'c') goto yy187;
+yy658:
+ YYDEBUG(658, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy659;
+ if (yych != 'e') goto yy187;
+yy659:
+ YYDEBUG(659, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(660, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1266 "Zend/zend_language_scanner.l"
+ {
+ return T_REQUIRE_ONCE;
+}
+#line 6253 "Zend/zend_language_scanner.c"
+yy661:
+ YYDEBUG(661, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy662;
+ if (yych != 'r') goto yy187;
+yy662:
+ YYDEBUG(662, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy663;
+ if (yych != 'n') goto yy187;
+yy663:
+ YYDEBUG(663, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(664, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1030 "Zend/zend_language_scanner.l"
+ {
+ return T_RETURN;
+}
+#line 6276 "Zend/zend_language_scanner.c"
+yy665:
+ YYDEBUG(665, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'T') {
+ if (yych <= 'L') {
+ if (yych <= 'K') goto yy187;
+ goto yy688;
+ } else {
+ if (yych <= 'R') goto yy187;
+ if (yych <= 'S') goto yy687;
+ goto yy686;
+ }
+ } else {
+ if (yych <= 'r') {
+ if (yych == 'l') goto yy688;
+ goto yy187;
+ } else {
+ if (yych <= 's') goto yy687;
+ if (yych <= 't') goto yy686;
+ goto yy187;
+ }
+ }
+yy666:
+ YYDEBUG(666, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'O') {
+ if (yych == 'A') goto yy678;
+ if (yych <= 'N') goto yy187;
+ goto yy679;
+ } else {
+ if (yych <= 'a') {
+ if (yych <= '`') goto yy187;
+ goto yy678;
+ } else {
+ if (yych == 'o') goto yy679;
+ goto yy187;
+ }
+ }
+yy667:
+ YYDEBUG(667, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy668;
+ if (yych != 'n') goto yy187;
+yy668:
+ YYDEBUG(668, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'T') {
+ if (yych <= 'R') goto yy187;
+ if (yych >= 'T') goto yy670;
+ } else {
+ if (yych <= 'r') goto yy187;
+ if (yych <= 's') goto yy669;
+ if (yych <= 't') goto yy670;
+ goto yy187;
+ }
+yy669:
+ YYDEBUG(669, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy676;
+ if (yych == 't') goto yy676;
+ goto yy187;
+yy670:
+ YYDEBUG(670, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'I') goto yy671;
+ if (yych != 'i') goto yy187;
+yy671:
+ YYDEBUG(671, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy672;
+ if (yych != 'n') goto yy187;
+yy672:
+ YYDEBUG(672, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'U') goto yy673;
+ if (yych != 'u') goto yy187;
+yy673:
+ YYDEBUG(673, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy674;
+ if (yych != 'e') goto yy187;
+yy674:
+ YYDEBUG(674, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(675, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1134 "Zend/zend_language_scanner.l"
+ {
+ return T_CONTINUE;
+}
+#line 6370 "Zend/zend_language_scanner.c"
+yy676:
+ YYDEBUG(676, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(677, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1026 "Zend/zend_language_scanner.l"
+ {
+ return T_CONST;
+}
+#line 6383 "Zend/zend_language_scanner.c"
+yy678:
+ YYDEBUG(678, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'S') goto yy683;
+ if (yych == 's') goto yy683;
+ goto yy187;
+yy679:
+ YYDEBUG(679, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy680;
+ if (yych != 'n') goto yy187;
+yy680:
+ YYDEBUG(680, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy681;
+ if (yych != 'e') goto yy187;
+yy681:
+ YYDEBUG(681, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(682, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1214 "Zend/zend_language_scanner.l"
+ {
+ return T_CLONE;
+}
+#line 6412 "Zend/zend_language_scanner.c"
+yy683:
+ YYDEBUG(683, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'S') goto yy684;
+ if (yych != 's') goto yy187;
+yy684:
+ YYDEBUG(684, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(685, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1150 "Zend/zend_language_scanner.l"
+ {
+ return T_CLASS;
+}
+#line 6430 "Zend/zend_language_scanner.c"
+yy686:
+ YYDEBUG(686, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy697;
+ if (yych == 'c') goto yy697;
+ goto yy187;
+yy687:
+ YYDEBUG(687, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy695;
+ if (yych == 'e') goto yy695;
+ goto yy187;
+yy688:
+ YYDEBUG(688, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy689;
+ if (yych != 'l') goto yy187;
+yy689:
+ YYDEBUG(689, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy690;
+ if (yych != 'a') goto yy187;
+yy690:
+ YYDEBUG(690, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'B') goto yy691;
+ if (yych != 'b') goto yy187;
+yy691:
+ YYDEBUG(691, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy692;
+ if (yych != 'l') goto yy187;
+yy692:
+ YYDEBUG(692, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy693;
+ if (yych != 'e') goto yy187;
+yy693:
+ YYDEBUG(693, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(694, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1338 "Zend/zend_language_scanner.l"
+ {
+ return T_CALLABLE;
+}
+#line 6480 "Zend/zend_language_scanner.c"
+yy695:
+ YYDEBUG(695, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(696, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1122 "Zend/zend_language_scanner.l"
+ {
+ return T_CASE;
+}
+#line 6493 "Zend/zend_language_scanner.c"
+yy697:
+ YYDEBUG(697, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'H') goto yy698;
+ if (yych != 'h') goto yy187;
+yy698:
+ YYDEBUG(698, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(699, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1042 "Zend/zend_language_scanner.l"
+ {
+ return T_CATCH;
+}
+#line 6511 "Zend/zend_language_scanner.c"
+yy700:
+ YYDEBUG(700, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy717;
+ if (yych == 'n') goto yy717;
+ goto yy187;
+yy701:
+ YYDEBUG(701, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy710;
+ if (yych == 'r') goto yy710;
+ goto yy187;
+yy702:
+ YYDEBUG(702, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy703;
+ if (yych != 'n') goto yy187;
+yy703:
+ YYDEBUG(703, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy704;
+ if (yych != 'c') goto yy187;
+yy704:
+ YYDEBUG(704, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy705;
+ if (yych != 't') goto yy187;
+yy705:
+ YYDEBUG(705, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'I') goto yy706;
+ if (yych != 'i') goto yy187;
+yy706:
+ YYDEBUG(706, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'O') goto yy707;
+ if (yych != 'o') goto yy187;
+yy707:
+ YYDEBUG(707, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy708;
+ if (yych != 'n') goto yy187;
+yy708:
+ YYDEBUG(708, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(709, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1022 "Zend/zend_language_scanner.l"
+ {
+ return T_FUNCTION;
+}
+#line 6566 "Zend/zend_language_scanner.c"
+yy710:
+ YYDEBUG(710, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) <= '^') {
+ if (yych <= '@') {
+ if (yych <= '/') goto yy711;
+ if (yych <= '9') goto yy186;
+ } else {
+ if (yych == 'E') goto yy712;
+ if (yych <= 'Z') goto yy186;
+ }
+ } else {
+ if (yych <= 'd') {
+ if (yych != '`') goto yy186;
+ } else {
+ if (yych <= 'e') goto yy712;
+ if (yych <= 'z') goto yy186;
+ if (yych >= 0x7F) goto yy186;
+ }
+ }
+yy711:
+ YYDEBUG(711, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1082 "Zend/zend_language_scanner.l"
+ {
+ return T_FOR;
+}
+#line 6594 "Zend/zend_language_scanner.c"
+yy712:
+ YYDEBUG(712, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy713;
+ if (yych != 'a') goto yy187;
+yy713:
+ YYDEBUG(713, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy714;
+ if (yych != 'c') goto yy187;
+yy714:
+ YYDEBUG(714, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'H') goto yy715;
+ if (yych != 'h') goto yy187;
+yy715:
+ YYDEBUG(715, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(716, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1090 "Zend/zend_language_scanner.l"
+ {
+ return T_FOREACH;
+}
+#line 6622 "Zend/zend_language_scanner.c"
+yy717:
+ YYDEBUG(717, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy718;
+ if (yych != 'a') goto yy187;
+yy718:
+ YYDEBUG(718, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy719;
+ if (yych != 'l') goto yy187;
+yy719:
+ YYDEBUG(719, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) <= '^') {
+ if (yych <= '@') {
+ if (yych <= '/') goto yy720;
+ if (yych <= '9') goto yy186;
+ } else {
+ if (yych == 'L') goto yy721;
+ if (yych <= 'Z') goto yy186;
+ }
+ } else {
+ if (yych <= 'k') {
+ if (yych != '`') goto yy186;
+ } else {
+ if (yych <= 'l') goto yy721;
+ if (yych <= 'z') goto yy186;
+ if (yych >= 0x7F) goto yy186;
+ }
+ }
+yy720:
+ YYDEBUG(720, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1306 "Zend/zend_language_scanner.l"
+ {
+ return T_FINAL;
+}
+#line 6660 "Zend/zend_language_scanner.c"
+yy721:
+ YYDEBUG(721, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'Y') goto yy722;
+ if (yych != 'y') goto yy187;
+yy722:
+ YYDEBUG(722, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(723, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1046 "Zend/zend_language_scanner.l"
+ {
+ return T_FINALLY;
+}
+#line 6678 "Zend/zend_language_scanner.c"
+yy724:
+ YYDEBUG(724, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'F') {
+ if (yych == 'C') goto yy730;
+ if (yych <= 'E') goto yy187;
+ goto yy731;
+ } else {
+ if (yych <= 'c') {
+ if (yych <= 'b') goto yy187;
+ goto yy730;
+ } else {
+ if (yych == 'f') goto yy731;
+ goto yy187;
+ }
+ }
+yy725:
+ YYDEBUG(725, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy728;
+ if (yych == 'e') goto yy728;
+ goto yy187;
+yy726:
+ YYDEBUG(726, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(727, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1078 "Zend/zend_language_scanner.l"
+ {
+ return T_DO;
+}
+#line 6713 "Zend/zend_language_scanner.c"
+yy728:
+ YYDEBUG(728, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(729, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1018 "Zend/zend_language_scanner.l"
+ {
+ return T_EXIT;
+}
+#line 6726 "Zend/zend_language_scanner.c"
+yy730:
+ YYDEBUG(730, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy737;
+ if (yych == 'l') goto yy737;
+ goto yy187;
+yy731:
+ YYDEBUG(731, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy732;
+ if (yych != 'a') goto yy187;
+yy732:
+ YYDEBUG(732, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'U') goto yy733;
+ if (yych != 'u') goto yy187;
+yy733:
+ YYDEBUG(733, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy734;
+ if (yych != 'l') goto yy187;
+yy734:
+ YYDEBUG(734, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy735;
+ if (yych != 't') goto yy187;
+yy735:
+ YYDEBUG(735, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(736, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1126 "Zend/zend_language_scanner.l"
+ {
+ return T_DEFAULT;
+}
+#line 6765 "Zend/zend_language_scanner.c"
+yy737:
+ YYDEBUG(737, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy738;
+ if (yych != 'a') goto yy187;
+yy738:
+ YYDEBUG(738, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy739;
+ if (yych != 'r') goto yy187;
+yy739:
+ YYDEBUG(739, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy740;
+ if (yych != 'e') goto yy187;
+yy740:
+ YYDEBUG(740, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(741, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1098 "Zend/zend_language_scanner.l"
+ {
+ return T_DECLARE;
+}
+#line 6793 "Zend/zend_language_scanner.c"
+yy742:
+ YYDEBUG(742, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'H') goto yy804;
+ if (yych == 'h') goto yy804;
+ goto yy187;
+yy743:
+ YYDEBUG(743, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'S') goto yy798;
+ if (yych == 's') goto yy798;
+ goto yy187;
+yy744:
+ YYDEBUG(744, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'P') goto yy794;
+ if (yych == 'p') goto yy794;
+ goto yy187;
+yy745:
+ YYDEBUG(745, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'D') goto yy760;
+ if (yych == 'd') goto yy760;
+ goto yy187;
+yy746:
+ YYDEBUG(746, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy757;
+ if (yych == 'a') goto yy757;
+ goto yy187;
+yy747:
+ YYDEBUG(747, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'T') {
+ if (yych == 'I') goto yy748;
+ if (yych <= 'S') goto yy187;
+ goto yy749;
+ } else {
+ if (yych <= 'i') {
+ if (yych <= 'h') goto yy187;
+ } else {
+ if (yych == 't') goto yy749;
+ goto yy187;
+ }
+ }
+yy748:
+ YYDEBUG(748, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy755;
+ if (yych == 't') goto yy755;
+ goto yy187;
+yy749:
+ YYDEBUG(749, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy750;
+ if (yych != 'e') goto yy187;
+yy750:
+ YYDEBUG(750, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy751;
+ if (yych != 'n') goto yy187;
+yy751:
+ YYDEBUG(751, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'D') goto yy752;
+ if (yych != 'd') goto yy187;
+yy752:
+ YYDEBUG(752, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'S') goto yy753;
+ if (yych != 's') goto yy187;
+yy753:
+ YYDEBUG(753, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(754, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1162 "Zend/zend_language_scanner.l"
+ {
+ return T_EXTENDS;
+}
+#line 6877 "Zend/zend_language_scanner.c"
+yy755:
+ YYDEBUG(755, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(756, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1014 "Zend/zend_language_scanner.l"
+ {
+ return T_EXIT;
+}
+#line 6890 "Zend/zend_language_scanner.c"
+yy757:
+ YYDEBUG(757, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy758;
+ if (yych != 'l') goto yy187;
+yy758:
+ YYDEBUG(758, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(759, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1250 "Zend/zend_language_scanner.l"
+ {
+ return T_EVAL;
+}
+#line 6908 "Zend/zend_language_scanner.c"
+yy760:
+ YYDEBUG(760, *YYCURSOR);
+ yych = *++YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch (yych) {
+ case 'D':
+ case 'd': goto yy761;
+ case 'F':
+ case 'f': goto yy762;
+ case 'I':
+ case 'i': goto yy763;
+ case 'S':
+ case 's': goto yy764;
+ case 'W':
+ case 'w': goto yy765;
+ default: goto yy187;
+ }
+yy761:
+ YYDEBUG(761, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy787;
+ if (yych == 'e') goto yy787;
+ goto yy187;
+yy762:
+ YYDEBUG(762, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'O') goto yy779;
+ if (yych == 'o') goto yy779;
+ goto yy187;
+yy763:
+ YYDEBUG(763, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'F') goto yy777;
+ if (yych == 'f') goto yy777;
+ goto yy187;
+yy764:
+ YYDEBUG(764, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'W') goto yy771;
+ if (yych == 'w') goto yy771;
+ goto yy187;
+yy765:
+ YYDEBUG(765, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'H') goto yy766;
+ if (yych != 'h') goto yy187;
+yy766:
+ YYDEBUG(766, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'I') goto yy767;
+ if (yych != 'i') goto yy187;
+yy767:
+ YYDEBUG(767, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy768;
+ if (yych != 'l') goto yy187;
+yy768:
+ YYDEBUG(768, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy769;
+ if (yych != 'e') goto yy187;
+yy769:
+ YYDEBUG(769, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(770, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1074 "Zend/zend_language_scanner.l"
+ {
+ return T_ENDWHILE;
+}
+#line 6982 "Zend/zend_language_scanner.c"
+yy771:
+ YYDEBUG(771, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'I') goto yy772;
+ if (yych != 'i') goto yy187;
+yy772:
+ YYDEBUG(772, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy773;
+ if (yych != 't') goto yy187;
+yy773:
+ YYDEBUG(773, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy774;
+ if (yych != 'c') goto yy187;
+yy774:
+ YYDEBUG(774, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'H') goto yy775;
+ if (yych != 'h') goto yy187;
+yy775:
+ YYDEBUG(775, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(776, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1118 "Zend/zend_language_scanner.l"
+ {
+ return T_ENDSWITCH;
+}
+#line 7015 "Zend/zend_language_scanner.c"
+yy777:
+ YYDEBUG(777, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(778, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1062 "Zend/zend_language_scanner.l"
+ {
+ return T_ENDIF;
+}
+#line 7028 "Zend/zend_language_scanner.c"
+yy779:
+ YYDEBUG(779, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy780;
+ if (yych != 'r') goto yy187;
+yy780:
+ YYDEBUG(780, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) <= '^') {
+ if (yych <= '@') {
+ if (yych <= '/') goto yy781;
+ if (yych <= '9') goto yy186;
+ } else {
+ if (yych == 'E') goto yy782;
+ if (yych <= 'Z') goto yy186;
+ }
+ } else {
+ if (yych <= 'd') {
+ if (yych != '`') goto yy186;
+ } else {
+ if (yych <= 'e') goto yy782;
+ if (yych <= 'z') goto yy186;
+ if (yych >= 0x7F) goto yy186;
+ }
+ }
+yy781:
+ YYDEBUG(781, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1086 "Zend/zend_language_scanner.l"
+ {
+ return T_ENDFOR;
+}
+#line 7061 "Zend/zend_language_scanner.c"
+yy782:
+ YYDEBUG(782, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy783;
+ if (yych != 'a') goto yy187;
+yy783:
+ YYDEBUG(783, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy784;
+ if (yych != 'c') goto yy187;
+yy784:
+ YYDEBUG(784, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'H') goto yy785;
+ if (yych != 'h') goto yy187;
+yy785:
+ YYDEBUG(785, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(786, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1094 "Zend/zend_language_scanner.l"
+ {
+ return T_ENDFOREACH;
+}
+#line 7089 "Zend/zend_language_scanner.c"
+yy787:
+ YYDEBUG(787, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'C') goto yy788;
+ if (yych != 'c') goto yy187;
+yy788:
+ YYDEBUG(788, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy789;
+ if (yych != 'l') goto yy187;
+yy789:
+ YYDEBUG(789, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy790;
+ if (yych != 'a') goto yy187;
+yy790:
+ YYDEBUG(790, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy791;
+ if (yych != 'r') goto yy187;
+yy791:
+ YYDEBUG(791, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy792;
+ if (yych != 'e') goto yy187;
+yy792:
+ YYDEBUG(792, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(793, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1102 "Zend/zend_language_scanner.l"
+ {
+ return T_ENDDECLARE;
+}
+#line 7127 "Zend/zend_language_scanner.c"
+yy794:
+ YYDEBUG(794, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'T') goto yy795;
+ if (yych != 't') goto yy187;
+yy795:
+ YYDEBUG(795, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'Y') goto yy796;
+ if (yych != 'y') goto yy187;
+yy796:
+ YYDEBUG(796, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(797, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1290 "Zend/zend_language_scanner.l"
+ {
+ return T_EMPTY;
+}
+#line 7150 "Zend/zend_language_scanner.c"
+yy798:
+ YYDEBUG(798, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy799;
+ if (yych != 'e') goto yy187;
+yy799:
+ YYDEBUG(799, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) <= '^') {
+ if (yych <= '@') {
+ if (yych <= '/') goto yy800;
+ if (yych <= '9') goto yy186;
+ } else {
+ if (yych == 'I') goto yy801;
+ if (yych <= 'Z') goto yy186;
+ }
+ } else {
+ if (yych <= 'h') {
+ if (yych != '`') goto yy186;
+ } else {
+ if (yych <= 'i') goto yy801;
+ if (yych <= 'z') goto yy186;
+ if (yych >= 0x7F) goto yy186;
+ }
+ }
+yy800:
+ YYDEBUG(800, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1066 "Zend/zend_language_scanner.l"
+ {
+ return T_ELSE;
+}
+#line 7183 "Zend/zend_language_scanner.c"
+yy801:
+ YYDEBUG(801, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'F') goto yy802;
+ if (yych != 'f') goto yy187;
+yy802:
+ YYDEBUG(802, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(803, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1058 "Zend/zend_language_scanner.l"
+ {
+ return T_ELSEIF;
+}
+#line 7201 "Zend/zend_language_scanner.c"
+yy804:
+ YYDEBUG(804, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'O') goto yy805;
+ if (yych != 'o') goto yy187;
+yy805:
+ YYDEBUG(805, *YYCURSOR);
+ ++YYCURSOR;
+ if (yybm[0+(yych = *YYCURSOR)] & 4) {
+ goto yy186;
+ }
+ YYDEBUG(806, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1142 "Zend/zend_language_scanner.l"
+ {
+ return T_ECHO;
+}
+#line 7219 "Zend/zend_language_scanner.c"
+ }
+/* *********************************** */
+yyc_ST_LOOKING_FOR_PROPERTY:
+ {
+ static const unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 128, 128, 0, 0, 128, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 128, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 0, 0, 0, 0, 0, 0,
+ 0, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 0, 0, 0, 0, 64,
+ 0, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 0, 0, 0, 0, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ };
+ YYDEBUG(807, *YYCURSOR);
+ YYFILL(2);
+ yych = *YYCURSOR;
+ if (yych <= '-') {
+ if (yych <= '\r') {
+ if (yych <= 0x08) goto yy815;
+ if (yych <= '\n') goto yy809;
+ if (yych <= '\f') goto yy815;
+ } else {
+ if (yych == ' ') goto yy809;
+ if (yych <= ',') goto yy815;
+ goto yy811;
+ }
+ } else {
+ if (yych <= '_') {
+ if (yych <= '@') goto yy815;
+ if (yych <= 'Z') goto yy813;
+ if (yych <= '^') goto yy815;
+ goto yy813;
+ } else {
+ if (yych <= '`') goto yy815;
+ if (yych <= 'z') goto yy813;
+ if (yych <= '~') goto yy815;
+ goto yy813;
+ }
+ }
+yy809:
+ YYDEBUG(809, *YYCURSOR);
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy821;
+yy810:
+ YYDEBUG(810, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1175 "Zend/zend_language_scanner.l"
+ {
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
+ HANDLE_NEWLINES(yytext, yyleng);
+ return T_WHITESPACE;
+}
+#line 7298 "Zend/zend_language_scanner.c"
+yy811:
+ YYDEBUG(811, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) == '>') goto yy818;
+yy812:
+ YYDEBUG(812, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1192 "Zend/zend_language_scanner.l"
+ {
+ yyless(0);
+ yy_pop_state(TSRMLS_C);
+ goto restart;
+}
+#line 7312 "Zend/zend_language_scanner.c"
+yy813:
+ YYDEBUG(813, *YYCURSOR);
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy817;
+yy814:
+ YYDEBUG(814, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1185 "Zend/zend_language_scanner.l"
+ {
+ yy_pop_state(TSRMLS_C);
+ zend_copy_value(zendlval, yytext, yyleng);
+ zendlval->type = IS_STRING;
+ return T_STRING;
+}
+#line 7328 "Zend/zend_language_scanner.c"
+yy815:
+ YYDEBUG(815, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy812;
+yy816:
+ YYDEBUG(816, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+yy817:
+ YYDEBUG(817, *YYCURSOR);
+ if (yybm[0+yych] & 64) {
+ goto yy816;
+ }
+ goto yy814;
+yy818:
+ YYDEBUG(818, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(819, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1181 "Zend/zend_language_scanner.l"
+ {
+ return T_OBJECT_OPERATOR;
+}
+#line 7353 "Zend/zend_language_scanner.c"
+yy820:
+ YYDEBUG(820, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+yy821:
+ YYDEBUG(821, *YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy820;
+ }
+ goto yy810;
+ }
+/* *********************************** */
+yyc_ST_LOOKING_FOR_VARNAME:
+ {
+ static const unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 0, 0, 0, 0, 0, 0,
+ 0, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 0, 0, 0, 0, 128,
+ 0, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 0, 0, 0, 0, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ };
+ YYDEBUG(822, *YYCURSOR);
+ YYFILL(2);
+ yych = *YYCURSOR;
+ if (yych <= '_') {
+ if (yych <= '@') goto yy826;
+ if (yych <= 'Z') goto yy824;
+ if (yych <= '^') goto yy826;
+ } else {
+ if (yych <= '`') goto yy826;
+ if (yych <= 'z') goto yy824;
+ if (yych <= '~') goto yy826;
+ }
+yy824:
+ YYDEBUG(824, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '_') {
+ if (yych <= '@') {
+ if (yych <= '/') goto yy825;
+ if (yych <= '9') goto yy828;
+ } else {
+ if (yych <= '[') goto yy828;
+ if (yych >= '_') goto yy828;
+ }
+ } else {
+ if (yych <= '|') {
+ if (yych <= '`') goto yy825;
+ if (yych <= 'z') goto yy828;
+ } else {
+ if (yych != '~') goto yy828;
+ }
+ }
+yy825:
+ YYDEBUG(825, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1490 "Zend/zend_language_scanner.l"
+ {
+ yyless(0);
+ yy_pop_state(TSRMLS_C);
+ yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
+ goto restart;
+}
+#line 7445 "Zend/zend_language_scanner.c"
+yy826:
+ YYDEBUG(826, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy825;
+yy827:
+ YYDEBUG(827, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+yy828:
+ YYDEBUG(828, *YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy827;
+ }
+ if (yych == '[') goto yy830;
+ if (yych == '}') goto yy830;
+ YYDEBUG(829, *YYCURSOR);
+ YYCURSOR = YYMARKER;
+ goto yy825;
+yy830:
+ YYDEBUG(830, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(831, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1480 "Zend/zend_language_scanner.l"
+ {
+ yyless(yyleng - 1);
+ zend_copy_value(zendlval, yytext, yyleng);
+ zendlval->type = IS_STRING;
+ yy_pop_state(TSRMLS_C);
+ yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
+ return T_STRING_VARNAME;
+}
+#line 7479 "Zend/zend_language_scanner.c"
+ }
+/* *********************************** */
+yyc_ST_NOWDOC:
+ YYDEBUG(832, *YYCURSOR);
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(834, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(835, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 2310 "Zend/zend_language_scanner.l"
+ {
+ int newline = 0;
+
+ zend_heredoc_label *heredoc_label = zend_ptr_stack_top(&SCNG(heredoc_label_stack));
+
+ if (YYCURSOR > YYLIMIT) {
+ return 0;
+ }
+
+ YYCURSOR--;
+
+ while (YYCURSOR < YYLIMIT) {
+ switch (*YYCURSOR++) {
+ case '\r':
+ if (*YYCURSOR == '\n') {
+ YYCURSOR++;
+ }
+ /* fall through */
+ case '\n':
+ /* Check for ending label on the next line */
+ if (IS_LABEL_START(*YYCURSOR) && heredoc_label->length < YYLIMIT - YYCURSOR && !memcmp(YYCURSOR, heredoc_label->label, heredoc_label->length)) {
+ YYCTYPE *end = YYCURSOR + heredoc_label->length;
+
+ if (*end == ';') {
+ end++;
+ }
+
+ if (*end == '\n' || *end == '\r') {
+ /* newline before label will be subtracted from returned text, but
+ * yyleng/yytext will include it, for zend_highlight/strip, tokenizer, etc. */
+ if (YYCURSOR[-2] == '\r' && YYCURSOR[-1] == '\n') {
+ newline = 2; /* Windows newline */
+ } else {
+ newline = 1;
+ }
+
+ CG(increment_lineno) = 1; /* For newline before label */
+ BEGIN(ST_END_HEREDOC);
+
+ goto nowdoc_scan_done;
+ }
+ }
+ /* fall through */
+ default:
+ continue;
+ }
+ }
+
+nowdoc_scan_done:
+ yyleng = YYCURSOR - SCNG(yy_text);
+
+ zend_copy_value(zendlval, yytext, yyleng - newline);
+ zendlval->type = IS_STRING;
+ HANDLE_NEWLINES(yytext, yyleng - newline);
+ return T_ENCAPSED_AND_WHITESPACE;
+}
+#line 7547 "Zend/zend_language_scanner.c"
+/* *********************************** */
+yyc_ST_VAR_OFFSET:
+ {
+ static const unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 240, 240, 112, 112, 112, 112, 112, 112,
+ 112, 112, 0, 0, 0, 0, 0, 0,
+ 0, 80, 80, 80, 80, 80, 80, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 0, 0, 0, 0, 16,
+ 0, 80, 80, 80, 80, 80, 80, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 0, 0, 0, 0, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16,
+ };
+ YYDEBUG(836, *YYCURSOR);
+ YYFILL(3);
+ yych = *YYCURSOR;
+ if (yych <= '/') {
+ if (yych <= ' ') {
+ if (yych <= '\f') {
+ if (yych <= 0x08) goto yy850;
+ if (yych <= '\n') goto yy846;
+ goto yy850;
+ } else {
+ if (yych <= '\r') goto yy846;
+ if (yych <= 0x1F) goto yy850;
+ goto yy846;
+ }
+ } else {
+ if (yych <= '$') {
+ if (yych <= '"') goto yy845;
+ if (yych <= '#') goto yy846;
+ goto yy841;
+ } else {
+ if (yych == '\'') goto yy846;
+ goto yy845;
+ }
+ }
+ } else {
+ if (yych <= '\\') {
+ if (yych <= '@') {
+ if (yych <= '0') goto yy838;
+ if (yych <= '9') goto yy840;
+ goto yy845;
+ } else {
+ if (yych <= 'Z') goto yy848;
+ if (yych <= '[') goto yy845;
+ goto yy846;
+ }
+ } else {
+ if (yych <= '_') {
+ if (yych <= ']') goto yy843;
+ if (yych <= '^') goto yy845;
+ goto yy848;
+ } else {
+ if (yych <= '`') goto yy845;
+ if (yych <= 'z') goto yy848;
+ if (yych <= '~') goto yy845;
+ goto yy848;
+ }
+ }
+ }
+yy838:
+ YYDEBUG(838, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= 'W') {
+ if (yych <= '9') {
+ if (yych >= '0') goto yy862;
+ } else {
+ if (yych == 'B') goto yy859;
+ }
+ } else {
+ if (yych <= 'b') {
+ if (yych <= 'X') goto yy861;
+ if (yych >= 'b') goto yy859;
+ } else {
+ if (yych == 'x') goto yy861;
+ }
+ }
+yy839:
+ YYDEBUG(839, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1566 "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)) {
+ ZVAL_LONG(zendlval, strtol(yytext, NULL, 10));
+ } else {
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 1);
+ }
+ return T_NUM_STRING;
+}
+#line 7663 "Zend/zend_language_scanner.c"
+yy840:
+ YYDEBUG(840, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy858;
+yy841:
+ YYDEBUG(841, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) <= '_') {
+ if (yych <= '@') goto yy842;
+ if (yych <= 'Z') goto yy854;
+ if (yych >= '_') goto yy854;
+ } else {
+ if (yych <= '`') goto yy842;
+ if (yych <= 'z') goto yy854;
+ if (yych >= 0x7F) goto yy854;
+ }
+yy842:
+ YYDEBUG(842, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1842 "Zend/zend_language_scanner.l"
+ {
+ /* Only '[' can be valid, but returning other tokens will allow a more explicit parse error */
+ return yytext[0];
+}
+#line 7688 "Zend/zend_language_scanner.c"
+yy843:
+ YYDEBUG(843, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(844, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1837 "Zend/zend_language_scanner.l"
+ {
+ yy_pop_state(TSRMLS_C);
+ return ']';
+}
+#line 7699 "Zend/zend_language_scanner.c"
+yy845:
+ YYDEBUG(845, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy842;
+yy846:
+ YYDEBUG(846, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(847, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1847 "Zend/zend_language_scanner.l"
+ {
+ /* Invalid rule to return a more explicit parse error with proper line number */
+ yyless(0);
+ yy_pop_state(TSRMLS_C);
+ return T_ENCAPSED_AND_WHITESPACE;
+}
+#line 7716 "Zend/zend_language_scanner.c"
+yy848:
+ YYDEBUG(848, *YYCURSOR);
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy853;
+yy849:
+ YYDEBUG(849, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1854 "Zend/zend_language_scanner.l"
+ {
+ zend_copy_value(zendlval, yytext, yyleng);
+ zendlval->type = IS_STRING;
+ return T_STRING;
+}
+#line 7731 "Zend/zend_language_scanner.c"
+yy850:
+ YYDEBUG(850, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(851, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 2368 "Zend/zend_language_scanner.l"
+ {
+ if (YYCURSOR > YYLIMIT) {
+ return 0;
+ }
+
+ zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
+ goto restart;
+}
+#line 7746 "Zend/zend_language_scanner.c"
+yy852:
+ YYDEBUG(852, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+yy853:
+ YYDEBUG(853, *YYCURSOR);
+ if (yybm[0+yych] & 16) {
+ goto yy852;
+ }
+ goto yy849;
+yy854:
+ YYDEBUG(854, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(855, *YYCURSOR);
+ if (yych <= '^') {
+ if (yych <= '9') {
+ if (yych >= '0') goto yy854;
+ } else {
+ if (yych <= '@') goto yy856;
+ if (yych <= 'Z') goto yy854;
+ }
+ } else {
+ if (yych <= '`') {
+ if (yych <= '_') goto yy854;
+ } else {
+ if (yych <= 'z') goto yy854;
+ if (yych >= 0x7F) goto yy854;
+ }
+ }
+yy856:
+ YYDEBUG(856, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1831 "Zend/zend_language_scanner.l"
+ {
+ zend_copy_value(zendlval, (yytext+1), (yyleng-1));
+ zendlval->type = IS_STRING;
+ return T_VARIABLE;
+}
+#line 7788 "Zend/zend_language_scanner.c"
+yy857:
+ YYDEBUG(857, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+yy858:
+ YYDEBUG(858, *YYCURSOR);
+ if (yybm[0+yych] & 32) {
+ goto yy857;
+ }
+ goto yy839;
+yy859:
+ YYDEBUG(859, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yybm[0+yych] & 128) {
+ goto yy867;
+ }
+yy860:
+ YYDEBUG(860, *YYCURSOR);
+ YYCURSOR = YYMARKER;
+ goto yy839;
+yy861:
+ YYDEBUG(861, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yybm[0+yych] & 64) {
+ goto yy865;
+ }
+ goto yy860;
+yy862:
+ YYDEBUG(862, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(863, *YYCURSOR);
+ if (yych <= '/') goto yy864;
+ if (yych <= '9') goto yy862;
+yy864:
+ YYDEBUG(864, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 1575 "Zend/zend_language_scanner.l"
+ { /* Offset must be treated as a string */
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 1);
+ return T_NUM_STRING;
+}
+#line 7833 "Zend/zend_language_scanner.c"
+yy865:
+ YYDEBUG(865, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(866, *YYCURSOR);
+ if (yybm[0+yych] & 64) {
+ goto yy865;
+ }
+ goto yy864;
+yy867:
+ YYDEBUG(867, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(868, *YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy867;
+ }
+ goto yy864;
+ }
+}
+#line 2377 "Zend/zend_language_scanner.l"
+
+}
diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l
index 87d208394f..db2ceda3d0 100644
--- a/Zend/zend_language_scanner.l
+++ b/Zend/zend_language_scanner.l
@@ -47,7 +47,7 @@
#include "zend_API.h"
#include "zend_strtod.h"
#include "zend_exceptions.h"
-#include "tsrm_virtual_cwd.h"
+#include "zend_virtual_cwd.h"
#include "tsrm_config_common.h"
#define YYCTYPE unsigned char
@@ -562,10 +562,8 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
zend_bool original_in_compilation = CG(in_compilation);
retval_znode.op_type = IS_CONST;
- retval_znode.u.constant.type = IS_LONG;
- retval_znode.u.constant.value.lval = 1;
- Z_UNSET_ISREF(retval_znode.u.constant);
- Z_SET_REFCOUNT(retval_znode.u.constant, 1);
+ INIT_PZVAL(&retval_znode.u.constant);
+ ZVAL_LONG(&retval_znode.u.constant, 1);
zend_save_lexical_state(&original_lex_state TSRMLS_CC);
@@ -622,7 +620,7 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC)
convert_to_string(&tmp);
filename = &tmp;
}
- file_handle.filename = filename->value.str.val;
+ file_handle.filename = Z_STRVAL_P(filename);
file_handle.free_filename = 0;
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.opened_path = NULL;
@@ -633,7 +631,7 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC)
int dummy = 1;
if (!file_handle.opened_path) {
- file_handle.opened_path = opened_path = estrndup(filename->value.str.val, filename->value.str.len);
+ file_handle.opened_path = opened_path = estrndup(Z_STRVAL_P(filename), Z_STRLEN_P(filename));
}
zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL);
@@ -655,22 +653,15 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
char *buf;
size_t size;
- /* enforce two trailing NULLs for flex... */
- if (IS_INTERNED(str->value.str.val)) {
- char *tmp = safe_emalloc(1, str->value.str.len, ZEND_MMAP_AHEAD);
- memcpy(tmp, str->value.str.val, str->value.str.len + ZEND_MMAP_AHEAD);
- str->value.str.val = tmp;
- } else {
- str->value.str.val = safe_erealloc(str->value.str.val, 1, str->value.str.len, ZEND_MMAP_AHEAD);
- }
-
- memset(str->value.str.val + str->value.str.len, 0, ZEND_MMAP_AHEAD);
+ /* enforce ZEND_MMAP_AHEAD trailing NULLs for flex... */
+ Z_STRVAL_P(str) = str_erealloc(Z_STRVAL_P(str), Z_STRLEN_P(str) + ZEND_MMAP_AHEAD);
+ memset(Z_STRVAL_P(str) + Z_STRLEN_P(str), 0, ZEND_MMAP_AHEAD);
SCNG(yy_in) = NULL;
SCNG(yy_start) = NULL;
- buf = str->value.str.val;
- size = str->value.str.len;
+ buf = Z_STRVAL_P(str);
+ size = Z_STRLEN_P(str);
if (CG(multibyte)) {
SCNG(script_org) = (unsigned char*)buf;
@@ -731,7 +722,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
int compiler_result;
zend_bool original_in_compilation = CG(in_compilation);
- if (source_string->value.str.len==0) {
+ if (Z_STRLEN_P(source_string)==0) {
efree(op_array);
return NULL;
}
@@ -869,11 +860,11 @@ ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter
# define zend_copy_value(zendlval, yytext, yyleng) \
if (SCNG(output_filter)) { \
size_t sz = 0; \
- SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); \
- zendlval->value.str.len = sz; \
+ SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); \
+ Z_STRLEN_P(zendlval) = sz; \
} else { \
- zendlval->value.str.val = (char *) estrndup(yytext, yyleng); \
- zendlval->value.str.len = yyleng; \
+ Z_STRVAL_P(zendlval) = (char *) estrndup(yytext, yyleng); \
+ Z_STRLEN_P(zendlval) = yyleng; \
}
static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quote_type TSRMLS_DC)
@@ -884,8 +875,8 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
ZVAL_STRINGL(zendlval, str, len, 1);
/* convert escape sequences */
- s = t = zendlval->value.str.val;
- end = s+zendlval->value.str.len;
+ s = t = Z_STRVAL_P(zendlval);
+ end = s+Z_STRLEN_P(zendlval);
while (s<end) {
if (*s=='\\') {
s++;
@@ -897,23 +888,23 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
switch(*s) {
case 'n':
*t++ = '\n';
- zendlval->value.str.len--;
+ Z_STRLEN_P(zendlval)--;
break;
case 'r':
*t++ = '\r';
- zendlval->value.str.len--;
+ Z_STRLEN_P(zendlval)--;
break;
case 't':
*t++ = '\t';
- zendlval->value.str.len--;
+ Z_STRLEN_P(zendlval)--;
break;
case 'f':
*t++ = '\f';
- zendlval->value.str.len--;
+ Z_STRLEN_P(zendlval)--;
break;
case 'v':
*t++ = '\v';
- zendlval->value.str.len--;
+ Z_STRLEN_P(zendlval)--;
break;
case 'e':
#ifdef PHP_WIN32
@@ -921,7 +912,7 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
#else
*t++ = '\e';
#endif
- zendlval->value.str.len--;
+ Z_STRLEN_P(zendlval)--;
break;
case '"':
case '`':
@@ -933,20 +924,20 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
case '\\':
case '$':
*t++ = *s;
- zendlval->value.str.len--;
+ Z_STRLEN_P(zendlval)--;
break;
case 'x':
case 'X':
if (ZEND_IS_HEX(*(s+1))) {
char hex_buf[3] = { 0, 0, 0 };
- zendlval->value.str.len--; /* for the 'x' */
+ Z_STRLEN_P(zendlval)--; /* for the 'x' */
hex_buf[0] = *(++s);
- zendlval->value.str.len--;
+ Z_STRLEN_P(zendlval)--;
if (ZEND_IS_HEX(*(s+1))) {
hex_buf[1] = *(++s);
- zendlval->value.str.len--;
+ Z_STRLEN_P(zendlval)--;
}
*t++ = (char) strtol(hex_buf, NULL, 16);
} else {
@@ -960,13 +951,13 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
char octal_buf[4] = { 0, 0, 0, 0 };
octal_buf[0] = *s;
- zendlval->value.str.len--;
+ Z_STRLEN_P(zendlval)--;
if (ZEND_IS_OCT(*(s+1))) {
octal_buf[1] = *(++s);
- zendlval->value.str.len--;
+ Z_STRLEN_P(zendlval)--;
if (ZEND_IS_OCT(*(s+1))) {
octal_buf[2] = *(++s);
- zendlval->value.str.len--;
+ Z_STRLEN_P(zendlval)--;
}
}
*t++ = (char) strtol(octal_buf, NULL, 8);
@@ -988,9 +979,9 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
*t = 0;
if (SCNG(output_filter)) {
size_t sz = 0;
- s = zendlval->value.str.val;
- SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)s, (size_t)zendlval->value.str.len TSRMLS_CC);
- zendlval->value.str.len = sz;
+ s = Z_STRVAL_P(zendlval);
+ SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC);
+ Z_STRLEN_P(zendlval) = sz;
efree(s);
}
}
@@ -1020,7 +1011,6 @@ NEWLINE ("\r"|"\n"|"\r\n")
/* compute yyleng before each rule */
<!*> := yyleng = YYCURSOR - SCNG(yy_text);
-
<ST_IN_SCRIPTING>"exit" {
return T_EXIT;
}
@@ -1183,9 +1173,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<ST_IN_SCRIPTING,ST_LOOKING_FOR_PROPERTY>{WHITESPACE}+ {
- zendlval->value.str.val = yytext; /* no copying - intentional */
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
HANDLE_NEWLINES(yytext, yyleng);
return T_WHITESPACE;
}
@@ -1215,6 +1203,10 @@ NEWLINE ("\r"|"\n"|"\r\n")
return T_NS_SEPARATOR;
}
+<ST_IN_SCRIPTING>"..." {
+ return T_ELLIPSIS;
+}
+
<ST_IN_SCRIPTING>"new" {
return T_NEW;
}
@@ -1391,6 +1383,14 @@ NEWLINE ("\r"|"\n"|"\r\n")
return T_MUL_EQUAL;
}
+<ST_IN_SCRIPTING>"*\*" {
+ return T_POW;
+}
+
+<ST_IN_SCRIPTING>"*\*=" {
+ return T_POW_EQUAL;
+}
+
<ST_IN_SCRIPTING>"/=" {
return T_DIV_EQUAL;
}
@@ -1506,30 +1506,29 @@ NEWLINE ("\r"|"\n"|"\r\n")
if (len < SIZEOF_LONG * 8) {
if (len == 0) {
- zendlval->value.lval = 0;
+ Z_LVAL_P(zendlval) = 0;
} else {
- zendlval->value.lval = strtol(bin, NULL, 2);
+ Z_LVAL_P(zendlval) = strtol(bin, NULL, 2);
}
zendlval->type = IS_LONG;
return T_LNUMBER;
} else {
- zendlval->value.dval = zend_bin_strtod(bin, NULL);
- zendlval->type = IS_DOUBLE;
+ ZVAL_DOUBLE(zendlval, zend_bin_strtod(bin, NULL));
return T_DNUMBER;
}
}
<ST_IN_SCRIPTING>{LNUM} {
if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */
- zendlval->value.lval = strtol(yytext, NULL, 0);
+ Z_LVAL_P(zendlval) = strtol(yytext, NULL, 0);
} else {
errno = 0;
- zendlval->value.lval = strtol(yytext, NULL, 0);
+ Z_LVAL_P(zendlval) = strtol(yytext, NULL, 0);
if (errno == ERANGE) { /* Overflow */
if (yytext[0] == '0') { /* octal overflow */
- zendlval->value.dval = zend_oct_strtod(yytext, NULL);
+ Z_DVAL_P(zendlval) = zend_oct_strtod(yytext, NULL);
} else {
- zendlval->value.dval = zend_strtod(yytext, NULL);
+ Z_DVAL_P(zendlval) = zend_strtod(yytext, NULL);
}
zendlval->type = IS_DOUBLE;
return T_DNUMBER;
@@ -1552,120 +1551,80 @@ NEWLINE ("\r"|"\n"|"\r\n")
if (len < SIZEOF_LONG * 2 || (len == SIZEOF_LONG * 2 && *hex <= '7')) {
if (len == 0) {
- zendlval->value.lval = 0;
+ Z_LVAL_P(zendlval) = 0;
} else {
- zendlval->value.lval = strtol(hex, NULL, 16);
+ Z_LVAL_P(zendlval) = strtol(hex, NULL, 16);
}
zendlval->type = IS_LONG;
return T_LNUMBER;
} else {
- zendlval->value.dval = zend_hex_strtod(hex, NULL);
- zendlval->type = IS_DOUBLE;
+ ZVAL_DOUBLE(zendlval, zend_hex_strtod(hex, NULL));
return T_DNUMBER;
}
}
<ST_VAR_OFFSET>[0]|([1-9][0-9]*) { /* 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)) {
- zendlval->value.lval = strtol(yytext, NULL, 10);
- zendlval->type = IS_LONG;
+ ZVAL_LONG(zendlval, strtol(yytext, NULL, 10));
} else {
- zendlval->value.str.val = (char *)estrndup(yytext, yyleng);
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 1);
}
return T_NUM_STRING;
}
<ST_VAR_OFFSET>{LNUM}|{HNUM}|{BNUM} { /* Offset must be treated as a string */
- zendlval->value.str.val = (char *)estrndup(yytext, yyleng);
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 1);
return T_NUM_STRING;
}
<ST_IN_SCRIPTING>{DNUM}|{EXPONENT_DNUM} {
- zendlval->value.dval = zend_strtod(yytext, NULL);
- zendlval->type = IS_DOUBLE;
+ ZVAL_DOUBLE(zendlval, zend_strtod(yytext, NULL));
return T_DNUMBER;
}
<ST_IN_SCRIPTING>"__CLASS__" {
- const char *class_name = NULL;
-
- if (CG(active_class_entry)
- && (ZEND_ACC_TRAIT ==
- (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT))) {
+ zend_class_entry *ce = CG(active_class_entry);
+ if (ce && ZEND_ACC_TRAIT == (ce->ce_flags & ZEND_ACC_TRAIT)) {
/* We create a special __CLASS__ constant that is going to be resolved
at run-time */
- zendlval->value.str.len = sizeof("__CLASS__")-1;
- zendlval->value.str.val = estrndup("__CLASS__", zendlval->value.str.len);
+ Z_STRLEN_P(zendlval) = sizeof("__CLASS__")-1;
+ Z_STRVAL_P(zendlval) = estrndup("__CLASS__", Z_STRLEN_P(zendlval));
zendlval->type = IS_CONSTANT;
} else {
- if (CG(active_class_entry)) {
- class_name = CG(active_class_entry)->name;
- }
-
- if (!class_name) {
- class_name = "";
+ if (ce && ce->name) {
+ ZVAL_STRINGL(zendlval, ce->name, ce->name_length, 1);
+ } else {
+ ZVAL_EMPTY_STRING(zendlval);
}
-
- zendlval->value.str.len = strlen(class_name);
- zendlval->value.str.val = estrndup(class_name, zendlval->value.str.len);
- zendlval->type = IS_STRING;
}
return T_CLASS_C;
}
<ST_IN_SCRIPTING>"__TRAIT__" {
- const char *trait_name = NULL;
-
- if (CG(active_class_entry)
- && (ZEND_ACC_TRAIT ==
- (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT))) {
- trait_name = CG(active_class_entry)->name;
- }
-
- if (!trait_name) {
- trait_name = "";
- }
-
- zendlval->value.str.len = strlen(trait_name);
- zendlval->value.str.val = estrndup(trait_name, zendlval->value.str.len);
- zendlval->type = IS_STRING;
-
+ zend_class_entry *ce = CG(active_class_entry);
+ if (ce && ce->name && ZEND_ACC_TRAIT == (ce->ce_flags & ZEND_ACC_TRAIT)) {
+ ZVAL_STRINGL(zendlval, ce->name, ce->name_length, 1);
+ } else {
+ ZVAL_EMPTY_STRING(zendlval);
+ }
return T_TRAIT_C;
}
<ST_IN_SCRIPTING>"__FUNCTION__" {
- const char *func_name = NULL;
-
- if (CG(active_op_array)) {
- func_name = CG(active_op_array)->function_name;
- }
-
- if (!func_name) {
- func_name = "";
+ zend_op_array *op_array = CG(active_op_array);
+ if (op_array && op_array->function_name) {
+ ZVAL_STRING(zendlval, op_array->function_name, 1);
+ } else {
+ ZVAL_EMPTY_STRING(zendlval);
}
- zendlval->value.str.len = strlen(func_name);
- zendlval->value.str.val = estrndup(func_name, zendlval->value.str.len);
- zendlval->type = IS_STRING;
return T_FUNC_C;
}
<ST_IN_SCRIPTING>"__METHOD__" {
const char *class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL;
const char *func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL;
- size_t len = 0;
-
- if (class_name) {
- len += strlen(class_name) + 2;
- }
- if (func_name) {
- len += strlen(func_name);
- }
- zendlval->value.str.len = zend_spprintf(&zendlval->value.str.val, 0, "%s%s%s",
+ Z_STRLEN_P(zendlval) = zend_spprintf(&Z_STRVAL_P(zendlval), 0, "%s%s%s",
class_name ? class_name : "",
class_name && func_name ? "::" : "",
func_name ? func_name : ""
@@ -1675,8 +1634,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<ST_IN_SCRIPTING>"__LINE__" {
- zendlval->value.lval = CG(zend_lineno);
- zendlval->type = IS_LONG;
+ ZVAL_LONG(zendlval, CG(zend_lineno));
return T_LINE;
}
@@ -1686,9 +1644,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
if (!filename) {
filename = "";
}
- zendlval->value.str.len = strlen(filename);
- zendlval->value.str.val = estrndup(filename, zendlval->value.str.len);
- zendlval->type = IS_STRING;
+ ZVAL_STRING(zendlval, filename, 1);
return T_FILE;
}
@@ -1713,9 +1669,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
#endif
}
- zendlval->value.str.len = strlen(dirname);
- zendlval->value.str.val = dirname;
- zendlval->type = IS_STRING;
+ ZVAL_STRING(zendlval, dirname, 0);
return T_DIR;
}
@@ -1739,9 +1693,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
HANDLE_NEWLINES(yytext, yyleng);
- zendlval->value.str.val = yytext; /* no copying - intentional */
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG;
}
@@ -1749,9 +1701,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
<INITIAL>"<%=" {
if (CG(asp_tags)) {
- zendlval->value.str.val = yytext; /* no copying - intentional */
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG_WITH_ECHO;
} else {
@@ -1761,9 +1711,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
<INITIAL>"<?=" {
- zendlval->value.str.val = yytext; /* no copying - intentional */
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG_WITH_ECHO;
}
@@ -1771,9 +1719,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
<INITIAL>"<%" {
if (CG(asp_tags)) {
- zendlval->value.str.val = yytext; /* no copying - intentional */
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG;
} else {
@@ -1783,9 +1729,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
<INITIAL>"<?php"([ \t]|{NEWLINE}) {
- zendlval->value.str.val = yytext; /* no copying - intentional */
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
HANDLE_NEWLINE(yytext[yyleng-1]);
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG;
@@ -1794,9 +1738,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
<INITIAL>"<?" {
if (CG(short_tags)) {
- zendlval->value.str.val = yytext; /* no copying - intentional */
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG;
} else {
@@ -1850,14 +1792,14 @@ inline_html:
if (SCNG(output_filter)) {
int readsize;
size_t sz = 0;
- readsize = SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC);
- zendlval->value.str.len = sz;
+ readsize = SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC);
+ Z_STRLEN_P(zendlval) = sz;
if (readsize < yyleng) {
yyless(readsize);
}
} else {
- zendlval->value.str.val = (char *) estrndup(yytext, yyleng);
- zendlval->value.str.len = yyleng;
+ Z_STRVAL_P(zendlval) = (char *) estrndup(yytext, yyleng);
+ Z_STRLEN_P(zendlval) = yyleng;
}
zendlval->type = IS_STRING;
HANDLE_NEWLINES(yytext, yyleng);
@@ -1985,9 +1927,7 @@ inline_html:
}
<ST_IN_SCRIPTING>("?>"|"</script"{WHITESPACE}*">"){NEWLINE}? {
- zendlval->value.str.val = yytext; /* no copying - intentional */
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
BEGIN(INITIAL);
return T_CLOSE_TAG; /* implicit ';' at php-end tag */
}
@@ -1996,9 +1936,7 @@ inline_html:
<ST_IN_SCRIPTING>"%>"{NEWLINE}? {
if (CG(asp_tags)) {
BEGIN(INITIAL);
- zendlval->value.str.len = yyleng;
- zendlval->type = IS_STRING;
- zendlval->value.str.val = yytext; /* no copying - intentional */
+ ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
return T_CLOSE_TAG; /* implicit ';' at php-end tag */
} else {
yyless(1);
@@ -2032,13 +1970,11 @@ inline_html:
}
}
- zendlval->value.str.val = estrndup(yytext+bprefix+1, yyleng-bprefix-2);
- zendlval->value.str.len = yyleng-bprefix-2;
- zendlval->type = IS_STRING;
+ ZVAL_STRINGL(zendlval, yytext+bprefix+1, yyleng-bprefix-2, 1);
/* convert escape sequences */
- s = t = zendlval->value.str.val;
- end = s+zendlval->value.str.len;
+ s = t = Z_STRVAL_P(zendlval);
+ end = s+Z_STRLEN_P(zendlval);
while (s<end) {
if (*s=='\\') {
s++;
@@ -2047,7 +1983,7 @@ inline_html:
case '\\':
case '\'':
*t++ = *s;
- zendlval->value.str.len--;
+ Z_STRLEN_P(zendlval)--;
break;
default:
*t++ = '\\';
@@ -2067,9 +2003,9 @@ inline_html:
if (SCNG(output_filter)) {
size_t sz = 0;
- s = zendlval->value.str.val;
- SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)s, (size_t)zendlval->value.str.len TSRMLS_CC);
- zendlval->value.str.len = sz;
+ s = Z_STRVAL_P(zendlval);
+ SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC);
+ Z_STRLEN_P(zendlval) = sz;
efree(s);
}
return T_CONSTANT_ENCAPSED_STRING;
@@ -2187,7 +2123,7 @@ inline_html:
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"{$" {
- zendlval->value.lval = (long) '{';
+ Z_LVAL_P(zendlval) = (long) '{';
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
yyless(1);
return T_CURLY_OPEN;
diff --git a/Zend/zend_language_scanner_defs.h b/Zend/zend_language_scanner_defs.h
index 70ce8b890c..f25c3f46be 100644
--- a/Zend/zend_language_scanner_defs.h
+++ b/Zend/zend_language_scanner_defs.h
@@ -1,15 +1,15 @@
-/* Generated by re2c 0.13.5 on Sun Dec 22 13:03:33 2013 */
-#line 3 "Zend/zend_language_scanner_defs.h"
-
-enum YYCONDTYPE {
- yycST_IN_SCRIPTING,
- yycST_LOOKING_FOR_PROPERTY,
- yycST_BACKQUOTE,
- yycST_DOUBLE_QUOTES,
- yycST_HEREDOC,
- yycST_LOOKING_FOR_VARNAME,
- yycST_VAR_OFFSET,
- yycINITIAL,
- yycST_END_HEREDOC,
- yycST_NOWDOC,
-};
+/* Generated by re2c 0.13.5 */
+#line 3 "Zend/zend_language_scanner_defs.h"
+
+enum YYCONDTYPE {
+ yycST_IN_SCRIPTING,
+ yycST_LOOKING_FOR_PROPERTY,
+ yycST_BACKQUOTE,
+ yycST_DOUBLE_QUOTES,
+ yycST_HEREDOC,
+ yycST_LOOKING_FOR_VARNAME,
+ yycST_VAR_OFFSET,
+ yycINITIAL,
+ yycST_END_HEREDOC,
+ yycST_NOWDOC,
+};
diff --git a/Zend/zend_modules.h b/Zend/zend_modules.h
index 5ec80b833c..358e672cf3 100644
--- a/Zend/zend_modules.h
+++ b/Zend/zend_modules.h
@@ -33,7 +33,7 @@
#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module TSRMLS_DC
#define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module TSRMLS_CC
-#define ZEND_MODULE_API_NO 20121212
+#define ZEND_MODULE_API_NO 20131226
#ifdef ZTS
#define USING_ZTS 1
#else
diff --git a/Zend/zend_multibyte.c b/Zend/zend_multibyte.c
index 7e3284bb38..597b2ba711 100644
--- a/Zend/zend_multibyte.c
+++ b/Zend/zend_multibyte.c
@@ -53,7 +53,7 @@ static size_t dummy_encoding_converter(unsigned char **to, size_t *to_length, co
static int dummy_encoding_list_parser(const char *encoding_list, size_t encoding_list_len, const zend_encoding ***return_list, size_t *return_size, int persistent TSRMLS_DC)
{
*return_list = pemalloc(0, persistent);
- return_size = 0;
+ *return_size = 0;
return SUCCESS;
}
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index 3971666675..0c43ba8aec 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -137,8 +137,40 @@ ZEND_API HashTable *zend_std_get_gc(zval *object, zval ***table, int *n TSRMLS_D
ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
{
- *is_temp = 0;
- return zend_std_get_properties(object TSRMLS_CC);
+ zend_class_entry *ce = Z_OBJCE_P(object);
+ zval *retval = NULL;
+
+ if (!ce->__debugInfo) {
+ *is_temp = 0;
+ return Z_OBJ_HANDLER_P(object, get_properties)
+ ? Z_OBJ_HANDLER_P(object, get_properties)(object TSRMLS_CC)
+ : NULL;
+ }
+
+ zend_call_method_with_0_params(&object, ce, &ce->__debugInfo, ZEND_DEBUGINFO_FUNC_NAME, &retval);
+ if (retval && Z_TYPE_P(retval) == IS_ARRAY) {
+ HashTable *ht = Z_ARRVAL_P(retval);
+ if (Z_REFCOUNT_P(retval) <= 1) {
+ *is_temp = 1;
+ efree(retval);
+ return ht;
+ } else {
+ *is_temp = 0;
+ zval_ptr_dtor(&retval);
+ }
+ return ht;
+ }
+ if (retval && Z_TYPE_P(retval) == IS_NULL) {
+ zval ret;
+ array_init(&ret);
+ *is_temp = 1;
+ zval_ptr_dtor(&retval);
+ return Z_ARRVAL(ret);
+ }
+
+ zend_error_noreturn(E_ERROR, ZEND_DEBUGINFO_FUNC_NAME "() must return an array");
+
+ return NULL; /* Compilers are dumb and don't understand that noreturn means that the function does NOT need a return value... */
}
/* }}} */
@@ -899,11 +931,8 @@ ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */
zend_call_method_with_2_params(&this_ptr, ce, &ce->__call, ZEND_CALL_FUNC_NAME, &method_result_ptr, method_name_ptr, method_args_ptr);
if (method_result_ptr) {
- if (Z_ISREF_P(method_result_ptr) || Z_REFCOUNT_P(method_result_ptr) > 1) {
- RETVAL_ZVAL(method_result_ptr, 1, 1);
- } else {
- RETVAL_ZVAL(method_result_ptr, 0, 1);
- }
+ RETVAL_ZVAL_FAST(method_result_ptr);
+ zval_ptr_dtor(&method_result_ptr);
}
/* now destruct all auxiliaries */
@@ -1116,11 +1145,8 @@ ZEND_API void zend_std_callstatic_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{
zend_call_method_with_2_params(NULL, ce, &ce->__callstatic, ZEND_CALLSTATIC_FUNC_NAME, &method_result_ptr, method_name_ptr, method_args_ptr);
if (method_result_ptr) {
- if (Z_ISREF_P(method_result_ptr) || Z_REFCOUNT_P(method_result_ptr) > 1) {
- RETVAL_ZVAL(method_result_ptr, 1, 1);
- } else {
- RETVAL_ZVAL(method_result_ptr, 0, 1);
- }
+ RETVAL_ZVAL_FAST(method_result_ptr);
+ zval_ptr_dtor(&method_result_ptr);
}
/* now destruct all auxiliaries */
@@ -1647,9 +1673,11 @@ ZEND_API zend_object_handlers std_object_handlers = {
zend_std_compare_objects, /* compare_objects */
zend_std_cast_object_tostring, /* cast_object */
NULL, /* count_elements */
- NULL, /* get_debug_info */
+ zend_std_get_debug_info, /* get_debug_info */
zend_std_get_closure, /* get_closure */
zend_std_get_gc, /* get_gc */
+ NULL, /* do_operation */
+ NULL, /* compare */
};
/*
diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h
index 90c96f1887..295540b917 100644
--- a/Zend/zend_object_handlers.h
+++ b/Zend/zend_object_handlers.h
@@ -100,6 +100,7 @@ typedef zend_object_value (*zend_object_clone_obj_t)(zval *object TSRMLS_DC);
typedef zend_class_entry *(*zend_object_get_class_entry_t)(const zval *object TSRMLS_DC);
typedef int (*zend_object_get_class_name_t)(const zval *object, const char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC);
typedef int (*zend_object_compare_t)(zval *object1, zval *object2 TSRMLS_DC);
+typedef int (*zend_object_compare_zvals_t)(zval *resul, zval *op1, zval *op2 TSRMLS_DC);
/* Cast an object to some other type
*/
@@ -113,6 +114,8 @@ typedef int (*zend_object_get_closure_t)(zval *obj, zend_class_entry **ce_ptr, u
typedef HashTable *(*zend_object_get_gc_t)(zval *object, zval ***table, int *n TSRMLS_DC);
+typedef int (*zend_object_do_operation_t)(zend_uchar opcode, zval *result, zval *op1, zval *op2 TSRMLS_DC);
+
struct _zend_object_handlers {
/* general object functions */
zend_object_add_ref_t add_ref;
@@ -142,6 +145,8 @@ struct _zend_object_handlers {
zend_object_get_debug_info_t get_debug_info;
zend_object_get_closure_t get_closure;
zend_object_get_gc_t get_gc;
+ zend_object_do_operation_t do_operation;
+ zend_object_compare_zvals_t compare;
};
extern ZEND_API zend_object_handlers std_object_handlers;
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index d31240234e..a4de08b659 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -606,11 +606,11 @@ static void zend_resolve_finally_call(zend_op_array *op_array, zend_uint op_num,
while (i > 0) {
i--;
if (op_array->try_catch_array[i].finally_op &&
- op_num >= op_array->try_catch_array[i].try_op &&
- op_num < op_array->try_catch_array[i].finally_op - 1 &&
- (dst_num < op_array->try_catch_array[i].try_op ||
- dst_num > op_array->try_catch_array[i].finally_end)) {
-
+ op_num >= op_array->try_catch_array[i].try_op &&
+ op_num < op_array->try_catch_array[i].finally_op - 1 &&
+ (dst_num < op_array->try_catch_array[i].try_op ||
+ dst_num > op_array->try_catch_array[i].finally_end)) {
+
opline = get_next_op(op_array TSRMLS_CC);
opline->opcode = ZEND_FAST_CALL;
SET_UNUSED(opline->op1);
@@ -630,7 +630,7 @@ static void zend_resolve_finally_call(zend_op_array *op_array, zend_uint op_num,
SET_UNUSED(opline->op2);
opline->op1.opline_num = start_op;
- break;
+ break;
}
}
}
@@ -779,7 +779,7 @@ ZEND_API int pass_two(zend_op_array *op_array TSRMLS_DC)
if (op_array->fn_flags & ZEND_ACC_GENERATOR) {
if (opline->op1_type != IS_CONST || Z_TYPE_P(opline->op1.zv) != IS_NULL) {
CG(zend_lineno) = opline->lineno;
- zend_error(E_COMPILE_ERROR, "Generators cannot return values using \"return\"");
+ zend_error_noreturn(E_COMPILE_ERROR, "Generators cannot return values using \"return\"");
}
opline->opcode = ZEND_GENERATOR_RETURN;
@@ -832,6 +832,9 @@ ZEND_API binary_op_type get_binary_op(int opcode)
case ZEND_ASSIGN_MUL:
return (binary_op_type) mul_function;
break;
+ case ZEND_POW:
+ return (binary_op_type) pow_function;
+ break;
case ZEND_DIV:
case ZEND_ASSIGN_DIV:
return (binary_op_type) div_function;
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index e0812fccc4..1013f26f61 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -192,7 +192,7 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC) /* {{{ */
if ((Z_TYPE_P(op)=is_numeric_string(strval, Z_STRLEN_P(op), &Z_LVAL_P(op), &Z_DVAL_P(op), 1)) == 0) {
ZVAL_LONG(op, 0);
}
- STR_FREE(strval);
+ str_efree(strval);
break;
}
case IS_BOOL:
@@ -391,7 +391,7 @@ ZEND_API void convert_to_long_base(zval *op, int base) /* {{{ */
char *strval = Z_STRVAL_P(op);
Z_LVAL_P(op) = strtol(strval, NULL, base);
- STR_FREE(strval);
+ str_efree(strval);
}
break;
case IS_ARRAY:
@@ -451,7 +451,7 @@ ZEND_API void convert_to_double(zval *op) /* {{{ */
char *strval = Z_STRVAL_P(op);
Z_DVAL_P(op) = zend_strtod(strval, NULL);
- STR_FREE(strval);
+ str_efree(strval);
}
break;
case IS_ARRAY:
@@ -540,7 +540,7 @@ ZEND_API void convert_to_boolean(zval *op) /* {{{ */
} else {
Z_LVAL_P(op) = 1;
}
- STR_FREE(strval);
+ str_efree(strval);
}
break;
case IS_ARRAY:
@@ -857,6 +857,8 @@ ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ *
default:
if (!converted) {
+ ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_ADD);
+
zendi_convert_scalar_to_number(op1, op1_copy, result);
zendi_convert_scalar_to_number(op2, op2_copy, result);
converted = 1;
@@ -904,6 +906,8 @@ ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ *
default:
if (!converted) {
+ ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_SUB);
+
zendi_convert_scalar_to_number(op1, op1_copy, result);
zendi_convert_scalar_to_number(op2, op2_copy, result);
converted = 1;
@@ -945,6 +949,8 @@ ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ *
default:
if (!converted) {
+ ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_MUL);
+
zendi_convert_scalar_to_number(op1, op1_copy, result);
zendi_convert_scalar_to_number(op2, op2_copy, result);
converted = 1;
@@ -957,6 +963,90 @@ ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ *
}
/* }}} */
+ZEND_API int pow_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+{
+ zval op1_copy, op2_copy;
+ int converted = 0;
+
+ while (1) {
+ switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) {
+ case TYPE_PAIR(IS_LONG, IS_LONG):
+ if (Z_LVAL_P(op2) >= 0) {
+ long l1 = 1, l2 = Z_LVAL_P(op1), i = Z_LVAL_P(op2);
+
+ if (i == 0) {
+ ZVAL_LONG(result, 1L);
+ return SUCCESS;
+ } else if (l2 == 0) {
+ ZVAL_LONG(result, 0);
+ return SUCCESS;
+ }
+
+ while (i >= 1) {
+ long overflow;
+ double dval = 0.0;
+
+ if (i % 2) {
+ --i;
+ ZEND_SIGNED_MULTIPLY_LONG(l1, l2, l1, dval, overflow);
+ if (overflow) {
+ ZVAL_DOUBLE(result, dval * pow(l2, i));
+ return SUCCESS;
+ }
+ } else {
+ i /= 2;
+ ZEND_SIGNED_MULTIPLY_LONG(l2, l2, l2, dval, overflow);
+ if (overflow) {
+ ZVAL_DOUBLE(result, (double)l1 * pow(dval, i));
+ return SUCCESS;
+ }
+ }
+ }
+ /* i == 0 */
+ ZVAL_LONG(result, l1);
+ } else {
+ ZVAL_DOUBLE(result, pow((double)Z_LVAL_P(op1), (double)Z_LVAL_P(op2)));
+ }
+ return SUCCESS;
+
+ case TYPE_PAIR(IS_LONG, IS_DOUBLE):
+ ZVAL_DOUBLE(result, pow((double)Z_LVAL_P(op1), Z_DVAL_P(op2)));
+ return SUCCESS;
+
+ case TYPE_PAIR(IS_DOUBLE, IS_LONG):
+ ZVAL_DOUBLE(result, pow(Z_DVAL_P(op1), (double)Z_LVAL_P(op2)));
+ return SUCCESS;
+
+ case TYPE_PAIR(IS_DOUBLE, IS_DOUBLE):
+ ZVAL_DOUBLE(result, pow(Z_DVAL_P(op1), Z_DVAL_P(op2)));
+ return SUCCESS;
+
+ default:
+ if (!converted) {
+ ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_POW);
+
+ if (Z_TYPE_P(op1) == IS_ARRAY) {
+ ZVAL_LONG(result, 0);
+ return SUCCESS;
+ } else {
+ zendi_convert_scalar_to_number(op1, op1_copy, result);
+ }
+ if (Z_TYPE_P(op2) == IS_ARRAY) {
+ ZVAL_LONG(result, 1L);
+ return SUCCESS;
+ } else {
+ zendi_convert_scalar_to_number(op2, op2_copy, result);
+ }
+ converted = 1;
+ } else {
+ zend_error(E_ERROR, "Unsupported operand types");
+ return FAILURE;
+ }
+ }
+ }
+}
+/* }}} */
+
ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
{
zval op1_copy, op2_copy;
@@ -1010,6 +1100,8 @@ ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ *
default:
if (!converted) {
+ ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_DIV);
+
zendi_convert_scalar_to_number(op1, op1_copy, result);
zendi_convert_scalar_to_number(op2, op2_copy, result);
converted = 1;
@@ -1027,9 +1119,15 @@ ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ *
zval op1_copy, op2_copy;
long op1_lval;
- zendi_convert_to_long(op1, op1_copy, result);
- op1_lval = Z_LVAL_P(op1);
- zendi_convert_to_long(op2, op2_copy, result);
+ if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) {
+ ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_MOD);
+
+ zendi_convert_to_long(op1, op1_copy, result);
+ op1_lval = Z_LVAL_P(op1);
+ zendi_convert_to_long(op2, op2_copy, result);
+ } else {
+ op1_lval = Z_LVAL_P(op1);
+ }
if (Z_LVAL_P(op2) == 0) {
zend_error(E_WARNING, "Division by zero");
@@ -1053,9 +1151,16 @@ ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
zval op1_copy, op2_copy;
long op1_lval;
- zendi_convert_to_boolean(op1, op1_copy, result);
- op1_lval = Z_LVAL_P(op1);
- zendi_convert_to_boolean(op2, op2_copy, result);
+ if (Z_TYPE_P(op1) != IS_BOOL || Z_TYPE_P(op2) != IS_BOOL) {
+ ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_BOOL_XOR);
+
+ zendi_convert_to_boolean(op1, op1_copy, result);
+ op1_lval = Z_LVAL_P(op1);
+ zendi_convert_to_boolean(op2, op2_copy, result);
+ } else {
+ op1_lval = Z_LVAL_P(op1);
+ }
+
ZVAL_BOOL(result, op1_lval ^ Z_LVAL_P(op2));
return SUCCESS;
}
@@ -1065,7 +1170,12 @@ ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC) /* {{{ */
{
zval op1_copy;
- zendi_convert_to_boolean(op1, op1_copy, result);
+ if (Z_TYPE_P(op1) != IS_BOOL) {
+ ZEND_TRY_UNARY_OBJECT_OPERATION(ZEND_BOOL_NOT);
+
+ zendi_convert_to_boolean(op1, op1_copy, result);
+ }
+
ZVAL_BOOL(result, !Z_LVAL_P(op1));
return SUCCESS;
}
@@ -1073,29 +1183,32 @@ ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC) /* {{{ */
ZEND_API int bitwise_not_function(zval *result, zval *op1 TSRMLS_DC) /* {{{ */
{
- zval op1_copy = *op1;
- op1 = &op1_copy;
-
- if (Z_TYPE_P(op1) == IS_LONG) {
- ZVAL_LONG(result, ~Z_LVAL_P(op1));
- return SUCCESS;
- } else if (Z_TYPE_P(op1) == IS_DOUBLE) {
- ZVAL_LONG(result, ~zend_dval_to_lval(Z_DVAL_P(op1)));
- return SUCCESS;
- } else if (Z_TYPE_P(op1) == IS_STRING) {
- int i;
-
- Z_TYPE_P(result) = IS_STRING;
- Z_STRVAL_P(result) = estrndup(Z_STRVAL_P(op1), Z_STRLEN_P(op1));
- Z_STRLEN_P(result) = Z_STRLEN_P(op1);
- for (i = 0; i < Z_STRLEN_P(op1); i++) {
- Z_STRVAL_P(result)[i] = ~Z_STRVAL_P(op1)[i];
+ switch (Z_TYPE_P(op1)) {
+ case IS_LONG:
+ ZVAL_LONG(result, ~Z_LVAL_P(op1));
+ return SUCCESS;
+ case IS_DOUBLE:
+ ZVAL_LONG(result, ~zend_dval_to_lval(Z_DVAL_P(op1)));
+ return SUCCESS;
+ case IS_STRING: {
+ int i;
+ zval op1_copy = *op1;
+
+ Z_TYPE_P(result) = IS_STRING;
+ Z_STRVAL_P(result) = estrndup(Z_STRVAL(op1_copy), Z_STRLEN(op1_copy));
+ Z_STRLEN_P(result) = Z_STRLEN(op1_copy);
+ for (i = 0; i < Z_STRLEN(op1_copy); i++) {
+ Z_STRVAL_P(result)[i] = ~Z_STRVAL(op1_copy)[i];
+ }
+ return SUCCESS;
}
- return SUCCESS;
+ default:
+ ZEND_TRY_UNARY_OBJECT_OPERATION(ZEND_BW_NOT);
+
+ zend_error(E_ERROR, "Unsupported operand types");
+ return FAILURE;
}
- zend_error(E_ERROR, "Unsupported operand types");
- return FAILURE; /* unknown datatype */
}
/* }}} */
@@ -1124,15 +1237,22 @@ ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /
result_str[i] |= Z_STRVAL_P(shorter)[i];
}
if (result==op1) {
- STR_FREE(Z_STRVAL_P(result));
+ str_efree(Z_STRVAL_P(result));
}
Z_STRVAL_P(result) = result_str;
Z_STRLEN_P(result) = result_len;
return SUCCESS;
}
- zendi_convert_to_long(op1, op1_copy, result);
- op1_lval = Z_LVAL_P(op1);
- zendi_convert_to_long(op2, op2_copy, result);
+
+ if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) {
+ ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_BW_OR);
+
+ zendi_convert_to_long(op1, op1_copy, result);
+ op1_lval = Z_LVAL_P(op1);
+ zendi_convert_to_long(op2, op2_copy, result);
+ } else {
+ op1_lval = Z_LVAL_P(op1);
+ }
ZVAL_LONG(result, op1_lval | Z_LVAL_P(op2));
return SUCCESS;
@@ -1164,17 +1284,22 @@ ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
result_str[i] &= Z_STRVAL_P(longer)[i];
}
if (result==op1) {
- STR_FREE(Z_STRVAL_P(result));
+ str_efree(Z_STRVAL_P(result));
}
Z_STRVAL_P(result) = result_str;
Z_STRLEN_P(result) = result_len;
return SUCCESS;
}
+ if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) {
+ ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_BW_AND);
- zendi_convert_to_long(op1, op1_copy, result);
- op1_lval = Z_LVAL_P(op1);
- zendi_convert_to_long(op2, op2_copy, result);
+ zendi_convert_to_long(op1, op1_copy, result);
+ op1_lval = Z_LVAL_P(op1);
+ zendi_convert_to_long(op2, op2_copy, result);
+ } else {
+ op1_lval = Z_LVAL_P(op1);
+ }
ZVAL_LONG(result, op1_lval & Z_LVAL_P(op2));
return SUCCESS;
@@ -1206,16 +1331,22 @@ ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
result_str[i] ^= Z_STRVAL_P(longer)[i];
}
if (result==op1) {
- STR_FREE(Z_STRVAL_P(result));
+ str_efree(Z_STRVAL_P(result));
}
Z_STRVAL_P(result) = result_str;
Z_STRLEN_P(result) = result_len;
return SUCCESS;
}
- zendi_convert_to_long(op1, op1_copy, result);
- op1_lval = Z_LVAL_P(op1);
- zendi_convert_to_long(op2, op2_copy, result);
+ if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) {
+ ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_BW_XOR);
+
+ zendi_convert_to_long(op1, op1_copy, result);
+ op1_lval = Z_LVAL_P(op1);
+ zendi_convert_to_long(op2, op2_copy, result);
+ } else {
+ op1_lval = Z_LVAL_P(op1);
+ }
ZVAL_LONG(result, op1_lval ^ Z_LVAL_P(op2));
return SUCCESS;
@@ -1227,9 +1358,16 @@ ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /
zval op1_copy, op2_copy;
long op1_lval;
- zendi_convert_to_long(op1, op1_copy, result);
- op1_lval = Z_LVAL_P(op1);
- zendi_convert_to_long(op2, op2_copy, result);
+ if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) {
+ ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_SL);
+
+ zendi_convert_to_long(op1, op1_copy, result);
+ op1_lval = Z_LVAL_P(op1);
+ zendi_convert_to_long(op2, op2_copy, result);
+ } else {
+ op1_lval = Z_LVAL_P(op1);
+ }
+
ZVAL_LONG(result, op1_lval << Z_LVAL_P(op2));
return SUCCESS;
}
@@ -1240,9 +1378,16 @@ ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
zval op1_copy, op2_copy;
long op1_lval;
- zendi_convert_to_long(op1, op1_copy, result);
- op1_lval = Z_LVAL_P(op1);
- zendi_convert_to_long(op2, op2_copy, result);
+ if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) {
+ ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_SR);
+
+ zendi_convert_to_long(op1, op1_copy, result);
+ op1_lval = Z_LVAL_P(op1);
+ zendi_convert_to_long(op2, op2_copy, result);
+ } else {
+ op1_lval = Z_LVAL_P(op1);
+ }
+
ZVAL_LONG(result, op1_lval >> Z_LVAL_P(op2));
return SUCCESS;
}
@@ -1252,14 +1397,8 @@ ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
ZEND_API int add_char_to_string(zval *result, const zval *op1, const zval *op2) /* {{{ */
{
int length = Z_STRLEN_P(op1) + 1;
- char *buf;
+ char *buf = str_erealloc(Z_STRVAL_P(op1), length + 1);
- if (IS_INTERNED(Z_STRVAL_P(op1))) {
- buf = (char *) emalloc(length + 1);
- memcpy(buf, Z_STRVAL_P(op1), Z_STRLEN_P(op1));
- } else {
- buf = (char *) erealloc(Z_STRVAL_P(op1), length + 1);
- }
buf[length - 1] = (char) Z_LVAL_P(op2);
buf[length] = 0;
ZVAL_STRINGL(result, buf, length, 0);
@@ -1271,14 +1410,8 @@ ZEND_API int add_char_to_string(zval *result, const zval *op1, const zval *op2)
ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2) /* {{{ */
{
int length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2);
- char *buf;
+ char *buf = str_erealloc(Z_STRVAL_P(op1), length + 1);
- if (IS_INTERNED(Z_STRVAL_P(op1))) {
- buf = (char *) emalloc(length+1);
- memcpy(buf, Z_STRVAL_P(op1), Z_STRLEN_P(op1));
- } else {
- buf = (char *) erealloc(Z_STRVAL_P(op1), length+1);
- }
memcpy(buf + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2));
buf[length] = 0;
ZVAL_STRINGL(result, buf, length, 0);
@@ -1291,11 +1424,15 @@ ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{
zval op1_copy, op2_copy;
int use_copy1 = 0, use_copy2 = 0;
- if (Z_TYPE_P(op1) != IS_STRING) {
- zend_make_printable_zval(op1, &op1_copy, &use_copy1);
- }
- if (Z_TYPE_P(op2) != IS_STRING) {
- zend_make_printable_zval(op2, &op2_copy, &use_copy2);
+ if (Z_TYPE_P(op1) != IS_STRING || Z_TYPE_P(op2) != IS_STRING) {
+ ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_CONCAT);
+
+ if (Z_TYPE_P(op1) != IS_STRING) {
+ zend_make_printable_zval(op1, &op1_copy, &use_copy1);
+ }
+ if (Z_TYPE_P(op2) != IS_STRING) {
+ zend_make_printable_zval(op2, &op2_copy, &use_copy2);
+ }
}
if (use_copy1) {
@@ -1531,20 +1668,24 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {
ZVAL_LONG(result, -1);
return SUCCESS;
- case TYPE_PAIR(IS_OBJECT, IS_OBJECT):
- /* If both are objects sharing the same comparision handler then use is */
- if (Z_OBJ_HANDLER_P(op1,compare_objects) == Z_OBJ_HANDLER_P(op2,compare_objects)) {
+ default:
+ if (Z_TYPE_P(op1) == IS_OBJECT && Z_OBJ_HANDLER_P(op1, compare)) {
+ return Z_OBJ_HANDLER_P(op1, compare)(result, op1, op2 TSRMLS_CC);
+ } else if (Z_TYPE_P(op2) == IS_OBJECT && Z_OBJ_HANDLER_P(op2, compare)) {
+ return Z_OBJ_HANDLER_P(op2, compare)(result, op1, op2 TSRMLS_CC);
+ }
+
+ if (Z_TYPE_P(op1) == IS_OBJECT && Z_TYPE_P(op2) == IS_OBJECT) {
if (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)) {
/* object handles are identical, apparently this is the same object */
ZVAL_LONG(result, 0);
return SUCCESS;
}
- ZVAL_LONG(result, Z_OBJ_HT_P(op1)->compare_objects(op1, op2 TSRMLS_CC));
- return SUCCESS;
+ if (Z_OBJ_HANDLER_P(op1, compare_objects) == Z_OBJ_HANDLER_P(op2, compare_objects)) {
+ ZVAL_LONG(result, Z_OBJ_HANDLER_P(op1, compare_objects)(op1, op2 TSRMLS_CC));
+ return SUCCESS;
+ }
}
- /* break missing intentionally */
-
- default:
if (Z_TYPE_P(op1) == IS_OBJECT) {
if (Z_OBJ_HT_P(op1)->get) {
op_free = Z_OBJ_HT_P(op1)->get(op1 TSRMLS_CC);
@@ -1778,16 +1919,14 @@ static void increment_string(zval *str) /* {{{ */
int ch;
if (Z_STRLEN_P(str) == 0) {
- STR_FREE(Z_STRVAL_P(str));
+ str_efree(Z_STRVAL_P(str));
Z_STRVAL_P(str) = estrndup("1", sizeof("1")-1);
Z_STRLEN_P(str) = 1;
return;
}
if (IS_INTERNED(s)) {
- s = (char*) emalloc(Z_STRLEN_P(str) + 1);
- memcpy(s, Z_STRVAL_P(str), Z_STRLEN_P(str) + 1);
- Z_STRVAL_P(str) = s;
+ Z_STRVAL_P(str) = s = estrndup(s, Z_STRLEN_P(str));
}
while (pos >= 0) {
@@ -1845,7 +1984,7 @@ static void increment_string(zval *str) /* {{{ */
t[0] = 'a';
break;
}
- STR_FREE(Z_STRVAL_P(str));
+ str_efree(Z_STRVAL_P(str));
Z_STRVAL_P(str) = t;
}
}
@@ -1895,6 +2034,20 @@ ZEND_API int increment_function(zval *op1) /* {{{ */
}
}
break;
+ case IS_OBJECT:
+ if (Z_OBJ_HANDLER_P(op1, do_operation)) {
+ zval *op2;
+ int res;
+ TSRMLS_FETCH();
+
+ MAKE_STD_ZVAL(op2);
+ ZVAL_LONG(op2, 1);
+ res = Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_ADD, op1, op1, op2 TSRMLS_CC);
+ zval_ptr_dtor(&op2);
+
+ return res;
+ }
+ return FAILURE;
default:
return FAILURE;
}
@@ -1921,13 +2074,13 @@ ZEND_API int decrement_function(zval *op1) /* {{{ */
break;
case IS_STRING: /* Like perl we only support string increment */
if (Z_STRLEN_P(op1) == 0) { /* consider as 0 */
- STR_FREE(Z_STRVAL_P(op1));
+ str_efree(Z_STRVAL_P(op1));
ZVAL_LONG(op1, -1);
break;
}
switch (is_numeric_string(Z_STRVAL_P(op1), Z_STRLEN_P(op1), &lval, &dval, 0)) {
case IS_LONG:
- STR_FREE(Z_STRVAL_P(op1));
+ str_efree(Z_STRVAL_P(op1));
if (lval == LONG_MIN) {
double d = (double)lval;
ZVAL_DOUBLE(op1, d-1);
@@ -1936,11 +2089,25 @@ ZEND_API int decrement_function(zval *op1) /* {{{ */
}
break;
case IS_DOUBLE:
- STR_FREE(Z_STRVAL_P(op1));
+ str_efree(Z_STRVAL_P(op1));
ZVAL_DOUBLE(op1, dval - 1);
break;
}
break;
+ case IS_OBJECT:
+ if (Z_OBJ_HANDLER_P(op1, do_operation)) {
+ zval *op2;
+ int res;
+ TSRMLS_FETCH();
+
+ MAKE_STD_ZVAL(op2);
+ ZVAL_LONG(op2, 1);
+ res = Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_SUB, op1, op1, op2 TSRMLS_CC);
+ zval_ptr_dtor(&op2);
+
+ return res;
+ }
+ return FAILURE;
default:
return FAILURE;
}
diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h
index b4c1d8473f..8307d1ef4b 100644
--- a/Zend/zend_operators.h
+++ b/Zend/zend_operators.h
@@ -47,6 +47,7 @@ BEGIN_EXTERN_C()
ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_API int pow_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
@@ -269,11 +270,11 @@ static inline zend_uchar is_numeric_string(const char *str, int length, long *lv
return is_numeric_string_ex(str, length, lval, dval, allow_errors, NULL);
}
-static inline char *
-zend_memnstr(char *haystack, char *needle, int needle_len, char *end)
+static inline const char *
+zend_memnstr(const char *haystack, const char *needle, int needle_len, char *end)
{
- char *p = haystack;
- char ne = needle[needle_len-1];
+ const char *p = haystack;
+ const char ne = needle[needle_len-1];
if (needle_len == 1) {
return (char *)memchr(p, *needle, (end-p));
@@ -443,6 +444,7 @@ END_EXTERN_C()
#define Z_STRVAL(zval) (zval).value.str.val
#define Z_STRLEN(zval) (zval).value.str.len
#define Z_ARRVAL(zval) (zval).value.ht
+#define Z_AST(zval) (zval).value.ast
#define Z_OBJVAL(zval) (zval).value.obj
#define Z_OBJ_HANDLE(zval) Z_OBJVAL(zval).handle
#define Z_OBJ_HT(zval) Z_OBJVAL(zval).handlers
@@ -458,6 +460,7 @@ END_EXTERN_C()
#define Z_STRVAL_P(zval_p) Z_STRVAL(*zval_p)
#define Z_STRLEN_P(zval_p) Z_STRLEN(*zval_p)
#define Z_ARRVAL_P(zval_p) Z_ARRVAL(*zval_p)
+#define Z_AST_P(zval_p) Z_AST(*zval_p)
#define Z_OBJPROP_P(zval_p) Z_OBJPROP(*zval_p)
#define Z_OBJCE_P(zval_p) Z_OBJCE(*zval_p)
#define Z_RESVAL_P(zval_p) Z_RESVAL(*zval_p)
@@ -473,6 +476,7 @@ END_EXTERN_C()
#define Z_STRVAL_PP(zval_pp) Z_STRVAL(**zval_pp)
#define Z_STRLEN_PP(zval_pp) Z_STRLEN(**zval_pp)
#define Z_ARRVAL_PP(zval_pp) Z_ARRVAL(**zval_pp)
+#define Z_AST_PP(zval_p) Z_AST(**zval_p)
#define Z_OBJPROP_PP(zval_pp) Z_OBJPROP(**zval_pp)
#define Z_OBJCE_PP(zval_pp) Z_OBJCE(**zval_pp)
#define Z_RESVAL_PP(zval_pp) Z_RESVAL(**zval_pp)
@@ -952,6 +956,24 @@ static zend_always_inline int fast_is_smaller_or_equal_function(zval *result, zv
return Z_LVAL_P(result) <= 0;
}
+#define ZEND_TRY_BINARY_OBJECT_OPERATION(opcode) \
+ if (Z_TYPE_P(op1) == IS_OBJECT && Z_OBJ_HANDLER_P(op1, do_operation)) { \
+ if (SUCCESS == Z_OBJ_HANDLER_P(op1, do_operation)(opcode, result, op1, op2 TSRMLS_CC)) { \
+ return SUCCESS; \
+ } \
+ } else if (Z_TYPE_P(op2) == IS_OBJECT && Z_OBJ_HANDLER_P(op2, do_operation)) { \
+ if (SUCCESS == Z_OBJ_HANDLER_P(op2, do_operation)(opcode, result, op1, op2 TSRMLS_CC)) { \
+ return SUCCESS; \
+ } \
+ }
+
+#define ZEND_TRY_UNARY_OBJECT_OPERATION(opcode) \
+ if (Z_TYPE_P(op1) == IS_OBJECT && Z_OBJ_HANDLER_P(op1, do_operation) \
+ && SUCCESS == Z_OBJ_HANDLER_P(op1, do_operation)(opcode, result, op1, NULL TSRMLS_CC) \
+ ) { \
+ return SUCCESS; \
+ }
+
#endif
/*
diff --git a/Zend/zend_signal.c b/Zend/zend_signal.c
index 3e0ce64213..6105fb1119 100644
--- a/Zend/zend_signal.c
+++ b/Zend/zend_signal.c
@@ -78,8 +78,8 @@ void zend_signal_handler_defer(int signo, siginfo_t *siginfo, void *context)
if (SIGG(active)) {
if (SIGG(depth) == 0) { /* try to handle signal */
- if (SIGG(blocked) != 0) { /* inverse */
- SIGG(blocked) = 0; /* signal is not blocked */
+ if (SIGG(blocked) != -1) { /* inverse */
+ SIGG(blocked) = -1; /* signal is not blocked */
}
if (SIGG(running) == 0) {
SIGG(running) = 1;
@@ -99,7 +99,7 @@ void zend_signal_handler_defer(int signo, siginfo_t *siginfo, void *context)
SIGG(running) = 0;
}
} else { /* delay signal handling */
- SIGG(blocked) = 1; /* signal is blocked */
+ SIGG(blocked) = 0; /* signal is blocked */
if ((queue = SIGG(pavail))) { /* if none available it's simply forgotton */
SIGG(pavail) = queue->next;
@@ -314,7 +314,7 @@ void zend_signal_deactivate(TSRMLS_D)
SIGNAL_BEGIN_CRITICAL();
SIGG(active) = 0;
SIGG(running) = 0;
- SIGG(blocked) = 0;
+ SIGG(blocked) = -1;
SIGG(depth) = 0;
SIGNAL_END_CRITICAL();
}
diff --git a/Zend/zend_string.c b/Zend/zend_string.c
index 6dba3d5b61..e8b3252a93 100644
--- a/Zend/zend_string.c
+++ b/Zend/zend_string.c
@@ -61,6 +61,8 @@ void zend_interned_strings_init(TSRMLS_D)
mprotect(CG(interned_strings_start), CG(interned_strings_end) - CG(interned_strings_start), PROT_READ);
#endif
+ /* interned empty string */
+ CG(interned_empty_string) = zend_new_interned_string_int("", sizeof(""), 0 TSRMLS_CC);
#endif
zend_new_interned_string = zend_new_interned_string_int;
diff --git a/Zend/zend_string.h b/Zend/zend_string.h
index 6b441002ee..84dc135f41 100644
--- a/Zend/zend_string.h
+++ b/Zend/zend_string.h
@@ -56,12 +56,39 @@ END_EXTERN_C()
} \
} while (0)
+#define str_efree_rel(s) do { \
+ if (!IS_INTERNED(s)) { \
+ efree_rel((char *)s); \
+ } \
+ } while (0)
+
#define str_free(s) do { \
if (!IS_INTERNED(s)) { \
free((char*)s); \
} \
} while (0)
+#define str_erealloc(str, new_len) \
+ (IS_INTERNED(str) \
+ ? _str_erealloc(str, new_len, INTERNED_LEN(str)) \
+ : erealloc(str, new_len))
+
+static inline char *_str_erealloc(char *str, size_t new_len, size_t old_len) {
+ char *buf = (char *) emalloc(new_len);
+ memcpy(buf, str, old_len);
+ return buf;
+}
+
+#define str_estrndup(str, len) \
+ (IS_INTERNED(str) ? (str) : estrndup((str), (len)))
+
+#define str_strndup(str, len) \
+ (IS_INTERNED(str) ? (str) : zend_strndup((str), (len)));
+
+#define str_hash(str, len) \
+ (IS_INTERNED(str) ? INTERNED_HASH(str) : zend_hash_func((str), (len)+1))
+
+
#endif /* ZEND_STRING_H */
/*
diff --git a/Zend/zend_ts_hash.c b/Zend/zend_ts_hash.c
index c528441e93..6d4bc1bd9c 100644
--- a/Zend/zend_ts_hash.c
+++ b/Zend/zend_ts_hash.c
@@ -59,24 +59,24 @@ static void end_write(TsHashTable *ht)
}
/* delegates */
-ZEND_API int _zend_ts_hash_init(TsHashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC)
+ZEND_API int _zend_ts_hash_init(TsHashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC)
{
#ifdef ZTS
ht->mx_reader = tsrm_mutex_alloc();
ht->mx_writer = tsrm_mutex_alloc();
ht->reader = 0;
#endif
- return _zend_hash_init(TS_HASH(ht), nSize, pHashFunction, pDestructor, persistent ZEND_FILE_LINE_RELAY_CC);
+ return _zend_hash_init(TS_HASH(ht), nSize, pDestructor, persistent ZEND_FILE_LINE_RELAY_CC);
}
-ZEND_API int _zend_ts_hash_init_ex(TsHashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC)
+ZEND_API int _zend_ts_hash_init_ex(TsHashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC)
{
#ifdef ZTS
ht->mx_reader = tsrm_mutex_alloc();
ht->mx_writer = tsrm_mutex_alloc();
ht->reader = 0;
#endif
- return _zend_hash_init_ex(TS_HASH(ht), nSize, pHashFunction, pDestructor, persistent, bApplyProtection ZEND_FILE_LINE_RELAY_CC);
+ return _zend_hash_init_ex(TS_HASH(ht), nSize, pDestructor, persistent, bApplyProtection ZEND_FILE_LINE_RELAY_CC);
}
ZEND_API void zend_ts_hash_destroy(TsHashTable *ht)
diff --git a/Zend/zend_ts_hash.h b/Zend/zend_ts_hash.h
index 148f3c213e..7e067fc8f9 100644
--- a/Zend/zend_ts_hash.h
+++ b/Zend/zend_ts_hash.h
@@ -37,15 +37,15 @@ BEGIN_EXTERN_C()
#define TS_HASH(table) (&(table->hash))
/* startup/shutdown */
-ZEND_API int _zend_ts_hash_init(TsHashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC);
-ZEND_API int _zend_ts_hash_init_ex(TsHashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC);
+ZEND_API int _zend_ts_hash_init(TsHashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC);
+ZEND_API int _zend_ts_hash_init_ex(TsHashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC);
ZEND_API void zend_ts_hash_destroy(TsHashTable *ht);
ZEND_API void zend_ts_hash_clean(TsHashTable *ht);
#define zend_ts_hash_init(ht, nSize, pHashFunction, pDestructor, persistent) \
- _zend_ts_hash_init(ht, nSize, pHashFunction, pDestructor, persistent ZEND_FILE_LINE_CC)
+ _zend_ts_hash_init(ht, nSize, pDestructor, persistent ZEND_FILE_LINE_CC)
#define zend_ts_hash_init_ex(ht, nSize, pHashFunction, pDestructor, persistent, bApplyProtection) \
- _zend_ts_hash_init_ex(ht, nSize, pHashFunction, pDestructor, persistent, bApplyProtection ZEND_FILE_LINE_CC)
+ _zend_ts_hash_init_ex(ht, nSize, pDestructor, persistent, bApplyProtection ZEND_FILE_LINE_CC)
/* additions/updates/changes */
diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c
index fe51781740..c2772ff13b 100644
--- a/Zend/zend_variables.c
+++ b/Zend/zend_variables.c
@@ -22,6 +22,7 @@
#include <stdio.h>
#include "zend.h"
#include "zend_API.h"
+#include "zend_ast.h"
#include "zend_globals.h"
#include "zend_constants.h"
#include "zend_list.h"
@@ -33,10 +34,9 @@ ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC)
case IS_STRING:
case IS_CONSTANT:
CHECK_ZVAL_STRING_REL(zvalue);
- STR_FREE_REL(zvalue->value.str.val);
+ str_efree_rel(zvalue->value.str.val);
break;
- case IS_ARRAY:
- case IS_CONSTANT_ARRAY: {
+ case IS_ARRAY: {
TSRMLS_FETCH();
if (zvalue->value.ht && (zvalue->value.ht != &EG(symbol_table))) {
@@ -47,6 +47,9 @@ ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC)
}
}
break;
+ case IS_CONSTANT_AST:
+ zend_ast_destroy(Z_AST_P(zvalue));
+ break;
case IS_OBJECT:
{
TSRMLS_FETCH();
@@ -82,7 +85,7 @@ ZEND_API void _zval_internal_dtor(zval *zvalue ZEND_FILE_LINE_DC)
str_free(zvalue->value.str.val);
break;
case IS_ARRAY:
- case IS_CONSTANT_ARRAY:
+ case IS_CONSTANT_AST:
case IS_OBJECT:
case IS_RESOURCE:
zend_error(E_CORE_ERROR, "Internal zval's can't be arrays, objects or resources");
@@ -123,8 +126,7 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
zvalue->value.str.val = (char *) estrndup_rel(zvalue->value.str.val, zvalue->value.str.len);
}
break;
- case IS_ARRAY:
- case IS_CONSTANT_ARRAY: {
+ case IS_ARRAY: {
zval *tmp;
HashTable *original_ht = zvalue->value.ht;
HashTable *tmp_ht = NULL;
@@ -140,6 +142,9 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
tmp_ht->nNextFreeElement = original_ht->nNextFreeElement;
}
break;
+ case IS_CONSTANT_AST:
+ Z_AST_P(zvalue) = zend_ast_copy(Z_AST_P(zvalue));
+ break;
case IS_OBJECT:
{
TSRMLS_FETCH();
diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c
new file mode 100644
index 0000000000..c38c3bea84
--- /dev/null
+++ b/Zend/zend_virtual_cwd.c
@@ -0,0 +1,2005 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2015 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Andi Gutmans <andi@zend.com> |
+ | Sascha Schumann <sascha@schumann.cx> |
+ | Pierre Joye <pierre@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id$ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <string.h>
+#include <stdio.h>
+#include <limits.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <time.h>
+
+#include "zend.h"
+#include "zend_virtual_cwd.h"
+#include "tsrm_strtok_r.h"
+
+#ifdef TSRM_WIN32
+#include <io.h>
+#include "tsrm_win32.h"
+# ifndef IO_REPARSE_TAG_SYMLINK
+# define IO_REPARSE_TAG_SYMLINK 0xA000000C
+# endif
+
+# ifndef IO_REPARSE_TAG_DEDUP
+# define IO_REPARSE_TAG_DEDUP 0x80000013
+# endif
+
+# ifndef VOLUME_NAME_NT
+# define VOLUME_NAME_NT 0x2
+# endif
+
+# ifndef VOLUME_NAME_DOS
+# define VOLUME_NAME_DOS 0x0
+# endif
+#endif
+
+#ifndef S_IFLNK
+# define S_IFLNK 0120000
+#endif
+
+#ifdef NETWARE
+#include <fsio.h>
+#endif
+
+#ifndef HAVE_REALPATH
+#define realpath(x,y) strcpy(y,x)
+#endif
+
+#define VIRTUAL_CWD_DEBUG 0
+
+#include "TSRM.h"
+
+/* Only need mutex for popen() in Windows and NetWare because it doesn't chdir() on UNIX */
+#if (defined(TSRM_WIN32) || defined(NETWARE)) && defined(ZTS)
+MUTEX_T cwd_mutex;
+#endif
+
+#ifdef ZTS
+ts_rsrc_id cwd_globals_id;
+#else
+virtual_cwd_globals cwd_globals;
+#endif
+
+cwd_state main_cwd_state; /* True global */
+
+#ifndef TSRM_WIN32
+#include <unistd.h>
+#else
+#include <direct.h>
+#endif
+
+#ifndef S_ISDIR
+#define S_ISDIR(mode) ((mode) & _S_IFDIR)
+#endif
+
+#ifndef S_ISREG
+#define S_ISREG(mode) ((mode) & _S_IFREG)
+#endif
+
+#ifdef TSRM_WIN32
+#include <tchar.h>
+#define tsrm_strtok_r(a,b,c) _tcstok((a),(b))
+#define TOKENIZER_STRING "/\\"
+
+static int php_check_dots(const char *element, int n)
+{
+ while (n-- > 0) if (element[n] != '.') break;
+
+ return (n != -1);
+}
+
+#define IS_DIRECTORY_UP(element, len) \
+ (len >= 2 && !php_check_dots(element, len))
+
+#define IS_DIRECTORY_CURRENT(element, len) \
+ (len == 1 && element[0] == '.')
+
+#elif defined(NETWARE)
+/* NetWare has strtok() (in LibC) and allows both slashes in paths, like Windows --
+ but rest of the stuff is like Unix */
+/* strtok() call in LibC is abending when used in a different address space -- hence using
+ PHP's version itself for now */
+/*#define tsrm_strtok_r(a,b,c) strtok((a),(b))*/
+#define TOKENIZER_STRING "/\\"
+
+#else
+#define TOKENIZER_STRING "/"
+#endif
+
+/* default macros */
+
+#ifndef IS_DIRECTORY_UP
+#define IS_DIRECTORY_UP(element, len) \
+ (len == 2 && element[0] == '.' && element[1] == '.')
+#endif
+
+#ifndef IS_DIRECTORY_CURRENT
+#define IS_DIRECTORY_CURRENT(element, len) \
+ (len == 1 && element[0] == '.')
+#endif
+
+/* define this to check semantics */
+#define IS_DIR_OK(s) (1)
+
+#ifndef IS_DIR_OK
+#define IS_DIR_OK(state) (php_is_dir_ok(state) == 0)
+#endif
+
+
+#define CWD_STATE_COPY(d, s) \
+ (d)->cwd_length = (s)->cwd_length; \
+ (d)->cwd = (char *) emalloc((s)->cwd_length+1); \
+ memcpy((d)->cwd, (s)->cwd, (s)->cwd_length+1);
+
+#define CWD_STATE_FREE(s) \
+ efree((s)->cwd);
+
+#ifdef TSRM_WIN32
+# define CWD_STATE_FREE_ERR(state) do { \
+ DWORD last_error = GetLastError(); \
+ CWD_STATE_FREE(state); \
+ SetLastError(last_error); \
+ } while (0)
+#else
+# define CWD_STATE_FREE_ERR(state) CWD_STATE_FREE(state)
+#endif
+
+#ifdef TSRM_WIN32
+
+#ifdef CTL_CODE
+#undef CTL_CODE
+#endif
+#define CTL_CODE(DeviceType,Function,Method,Access) (((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method))
+#define FILE_DEVICE_FILE_SYSTEM 0x00000009
+#define METHOD_BUFFERED 0
+#define FILE_ANY_ACCESS 0
+#define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define MAXIMUM_REPARSE_DATA_BUFFER_SIZE ( 16 * 1024 )
+
+typedef struct {
+ unsigned long ReparseTag;
+ unsigned short ReparseDataLength;
+ unsigned short Reserved;
+ union {
+ struct {
+ unsigned short SubstituteNameOffset;
+ unsigned short SubstituteNameLength;
+ unsigned short PrintNameOffset;
+ unsigned short PrintNameLength;
+ unsigned long Flags;
+ wchar_t ReparseTarget[1];
+ } SymbolicLinkReparseBuffer;
+ struct {
+ unsigned short SubstituteNameOffset;
+ unsigned short SubstituteNameLength;
+ unsigned short PrintNameOffset;
+ unsigned short PrintNameLength;
+ wchar_t ReparseTarget[1];
+ } MountPointReparseBuffer;
+ struct {
+ unsigned char ReparseTarget[1];
+ } GenericReparseBuffer;
+ };
+} REPARSE_DATA_BUFFER;
+
+#define SECS_BETWEEN_EPOCHS (__int64)11644473600
+#define SECS_TO_100NS (__int64)10000000
+static inline time_t FileTimeToUnixTime(const FILETIME FileTime)
+{
+ __int64 UnixTime;
+ long *nsec = NULL;
+ SYSTEMTIME SystemTime;
+ FileTimeToSystemTime(&FileTime, &SystemTime);
+
+ UnixTime = ((__int64)FileTime.dwHighDateTime << 32) +
+ FileTime.dwLowDateTime;
+
+ UnixTime -= (SECS_BETWEEN_EPOCHS * SECS_TO_100NS);
+
+ if (nsec) {
+ *nsec = (UnixTime % SECS_TO_100NS) * (__int64)100;
+ }
+
+ UnixTime /= SECS_TO_100NS; /* now convert to seconds */
+
+ if ((time_t)UnixTime != UnixTime) {
+ UnixTime = 0;
+ }
+ return (time_t)UnixTime;
+}
+
+CWD_API int php_sys_readlink(const char *link, char *target, size_t target_len){ /* {{{ */
+ HINSTANCE kernel32;
+ HANDLE hFile;
+ DWORD dwRet;
+
+ typedef BOOL (WINAPI *gfpnh_func)(HANDLE, LPTSTR, DWORD, DWORD);
+ gfpnh_func pGetFinalPathNameByHandle;
+
+ kernel32 = LoadLibrary("kernel32.dll");
+
+ if (kernel32) {
+ pGetFinalPathNameByHandle = (gfpnh_func)GetProcAddress(kernel32, "GetFinalPathNameByHandleA");
+ if (pGetFinalPathNameByHandle == NULL) {
+ return -1;
+ }
+ } else {
+ return -1;
+ }
+
+ hFile = CreateFile(link, // file to open
+ GENERIC_READ, // open for reading
+ FILE_SHARE_READ, // share for reading
+ NULL, // default security
+ OPEN_EXISTING, // existing file only
+ FILE_FLAG_BACKUP_SEMANTICS, // normal file
+ NULL); // no attr. template
+
+ if( hFile == INVALID_HANDLE_VALUE) {
+ return -1;
+ }
+
+ dwRet = pGetFinalPathNameByHandle(hFile, target, MAXPATHLEN, VOLUME_NAME_DOS);
+ if(dwRet >= MAXPATHLEN || dwRet == 0) {
+ return -1;
+ }
+
+ CloseHandle(hFile);
+
+ if(dwRet > 4) {
+ /* Skip first 4 characters if they are "\??\" */
+ if(target[0] == '\\' && target[1] == '\\' && target[2] == '?' && target[3] == '\\') {
+ char tmp[MAXPATHLEN];
+ unsigned int offset = 4;
+ dwRet -= 4;
+
+ /* \??\UNC\ */
+ if (dwRet > 7 && target[4] == 'U' && target[5] == 'N' && target[6] == 'C') {
+ offset += 2;
+ dwRet -= 2;
+ target[offset] = '\\';
+ }
+
+ memcpy(tmp, target + offset, dwRet);
+ memcpy(target, tmp, dwRet);
+ }
+ }
+
+ target[dwRet] = '\0';
+ return dwRet;
+}
+/* }}} */
+
+CWD_API int php_sys_stat_ex(const char *path, struct stat *buf, int lstat) /* {{{ */
+{
+ WIN32_FILE_ATTRIBUTE_DATA data;
+ __int64 t;
+ const size_t path_len = strlen(path);
+ ALLOCA_FLAG(use_heap_large);
+
+ if (!GetFileAttributesEx(path, GetFileExInfoStandard, &data)) {
+ return stat(path, buf);
+ }
+
+ if (path_len >= 1 && path[1] == ':') {
+ if (path[0] >= 'A' && path[0] <= 'Z') {
+ buf->st_dev = buf->st_rdev = path[0] - 'A';
+ } else {
+ buf->st_dev = buf->st_rdev = path[0] - 'a';
+ }
+ } else if (IS_UNC_PATH(path, path_len)) {
+ buf->st_dev = buf->st_rdev = 0;
+ } else {
+ char cur_path[MAXPATHLEN+1];
+ DWORD len = sizeof(cur_path);
+ char *tmp = cur_path;
+
+ while(1) {
+ DWORD r = GetCurrentDirectory(len, tmp);
+ if (r < len) {
+ if (tmp[1] == ':') {
+ if (path[0] >= 'A' && path[0] <= 'Z') {
+ buf->st_dev = buf->st_rdev = path[0] - 'A';
+ } else {
+ buf->st_dev = buf->st_rdev = path[0] - 'a';
+ }
+ } else {
+ buf->st_dev = buf->st_rdev = -1;
+ }
+ break;
+ } else if (!r) {
+ buf->st_dev = buf->st_rdev = -1;
+ break;
+ } else {
+ len = r+1;
+ tmp = (char*)malloc(len);
+ }
+ }
+ if (tmp != cur_path) {
+ free(tmp);
+ }
+ }
+
+ buf->st_uid = buf->st_gid = buf->st_ino = 0;
+
+ if (lstat && data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
+ /* File is a reparse point. Get the target */
+ HANDLE hLink = NULL;
+ REPARSE_DATA_BUFFER * pbuffer;
+ unsigned int retlength = 0;
+
+ hLink = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ if(hLink == INVALID_HANDLE_VALUE) {
+ return -1;
+ }
+
+ pbuffer = (REPARSE_DATA_BUFFER *)do_alloca(MAXIMUM_REPARSE_DATA_BUFFER_SIZE, use_heap_large);
+ if(!DeviceIoControl(hLink, FSCTL_GET_REPARSE_POINT, NULL, 0, pbuffer, MAXIMUM_REPARSE_DATA_BUFFER_SIZE, &retlength, NULL)) {
+ free_alloca(pbuffer, use_heap_large);
+ CloseHandle(hLink);
+ return -1;
+ }
+
+ CloseHandle(hLink);
+
+ if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
+ buf->st_mode = S_IFLNK;
+ buf->st_mode |= (data.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)) : (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)|S_IWRITE|(S_IWRITE>>3)|(S_IWRITE>>6));
+ }
+
+#if 0 /* Not used yet */
+ else if(pbuffer->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) {
+ buf->st_mode |=;
+ }
+#endif
+ free_alloca(pbuffer, use_heap_large);
+ } else {
+ buf->st_mode = (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? (S_IFDIR|S_IEXEC|(S_IEXEC>>3)|(S_IEXEC>>6)) : S_IFREG;
+ buf->st_mode |= (data.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)) : (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)|S_IWRITE|(S_IWRITE>>3)|(S_IWRITE>>6));
+ }
+
+ if ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
+ int len = strlen(path);
+
+ if (path[len-4] == '.') {
+ if (_memicmp(path+len-3, "exe", 3) == 0 ||
+ _memicmp(path+len-3, "com", 3) == 0 ||
+ _memicmp(path+len-3, "bat", 3) == 0 ||
+ _memicmp(path+len-3, "cmd", 3) == 0) {
+ buf->st_mode |= (S_IEXEC|(S_IEXEC>>3)|(S_IEXEC>>6));
+ }
+ }
+ }
+
+ buf->st_nlink = 1;
+ t = data.nFileSizeHigh;
+ t = t << 32;
+ t |= data.nFileSizeLow;
+ buf->st_size = t;
+ buf->st_atime = FileTimeToUnixTime(data.ftLastAccessTime);
+ buf->st_ctime = FileTimeToUnixTime(data.ftCreationTime);
+ buf->st_mtime = FileTimeToUnixTime(data.ftLastWriteTime);
+ return 0;
+}
+/* }}} */
+#endif
+
+static int php_is_dir_ok(const cwd_state *state) /* {{{ */
+{
+ struct stat buf;
+
+ if (php_sys_stat(state->cwd, &buf) == 0 && S_ISDIR(buf.st_mode))
+ return (0);
+
+ return (1);
+}
+/* }}} */
+
+static int php_is_file_ok(const cwd_state *state) /* {{{ */
+{
+ struct stat buf;
+
+ if (php_sys_stat(state->cwd, &buf) == 0 && S_ISREG(buf.st_mode))
+ return (0);
+
+ return (1);
+}
+/* }}} */
+
+static void cwd_globals_ctor(virtual_cwd_globals *cwd_g TSRMLS_DC) /* {{{ */
+{
+ CWD_STATE_COPY(&cwd_g->cwd, &main_cwd_state);
+ cwd_g->realpath_cache_size = 0;
+ cwd_g->realpath_cache_size_limit = REALPATH_CACHE_SIZE;
+ cwd_g->realpath_cache_ttl = REALPATH_CACHE_TTL;
+ memset(cwd_g->realpath_cache, 0, sizeof(cwd_g->realpath_cache));
+}
+/* }}} */
+
+static void cwd_globals_dtor(virtual_cwd_globals *cwd_g TSRMLS_DC) /* {{{ */
+{
+ realpath_cache_clean(TSRMLS_C);
+}
+/* }}} */
+
+CWD_API void virtual_cwd_startup(void) /* {{{ */
+{
+ char cwd[MAXPATHLEN];
+ char *result;
+
+#ifdef NETWARE
+ result = getcwdpath(cwd, NULL, 1);
+ if(result)
+ {
+ char *c=cwd;
+ while(c = strchr(c, '\\'))
+ {
+ *c='/';
+ ++c;
+ }
+ }
+#else
+ result = getcwd(cwd, sizeof(cwd));
+#endif
+ if (!result) {
+ cwd[0] = '\0';
+ }
+
+ main_cwd_state.cwd_length = strlen(cwd);
+#ifdef TSRM_WIN32
+ if (main_cwd_state.cwd_length >= 2 && cwd[1] == ':') {
+ cwd[0] = toupper(cwd[0]);
+ }
+#endif
+ main_cwd_state.cwd = strdup(cwd);
+
+#ifdef ZTS
+ ts_allocate_id(&cwd_globals_id, sizeof(virtual_cwd_globals), (ts_allocate_ctor) cwd_globals_ctor, (ts_allocate_dtor) cwd_globals_dtor);
+#else
+ cwd_globals_ctor(&cwd_globals TSRMLS_CC);
+#endif
+
+#if (defined(TSRM_WIN32) || defined(NETWARE)) && defined(ZTS)
+ cwd_mutex = tsrm_mutex_alloc();
+#endif
+}
+/* }}} */
+
+CWD_API void virtual_cwd_shutdown(void) /* {{{ */
+{
+#ifndef ZTS
+ cwd_globals_dtor(&cwd_globals TSRMLS_CC);
+#endif
+#if (defined(TSRM_WIN32) || defined(NETWARE)) && defined(ZTS)
+ tsrm_mutex_free(cwd_mutex);
+#endif
+
+ free(main_cwd_state.cwd); /* Don't use CWD_STATE_FREE because the non global states will probably use emalloc()/efree() */
+}
+/* }}} */
+
+CWD_API int virtual_cwd_activate(TSRMLS_D) /* {{{ */
+{
+ if (CWDG(cwd).cwd == NULL) {
+ CWD_STATE_COPY(&CWDG(cwd), &main_cwd_state);
+ }
+ return 0;
+}
+/* }}} */
+
+CWD_API int virtual_cwd_deactivate(TSRMLS_D) /* {{{ */
+{
+ if (CWDG(cwd).cwd != NULL) {
+ CWD_STATE_FREE(&CWDG(cwd));
+ CWDG(cwd).cwd = NULL;
+ }
+ return 0;
+}
+/* }}} */
+
+CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC) /* {{{ */
+{
+ cwd_state *state;
+
+ state = &CWDG(cwd);
+
+ if (state->cwd_length == 0) {
+ char *retval;
+
+ *length = 1;
+ retval = (char *) emalloc(2);
+ if (retval == NULL) {
+ return NULL;
+ }
+ retval[0] = DEFAULT_SLASH;
+ retval[1] = '\0';
+ return retval;
+ }
+
+#ifdef TSRM_WIN32
+ /* If we have something like C: */
+ if (state->cwd_length == 2 && state->cwd[state->cwd_length-1] == ':') {
+ char *retval;
+
+ *length = state->cwd_length+1;
+ retval = (char *) emalloc(*length+1);
+ if (retval == NULL) {
+ return NULL;
+ }
+ memcpy(retval, state->cwd, *length);
+ retval[0] = toupper(retval[0]);
+ retval[*length-1] = DEFAULT_SLASH;
+ retval[*length] = '\0';
+ return retval;
+ }
+#endif
+ *length = state->cwd_length;
+ return estrdup(state->cwd);
+}
+/* }}} */
+
+/* Same semantics as UNIX getcwd() */
+CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC) /* {{{ */
+{
+ size_t length;
+ char *cwd;
+
+ cwd = virtual_getcwd_ex(&length TSRMLS_CC);
+
+ if (buf == NULL) {
+ return cwd;
+ }
+ if (length > size-1) {
+ efree(cwd);
+ errno = ERANGE; /* Is this OK? */
+ return NULL;
+ }
+ memcpy(buf, cwd, length+1);
+ efree(cwd);
+ return buf;
+}
+/* }}} */
+
+#ifdef PHP_WIN32
+static inline unsigned long realpath_cache_key(const char *path, int path_len TSRMLS_DC) /* {{{ */
+{
+ register unsigned long h;
+ char *bucket_key_start = tsrm_win32_get_path_sid_key(path TSRMLS_CC);
+ char *bucket_key = (char *)bucket_key_start;
+ const char *e = bucket_key + strlen(bucket_key);
+
+ if (!bucket_key) {
+ return 0;
+ }
+
+ for (h = 2166136261U; bucket_key < e;) {
+ h *= 16777619;
+ h ^= *bucket_key++;
+ }
+ HeapFree(GetProcessHeap(), 0, (LPVOID)bucket_key_start);
+ return h;
+}
+/* }}} */
+#else
+static inline unsigned long realpath_cache_key(const char *path, int path_len) /* {{{ */
+{
+ register unsigned long h;
+ const char *e = path + path_len;
+
+ for (h = 2166136261U; path < e;) {
+ h *= 16777619;
+ h ^= *path++;
+ }
+
+ return h;
+}
+/* }}} */
+#endif /* defined(PHP_WIN32) */
+
+CWD_API void realpath_cache_clean(TSRMLS_D) /* {{{ */
+{
+ int i;
+
+ for (i = 0; i < sizeof(CWDG(realpath_cache))/sizeof(CWDG(realpath_cache)[0]); i++) {
+ realpath_cache_bucket *p = CWDG(realpath_cache)[i];
+ while (p != NULL) {
+ realpath_cache_bucket *r = p;
+ p = p->next;
+ free(r);
+ }
+ CWDG(realpath_cache)[i] = NULL;
+ }
+ CWDG(realpath_cache_size) = 0;
+}
+/* }}} */
+
+CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC) /* {{{ */
+{
+#ifdef PHP_WIN32
+ unsigned long key = realpath_cache_key(path, path_len TSRMLS_CC);
+#else
+ unsigned long key = realpath_cache_key(path, path_len);
+#endif
+ unsigned long n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
+ realpath_cache_bucket **bucket = &CWDG(realpath_cache)[n];
+
+ while (*bucket != NULL) {
+ if (key == (*bucket)->key && path_len == (*bucket)->path_len &&
+ memcmp(path, (*bucket)->path, path_len) == 0) {
+ realpath_cache_bucket *r = *bucket;
+ *bucket = (*bucket)->next;
+
+ /* if the pointers match then only subtract the length of the path */
+ if(r->path == r->realpath) {
+ CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1;
+ } else {
+ CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
+ }
+
+ free(r);
+ return;
+ } else {
+ bucket = &(*bucket)->next;
+ }
+ }
+}
+/* }}} */
+
+static inline void realpath_cache_add(const char *path, int path_len, const char *realpath, int realpath_len, int is_dir, time_t t TSRMLS_DC) /* {{{ */
+{
+ long size = sizeof(realpath_cache_bucket) + path_len + 1;
+ int same = 1;
+
+ if (realpath_len != path_len ||
+ memcmp(path, realpath, path_len) != 0) {
+ size += realpath_len + 1;
+ same = 0;
+ }
+
+ if (CWDG(realpath_cache_size) + size <= CWDG(realpath_cache_size_limit)) {
+ realpath_cache_bucket *bucket = malloc(size);
+ unsigned long n;
+
+ if (bucket == NULL) {
+ return;
+ }
+
+#ifdef PHP_WIN32
+ bucket->key = realpath_cache_key(path, path_len TSRMLS_CC);
+#else
+ bucket->key = realpath_cache_key(path, path_len);
+#endif
+ bucket->path = (char*)bucket + sizeof(realpath_cache_bucket);
+ memcpy(bucket->path, path, path_len+1);
+ bucket->path_len = path_len;
+ if (same) {
+ bucket->realpath = bucket->path;
+ } else {
+ bucket->realpath = bucket->path + (path_len + 1);
+ memcpy(bucket->realpath, realpath, realpath_len+1);
+ }
+ bucket->realpath_len = realpath_len;
+ bucket->is_dir = is_dir;
+#ifdef PHP_WIN32
+ bucket->is_rvalid = 0;
+ bucket->is_readable = 0;
+ bucket->is_wvalid = 0;
+ bucket->is_writable = 0;
+#endif
+ bucket->expires = t + CWDG(realpath_cache_ttl);
+ n = bucket->key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
+ bucket->next = CWDG(realpath_cache)[n];
+ CWDG(realpath_cache)[n] = bucket;
+ CWDG(realpath_cache_size) += size;
+ }
+}
+/* }}} */
+
+static inline realpath_cache_bucket* realpath_cache_find(const char *path, int path_len, time_t t TSRMLS_DC) /* {{{ */
+{
+#ifdef PHP_WIN32
+ unsigned long key = realpath_cache_key(path, path_len TSRMLS_CC);
+#else
+ unsigned long key = realpath_cache_key(path, path_len);
+#endif
+
+ unsigned long n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
+ realpath_cache_bucket **bucket = &CWDG(realpath_cache)[n];
+
+ while (*bucket != NULL) {
+ if (CWDG(realpath_cache_ttl) && (*bucket)->expires < t) {
+ realpath_cache_bucket *r = *bucket;
+ *bucket = (*bucket)->next;
+
+ /* if the pointers match then only subtract the length of the path */
+ if(r->path == r->realpath) {
+ CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1;
+ } else {
+ CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
+ }
+ free(r);
+ } else if (key == (*bucket)->key && path_len == (*bucket)->path_len &&
+ memcmp(path, (*bucket)->path, path_len) == 0) {
+ return *bucket;
+ } else {
+ bucket = &(*bucket)->next;
+ }
+ }
+ return NULL;
+}
+/* }}} */
+
+CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, int path_len, time_t t TSRMLS_DC) /* {{{ */
+{
+ return realpath_cache_find(path, path_len, t TSRMLS_CC);
+}
+/* }}} */
+
+CWD_API int realpath_cache_size(TSRMLS_D)
+{
+ return CWDG(realpath_cache_size);
+}
+
+CWD_API int realpath_cache_max_buckets(TSRMLS_D)
+{
+ return (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
+}
+
+CWD_API realpath_cache_bucket** realpath_cache_get_buckets(TSRMLS_D)
+{
+ return CWDG(realpath_cache);
+}
+
+
+#undef LINK_MAX
+#define LINK_MAX 32
+
+static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, int use_realpath, int is_dir, int *link_is_dir TSRMLS_DC) /* {{{ */
+{
+ int i, j, save;
+ int directory = 0;
+#ifdef TSRM_WIN32
+ WIN32_FIND_DATA data;
+ HANDLE hFind;
+ ALLOCA_FLAG(use_heap_large)
+#else
+ struct stat st;
+#endif
+ realpath_cache_bucket *bucket;
+ char *tmp;
+ ALLOCA_FLAG(use_heap)
+
+ while (1) {
+ if (len <= start) {
+ if (link_is_dir) {
+ *link_is_dir = 1;
+ }
+ return start;
+ }
+
+ i = len;
+ while (i > start && !IS_SLASH(path[i-1])) {
+ i--;
+ }
+
+ if (i == len ||
+ (i == len - 1 && path[i] == '.')) {
+ /* remove double slashes and '.' */
+ len = i - 1;
+ is_dir = 1;
+ continue;
+ } else if (i == len - 2 && path[i] == '.' && path[i+1] == '.') {
+ /* remove '..' and previous directory */
+ is_dir = 1;
+ if (link_is_dir) {
+ *link_is_dir = 1;
+ }
+ if (i - 1 <= start) {
+ return start ? start : len;
+ }
+ j = tsrm_realpath_r(path, start, i-1, ll, t, use_realpath, 1, NULL TSRMLS_CC);
+ if (j > start) {
+ j--;
+ while (j > start && !IS_SLASH(path[j])) {
+ j--;
+ }
+ if (!start) {
+ /* leading '..' must not be removed in case of relative path */
+ if (j == 0 && path[0] == '.' && path[1] == '.' &&
+ IS_SLASH(path[2])) {
+ path[3] = '.';
+ path[4] = '.';
+ path[5] = DEFAULT_SLASH;
+ j = 5;
+ } else if (j > 0 &&
+ path[j+1] == '.' && path[j+2] == '.' &&
+ IS_SLASH(path[j+3])) {
+ j += 4;
+ path[j++] = '.';
+ path[j++] = '.';
+ path[j] = DEFAULT_SLASH;
+ }
+ }
+ } else if (!start && !j) {
+ /* leading '..' must not be removed in case of relative path */
+ path[0] = '.';
+ path[1] = '.';
+ path[2] = DEFAULT_SLASH;
+ j = 2;
+ }
+ return j;
+ }
+
+ path[len] = 0;
+
+ save = (use_realpath != CWD_EXPAND);
+
+ if (start && save && CWDG(realpath_cache_size_limit)) {
+ /* cache lookup for absolute path */
+ if (!*t) {
+ *t = time(0);
+ }
+ if ((bucket = realpath_cache_find(path, len, *t TSRMLS_CC)) != NULL) {
+ if (is_dir && !bucket->is_dir) {
+ /* not a directory */
+ return -1;
+ } else {
+ if (link_is_dir) {
+ *link_is_dir = bucket->is_dir;
+ }
+ memcpy(path, bucket->realpath, bucket->realpath_len + 1);
+ return bucket->realpath_len;
+ }
+ }
+ }
+
+#ifdef TSRM_WIN32
+ if (save && (hFind = FindFirstFile(path, &data)) == INVALID_HANDLE_VALUE) {
+ if (use_realpath == CWD_REALPATH) {
+ /* file not found */
+ return -1;
+ }
+ /* continue resolution anyway but don't save result in the cache */
+ save = 0;
+ }
+
+ if (save) {
+ FindClose(hFind);
+ }
+
+ tmp = do_alloca(len+1, use_heap);
+ memcpy(tmp, path, len+1);
+
+ if(save &&
+ !(IS_UNC_PATH(path, len) && len >= 3 && path[2] != '?') &&
+ (data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) {
+ /* File is a reparse point. Get the target */
+ HANDLE hLink = NULL;
+ REPARSE_DATA_BUFFER * pbuffer;
+ unsigned int retlength = 0;
+ int bufindex = 0, isabsolute = 0;
+ wchar_t * reparsetarget;
+ BOOL isVolume = FALSE;
+ char printname[MAX_PATH];
+ char substitutename[MAX_PATH];
+ int printname_len, substitutename_len;
+ int substitutename_off = 0;
+
+ if(++(*ll) > LINK_MAX) {
+ return -1;
+ }
+
+ hLink = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ if(hLink == INVALID_HANDLE_VALUE) {
+ return -1;
+ }
+
+ pbuffer = (REPARSE_DATA_BUFFER *)do_alloca(MAXIMUM_REPARSE_DATA_BUFFER_SIZE, use_heap_large);
+ if (pbuffer == NULL) {
+ return -1;
+ }
+ if(!DeviceIoControl(hLink, FSCTL_GET_REPARSE_POINT, NULL, 0, pbuffer, MAXIMUM_REPARSE_DATA_BUFFER_SIZE, &retlength, NULL)) {
+ free_alloca(pbuffer, use_heap_large);
+ CloseHandle(hLink);
+ return -1;
+ }
+
+ CloseHandle(hLink);
+
+ if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
+ reparsetarget = pbuffer->SymbolicLinkReparseBuffer.ReparseTarget;
+ printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
+ isabsolute = (pbuffer->SymbolicLinkReparseBuffer.Flags == 0) ? 1 : 0;
+ if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
+ reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR),
+ printname_len + 1,
+ printname, MAX_PATH, NULL, NULL
+ )) {
+ free_alloca(pbuffer, use_heap_large);
+ return -1;
+ };
+ printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
+ printname[printname_len] = 0;
+
+ substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR);
+ if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
+ reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR),
+ substitutename_len + 1,
+ substitutename, MAX_PATH, NULL, NULL
+ )) {
+ free_alloca(pbuffer, use_heap_large);
+ return -1;
+ };
+ substitutename[substitutename_len] = 0;
+ }
+ else if(pbuffer->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) {
+ isabsolute = 1;
+ reparsetarget = pbuffer->MountPointReparseBuffer.ReparseTarget;
+ printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
+ if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
+ reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR),
+ printname_len + 1,
+ printname, MAX_PATH, NULL, NULL
+ )) {
+ free_alloca(pbuffer, use_heap_large);
+ return -1;
+ };
+ printname[pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR)] = 0;
+
+ substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR);
+ if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
+ reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR),
+ substitutename_len + 1,
+ substitutename, MAX_PATH, NULL, NULL
+ )) {
+ free_alloca(pbuffer, use_heap_large);
+ return -1;
+ };
+ substitutename[substitutename_len] = 0;
+ }
+ else if (pbuffer->ReparseTag == IO_REPARSE_TAG_DEDUP) {
+ isabsolute = 1;
+ memcpy(substitutename, path, len + 1);
+ substitutename_len = len;
+ } else {
+ free_alloca(pbuffer, use_heap_large);
+ return -1;
+ }
+
+ if(isabsolute && substitutename_len > 4) {
+ /* Do not resolve volumes (for now). A mounted point can
+ target a volume without a drive, it is not certain that
+ all IO functions we use in php and its deps support
+ path with volume GUID instead of the DOS way, like:
+ d:\test\mnt\foo
+ \\?\Volume{62d1c3f8-83b9-11de-b108-806e6f6e6963}\foo
+ */
+ if (strncmp(substitutename, "\\??\\Volume{",11) == 0
+ || strncmp(substitutename, "\\\\?\\Volume{",11) == 0
+ || strncmp(substitutename, "\\??\\UNC\\", 8) == 0
+ ) {
+ isVolume = TRUE;
+ substitutename_off = 0;
+ } else
+ /* do not use the \??\ and \\?\ prefix*/
+ if (strncmp(substitutename, "\\??\\", 4) == 0
+ || strncmp(substitutename, "\\\\?\\", 4) == 0) {
+ substitutename_off = 4;
+ }
+ }
+
+ if (!isVolume) {
+ char * tmp2 = substitutename + substitutename_off;
+ for(bufindex = 0; bufindex < (substitutename_len - substitutename_off); bufindex++) {
+ *(path + bufindex) = *(tmp2 + bufindex);
+ }
+
+ *(path + bufindex) = 0;
+ j = bufindex;
+ } else {
+ j = len;
+ }
+
+
+#if VIRTUAL_CWD_DEBUG
+ fprintf(stderr, "reparse: print: %s ", printname);
+ fprintf(stderr, "sub: %s ", substitutename);
+ fprintf(stderr, "resolved: %s ", path);
+#endif
+ free_alloca(pbuffer, use_heap_large);
+
+ if(isabsolute == 1) {
+ if (!((j == 3) && (path[1] == ':') && (path[2] == '\\'))) {
+ /* use_realpath is 0 in the call below coz path is absolute*/
+ j = tsrm_realpath_r(path, 0, j, ll, t, 0, is_dir, &directory TSRMLS_CC);
+ if(j < 0) {
+ free_alloca(tmp, use_heap);
+ return -1;
+ }
+ }
+ }
+ else {
+ if(i + j >= MAXPATHLEN - 1) {
+ free_alloca(tmp, use_heap);
+ return -1;
+ }
+
+ memmove(path+i, path, j+1);
+ memcpy(path, tmp, i-1);
+ path[i-1] = DEFAULT_SLASH;
+ j = tsrm_realpath_r(path, start, i + j, ll, t, use_realpath, is_dir, &directory TSRMLS_CC);
+ if(j < 0) {
+ free_alloca(tmp, use_heap);
+ return -1;
+ }
+ }
+ directory = (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
+
+ if(link_is_dir) {
+ *link_is_dir = directory;
+ }
+ }
+ else {
+ if (save) {
+ directory = (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0;
+ if (is_dir && !directory) {
+ /* not a directory */
+ return -1;
+ }
+ }
+
+#elif defined(NETWARE)
+ save = 0;
+ tmp = do_alloca(len+1, use_heap);
+ memcpy(tmp, path, len+1);
+#else
+ if (save && php_sys_lstat(path, &st) < 0) {
+ if (use_realpath == CWD_REALPATH) {
+ /* file not found */
+ return -1;
+ }
+ /* continue resolution anyway but don't save result in the cache */
+ save = 0;
+ }
+
+ tmp = do_alloca(len+1, use_heap);
+ memcpy(tmp, path, len+1);
+
+ if (save && S_ISLNK(st.st_mode)) {
+ if (++(*ll) > LINK_MAX || (j = php_sys_readlink(tmp, path, MAXPATHLEN)) < 0) {
+ /* too many links or broken symlinks */
+ free_alloca(tmp, use_heap);
+ return -1;
+ }
+ path[j] = 0;
+ if (IS_ABSOLUTE_PATH(path, j)) {
+ j = tsrm_realpath_r(path, 1, j, ll, t, use_realpath, is_dir, &directory TSRMLS_CC);
+ if (j < 0) {
+ free_alloca(tmp, use_heap);
+ return -1;
+ }
+ } else {
+ if (i + j >= MAXPATHLEN-1) {
+ free_alloca(tmp, use_heap);
+ return -1; /* buffer overflow */
+ }
+ memmove(path+i, path, j+1);
+ memcpy(path, tmp, i-1);
+ path[i-1] = DEFAULT_SLASH;
+ j = tsrm_realpath_r(path, start, i + j, ll, t, use_realpath, is_dir, &directory TSRMLS_CC);
+ if (j < 0) {
+ free_alloca(tmp, use_heap);
+ return -1;
+ }
+ }
+ if (link_is_dir) {
+ *link_is_dir = directory;
+ }
+ } else {
+ if (save) {
+ directory = S_ISDIR(st.st_mode);
+ if (link_is_dir) {
+ *link_is_dir = directory;
+ }
+ if (is_dir && !directory) {
+ /* not a directory */
+ free_alloca(tmp, use_heap);
+ return -1;
+ }
+ }
+#endif
+ if (i - 1 <= start) {
+ j = start;
+ } else {
+ /* some leading directories may be unaccessable */
+ j = tsrm_realpath_r(path, start, i-1, ll, t, save ? CWD_FILEPATH : use_realpath, 1, NULL TSRMLS_CC);
+ if (j > start) {
+ path[j++] = DEFAULT_SLASH;
+ }
+ }
+#ifdef TSRM_WIN32
+ if (j < 0 || j + len - i >= MAXPATHLEN-1) {
+ free_alloca(tmp, use_heap);
+ return -1;
+ }
+ if (save) {
+ i = strlen(data.cFileName);
+ memcpy(path+j, data.cFileName, i+1);
+ j += i;
+ } else {
+ /* use the original file or directory name as it wasn't found */
+ memcpy(path+j, tmp+i, len-i+1);
+ j += (len-i);
+ }
+ }
+#else
+ if (j < 0 || j + len - i >= MAXPATHLEN-1) {
+ free_alloca(tmp, use_heap);
+ return -1;
+ }
+ memcpy(path+j, tmp+i, len-i+1);
+ j += (len-i);
+ }
+#endif
+
+ if (save && start && CWDG(realpath_cache_size_limit)) {
+ /* save absolute path in the cache */
+ realpath_cache_add(tmp, len, path, j, directory, *t TSRMLS_CC);
+ }
+
+ free_alloca(tmp, use_heap);
+ return j;
+ }
+}
+/* }}} */
+
+/* Resolve path relatively to state and put the real path into state */
+/* returns 0 for ok, 1 for error */
+CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath TSRMLS_DC) /* {{{ */
+{
+ int path_length = strlen(path);
+ char resolved_path[MAXPATHLEN];
+ int start = 1;
+ int ll = 0;
+ time_t t;
+ int ret;
+ int add_slash;
+ void *tmp;
+
+ if (path_length == 0 || path_length >= MAXPATHLEN-1) {
+#ifdef TSRM_WIN32
+# if _MSC_VER < 1300
+ errno = EINVAL;
+# else
+ _set_errno(EINVAL);
+# endif
+#else
+ errno = EINVAL;
+#endif
+ return 1;
+ }
+
+#if VIRTUAL_CWD_DEBUG
+ fprintf(stderr,"cwd = %s path = %s\n", state->cwd, path);
+#endif
+
+ /* cwd_length can be 0 when getcwd() fails.
+ * This can happen under solaris when a dir does not have read permissions
+ * but *does* have execute permissions */
+ if (!IS_ABSOLUTE_PATH(path, path_length)) {
+ if (state->cwd_length == 0) {
+ /* resolve relative path */
+ start = 0;
+ memcpy(resolved_path , path, path_length + 1);
+ } else {
+ int state_cwd_length = state->cwd_length;
+
+#ifdef TSRM_WIN32
+ if (IS_SLASH(path[0])) {
+ if (state->cwd[1] == ':') {
+ /* Copy only the drive name */
+ state_cwd_length = 2;
+ } else if (IS_UNC_PATH(state->cwd, state->cwd_length)) {
+ /* Copy only the share name */
+ state_cwd_length = 2;
+ while (IS_SLASH(state->cwd[state_cwd_length])) {
+ state_cwd_length++;
+ }
+ while (state->cwd[state_cwd_length] &&
+ !IS_SLASH(state->cwd[state_cwd_length])) {
+ state_cwd_length++;
+ }
+ while (IS_SLASH(state->cwd[state_cwd_length])) {
+ state_cwd_length++;
+ }
+ while (state->cwd[state_cwd_length] &&
+ !IS_SLASH(state->cwd[state_cwd_length])) {
+ state_cwd_length++;
+ }
+ }
+ }
+#endif
+ if (path_length + state_cwd_length + 1 >= MAXPATHLEN-1) {
+ return 1;
+ }
+ memcpy(resolved_path, state->cwd, state_cwd_length);
+ if (resolved_path[state_cwd_length-1] == DEFAULT_SLASH) {
+ memcpy(resolved_path + state_cwd_length, path, path_length + 1);
+ path_length += state_cwd_length;
+ } else {
+ resolved_path[state_cwd_length] = DEFAULT_SLASH;
+ memcpy(resolved_path + state_cwd_length + 1, path, path_length + 1);
+ path_length += state_cwd_length + 1;
+ }
+ }
+ } else {
+#ifdef TSRM_WIN32
+ if (path_length > 2 && path[1] == ':' && !IS_SLASH(path[2])) {
+ resolved_path[0] = path[0];
+ resolved_path[1] = ':';
+ resolved_path[2] = DEFAULT_SLASH;
+ memcpy(resolved_path + 3, path + 2, path_length - 1);
+ path_length++;
+ } else
+#endif
+ memcpy(resolved_path, path, path_length + 1);
+ }
+
+#ifdef TSRM_WIN32
+ if (memchr(resolved_path, '*', path_length) ||
+ memchr(resolved_path, '?', path_length)) {
+ return 1;
+ }
+#endif
+
+#ifdef TSRM_WIN32
+ if (IS_UNC_PATH(resolved_path, path_length)) {
+ /* skip UNC name */
+ resolved_path[0] = DEFAULT_SLASH;
+ resolved_path[1] = DEFAULT_SLASH;
+ start = 2;
+ while (!IS_SLASH(resolved_path[start])) {
+ if (resolved_path[start] == 0) {
+ goto verify;
+ }
+ resolved_path[start] = toupper(resolved_path[start]);
+ start++;
+ }
+ resolved_path[start++] = DEFAULT_SLASH;
+ while (!IS_SLASH(resolved_path[start])) {
+ if (resolved_path[start] == 0) {
+ goto verify;
+ }
+ resolved_path[start] = toupper(resolved_path[start]);
+ start++;
+ }
+ resolved_path[start++] = DEFAULT_SLASH;
+ } else if (IS_ABSOLUTE_PATH(resolved_path, path_length)) {
+ /* skip DRIVE name */
+ resolved_path[0] = toupper(resolved_path[0]);
+ resolved_path[2] = DEFAULT_SLASH;
+ start = 3;
+ }
+#elif defined(NETWARE)
+ if (IS_ABSOLUTE_PATH(resolved_path, path_length)) {
+ /* skip VOLUME name */
+ start = 0;
+ while (start != ':') {
+ if (resolved_path[start] == 0) return -1;
+ start++;
+ }
+ start++;
+ if (!IS_SLASH(resolved_path[start])) return -1;
+ resolved_path[start++] = DEFAULT_SLASH;
+ }
+#endif
+
+ add_slash = (use_realpath != CWD_REALPATH) && path_length > 0 && IS_SLASH(resolved_path[path_length-1]);
+ t = CWDG(realpath_cache_ttl) ? 0 : -1;
+ path_length = tsrm_realpath_r(resolved_path, start, path_length, &ll, &t, use_realpath, 0, NULL TSRMLS_CC);
+
+ if (path_length < 0) {
+ errno = ENOENT;
+ return 1;
+ }
+
+ if (!start && !path_length) {
+ resolved_path[path_length++] = '.';
+ }
+ if (add_slash && path_length && !IS_SLASH(resolved_path[path_length-1])) {
+ if (path_length >= MAXPATHLEN-1) {
+ return -1;
+ }
+ resolved_path[path_length++] = DEFAULT_SLASH;
+ }
+ resolved_path[path_length] = 0;
+
+#ifdef TSRM_WIN32
+verify:
+#endif
+ if (verify_path) {
+ cwd_state old_state;
+
+ CWD_STATE_COPY(&old_state, state);
+ state->cwd_length = path_length;
+
+ tmp = erealloc(state->cwd, state->cwd_length+1);
+ if (tmp == NULL) {
+#if VIRTUAL_CWD_DEBUG
+ fprintf (stderr, "Out of memory\n");
+#endif
+ return 1;
+ }
+ state->cwd = (char *) tmp;
+
+ memcpy(state->cwd, resolved_path, state->cwd_length+1);
+ if (verify_path(state)) {
+ CWD_STATE_FREE(state);
+ *state = old_state;
+ ret = 1;
+ } else {
+ CWD_STATE_FREE(&old_state);
+ ret = 0;
+ }
+ } else {
+ state->cwd_length = path_length;
+ tmp = erealloc(state->cwd, state->cwd_length+1);
+ if (tmp == NULL) {
+#if VIRTUAL_CWD_DEBUG
+ fprintf (stderr, "Out of memory\n");
+#endif
+ return 1;
+ }
+ state->cwd = (char *) tmp;
+
+ memcpy(state->cwd, resolved_path, state->cwd_length+1);
+ ret = 0;
+ }
+
+#if VIRTUAL_CWD_DEBUG
+ fprintf (stderr, "virtual_file_ex() = %s\n",state->cwd);
+#endif
+ return (ret);
+}
+/* }}} */
+
+CWD_API int virtual_chdir(const char *path TSRMLS_DC) /* {{{ */
+{
+ return virtual_file_ex(&CWDG(cwd), path, php_is_dir_ok, CWD_REALPATH TSRMLS_CC)?-1:0;
+}
+/* }}} */
+
+CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path TSRMLS_DC) TSRMLS_DC) /* {{{ */
+{
+ int length = strlen(path);
+ char *temp;
+ int retval;
+ ALLOCA_FLAG(use_heap)
+
+ if (length == 0) {
+ return 1; /* Can't cd to empty string */
+ }
+ while(--length >= 0 && !IS_SLASH(path[length])) {
+ }
+
+ if (length == -1) {
+ /* No directory only file name */
+ errno = ENOENT;
+ return -1;
+ }
+
+ if (length == COPY_WHEN_ABSOLUTE(path) && IS_ABSOLUTE_PATH(path, length+1)) { /* Also use trailing slash if this is absolute */
+ length++;
+ }
+ temp = (char *) do_alloca(length+1, use_heap);
+ memcpy(temp, path, length);
+ temp[length] = 0;
+#if VIRTUAL_CWD_DEBUG
+ fprintf (stderr, "Changing directory to %s\n", temp);
+#endif
+ retval = p_chdir(temp TSRMLS_CC);
+ free_alloca(temp, use_heap);
+ return retval;
+}
+/* }}} */
+
+CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC) /* {{{ */
+{
+ cwd_state new_state;
+ char *retval;
+ char cwd[MAXPATHLEN];
+
+ /* realpath("") returns CWD */
+ if (!*path) {
+ new_state.cwd = (char*)emalloc(1);
+ if (new_state.cwd == NULL) {
+ retval = NULL;
+ goto end;
+ }
+ new_state.cwd[0] = '\0';
+ new_state.cwd_length = 0;
+ if (VCWD_GETCWD(cwd, MAXPATHLEN)) {
+ path = cwd;
+ }
+ } else if (!IS_ABSOLUTE_PATH(path, strlen(path))) {
+ CWD_STATE_COPY(&new_state, &CWDG(cwd));
+ } else {
+ new_state.cwd = (char*)emalloc(1);
+ if (new_state.cwd == NULL) {
+ retval = NULL;
+ goto end;
+ }
+ new_state.cwd[0] = '\0';
+ new_state.cwd_length = 0;
+ }
+
+ if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)==0) {
+ int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length;
+
+ memcpy(real_path, new_state.cwd, len);
+ real_path[len] = '\0';
+ retval = real_path;
+ } else {
+ retval = NULL;
+ }
+
+ CWD_STATE_FREE(&new_state);
+end:
+ return retval;
+}
+/* }}} */
+
+CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path TSRMLS_DC) /* {{{ */
+{
+ cwd_state new_state;
+ int retval;
+
+ CWD_STATE_COPY(&new_state, &CWDG(cwd));
+ retval = virtual_file_ex(&new_state, path, verify_path, CWD_FILEPATH TSRMLS_CC);
+
+ *filepath = new_state.cwd;
+
+ return retval;
+
+}
+/* }}} */
+
+CWD_API int virtual_filepath(const char *path, char **filepath TSRMLS_DC) /* {{{ */
+{
+ return virtual_filepath_ex(path, filepath, php_is_file_ok TSRMLS_CC);
+}
+/* }}} */
+
+CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC) /* {{{ */
+{
+ cwd_state new_state;
+ FILE *f;
+
+ if (path[0] == '\0') { /* Fail to open empty path */
+ return NULL;
+ }
+
+ CWD_STATE_COPY(&new_state, &CWDG(cwd));
+ if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND TSRMLS_CC)) {
+ CWD_STATE_FREE_ERR(&new_state);
+ return NULL;
+ }
+
+ f = fopen(new_state.cwd, mode);
+
+ CWD_STATE_FREE_ERR(&new_state);
+
+ return f;
+}
+/* }}} */
+
+CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC) /* {{{ */
+{
+ cwd_state new_state;
+ int ret;
+
+ CWD_STATE_COPY(&new_state, &CWDG(cwd));
+ if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH TSRMLS_CC)) {
+ CWD_STATE_FREE_ERR(&new_state);
+ return -1;
+ }
+
+#if defined(TSRM_WIN32)
+ ret = tsrm_win32_access(new_state.cwd, mode TSRMLS_CC);
+#else
+ ret = access(new_state.cwd, mode);
+#endif
+
+ CWD_STATE_FREE_ERR(&new_state);
+
+ return ret;
+}
+/* }}} */
+
+#if HAVE_UTIME
+#ifdef TSRM_WIN32
+static void UnixTimeToFileTime(time_t t, LPFILETIME pft) /* {{{ */
+{
+ // Note that LONGLONG is a 64-bit value
+ LONGLONG ll;
+
+ ll = Int32x32To64(t, 10000000) + 116444736000000000;
+ pft->dwLowDateTime = (DWORD)ll;
+ pft->dwHighDateTime = ll >> 32;
+}
+/* }}} */
+
+TSRM_API int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */
+{
+ FILETIME mtime, atime;
+ HANDLE hFile;
+
+ hFile = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL,
+ OPEN_ALWAYS, FILE_FLAG_BACKUP_SEMANTICS, NULL);
+
+ /* OPEN_ALWAYS mode sets the last error to ERROR_ALREADY_EXISTS but
+ the CreateFile operation succeeds */
+ if (GetLastError() == ERROR_ALREADY_EXISTS) {
+ SetLastError(0);
+ }
+
+ if ( hFile == INVALID_HANDLE_VALUE ) {
+ return -1;
+ }
+
+ if (!buf) {
+ SYSTEMTIME st;
+ GetSystemTime(&st);
+ SystemTimeToFileTime(&st, &mtime);
+ atime = mtime;
+ } else {
+ UnixTimeToFileTime(buf->modtime, &mtime);
+ UnixTimeToFileTime(buf->actime, &atime);
+ }
+ if (!SetFileTime(hFile, NULL, &atime, &mtime)) {
+ CloseHandle(hFile);
+ return -1;
+ }
+ CloseHandle(hFile);
+ return 1;
+}
+/* }}} */
+#endif
+
+CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC) /* {{{ */
+{
+ cwd_state new_state;
+ int ret;
+
+ CWD_STATE_COPY(&new_state, &CWDG(cwd));
+ if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) {
+ CWD_STATE_FREE_ERR(&new_state);
+ return -1;
+ }
+
+#ifdef TSRM_WIN32
+ ret = win32_utime(new_state.cwd, buf);
+#else
+ ret = utime(new_state.cwd, buf);
+#endif
+
+ CWD_STATE_FREE_ERR(&new_state);
+ return ret;
+}
+/* }}} */
+#endif
+
+CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC) /* {{{ */
+{
+ cwd_state new_state;
+ int ret;
+
+ CWD_STATE_COPY(&new_state, &CWDG(cwd));
+ if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) {
+ CWD_STATE_FREE_ERR(&new_state);
+ return -1;
+ }
+
+ ret = chmod(new_state.cwd, mode);
+
+ CWD_STATE_FREE_ERR(&new_state);
+ return ret;
+}
+/* }}} */
+
+#if !defined(TSRM_WIN32) && !defined(NETWARE)
+CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int link TSRMLS_DC) /* {{{ */
+{
+ cwd_state new_state;
+ int ret;
+
+ CWD_STATE_COPY(&new_state, &CWDG(cwd));
+ if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) {
+ CWD_STATE_FREE_ERR(&new_state);
+ return -1;
+ }
+
+ if (link) {
+#if HAVE_LCHOWN
+ ret = lchown(new_state.cwd, owner, group);
+#else
+ ret = -1;
+#endif
+ } else {
+ ret = chown(new_state.cwd, owner, group);
+ }
+
+ CWD_STATE_FREE_ERR(&new_state);
+ return ret;
+}
+/* }}} */
+#endif
+
+CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...) /* {{{ */
+{
+ cwd_state new_state;
+ int f;
+
+ CWD_STATE_COPY(&new_state, &CWDG(cwd));
+ if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH TSRMLS_CC)) {
+ CWD_STATE_FREE_ERR(&new_state);
+ return -1;
+ }
+
+ if (flags & O_CREAT) {
+ mode_t mode;
+ va_list arg;
+
+ va_start(arg, flags);
+ mode = (mode_t) va_arg(arg, int);
+ va_end(arg);
+
+ f = open(new_state.cwd, flags, mode);
+ } else {
+ f = open(new_state.cwd, flags);
+ }
+ CWD_STATE_FREE_ERR(&new_state);
+ return f;
+}
+/* }}} */
+
+CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC) /* {{{ */
+{
+ cwd_state new_state;
+ int f;
+
+ CWD_STATE_COPY(&new_state, &CWDG(cwd));
+ if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH TSRMLS_CC)) {
+ CWD_STATE_FREE_ERR(&new_state);
+ return -1;
+ }
+
+ f = creat(new_state.cwd, mode);
+
+ CWD_STATE_FREE_ERR(&new_state);
+ return f;
+}
+/* }}} */
+
+CWD_API int virtual_rename(const char *oldname, const char *newname TSRMLS_DC) /* {{{ */
+{
+ cwd_state old_state;
+ cwd_state new_state;
+ int retval;
+
+ CWD_STATE_COPY(&old_state, &CWDG(cwd));
+ if (virtual_file_ex(&old_state, oldname, NULL, CWD_EXPAND TSRMLS_CC)) {
+ CWD_STATE_FREE_ERR(&old_state);
+ return -1;
+ }
+ oldname = old_state.cwd;
+
+ CWD_STATE_COPY(&new_state, &CWDG(cwd));
+ if (virtual_file_ex(&new_state, newname, NULL, CWD_EXPAND TSRMLS_CC)) {
+ CWD_STATE_FREE_ERR(&old_state);
+ CWD_STATE_FREE_ERR(&new_state);
+ return -1;
+ }
+ newname = new_state.cwd;
+
+ /* rename on windows will fail if newname already exists.
+ MoveFileEx has to be used */
+#ifdef TSRM_WIN32
+ /* MoveFileEx returns 0 on failure, other way 'round for this function */
+ retval = (MoveFileEx(oldname, newname, MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED) == 0) ? -1 : 0;
+#else
+ retval = rename(oldname, newname);
+#endif
+
+ CWD_STATE_FREE_ERR(&old_state);
+ CWD_STATE_FREE_ERR(&new_state);
+
+ return retval;
+}
+/* }}} */
+
+CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC) /* {{{ */
+{
+ cwd_state new_state;
+ int retval;
+
+ CWD_STATE_COPY(&new_state, &CWDG(cwd));
+ if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)) {
+ CWD_STATE_FREE_ERR(&new_state);
+ return -1;
+ }
+
+ retval = php_sys_stat(new_state.cwd, buf);
+
+ CWD_STATE_FREE_ERR(&new_state);
+ return retval;
+}
+/* }}} */
+
+CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC) /* {{{ */
+{
+ cwd_state new_state;
+ int retval;
+
+ CWD_STATE_COPY(&new_state, &CWDG(cwd));
+ if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND TSRMLS_CC)) {
+ CWD_STATE_FREE_ERR(&new_state);
+ return -1;
+ }
+
+ retval = php_sys_lstat(new_state.cwd, buf);
+
+ CWD_STATE_FREE_ERR(&new_state);
+ return retval;
+}
+/* }}} */
+
+CWD_API int virtual_unlink(const char *path TSRMLS_DC) /* {{{ */
+{
+ cwd_state new_state;
+ int retval;
+
+ CWD_STATE_COPY(&new_state, &CWDG(cwd));
+ if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND TSRMLS_CC)) {
+ CWD_STATE_FREE_ERR(&new_state);
+ return -1;
+ }
+
+ retval = unlink(new_state.cwd);
+
+ CWD_STATE_FREE_ERR(&new_state);
+ return retval;
+}
+/* }}} */
+
+CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC) /* {{{ */
+{
+ cwd_state new_state;
+ int retval;
+
+ CWD_STATE_COPY(&new_state, &CWDG(cwd));
+ if (virtual_file_ex(&new_state, pathname, NULL, CWD_FILEPATH TSRMLS_CC)) {
+ CWD_STATE_FREE_ERR(&new_state);
+ return -1;
+ }
+
+#ifdef TSRM_WIN32
+ retval = mkdir(new_state.cwd);
+#else
+ retval = mkdir(new_state.cwd, mode);
+#endif
+ CWD_STATE_FREE_ERR(&new_state);
+ return retval;
+}
+/* }}} */
+
+CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC) /* {{{ */
+{
+ cwd_state new_state;
+ int retval;
+
+ CWD_STATE_COPY(&new_state, &CWDG(cwd));
+ if (virtual_file_ex(&new_state, pathname, NULL, CWD_EXPAND TSRMLS_CC)) {
+ CWD_STATE_FREE_ERR(&new_state);
+ return -1;
+ }
+
+ retval = rmdir(new_state.cwd);
+
+ CWD_STATE_FREE_ERR(&new_state);
+ return retval;
+}
+/* }}} */
+
+#ifdef TSRM_WIN32
+DIR *opendir(const char *name);
+#endif
+
+CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC) /* {{{ */
+{
+ cwd_state new_state;
+ DIR *retval;
+
+ CWD_STATE_COPY(&new_state, &CWDG(cwd));
+ if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH TSRMLS_CC)) {
+ CWD_STATE_FREE_ERR(&new_state);
+ return NULL;
+ }
+
+ retval = opendir(new_state.cwd);
+
+ CWD_STATE_FREE_ERR(&new_state);
+ return retval;
+}
+/* }}} */
+
+#ifdef TSRM_WIN32
+CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /* {{{ */
+{
+ return popen_ex(command, type, CWDG(cwd).cwd, NULL TSRMLS_CC);
+}
+/* }}} */
+#elif defined(NETWARE)
+/* On NetWare, the trick of prepending "cd cwd; " doesn't work so we need to perform
+ a VCWD_CHDIR() and mutex it
+ */
+CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /* {{{ */
+{
+ char prev_cwd[MAXPATHLEN];
+ char *getcwd_result;
+ FILE *retval;
+
+ getcwd_result = VCWD_GETCWD(prev_cwd, MAXPATHLEN);
+ if (!getcwd_result) {
+ return NULL;
+ }
+
+#ifdef ZTS
+ tsrm_mutex_lock(cwd_mutex);
+#endif
+
+ VCWD_CHDIR(CWDG(cwd).cwd);
+ retval = popen(command, type);
+ VCWD_CHDIR(prev_cwd);
+
+#ifdef ZTS
+ tsrm_mutex_unlock(cwd_mutex);
+#endif
+
+ return retval;
+}
+/* }}} */
+#else /* Unix */
+CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /* {{{ */
+{
+ int command_length;
+ int dir_length, extra = 0;
+ char *command_line;
+ char *ptr, *dir;
+ FILE *retval;
+
+ command_length = strlen(command);
+
+ dir_length = CWDG(cwd).cwd_length;
+ dir = CWDG(cwd).cwd;
+ while (dir_length > 0) {
+ if (*dir == '\'') extra+=3;
+ dir++;
+ dir_length--;
+ }
+ dir_length = CWDG(cwd).cwd_length;
+ dir = CWDG(cwd).cwd;
+
+ ptr = command_line = (char *) emalloc(command_length + sizeof("cd '' ; ") + dir_length + extra+1+1);
+ if (!command_line) {
+ return NULL;
+ }
+ memcpy(ptr, "cd ", sizeof("cd ")-1);
+ ptr += sizeof("cd ")-1;
+
+ if (CWDG(cwd).cwd_length == 0) {
+ *ptr++ = DEFAULT_SLASH;
+ } else {
+ *ptr++ = '\'';
+ while (dir_length > 0) {
+ switch (*dir) {
+ case '\'':
+ *ptr++ = '\'';
+ *ptr++ = '\\';
+ *ptr++ = '\'';
+ /* fall-through */
+ default:
+ *ptr++ = *dir;
+ }
+ dir++;
+ dir_length--;
+ }
+ *ptr++ = '\'';
+ }
+
+ *ptr++ = ' ';
+ *ptr++ = ';';
+ *ptr++ = ' ';
+
+ memcpy(ptr, command, command_length+1);
+ retval = popen(command_line, type);
+
+ efree(command_line);
+ return retval;
+}
+/* }}} */
+#endif
+
+CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC) /* {{{ */
+{
+ cwd_state new_state;
+ char cwd[MAXPATHLEN];
+
+ /* realpath("") returns CWD */
+ if (!*path) {
+ new_state.cwd = (char*)emalloc(1);
+ if (new_state.cwd == NULL) {
+ return NULL;
+ }
+ new_state.cwd[0] = '\0';
+ new_state.cwd_length = 0;
+ if (VCWD_GETCWD(cwd, MAXPATHLEN)) {
+ path = cwd;
+ }
+ } else if (!IS_ABSOLUTE_PATH(path, strlen(path)) &&
+ VCWD_GETCWD(cwd, MAXPATHLEN)) {
+ new_state.cwd = estrdup(cwd);
+ new_state.cwd_length = strlen(cwd);
+ } else {
+ new_state.cwd = (char*)emalloc(1);
+ if (new_state.cwd == NULL) {
+ return NULL;
+ }
+ new_state.cwd[0] = '\0';
+ new_state.cwd_length = 0;
+ }
+
+ if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)) {
+ efree(new_state.cwd);
+ return NULL;
+ }
+
+ if (real_path) {
+ int copy_len = new_state.cwd_length>MAXPATHLEN-1 ? MAXPATHLEN-1 : new_state.cwd_length;
+ memcpy(real_path, new_state.cwd, copy_len);
+ real_path[copy_len] = '\0';
+ efree(new_state.cwd);
+ return real_path;
+ } else {
+ return new_state.cwd;
+ }
+}
+/* }}} */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
diff --git a/Zend/zend_virtual_cwd.h b/Zend/zend_virtual_cwd.h
new file mode 100644
index 0000000000..1603815178
--- /dev/null
+++ b/Zend/zend_virtual_cwd.h
@@ -0,0 +1,340 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2015 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Andi Gutmans <andi@zend.com> |
+ | Sascha Schumann <sascha@schumann.cx> |
+ | Pierre Joye <pierre@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id$ */
+
+#ifndef VIRTUAL_CWD_H
+#define VIRTUAL_CWD_H
+
+#include "TSRM.h"
+#include "tsrm_config_common.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <ctype.h>
+
+#ifdef HAVE_UTIME_H
+#include <utime.h>
+#endif
+
+#ifdef HAVE_STDARG_H
+#include <stdarg.h>
+#endif
+
+#ifdef ZTS
+#define VIRTUAL_DIR
+#endif
+
+#ifndef TSRM_WIN32
+#include <unistd.h>
+#else
+#include <direct.h>
+#endif
+
+#if defined(__osf__) || defined(_AIX)
+#include <errno.h>
+#endif
+
+#ifdef TSRM_WIN32
+#include "readdir.h"
+#include <sys/utime.h>
+/* mode_t isn't defined on Windows */
+typedef unsigned short mode_t;
+
+#define DEFAULT_SLASH '\\'
+#define DEFAULT_DIR_SEPARATOR ';'
+#define IS_SLASH(c) ((c) == '/' || (c) == '\\')
+#define IS_SLASH_P(c) (*(c) == '/' || \
+ (*(c) == '\\' && !IsDBCSLeadByte(*(c-1))))
+
+/* COPY_WHEN_ABSOLUTE is 2 under Win32 because by chance both regular absolute paths
+ in the file system and UNC paths need copying of two characters */
+#define COPY_WHEN_ABSOLUTE(path) 2
+#define IS_UNC_PATH(path, len) \
+ (len >= 2 && IS_SLASH(path[0]) && IS_SLASH(path[1]))
+#define IS_ABSOLUTE_PATH(path, len) \
+ (len >= 2 && ((isalpha(path[0]) && path[1] == ':') || IS_UNC_PATH(path, len)))
+
+#elif defined(NETWARE)
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+
+#define DEFAULT_SLASH '/'
+#define DEFAULT_DIR_SEPARATOR ';'
+#define IS_SLASH(c) ((c) == '/' || (c) == '\\')
+#define IS_SLASH_P(c) IS_SLASH(*(c))
+/* Colon indicates volume name, either first character should be forward slash or backward slash */
+#define IS_ABSOLUTE_PATH(path, len) \
+ ((strchr(path, ':') != NULL) || ((len >= 1) && ((path[0] == '/') || (path[0] == '\\'))))
+
+#else
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+
+#define DEFAULT_SLASH '/'
+
+#ifdef __riscos__
+#define DEFAULT_DIR_SEPARATOR ';'
+#else
+#define DEFAULT_DIR_SEPARATOR ':'
+#endif
+
+#define IS_SLASH(c) ((c) == '/')
+#define IS_SLASH_P(c) (*(c) == '/')
+
+#endif
+
+
+#ifndef COPY_WHEN_ABSOLUTE
+#define COPY_WHEN_ABSOLUTE(path) 0
+#endif
+
+#ifndef IS_ABSOLUTE_PATH
+#define IS_ABSOLUTE_PATH(path, len) \
+ (IS_SLASH(path[0]))
+#endif
+
+#ifdef TSRM_EXPORTS
+#define CWD_EXPORTS
+#endif
+
+#ifdef TSRM_WIN32
+# ifdef CWD_EXPORTS
+# define CWD_API __declspec(dllexport)
+# else
+# define CWD_API __declspec(dllimport)
+# endif
+#elif defined(__GNUC__) && __GNUC__ >= 4
+# define CWD_API __attribute__ ((visibility("default")))
+#else
+# define CWD_API
+#endif
+
+#ifdef TSRM_WIN32
+CWD_API int php_sys_stat_ex(const char *path, struct stat *buf, int lstat);
+# define php_sys_stat(path, buf) php_sys_stat_ex(path, buf, 0)
+# define php_sys_lstat(path, buf) php_sys_stat_ex(path, buf, 1)
+CWD_API int php_sys_readlink(const char *link, char *target, size_t target_len);
+#else
+# define php_sys_stat stat
+# define php_sys_lstat lstat
+# ifdef HAVE_SYMLINK
+# define php_sys_readlink(link, target, target_len) readlink(link, target, target_len)
+# endif
+#endif
+
+typedef struct _cwd_state {
+ char *cwd;
+ int cwd_length;
+} cwd_state;
+
+typedef int (*verify_path_func)(const cwd_state *);
+
+CWD_API void virtual_cwd_startup(void);
+CWD_API void virtual_cwd_shutdown(void);
+CWD_API int virtual_cwd_activate(TSRMLS_D);
+CWD_API int virtual_cwd_deactivate(TSRMLS_D);
+CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC);
+CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC);
+CWD_API int virtual_chdir(const char *path TSRMLS_DC);
+CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path TSRMLS_DC) TSRMLS_DC);
+CWD_API int virtual_filepath(const char *path, char **filepath TSRMLS_DC);
+CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path TSRMLS_DC);
+CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC);
+CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC);
+CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...);
+CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC);
+CWD_API int virtual_rename(const char *oldname, const char *newname TSRMLS_DC);
+CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC);
+CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC);
+CWD_API int virtual_unlink(const char *path TSRMLS_DC);
+CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC);
+CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC);
+CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC);
+CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC);
+CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC);
+#if defined(TSRM_WIN32)
+/* these are not defined in win32 headers */
+#ifndef W_OK
+#define W_OK 0x02
+#endif
+#ifndef R_OK
+#define R_OK 0x04
+#endif
+#ifndef X_OK
+#define X_OK 0x01
+#endif
+#ifndef F_OK
+#define F_OK 0x00
+#endif
+#endif
+
+#if HAVE_UTIME
+CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC);
+#endif
+CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC);
+#if !defined(TSRM_WIN32) && !defined(NETWARE)
+CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int link TSRMLS_DC);
+#endif
+
+/* One of the following constants must be used as the last argument
+ in virtual_file_ex() call. */
+
+#define CWD_EXPAND 0 /* expand "." and ".." but dont resolve symlinks */
+#define CWD_FILEPATH 1 /* resolve symlinks if file is exist otherwise expand */
+#define CWD_REALPATH 2 /* call realpath(), resolve symlinks. File must exist */
+
+CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath TSRMLS_DC);
+
+CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC);
+
+#define REALPATH_CACHE_TTL (2*60) /* 2 minutes */
+#define REALPATH_CACHE_SIZE 0 /* disabled while php.ini isn't loaded */
+
+typedef struct _realpath_cache_bucket {
+ unsigned long key;
+ char *path;
+ int path_len;
+ char *realpath;
+ int realpath_len;
+ int is_dir;
+ time_t expires;
+#ifdef PHP_WIN32
+ unsigned char is_rvalid;
+ unsigned char is_readable;
+ unsigned char is_wvalid;
+ unsigned char is_writable;
+#endif
+ struct _realpath_cache_bucket *next;
+} realpath_cache_bucket;
+
+typedef struct _virtual_cwd_globals {
+ cwd_state cwd;
+ long realpath_cache_size;
+ long realpath_cache_size_limit;
+ long realpath_cache_ttl;
+ realpath_cache_bucket *realpath_cache[1024];
+} virtual_cwd_globals;
+
+#ifdef ZTS
+extern ts_rsrc_id cwd_globals_id;
+# define CWDG(v) TSRMG(cwd_globals_id, virtual_cwd_globals *, v)
+#else
+extern virtual_cwd_globals cwd_globals;
+# define CWDG(v) (cwd_globals.v)
+#endif
+
+CWD_API void realpath_cache_clean(TSRMLS_D);
+CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC);
+CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, int path_len, time_t t TSRMLS_DC);
+CWD_API int realpath_cache_size(TSRMLS_D);
+CWD_API int realpath_cache_max_buckets(TSRMLS_D);
+CWD_API realpath_cache_bucket** realpath_cache_get_buckets(TSRMLS_D);
+
+/* The actual macros to be used in programs using TSRM
+ * If the program defines VIRTUAL_DIR it will use the
+ * virtual_* functions
+ */
+
+#ifdef VIRTUAL_DIR
+
+#define VCWD_GETCWD(buff, size) virtual_getcwd(buff, size TSRMLS_CC)
+#define VCWD_FOPEN(path, mode) virtual_fopen(path, mode TSRMLS_CC)
+/* Because open() has two modes, we have to macros to replace it */
+#define VCWD_OPEN(path, flags) virtual_open(path TSRMLS_CC, flags)
+#define VCWD_OPEN_MODE(path, flags, mode) virtual_open(path TSRMLS_CC, flags, mode)
+#define VCWD_CREAT(path, mode) virtual_creat(path, mode TSRMLS_CC)
+#define VCWD_CHDIR(path) virtual_chdir(path TSRMLS_CC)
+#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, virtual_chdir TSRMLS_CC)
+#define VCWD_GETWD(buf)
+#define VCWD_REALPATH(path, real_path) virtual_realpath(path, real_path TSRMLS_CC)
+#define VCWD_RENAME(oldname, newname) virtual_rename(oldname, newname TSRMLS_CC)
+#define VCWD_STAT(path, buff) virtual_stat(path, buff TSRMLS_CC)
+# define VCWD_LSTAT(path, buff) virtual_lstat(path, buff TSRMLS_CC)
+#define VCWD_UNLINK(path) virtual_unlink(path TSRMLS_CC)
+#define VCWD_MKDIR(pathname, mode) virtual_mkdir(pathname, mode TSRMLS_CC)
+#define VCWD_RMDIR(pathname) virtual_rmdir(pathname TSRMLS_CC)
+#define VCWD_OPENDIR(pathname) virtual_opendir(pathname TSRMLS_CC)
+#define VCWD_POPEN(command, type) virtual_popen(command, type TSRMLS_CC)
+#define VCWD_ACCESS(pathname, mode) virtual_access(pathname, mode TSRMLS_CC)
+#if HAVE_UTIME
+#define VCWD_UTIME(path, time) virtual_utime(path, time TSRMLS_CC)
+#endif
+#define VCWD_CHMOD(path, mode) virtual_chmod(path, mode TSRMLS_CC)
+#if !defined(TSRM_WIN32) && !defined(NETWARE)
+#define VCWD_CHOWN(path, owner, group) virtual_chown(path, owner, group, 0 TSRMLS_CC)
+#if HAVE_LCHOWN
+#define VCWD_LCHOWN(path, owner, group) virtual_chown(path, owner, group, 1 TSRMLS_CC)
+#endif
+#endif
+
+#else
+
+#define VCWD_GETCWD(buff, size) getcwd(buff, size)
+#define VCWD_FOPEN(path, mode) fopen(path, mode)
+#define VCWD_OPEN(path, flags) open(path, flags)
+#define VCWD_OPEN_MODE(path, flags, mode) open(path, flags, mode)
+#define VCWD_CREAT(path, mode) creat(path, mode)
+/* rename on windows will fail if newname already exists.
+ MoveFileEx has to be used */
+#if defined(TSRM_WIN32)
+# define VCWD_RENAME(oldname, newname) (MoveFileEx(oldname, newname, MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED) == 0 ? -1 : 0)
+#else
+# define VCWD_RENAME(oldname, newname) rename(oldname, newname)
+#endif
+#define VCWD_CHDIR(path) chdir(path)
+#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, chdir)
+#define VCWD_GETWD(buf) getwd(buf)
+#define VCWD_STAT(path, buff) php_sys_stat(path, buff)
+#define VCWD_LSTAT(path, buff) lstat(path, buff)
+#define VCWD_UNLINK(path) unlink(path)
+#define VCWD_MKDIR(pathname, mode) mkdir(pathname, mode)
+#define VCWD_RMDIR(pathname) rmdir(pathname)
+#define VCWD_OPENDIR(pathname) opendir(pathname)
+#define VCWD_POPEN(command, type) popen(command, type)
+#if defined(TSRM_WIN32)
+#define VCWD_ACCESS(pathname, mode) tsrm_win32_access(pathname, mode TSRMLS_CC)
+#else
+#define VCWD_ACCESS(pathname, mode) access(pathname, mode)
+#endif
+
+#define VCWD_REALPATH(path, real_path) tsrm_realpath(path, real_path TSRMLS_CC)
+
+#if HAVE_UTIME
+# ifdef TSRM_WIN32
+# define VCWD_UTIME(path, time) win32_utime(path, time)
+# else
+# define VCWD_UTIME(path, time) utime(path, time)
+# endif
+#endif
+
+#define VCWD_CHMOD(path, mode) chmod(path, mode)
+#if !defined(TSRM_WIN32) && !defined(NETWARE)
+#define VCWD_CHOWN(path, owner, group) chown(path, owner, group)
+#if HAVE_LCHOWN
+#define VCWD_LCHOWN(path, owner, group) lchown(path, owner, group)
+#endif
+#endif
+
+#endif
+
+#endif /* VIRTUAL_CWD_H */
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 040ab74db0..7c029ada3f 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -352,7 +352,6 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
} else {
/* here we are sure we are dealing with an object */
@@ -372,7 +371,6 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*zptr);
EX_T(opline->result.var).var.ptr = *zptr;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
}
@@ -412,7 +410,6 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(z);
EX_T(opline->result.var).var.ptr = z;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
zval_ptr_dtor(&z);
} else {
@@ -420,7 +417,6 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
zval_ptr_dtor(&object);
@@ -486,7 +482,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_helper, VAR|UNUSED|CV, CONST|TMP|VAR|UNU
if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
FREE_OP2();
FREE_OP1_VAR_PTR();
@@ -514,7 +510,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_helper, VAR|UNUSED|CV, CONST|TMP|VAR|UNU
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
FREE_OP2();
@@ -813,7 +809,7 @@ ZEND_VM_HANDLER(34, ZEND_PRE_INC, VAR|CV, ANY)
if (OP1_TYPE == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
FREE_OP1_VAR_PTR();
CHECK_EXCEPTION();
@@ -837,7 +833,7 @@ ZEND_VM_HANDLER(34, ZEND_PRE_INC, VAR|CV, ANY)
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
FREE_OP1_VAR_PTR();
@@ -860,7 +856,7 @@ ZEND_VM_HANDLER(35, ZEND_PRE_DEC, VAR|CV, ANY)
if (OP1_TYPE == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
FREE_OP1_VAR_PTR();
CHECK_EXCEPTION();
@@ -884,7 +880,7 @@ ZEND_VM_HANDLER(35, ZEND_PRE_DEC, VAR|CV, ANY)
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
FREE_OP1_VAR_PTR();
@@ -1060,10 +1056,8 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, UNUSED|CONST|
*/
if (OP1_TYPE == IS_CONST) {
hash_value = Z_HASH_P(varname);
- } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
- hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
} else {
- hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
+ hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname));
}
if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
@@ -1095,7 +1089,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, UNUSED|CONST|
FREE_OP1();
break;
case ZEND_FETCH_STATIC:
- zval_update_constant(retval, (void*) 1 TSRMLS_CC);
+ zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (OP1_TYPE == IS_VAR && !free_op1.var) {
@@ -1116,7 +1110,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, UNUSED|CONST|
switch (type) {
case BP_VAR_R:
case BP_VAR_IS:
- AI_SET_PTR(&EX_T(opline->result.var), *retval);
+ EX_T(opline->result.var).var.ptr = *retval;
break;
case BP_VAR_UNSET: {
zend_free_op free_res;
@@ -1157,7 +1151,7 @@ ZEND_VM_HANDLER(92, ZEND_FETCH_FUNC_ARG, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
USE_OPLINE
ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type,
- ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R);
+ zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC) ? BP_VAR_W : BP_VAR_R);
}
ZEND_VM_HANDLER(95, ZEND_FETCH_UNSET, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
@@ -1177,14 +1171,12 @@ ZEND_VM_HANDLER(81, ZEND_FETCH_DIM_R, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zval *container;
SAVE_OPLINE();
-
- if (OP1_TYPE == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
container = GET_OP1_ZVAL_PTR(BP_VAR_R);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE, BP_VAR_R TSRMLS_CC);
FREE_OP2();
- FREE_OP1();
+ if (OP1_TYPE != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
+ FREE_OP1();
+ }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -1267,9 +1259,8 @@ ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
SAVE_OPLINE();
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
zval **container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
-
if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -1351,7 +1342,7 @@ ZEND_VM_HELPER(zend_fetch_property_address_read_helper, VAR|UNUSED|CV, CONST|TMP
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
FREE_OP2();
} else {
zval *retval;
@@ -1364,7 +1355,7 @@ ZEND_VM_HELPER(zend_fetch_property_address_read_helper, VAR|UNUSED|CV, CONST|TMP
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (IS_OP2_TMP_FREE()) {
zval_ptr_dtor(&offset);
@@ -1473,7 +1464,7 @@ ZEND_VM_HANDLER(91, ZEND_FETCH_OBJ_IS, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
FREE_OP2();
} else {
zval *retval;
@@ -1486,7 +1477,7 @@ ZEND_VM_HANDLER(91, ZEND_FETCH_OBJ_IS, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (IS_OP2_TMP_FREE()) {
zval_ptr_dtor(&offset);
@@ -1504,7 +1495,7 @@ ZEND_VM_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
{
USE_OPLINE
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1, free_op2;
zval *property;
@@ -1591,13 +1582,13 @@ ZEND_VM_HANDLER(98, ZEND_FETCH_DIM_TMP_VAR, CONST|TMP, CONST)
if (UNEXPECTED(Z_TYPE_P(container) != IS_ARRAY)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
} else {
zend_free_op free_op2;
zval *value = *zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE, BP_VAR_R TSRMLS_CC);
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
FREE_OP2();
}
CHECK_EXCEPTION();
@@ -1678,11 +1669,11 @@ ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
ALLOC_ZVAL(retval);
ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
} else if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
if (IS_TMP_FREE(free_op_data1)) {
@@ -1690,7 +1681,7 @@ ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else {
if ((opline+1)->op1_type == IS_TMP_VAR) {
@@ -1702,7 +1693,7 @@ ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
}
FREE_OP_VAR_PTR(free_op_data2);
@@ -1734,11 +1725,11 @@ ZEND_VM_HANDLER(38, ZEND_ASSIGN, VAR|CV, CONST|TMP|VAR|CV)
ALLOC_ZVAL(retval);
ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
} else if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else if (OP1_TYPE == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
if (IS_OP2_TMP_FREE()) {
@@ -1746,7 +1737,7 @@ ZEND_VM_HANDLER(38, ZEND_ASSIGN, VAR|CV, CONST|TMP|VAR|CV)
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else {
if (OP2_TYPE == IS_TMP_VAR) {
@@ -1758,7 +1749,7 @@ ZEND_VM_HANDLER(38, ZEND_ASSIGN, VAR|CV, CONST|TMP|VAR|CV)
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
}
@@ -1815,7 +1806,7 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*variable_ptr_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *variable_ptr_ptr);
+ EX_T(opline->result.var).var.ptr = *variable_ptr_ptr;
}
FREE_OP1_VAR_PTR();
@@ -1833,7 +1824,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
EG(current_execute_data) = EX(prev_execute_data);
EG(opline_ptr) = NULL;
if (!EG(active_symbol_table)) {
- i_free_compiled_variables(execute_data);
+ i_free_compiled_variables(execute_data TSRMLS_CC);
}
zend_vm_stack_free((char*)execute_data - (ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T) TSRMLS_CC);
@@ -1896,7 +1887,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
EX(call)--;
- zend_vm_stack_clear_multiple(1 TSRMLS_CC);
+ zend_vm_stack_clear_multiple(0 TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
zend_throw_exception_internal(NULL TSRMLS_CC);
@@ -1918,20 +1909,22 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
USE_OPLINE
zend_bool should_change_scope = 0;
zend_function *fbc = EX(function_state).function;
+ zend_uint num_args;
SAVE_OPLINE();
EX(object) = EX(call)->object;
if (UNEXPECTED((fbc->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) != 0)) {
if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_ABSTRACT) != 0)) {
zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", fbc->common.scope->name, fbc->common.function_name);
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE(); /* Never reached */
}
if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) {
zend_error(E_DEPRECATED, "Function %s%s%s() is deprecated",
fbc->common.scope ? fbc->common.scope->name : "",
fbc->common.scope ? "::" : "",
fbc->common.function_name);
+ if (UNEXPECTED(EG(exception) != NULL)) {
+ HANDLE_EXCEPTION();
+ }
}
}
if (fbc->common.scope &&
@@ -1941,6 +1934,9 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* FIXME: output identifiers properly */
zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically", fbc->common.scope->name, fbc->common.function_name);
+ if (UNEXPECTED(EG(exception) != NULL)) {
+ HANDLE_EXCEPTION();
+ }
} else {
/* FIXME: output identifiers properly */
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
@@ -1958,19 +1954,22 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
EG(called_scope) = EX(call)->called_scope;
}
- EX(function_state).arguments = zend_vm_stack_top(TSRMLS_C);
- zend_vm_stack_push((void*)(zend_uintptr_t)opline->extended_value TSRMLS_CC);
+ num_args = opline->extended_value + EX(call)->num_additional_args;
+ if (EX(call)->num_additional_args) {
+ EX(function_state).arguments = zend_vm_stack_push_args(num_args TSRMLS_CC);
+ } else {
+ EX(function_state).arguments = zend_vm_stack_top(TSRMLS_C);
+ zend_vm_stack_push((void*)(zend_uintptr_t) num_args TSRMLS_CC);
+ }
LOAD_OPLINE();
if (fbc->type == ZEND_INTERNAL_FUNCTION) {
- if (fbc->common.arg_info) {
- zend_uint i=0;
- zval **p = (zval**)EX(function_state).arguments;
- ulong arg_count = opline->extended_value;
-
- while (arg_count>0) {
- zend_verify_arg_type(fbc, ++i, *(p-arg_count), 0 TSRMLS_CC);
- arg_count--;
+ if (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) {
+ zend_uint i;
+ void **p = EX(function_state).arguments - num_args;
+
+ for (i = 0; i < num_args; ++i, ++p) {
+ zend_verify_arg_type(fbc, i + 1, (zval *) *p, 0, NULL TSRMLS_CC);
}
}
@@ -1984,7 +1983,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
if (!zend_execute_internal) {
/* saves one function call if zend_execute_internal is not used */
- fbc->internal_function.handler(opline->extended_value, ret->var.ptr, (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? &ret->var.ptr : NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
+ fbc->internal_function.handler(num_args, ret->var.ptr, &ret->var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
} else {
zend_execute_internal(execute_data, NULL, RETURN_VALUE_USED(opline) TSRMLS_CC);
}
@@ -2034,7 +2033,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
/* Not sure what should be done here if it's a static method */
if (EXPECTED(EX(object) != NULL)) {
- Z_OBJ_HT_P(EX(object))->call_method(fbc->common.function_name, opline->extended_value, EX_T(opline->result.var).var.ptr, &EX_T(opline->result.var).var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
+ Z_OBJ_HT_P(EX(object))->call_method(fbc->common.function_name, num_args, EX_T(opline->result.var).var.ptr, &EX_T(opline->result.var).var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
} else {
zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object");
}
@@ -2076,7 +2075,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
EX(call)--;
- zend_vm_stack_clear_multiple(1 TSRMLS_CC);
+ zend_vm_stack_clear_multiple(0 TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
zend_throw_exception_internal(NULL TSRMLS_CC);
@@ -2472,7 +2471,7 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV)
FREE_OP2();
HANDLE_EXCEPTION();
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object)));
}
if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
@@ -2488,6 +2487,8 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV)
call->object = this_ptr;
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -2603,7 +2604,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
+ zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
} else {
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
@@ -2614,6 +2615,8 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS
call->called_scope = Z_OBJCE_P(call->object);
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -2637,10 +2640,13 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
} else {
CACHE_PTR(opline->op2.literal->cache_slot, call->fbc);
}
+
call->object = NULL;
call->called_scope = NULL;
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
+
/*CHECK_EXCEPTION();*/
ZEND_VM_NEXT_OPCODE();
} else {
@@ -2665,10 +2671,13 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
}
efree(lcname);
FREE_OP2();
+
call->object = NULL;
call->called_scope = NULL;
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else if (OP2_TYPE != IS_CONST && OP2_TYPE != IS_TMP_VAR &&
@@ -2678,15 +2687,18 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
if (call->object) {
Z_ADDREF_P(call->object);
}
- if (OP2_TYPE == IS_VAR && OP2_FREE &&
+ if (OP2_TYPE == IS_VAR && OP2_FREE && Z_REFCOUNT_P(function_name) == 1 &&
call->fbc->common.fn_flags & ZEND_ACC_CLOSURE) {
/* Delay closure destruction until its invocation */
call->fbc->common.prototype = (zend_function*)function_name;
} else {
FREE_OP2();
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else if (OP2_TYPE != IS_CONST &&
@@ -2752,8 +2764,11 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
if (UNEXPECTED(call->fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, Z_STRVAL_PP(method));
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
+
FREE_OP2();
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -2791,7 +2806,9 @@ ZEND_VM_HANDLER(69, ZEND_INIT_NS_FCALL_BY_NAME, ANY, CONST)
call->object = NULL;
call->called_scope = NULL;
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
+
EX(call) = call;
ZEND_VM_NEXT_OPCODE();
}
@@ -2817,9 +2834,11 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, CONST, ANY)
} else {
CACHE_PTR(opline->op1.literal->cache_slot, EX(function_state).function);
}
+
call->fbc = EX(function_state).function;
call->object = NULL;
call->called_scope = NULL;
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -2838,9 +2857,7 @@ ZEND_VM_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY)
retval_ptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
if (!EG(return_value_ptr_ptr)) {
- if (OP1_TYPE == IS_TMP_VAR) {
- FREE_OP1();
- }
+ FREE_OP1();
} else {
if (OP1_TYPE == IS_CONST ||
OP1_TYPE == IS_TMP_VAR ||
@@ -2853,18 +2870,23 @@ ZEND_VM_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY)
zval_copy_ctor(ret);
}
*EG(return_value_ptr_ptr) = ret;
+ FREE_OP1_IF_VAR();
} else if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) &&
retval_ptr == &EG(uninitialized_zval)) {
zval *ret;
+ if (OP1_TYPE == IS_VAR) {
+ Z_DELREF_P(retval_ptr);
+ }
ALLOC_INIT_ZVAL(ret);
*EG(return_value_ptr_ptr) = ret;
} else {
*EG(return_value_ptr_ptr) = retval_ptr;
- Z_ADDREF_P(retval_ptr);
+ if (OP1_TYPE == IS_CV) {
+ Z_ADDREF_P(retval_ptr);
+ }
}
}
- FREE_OP1_IF_VAR();
ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
}
@@ -2878,7 +2900,8 @@ ZEND_VM_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY)
SAVE_OPLINE();
do {
- if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR) {
+ if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR ||
+ (OP1_TYPE == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) {
/* Not supposed to happen, but we'll allow it */
zend_error(E_NOTICE, "Only variable references should be returned by reference");
@@ -2935,7 +2958,7 @@ ZEND_VM_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY)
}
} while (0);
- FREE_OP1_IF_VAR();
+ FREE_OP1_VAR_PTR();
ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
}
@@ -3047,10 +3070,12 @@ ZEND_VM_HANDLER(65, ZEND_SEND_VAL, CONST|TMP, ANY)
USE_OPLINE
SAVE_OPLINE();
- if (opline->extended_value==ZEND_DO_FCALL_BY_NAME
- && ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
- zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.opline_num);
+ if (opline->extended_value == ZEND_DO_FCALL_BY_NAME) {
+ if (ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
+ zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.num);
+ }
}
+
{
zval *valptr;
zval *value;
@@ -3078,21 +3103,26 @@ ZEND_VM_HELPER(zend_send_by_var_helper, VAR|CV, ANY)
varptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
if (varptr == &EG(uninitialized_zval)) {
- ALLOC_ZVAL(varptr);
- INIT_ZVAL(*varptr);
- Z_SET_REFCOUNT_P(varptr, 0);
+ if (OP1_TYPE == IS_VAR) {
+ Z_DELREF_P(varptr);
+ }
+ ALLOC_INIT_ZVAL(varptr);
} else if (PZVAL_IS_REF(varptr)) {
- zval *original_var = varptr;
+ if (OP1_TYPE == IS_CV ||
+ (OP1_TYPE == IS_VAR && Z_REFCOUNT_P(varptr) > 2)) {
+ zval *original_var = varptr;
- ALLOC_ZVAL(varptr);
- ZVAL_COPY_VALUE(varptr, original_var);
- Z_UNSET_ISREF_P(varptr);
- Z_SET_REFCOUNT_P(varptr, 0);
- zval_copy_ctor(varptr);
+ ALLOC_ZVAL(varptr);
+ INIT_PZVAL_COPY(varptr, original_var);
+ zval_copy_ctor(varptr);
+ FREE_OP1();
+ } else {
+ Z_UNSET_ISREF_P(varptr);
+ }
+ } else if (OP1_TYPE == IS_CV) {
+ Z_ADDREF_P(varptr);
}
- Z_ADDREF_P(varptr);
zend_vm_stack_push(varptr TSRMLS_CC);
- FREE_OP1(); /* for string offsets */
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -3109,33 +3139,28 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) {
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
}
- } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
- ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
- }
-
- if (OP1_TYPE == IS_VAR &&
- (opline->extended_value & ZEND_ARG_SEND_FUNCTION) &&
- EX_T(opline->op1.var).var.fcall_returned_reference &&
- EX_T(opline->op1.var).var.ptr) {
- varptr = EX_T(opline->op1.var).var.ptr;
- PZVAL_UNLOCK_EX(varptr, &free_op1, 0);
} else {
- varptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
+ if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
+ ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
+ }
}
+
+ varptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) ||
EX_T(opline->op1.var).var.fcall_returned_reference) &&
varptr != &EG(uninitialized_zval) &&
- (PZVAL_IS_REF(varptr) ||
- (Z_REFCOUNT_P(varptr) == 1 && (OP1_TYPE == IS_CV || free_op1.var)))) {
+ (PZVAL_IS_REF(varptr) || Z_REFCOUNT_P(varptr) == 1)) {
Z_SET_ISREF_P(varptr);
- Z_ADDREF_P(varptr);
+ if (OP1_TYPE == IS_CV) {
+ Z_ADDREF_P(varptr);
+ }
zend_vm_stack_push(varptr TSRMLS_CC);
} else {
zval *valptr;
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
- !ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
+ !ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
zend_error(E_STRICT, "Only variables should be passed by reference");
}
ALLOC_ZVAL(valptr);
@@ -3143,9 +3168,9 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
if (!IS_OP1_TMP_FREE()) {
zval_copy_ctor(valptr);
}
+ FREE_OP1_IF_VAR();
zend_vm_stack_push(valptr TSRMLS_CC);
}
- FREE_OP1_IF_VAR();
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -3172,9 +3197,10 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
}
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
- EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
- !ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
- ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
+ EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) {
+ if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
+ ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
+ }
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
@@ -3191,14 +3217,163 @@ ZEND_VM_HANDLER(66, ZEND_SEND_VAR, VAR|CV, ANY)
{
USE_OPLINE
- if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME)
- && ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
- ZEND_VM_DISPATCH_TO_HANDLER(ZEND_SEND_REF);
+ if (opline->extended_value == ZEND_DO_FCALL_BY_NAME) {
+ if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
+ ZEND_VM_DISPATCH_TO_HANDLER(ZEND_SEND_REF);
+ }
}
SAVE_OPLINE();
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
}
+ZEND_VM_HANDLER(165, ZEND_SEND_UNPACK, ANY, ANY)
+{
+ USE_OPLINE
+ zend_free_op free_op1;
+ zval *args;
+ int arg_num;
+ SAVE_OPLINE();
+
+ args = GET_OP1_ZVAL_PTR(BP_VAR_R);
+ arg_num = opline->op2.num + EX(call)->num_additional_args + 1;
+
+ switch (Z_TYPE_P(args)) {
+ case IS_ARRAY: {
+ HashTable *ht = Z_ARRVAL_P(args);
+ HashPosition pos;
+ zval **arg_ptr, *arg;
+
+ ZEND_VM_STACK_GROW_IF_NEEDED(zend_hash_num_elements(ht));
+
+ for (zend_hash_internal_pointer_reset_ex(ht, &pos);
+ zend_hash_get_current_data_ex(ht, (void **) &arg_ptr, &pos) == SUCCESS;
+ zend_hash_move_forward_ex(ht, &pos), ++arg_num
+ ) {
+ char *name;
+ zend_uint name_len;
+ zend_ulong index;
+
+ if (zend_hash_get_current_key_ex(ht, &name, &name_len, &index, 0, &pos) == HASH_KEY_IS_STRING) {
+ zend_error(E_RECOVERABLE_ERROR, "Cannot unpack array with string keys");
+ FREE_OP1();
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+ }
+
+ if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
+ SEPARATE_ZVAL_TO_MAKE_IS_REF(arg_ptr);
+ arg = *arg_ptr;
+ Z_ADDREF_P(arg);
+ } else if (Z_ISREF_PP(arg_ptr)) {
+ ALLOC_ZVAL(arg);
+ MAKE_COPY_ZVAL(arg_ptr, arg);
+ } else {
+ arg = *arg_ptr;
+ Z_ADDREF_P(arg);
+ }
+
+ zend_vm_stack_push(arg TSRMLS_CC);
+ EX(call)->num_additional_args++;
+ }
+ break;
+ }
+ case IS_OBJECT: {
+ zend_class_entry *ce = Z_OBJCE_P(args);
+ zend_object_iterator *iter;
+
+ if (!ce || !ce->get_iterator) {
+ zend_error(E_WARNING, "Only arrays and Traversables can be unpacked");
+ break;
+ }
+
+ iter = ce->get_iterator(ce, args, 0 TSRMLS_CC);
+ if (UNEXPECTED(!iter)) {
+ FREE_OP1();
+ if (!EG(exception)) {
+ zend_throw_exception_ex(
+ NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name
+ );
+ }
+ HANDLE_EXCEPTION();
+ }
+
+ if (iter->funcs->rewind) {
+ iter->funcs->rewind(iter TSRMLS_CC);
+ if (UNEXPECTED(EG(exception) != NULL)) {
+ ZEND_VM_C_GOTO(unpack_iter_dtor);
+ }
+ }
+
+ for (; iter->funcs->valid(iter TSRMLS_CC) == SUCCESS; ++arg_num) {
+ zval **arg_ptr, *arg;
+
+ if (UNEXPECTED(EG(exception) != NULL)) {
+ ZEND_VM_C_GOTO(unpack_iter_dtor);
+ }
+
+ iter->funcs->get_current_data(iter, &arg_ptr TSRMLS_CC);
+ if (UNEXPECTED(EG(exception) != NULL)) {
+ ZEND_VM_C_GOTO(unpack_iter_dtor);
+ }
+
+ if (iter->funcs->get_current_key) {
+ zval key;
+ iter->funcs->get_current_key(iter, &key TSRMLS_CC);
+ if (UNEXPECTED(EG(exception) != NULL)) {
+ ZEND_VM_C_GOTO(unpack_iter_dtor);
+ }
+
+ if (Z_TYPE(key) == IS_STRING) {
+ zend_error(E_RECOVERABLE_ERROR,
+ "Cannot unpack Traversable with string keys");
+ zval_dtor(&key);
+ ZEND_VM_C_GOTO(unpack_iter_dtor);
+ }
+
+ zval_dtor(&key);
+ }
+
+ if (ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
+ zend_error(
+ E_WARNING, "Cannot pass by-reference argument %d of %s%s%s()"
+ " by unpacking a Traversable, passing by-value instead", arg_num,
+ EX(call)->fbc->common.scope ? EX(call)->fbc->common.scope->name : "",
+ EX(call)->fbc->common.scope ? "::" : "",
+ EX(call)->fbc->common.function_name
+ );
+ }
+
+ if (Z_ISREF_PP(arg_ptr)) {
+ ALLOC_ZVAL(arg);
+ MAKE_COPY_ZVAL(arg_ptr, arg);
+ } else {
+ arg = *arg_ptr;
+ Z_ADDREF_P(arg);
+ }
+
+ ZEND_VM_STACK_GROW_IF_NEEDED(1);
+ zend_vm_stack_push(arg TSRMLS_CC);
+ EX(call)->num_additional_args++;
+
+ iter->funcs->move_forward(iter TSRMLS_CC);
+ if (UNEXPECTED(EG(exception) != NULL)) {
+ ZEND_VM_C_GOTO(unpack_iter_dtor);
+ }
+ }
+
+ZEND_VM_C_LABEL(unpack_iter_dtor):
+ iter->funcs->dtor(iter TSRMLS_CC);
+ break;
+ }
+ default:
+ zend_error(E_WARNING, "Only arrays and Traversables can be unpacked");
+ }
+
+ FREE_OP1();
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
{
USE_OPLINE
@@ -3207,7 +3382,7 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
SAVE_OPLINE();
if (UNEXPECTED(param == NULL)) {
- if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value TSRMLS_CC)) {
+ if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value, NULL TSRMLS_CC)) {
const char *space;
const char *class_name;
zend_execute_data *ptr;
@@ -3229,7 +3404,7 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
} else {
zval **var_ptr;
- zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC);
+ zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value, NULL TSRMLS_CC);
var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
Z_DELREF_PP(var_ptr);
*var_ptr = *param;
@@ -3252,10 +3427,16 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
if (param == NULL) {
ALLOC_ZVAL(assignment_value);
*assignment_value = *opline->op2.zv;
- if ((Z_TYPE_P(assignment_value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT ||
- Z_TYPE_P(assignment_value)==IS_CONSTANT_ARRAY) {
+ if (IS_CONSTANT_TYPE(Z_TYPE_P(assignment_value))) {
Z_SET_REFCOUNT_P(assignment_value, 1);
zval_update_constant(&assignment_value, 0 TSRMLS_CC);
+ } else if (Z_TYPE_P(assignment_value) == IS_ARRAY) {
+ HashTable *ht;
+
+ ALLOC_HASHTABLE(ht);
+ zend_hash_init(ht, zend_hash_num_elements(Z_ARRVAL_P(assignment_value)), NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_copy(ht, Z_ARRVAL_P(assignment_value), (copy_ctor_func_t) zval_deep_copy, NULL, sizeof(zval *));
+ Z_ARRVAL_P(assignment_value) = ht;
} else {
zval_copy_ctor(assignment_value);
}
@@ -3265,7 +3446,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
Z_ADDREF_P(assignment_value);
}
- zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC);
+ zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value, opline->op2.zv TSRMLS_CC);
var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
zval_ptr_dtor(var_ptr);
*var_ptr = assignment_value;
@@ -3274,6 +3455,37 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
ZEND_VM_NEXT_OPCODE();
}
+ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, ANY, ANY)
+{
+ USE_OPLINE
+ zend_uint arg_num = opline->op1.num;
+ zend_uint arg_count = zend_vm_stack_get_args_count(TSRMLS_C);
+ zval **var_ptr, *params;
+
+ SAVE_OPLINE();
+
+ var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
+ Z_DELREF_PP(var_ptr);
+ MAKE_STD_ZVAL(params);
+ *var_ptr = params;
+
+ if (arg_num <= arg_count) {
+ array_init_size(params, arg_count - arg_num + 1);
+ } else {
+ array_init(params);
+ }
+
+ for (; arg_num <= arg_count; ++arg_num) {
+ zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC);
+ zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value, NULL TSRMLS_CC);
+ zend_hash_next_index_insert(Z_ARRVAL_P(params), param, sizeof(zval *), NULL);
+ Z_ADDREF_PP(param);
+ }
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
ZEND_VM_HANDLER(52, ZEND_BOOL, CONST|TMP|VAR|CV, ANY)
{
USE_OPLINE
@@ -3344,9 +3556,6 @@ ZEND_VM_HANDLER(48, ZEND_CASE, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zend_free_op free_op1, free_op2;
SAVE_OPLINE();
- if (OP1_TYPE==IS_VAR) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
is_equal_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
@@ -3407,6 +3616,7 @@ ZEND_VM_HANDLER(68, ZEND_NEW, ANY, ANY)
call->fbc = constructor;
call->object = object_zval;
call->called_scope = EX_T(opline->op1.var).class_entry;
+ call->num_additional_args = 0;
call->is_ctor_call = 1;
call->is_ctor_result_used = RETURN_VALUE_USED(opline);
EX(call) = call;
@@ -3474,7 +3684,7 @@ ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMP|VAR|UNUSED|CV, ANY)
if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(&retval);
} else {
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
}
FREE_OP1_IF_VAR();
@@ -3515,8 +3725,6 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
retval = &EX_T(opline->result.var).tmp_var;
ZVAL_COPY_VALUE(retval, &c->value);
zval_copy_ctor(retval);
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
} else {
/* class constant */
zend_class_entry *ce;
@@ -3527,8 +3735,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
value = CACHED_PTR(opline->op2.literal->cache_slot);
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
+ goto constant_fetch_end;
} else if (CACHED_PTR(opline->op1.literal->cache_slot)) {
ce = CACHED_PTR(opline->op1.literal->cache_slot);
} else {
@@ -3546,18 +3753,16 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
if ((value = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce)) != NULL) {
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
+ goto constant_fetch_end;
}
}
if (EXPECTED(zend_hash_quick_find(&ce->constants_table, Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv)+1, Z_HASH_P(opline->op2.zv), (void **) &value) == SUCCESS)) {
- if (Z_TYPE_PP(value) == IS_CONSTANT_ARRAY ||
- (Z_TYPE_PP(value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
+ if (IS_CONSTANT_TYPE(Z_TYPE_PP(value))) {
zend_class_entry *old_scope = EG(scope);
EG(scope) = ce;
- zval_update_constant(value, (void *) 1 TSRMLS_CC);
+ zval_update_constant(value, 1 TSRMLS_CC);
EG(scope) = old_scope;
}
if (OP1_TYPE == IS_CONST) {
@@ -3567,16 +3772,16 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
}
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
- } else if (Z_STRLEN_P(opline->op2.zv) == sizeof("class")-1 && strcmp(Z_STRVAL_P(opline->op2.zv), "class") == 0) {
+ } else if (Z_STRLEN_P(opline->op2.zv) == sizeof("class")-1 && memcmp(Z_STRVAL_P(opline->op2.zv), "class", sizeof("class") - 1) == 0) {
/* "class" is assigned as a case-sensitive keyword from zend_do_resolve_class_name */
ZVAL_STRINGL(&EX_T(opline->result.var).tmp_var, ce->name, ce->name_length, 1);
} else {
zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
}
-
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
}
+constant_fetch_end:
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
}
ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|CV, CONST|TMP|VAR|UNUSED|CV)
@@ -3610,7 +3815,8 @@ ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|CV, CONST|TMP|VAR|UNUS
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
- } else {
+ FREE_OP1_IF_VAR();
+ } else if (OP1_TYPE == IS_CV) {
Z_ADDREF_P(expr_ptr);
}
}
@@ -3635,11 +3841,7 @@ ZEND_VM_C_LABEL(num_index):
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, ZEND_VM_C_GOTO(num_index));
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -3658,8 +3860,6 @@ ZEND_VM_C_LABEL(num_index):
}
if ((OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) && opline->extended_value) {
FREE_OP1_VAR_PTR();
- } else {
- FREE_OP1_IF_VAR();
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -3829,7 +4029,6 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
EX(original_return_value) = EG(return_value_ptr_ptr);
EG(active_op_array) = new_op_array;
if (RETURN_VALUE_USED(opline)) {
- EX_T(opline->result.var).var.ptr = NULL;
EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
EG(return_value_ptr_ptr) = EX_T(opline->result.var).var.ptr_ptr;
} else {
@@ -3867,7 +4066,7 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
ALLOC_ZVAL(retval);
ZVAL_BOOL(retval, failure_retval);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
ZEND_VM_NEXT_OPCODE();
}
@@ -3989,11 +4188,7 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, ZEND_VM_C_GOTO(num_index_dim));
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (ht == &EG(symbol_table)) {
zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
@@ -4148,19 +4343,27 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
if (!ce || !ce->get_iterator) {
- Z_ADDREF_P(array_ptr);
+ if (OP1_TYPE == IS_CV) {
+ Z_ADDREF_P(array_ptr);
+ }
}
} else if (OP1_TYPE == IS_CONST ||
- ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) &&
+ (OP1_TYPE == IS_CV &&
!Z_ISREF_P(array_ptr) &&
- Z_REFCOUNT_P(array_ptr) > 1)) {
+ Z_REFCOUNT_P(array_ptr) > 1) ||
+ (OP1_TYPE == IS_VAR &&
+ !Z_ISREF_P(array_ptr) &&
+ Z_REFCOUNT_P(array_ptr) > 2)) {
zval *tmp;
+ if (OP1_TYPE == IS_VAR) {
+ Z_DELREF_P(array_ptr);
+ }
ALLOC_ZVAL(tmp);
INIT_PZVAL_COPY(tmp, array_ptr);
zval_copy_ctor(tmp);
array_ptr = tmp;
- } else {
+ } else if (OP1_TYPE == IS_CV) {
Z_ADDREF_P(array_ptr);
}
}
@@ -4168,10 +4371,15 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
if (ce && ce->get_iterator) {
iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
+ if (OP1_TYPE == IS_VAR && !(opline->extended_value & ZEND_FE_RESET_VARIABLE)) {
+ FREE_OP1_IF_VAR();
+ }
if (iter && EXPECTED(EG(exception) == NULL)) {
array_ptr = zend_iterator_wrap(iter TSRMLS_CC);
} else {
- FREE_OP1_IF_VAR();
+ if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ FREE_OP1_VAR_PTR();
+ }
if (!EG(exception)) {
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name);
}
@@ -4188,14 +4396,18 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
iter->funcs->rewind(iter TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(&array_ptr);
- FREE_OP1_IF_VAR();
+ if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ FREE_OP1_VAR_PTR();
+ }
HANDLE_EXCEPTION();
}
}
is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS;
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(&array_ptr);
- FREE_OP1_IF_VAR();
+ if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ FREE_OP1_VAR_PTR();
+ }
HANDLE_EXCEPTION();
}
iter->index = -1; /* will be set to 0 before using next handler */
@@ -4225,7 +4437,9 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
is_empty = 1;
}
- FREE_OP1_IF_VAR();
+ if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ FREE_OP1_VAR_PTR();
+ }
if (is_empty) {
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
} else {
@@ -4357,7 +4571,7 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
Z_ADDREF_PP(value);
} else {
PZVAL_LOCK(*value);
- AI_SET_PTR(&EX_T(opline->result.var), *value);
+ EX_T(opline->result.var).var.ptr = *value;
}
CHECK_EXCEPTION();
@@ -4462,7 +4676,6 @@ ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST|
SAVE_OPLINE();
container = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_IS);
-
offset = GET_OP2_ZVAL_PTR(BP_VAR_R);
if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
@@ -4489,11 +4702,7 @@ ZEND_VM_C_LABEL(num_index_prop):
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, ZEND_VM_C_GOTO(num_index_prop));
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
isset = 1;
@@ -4586,7 +4795,7 @@ ZEND_VM_C_LABEL(num_index_prop):
Z_LVAL(EX_T(opline->result.var).tmp_var) = !result;
}
- FREE_OP1_VAR_PTR();
+ FREE_OP1_IF_VAR();
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -5001,7 +5210,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
{
zend_uint op_num = EG(opline_before_exception)-EG(active_op_array)->opcodes;
int i;
- zend_uint catch_op_num = 0, finally_op_num = 0;
+ zend_uint catch_op_num = 0, finally_op_num = 0, finally_op_end = 0;
void **stack_frame;
/* Figure out where the next stack frame (which maybe contains pushed
@@ -5026,6 +5235,10 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
if (op_num < EG(active_op_array)->try_catch_array[i].finally_op) {
finally_op_num = EX(op_array)->try_catch_array[i].finally_op;
}
+ if (op_num >= EG(active_op_array)->try_catch_array[i].finally_op &&
+ op_num < EG(active_op_array)->try_catch_array[i].finally_end) {
+ finally_op_end = EG(active_op_array)->try_catch_array[i].finally_end;
+ }
}
if (EX(call) >= EX(call_slots)) {
@@ -5091,14 +5304,29 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
EX(old_error_reporting) = NULL;
if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) {
- zend_exception_save(TSRMLS_C);
+ if (EX(delayed_exception)) {
+ zend_exception_set_previous(EG(exception), EX(delayed_exception) TSRMLS_CC);
+ }
+ EX(delayed_exception) = EG(exception);
+ EG(exception) = NULL;
EX(fast_ret) = NULL;
ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[finally_op_num]);
ZEND_VM_CONTINUE();
} else if (catch_op_num) {
+ if (finally_op_end && catch_op_num > finally_op_end) {
+ /* we are going out of current finally scope */
+ if (EX(delayed_exception)) {
+ zend_exception_set_previous(EG(exception), EX(delayed_exception) TSRMLS_CC);
+ EX(delayed_exception) = NULL;
+ }
+ }
ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]);
ZEND_VM_CONTINUE();
} else {
+ if (EX(delayed_exception)) {
+ zend_exception_set_previous(EG(exception), EX(delayed_exception) TSRMLS_CC);
+ EX(delayed_exception) = NULL;
+ }
if (UNEXPECTED((EX(op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0)) {
ZEND_VM_DISPATCH_TO_HANDLER(ZEND_GENERATOR_RETURN);
} else {
@@ -5158,23 +5386,29 @@ ZEND_VM_HANDLER(143, ZEND_DECLARE_CONST, CONST, CONST)
name = GET_OP1_ZVAL_PTR(BP_VAR_R);
val = GET_OP2_ZVAL_PTR(BP_VAR_R);
- if ((Z_TYPE_P(val) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT || Z_TYPE_P(val) == IS_CONSTANT_ARRAY) {
+ if (IS_CONSTANT_TYPE(Z_TYPE_P(val))) {
zval tmp;
zval *tmp_ptr = &tmp;
ZVAL_COPY_VALUE(&tmp, val);
- if (Z_TYPE_P(val) == IS_CONSTANT_ARRAY) {
- zval_copy_ctor(&tmp);
- }
INIT_PZVAL(&tmp);
- zval_update_constant(&tmp_ptr, NULL TSRMLS_CC);
+ zval_update_constant(&tmp_ptr, 0 TSRMLS_CC);
c.value = *tmp_ptr;
} else {
INIT_PZVAL_COPY(&c.value, val);
- zval_copy_ctor(&c.value);
+ if (Z_TYPE(c.value) == IS_ARRAY) {
+ HashTable *ht;
+
+ ALLOC_HASHTABLE(ht);
+ zend_hash_init(ht, zend_hash_num_elements(Z_ARRVAL(c.value)), NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_copy(ht, Z_ARRVAL(c.value), (copy_ctor_func_t) zval_deep_copy, NULL, sizeof(zval *));
+ Z_ARRVAL(c.value) = ht;
+ } else {
+ zval_copy_ctor(&c.value);
+ }
}
c.flags = CONST_CS; /* non persistent, case sensetive */
- c.name = IS_INTERNED(Z_STRVAL_P(name)) ? Z_STRVAL_P(name) : zend_strndup(Z_STRVAL_P(name), Z_STRLEN_P(name));
+ c.name = str_strndup(Z_STRVAL_P(name), Z_STRLEN_P(name));
c.name_len = Z_STRLEN_P(name)+1;
c.module_number = PHP_USER_CONSTANT;
@@ -5298,14 +5532,14 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE
generator->value = *value_ptr;
}
- FREE_OP1_IF_VAR();
+ FREE_OP1_VAR_PTR();
}
} else {
zval *value = GET_OP1_ZVAL_PTR(BP_VAR_R);
/* Consts, temporary variables and references need copying */
if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -5318,12 +5552,13 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE
}
generator->value = copy;
+ FREE_OP1_IF_VAR();
} else {
- Z_ADDREF_P(value);
+ if (OP1_TYPE == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
- FREE_OP1_IF_VAR();
}
} else {
/* If no value was specified yield null */
@@ -5394,10 +5629,10 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE
ZEND_VM_HANDLER(159, ZEND_DISCARD_EXCEPTION, ANY, ANY)
{
- if (EG(prev_exception) != NULL) {
+ if (EX(delayed_exception) != NULL) {
/* discard the previously thrown exception */
- zval_ptr_dtor(&EG(prev_exception));
- EG(prev_exception) = NULL;
+ zval_ptr_dtor(&EX(delayed_exception));
+ EX(delayed_exception) = NULL;
}
ZEND_VM_NEXT_OPCODE();
@@ -5414,6 +5649,7 @@ ZEND_VM_HANDLER(162, ZEND_FAST_CALL, ANY, ANY)
ZEND_VM_CONTINUE();
}
EX(fast_ret) = opline;
+ EX(delayed_exception) = NULL;
ZEND_VM_SET_OPCODE(opline->op1.jmp_addr);
ZEND_VM_CONTINUE();
}
@@ -5433,18 +5669,39 @@ ZEND_VM_HANDLER(163, ZEND_FAST_RET, ANY, ANY)
if (opline->extended_value == ZEND_FAST_RET_TO_FINALLY) {
ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE();
- } else if (opline->extended_value == ZEND_FAST_RET_TO_CATCH) {
- zend_exception_restore(TSRMLS_C);
- ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
- ZEND_VM_CONTINUE();
- } else if (UNEXPECTED((EX(op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0)) {
- zend_exception_restore(TSRMLS_C);
- ZEND_VM_DISPATCH_TO_HANDLER(ZEND_GENERATOR_RETURN);
} else {
- zend_exception_restore(TSRMLS_C);
- ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
+ EG(exception) = EX(delayed_exception);
+ EX(delayed_exception) = NULL;
+ if (opline->extended_value == ZEND_FAST_RET_TO_CATCH) {
+ ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
+ ZEND_VM_CONTINUE();
+ } else if (UNEXPECTED((EX(op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0)) {
+ ZEND_VM_DISPATCH_TO_HANDLER(ZEND_GENERATOR_RETURN);
+ } else {
+ ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
+ }
}
}
}
+ZEND_VM_HANDLER(166, ZEND_POW, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
+{
+ USE_OPLINE
+ zend_free_op free_op1, free_op2;
+
+ SAVE_OPLINE();
+ pow_function(&EX_T(opline->result.var).tmp_var,
+ GET_OP1_ZVAL_PTR(BP_VAR_R),
+ GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
+ FREE_OP1();
+ FREE_OP2();
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
+ZEND_VM_HANDLER(167, ZEND_ASSIGN_POW, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV)
+{
+ ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op,pow_function);
+}
+
ZEND_VM_EXPORT_HELPER(zend_do_fcall, zend_do_fcall_common_helper)
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 6ab02321d5..1f5e55f40d 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -396,7 +396,7 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
EG(current_execute_data) = EX(prev_execute_data);
EG(opline_ptr) = NULL;
if (!EG(active_symbol_table)) {
- i_free_compiled_variables(execute_data);
+ i_free_compiled_variables(execute_data TSRMLS_CC);
}
zend_vm_stack_free((char*)execute_data - (ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T) TSRMLS_CC);
@@ -459,7 +459,7 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
EX(call)--;
- zend_vm_stack_clear_multiple(1 TSRMLS_CC);
+ zend_vm_stack_clear_multiple(0 TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
zend_throw_exception_internal(NULL TSRMLS_CC);
@@ -481,20 +481,22 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
USE_OPLINE
zend_bool should_change_scope = 0;
zend_function *fbc = EX(function_state).function;
+ zend_uint num_args;
SAVE_OPLINE();
EX(object) = EX(call)->object;
if (UNEXPECTED((fbc->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) != 0)) {
if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_ABSTRACT) != 0)) {
zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", fbc->common.scope->name, fbc->common.function_name);
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE(); /* Never reached */
}
if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) {
zend_error(E_DEPRECATED, "Function %s%s%s() is deprecated",
fbc->common.scope ? fbc->common.scope->name : "",
fbc->common.scope ? "::" : "",
fbc->common.function_name);
+ if (UNEXPECTED(EG(exception) != NULL)) {
+ HANDLE_EXCEPTION();
+ }
}
}
if (fbc->common.scope &&
@@ -504,6 +506,9 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* FIXME: output identifiers properly */
zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically", fbc->common.scope->name, fbc->common.function_name);
+ if (UNEXPECTED(EG(exception) != NULL)) {
+ HANDLE_EXCEPTION();
+ }
} else {
/* FIXME: output identifiers properly */
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
@@ -521,19 +526,22 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
EG(called_scope) = EX(call)->called_scope;
}
- EX(function_state).arguments = zend_vm_stack_top(TSRMLS_C);
- zend_vm_stack_push((void*)(zend_uintptr_t)opline->extended_value TSRMLS_CC);
+ num_args = opline->extended_value + EX(call)->num_additional_args;
+ if (EX(call)->num_additional_args) {
+ EX(function_state).arguments = zend_vm_stack_push_args(num_args TSRMLS_CC);
+ } else {
+ EX(function_state).arguments = zend_vm_stack_top(TSRMLS_C);
+ zend_vm_stack_push((void*)(zend_uintptr_t) num_args TSRMLS_CC);
+ }
LOAD_OPLINE();
if (fbc->type == ZEND_INTERNAL_FUNCTION) {
- if (fbc->common.arg_info) {
- zend_uint i=0;
- zval **p = (zval**)EX(function_state).arguments;
- ulong arg_count = opline->extended_value;
+ if (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) {
+ zend_uint i;
+ void **p = EX(function_state).arguments - num_args;
- while (arg_count>0) {
- zend_verify_arg_type(fbc, ++i, *(p-arg_count), 0 TSRMLS_CC);
- arg_count--;
+ for (i = 0; i < num_args; ++i, ++p) {
+ zend_verify_arg_type(fbc, i + 1, (zval *) *p, 0, NULL TSRMLS_CC);
}
}
@@ -547,7 +555,7 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
if (!zend_execute_internal) {
/* saves one function call if zend_execute_internal is not used */
- fbc->internal_function.handler(opline->extended_value, ret->var.ptr, (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? &ret->var.ptr : NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
+ fbc->internal_function.handler(num_args, ret->var.ptr, &ret->var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
} else {
zend_execute_internal(execute_data, NULL, RETURN_VALUE_USED(opline) TSRMLS_CC);
}
@@ -597,7 +605,7 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
/* Not sure what should be done here if it's a static method */
if (EXPECTED(EX(object) != NULL)) {
- Z_OBJ_HT_P(EX(object))->call_method(fbc->common.function_name, opline->extended_value, EX_T(opline->result.var).var.ptr, &EX_T(opline->result.var).var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
+ Z_OBJ_HT_P(EX(object))->call_method(fbc->common.function_name, num_args, EX_T(opline->result.var).var.ptr, &EX_T(opline->result.var).var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
} else {
zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object");
}
@@ -639,7 +647,7 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
EX(call)--;
- zend_vm_stack_clear_multiple(1 TSRMLS_CC);
+ zend_vm_stack_clear_multiple(0 TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
zend_throw_exception_internal(NULL TSRMLS_CC);
@@ -697,6 +705,154 @@ static int ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_HANDLER(ZEND_OPCODE_HANDLER
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_SEND_UNPACK_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+ zend_free_op free_op1;
+ zval *args;
+ int arg_num;
+ SAVE_OPLINE();
+
+ args = get_zval_ptr(opline->op1_type, &opline->op1, execute_data, &free_op1, BP_VAR_R);
+ arg_num = opline->op2.num + EX(call)->num_additional_args + 1;
+
+ switch (Z_TYPE_P(args)) {
+ case IS_ARRAY: {
+ HashTable *ht = Z_ARRVAL_P(args);
+ HashPosition pos;
+ zval **arg_ptr, *arg;
+
+ ZEND_VM_STACK_GROW_IF_NEEDED(zend_hash_num_elements(ht));
+
+ for (zend_hash_internal_pointer_reset_ex(ht, &pos);
+ zend_hash_get_current_data_ex(ht, (void **) &arg_ptr, &pos) == SUCCESS;
+ zend_hash_move_forward_ex(ht, &pos), ++arg_num
+ ) {
+ char *name;
+ zend_uint name_len;
+ zend_ulong index;
+
+ if (zend_hash_get_current_key_ex(ht, &name, &name_len, &index, 0, &pos) == HASH_KEY_IS_STRING) {
+ zend_error(E_RECOVERABLE_ERROR, "Cannot unpack array with string keys");
+ FREE_OP(free_op1);
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+ }
+
+ if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
+ SEPARATE_ZVAL_TO_MAKE_IS_REF(arg_ptr);
+ arg = *arg_ptr;
+ Z_ADDREF_P(arg);
+ } else if (Z_ISREF_PP(arg_ptr)) {
+ ALLOC_ZVAL(arg);
+ MAKE_COPY_ZVAL(arg_ptr, arg);
+ } else {
+ arg = *arg_ptr;
+ Z_ADDREF_P(arg);
+ }
+
+ zend_vm_stack_push(arg TSRMLS_CC);
+ EX(call)->num_additional_args++;
+ }
+ break;
+ }
+ case IS_OBJECT: {
+ zend_class_entry *ce = Z_OBJCE_P(args);
+ zend_object_iterator *iter;
+
+ if (!ce || !ce->get_iterator) {
+ zend_error(E_WARNING, "Only arrays and Traversables can be unpacked");
+ break;
+ }
+
+ iter = ce->get_iterator(ce, args, 0 TSRMLS_CC);
+ if (UNEXPECTED(!iter)) {
+ FREE_OP(free_op1);
+ if (!EG(exception)) {
+ zend_throw_exception_ex(
+ NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name
+ );
+ }
+ HANDLE_EXCEPTION();
+ }
+
+ if (iter->funcs->rewind) {
+ iter->funcs->rewind(iter TSRMLS_CC);
+ if (UNEXPECTED(EG(exception) != NULL)) {
+ goto unpack_iter_dtor;
+ }
+ }
+
+ for (; iter->funcs->valid(iter TSRMLS_CC) == SUCCESS; ++arg_num) {
+ zval **arg_ptr, *arg;
+
+ if (UNEXPECTED(EG(exception) != NULL)) {
+ goto unpack_iter_dtor;
+ }
+
+ iter->funcs->get_current_data(iter, &arg_ptr TSRMLS_CC);
+ if (UNEXPECTED(EG(exception) != NULL)) {
+ goto unpack_iter_dtor;
+ }
+
+ if (iter->funcs->get_current_key) {
+ zval key;
+ iter->funcs->get_current_key(iter, &key TSRMLS_CC);
+ if (UNEXPECTED(EG(exception) != NULL)) {
+ goto unpack_iter_dtor;
+ }
+
+ if (Z_TYPE(key) == IS_STRING) {
+ zend_error(E_RECOVERABLE_ERROR,
+ "Cannot unpack Traversable with string keys");
+ zval_dtor(&key);
+ goto unpack_iter_dtor;
+ }
+
+ zval_dtor(&key);
+ }
+
+ if (ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
+ zend_error(
+ E_WARNING, "Cannot pass by-reference argument %d of %s%s%s()"
+ " by unpacking a Traversable, passing by-value instead", arg_num,
+ EX(call)->fbc->common.scope ? EX(call)->fbc->common.scope->name : "",
+ EX(call)->fbc->common.scope ? "::" : "",
+ EX(call)->fbc->common.function_name
+ );
+ }
+
+ if (Z_ISREF_PP(arg_ptr)) {
+ ALLOC_ZVAL(arg);
+ MAKE_COPY_ZVAL(arg_ptr, arg);
+ } else {
+ arg = *arg_ptr;
+ Z_ADDREF_P(arg);
+ }
+
+ ZEND_VM_STACK_GROW_IF_NEEDED(1);
+ zend_vm_stack_push(arg TSRMLS_CC);
+ EX(call)->num_additional_args++;
+
+ iter->funcs->move_forward(iter TSRMLS_CC);
+ if (UNEXPECTED(EG(exception) != NULL)) {
+ goto unpack_iter_dtor;
+ }
+ }
+
+unpack_iter_dtor:
+ iter->funcs->dtor(iter TSRMLS_CC);
+ break;
+ }
+ default:
+ zend_error(E_WARNING, "Only arrays and Traversables can be unpacked");
+ }
+
+ FREE_OP(free_op1);
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
static int ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -705,7 +861,7 @@ static int ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
if (UNEXPECTED(param == NULL)) {
- if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value TSRMLS_CC)) {
+ if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value, NULL TSRMLS_CC)) {
const char *space;
const char *class_name;
zend_execute_data *ptr;
@@ -727,7 +883,7 @@ static int ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
zval **var_ptr;
- zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC);
+ zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value, NULL TSRMLS_CC);
var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
Z_DELREF_PP(var_ptr);
*var_ptr = *param;
@@ -738,6 +894,37 @@ static int ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ZEND_VM_NEXT_OPCODE();
}
+static int ZEND_FASTCALL ZEND_RECV_VARIADIC_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+ zend_uint arg_num = opline->op1.num;
+ zend_uint arg_count = zend_vm_stack_get_args_count(TSRMLS_C);
+ zval **var_ptr, *params;
+
+ SAVE_OPLINE();
+
+ var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
+ Z_DELREF_PP(var_ptr);
+ MAKE_STD_ZVAL(params);
+ *var_ptr = params;
+
+ if (arg_num <= arg_count) {
+ array_init_size(params, arg_count - arg_num + 1);
+ } else {
+ array_init(params);
+ }
+
+ for (; arg_num <= arg_count; ++arg_num) {
+ zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC);
+ zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value, NULL TSRMLS_CC);
+ zend_hash_next_index_insert(Z_ARRVAL_P(params), param, sizeof(zval *), NULL);
+ Z_ADDREF_PP(param);
+ }
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
static int ZEND_FASTCALL ZEND_NEW_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -779,6 +966,7 @@ static int ZEND_FASTCALL ZEND_NEW_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
call->fbc = constructor;
call->object = object_zval;
call->called_scope = EX_T(opline->op1.var).class_entry;
+ call->num_additional_args = 0;
call->is_ctor_call = 1;
call->is_ctor_result_used = RETURN_VALUE_USED(opline);
EX(call) = call;
@@ -981,7 +1169,7 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
{
zend_uint op_num = EG(opline_before_exception)-EG(active_op_array)->opcodes;
int i;
- zend_uint catch_op_num = 0, finally_op_num = 0;
+ zend_uint catch_op_num = 0, finally_op_num = 0, finally_op_end = 0;
void **stack_frame;
/* Figure out where the next stack frame (which maybe contains pushed
@@ -1006,6 +1194,10 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
if (op_num < EG(active_op_array)->try_catch_array[i].finally_op) {
finally_op_num = EX(op_array)->try_catch_array[i].finally_op;
}
+ if (op_num >= EG(active_op_array)->try_catch_array[i].finally_op &&
+ op_num < EG(active_op_array)->try_catch_array[i].finally_end) {
+ finally_op_end = EG(active_op_array)->try_catch_array[i].finally_end;
+ }
}
if (EX(call) >= EX(call_slots)) {
@@ -1071,14 +1263,29 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
EX(old_error_reporting) = NULL;
if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) {
- zend_exception_save(TSRMLS_C);
+ if (EX(delayed_exception)) {
+ zend_exception_set_previous(EG(exception), EX(delayed_exception) TSRMLS_CC);
+ }
+ EX(delayed_exception) = EG(exception);
+ EG(exception) = NULL;
EX(fast_ret) = NULL;
ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[finally_op_num]);
ZEND_VM_CONTINUE();
} else if (catch_op_num) {
+ if (finally_op_end && catch_op_num > finally_op_end) {
+ /* we are going out of current finally scope */
+ if (EX(delayed_exception)) {
+ zend_exception_set_previous(EG(exception), EX(delayed_exception) TSRMLS_CC);
+ EX(delayed_exception) = NULL;
+ }
+ }
ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]);
ZEND_VM_CONTINUE();
} else {
+ if (EX(delayed_exception)) {
+ zend_exception_set_previous(EG(exception), EX(delayed_exception) TSRMLS_CC);
+ EX(delayed_exception) = NULL;
+ }
if (UNEXPECTED((EX(op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0)) {
return ZEND_GENERATOR_RETURN_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else {
@@ -1128,10 +1335,10 @@ static int ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS
static int ZEND_FASTCALL ZEND_DISCARD_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- if (EG(prev_exception) != NULL) {
+ if (EX(delayed_exception) != NULL) {
/* discard the previously thrown exception */
- zval_ptr_dtor(&EG(prev_exception));
- EG(prev_exception) = NULL;
+ zval_ptr_dtor(&EX(delayed_exception));
+ EX(delayed_exception) = NULL;
}
ZEND_VM_NEXT_OPCODE();
@@ -1148,6 +1355,7 @@ static int ZEND_FASTCALL ZEND_FAST_CALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ZEND_VM_CONTINUE();
}
EX(fast_ret) = opline;
+ EX(delayed_exception) = NULL;
ZEND_VM_SET_OPCODE(opline->op1.jmp_addr);
ZEND_VM_CONTINUE();
}
@@ -1167,16 +1375,17 @@ static int ZEND_FASTCALL ZEND_FAST_RET_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (opline->extended_value == ZEND_FAST_RET_TO_FINALLY) {
ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE();
- } else if (opline->extended_value == ZEND_FAST_RET_TO_CATCH) {
- zend_exception_restore(TSRMLS_C);
- ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
- ZEND_VM_CONTINUE();
- } else if (UNEXPECTED((EX(op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0)) {
- zend_exception_restore(TSRMLS_C);
- return ZEND_GENERATOR_RETURN_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else {
- zend_exception_restore(TSRMLS_C);
- return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ EG(exception) = EX(delayed_exception);
+ EX(delayed_exception) = NULL;
+ if (opline->extended_value == ZEND_FAST_RET_TO_CATCH) {
+ ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
+ ZEND_VM_CONTINUE();
+ } else if (UNEXPECTED((EX(op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0)) {
+ return ZEND_GENERATOR_RETURN_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ } else {
+ return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ }
}
}
}
@@ -1236,10 +1445,13 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE
} else {
CACHE_PTR(opline->op2.literal->cache_slot, call->fbc);
}
+
call->object = NULL;
call->called_scope = NULL;
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
+
/*CHECK_EXCEPTION();*/
ZEND_VM_NEXT_OPCODE();
} else {
@@ -1266,8 +1478,10 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE
call->object = NULL;
call->called_scope = NULL;
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else if (IS_CONST != IS_CONST && IS_CONST != IS_TMP_VAR &&
@@ -1277,15 +1491,18 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE
if (call->object) {
Z_ADDREF_P(call->object);
}
- if (IS_CONST == IS_VAR && 0 &&
+ if (IS_CONST == IS_VAR && 0 && Z_REFCOUNT_P(function_name) == 1 &&
call->fbc->common.fn_flags & ZEND_ACC_CLOSURE) {
/* Delay closure destruction until its invocation */
call->fbc->common.prototype = (zend_function*)function_name;
} else {
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else if (IS_CONST != IS_CONST &&
@@ -1351,6 +1568,8 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE
if (UNEXPECTED(call->fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, Z_STRVAL_PP(method));
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -1390,7 +1609,9 @@ static int ZEND_FASTCALL ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPC
call->object = NULL;
call->called_scope = NULL;
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
+
EX(call) = call;
ZEND_VM_NEXT_OPCODE();
}
@@ -1407,10 +1628,16 @@ static int ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_
if (param == NULL) {
ALLOC_ZVAL(assignment_value);
*assignment_value = *opline->op2.zv;
- if ((Z_TYPE_P(assignment_value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT ||
- Z_TYPE_P(assignment_value)==IS_CONSTANT_ARRAY) {
+ if (IS_CONSTANT_TYPE(Z_TYPE_P(assignment_value))) {
Z_SET_REFCOUNT_P(assignment_value, 1);
zval_update_constant(&assignment_value, 0 TSRMLS_CC);
+ } else if (Z_TYPE_P(assignment_value) == IS_ARRAY) {
+ HashTable *ht;
+
+ ALLOC_HASHTABLE(ht);
+ zend_hash_init(ht, zend_hash_num_elements(Z_ARRVAL_P(assignment_value)), NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_copy(ht, Z_ARRVAL_P(assignment_value), (copy_ctor_func_t) zval_deep_copy, NULL, sizeof(zval *));
+ Z_ARRVAL_P(assignment_value) = ht;
} else {
zval_copy_ctor(assignment_value);
}
@@ -1420,7 +1647,7 @@ static int ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_
Z_ADDREF_P(assignment_value);
}
- zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC);
+ zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value, opline->op2.zv TSRMLS_CC);
var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
zval_ptr_dtor(var_ptr);
*var_ptr = assignment_value;
@@ -1561,10 +1788,13 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H
} else {
CACHE_PTR(opline->op2.literal->cache_slot, call->fbc);
}
+
call->object = NULL;
call->called_scope = NULL;
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
+
/*CHECK_EXCEPTION();*/
ZEND_VM_NEXT_OPCODE();
} else {
@@ -1589,10 +1819,13 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H
}
efree(lcname);
zval_dtor(free_op2.var);
+
call->object = NULL;
call->called_scope = NULL;
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else if (IS_TMP_VAR != IS_CONST && IS_TMP_VAR != IS_TMP_VAR &&
@@ -1602,15 +1835,18 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H
if (call->object) {
Z_ADDREF_P(call->object);
}
- if (IS_TMP_VAR == IS_VAR && 1 &&
+ if (IS_TMP_VAR == IS_VAR && 1 && Z_REFCOUNT_P(function_name) == 1 &&
call->fbc->common.fn_flags & ZEND_ACC_CLOSURE) {
/* Delay closure destruction until its invocation */
call->fbc->common.prototype = (zend_function*)function_name;
} else {
zval_dtor(free_op2.var);
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else if (IS_TMP_VAR != IS_CONST &&
@@ -1676,8 +1912,11 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H
if (UNEXPECTED(call->fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, Z_STRVAL_PP(method));
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
+
zval_dtor(free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -1726,7 +1965,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_
zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string");
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -1748,10 +1987,13 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H
} else {
CACHE_PTR(opline->op2.literal->cache_slot, call->fbc);
}
+
call->object = NULL;
call->called_scope = NULL;
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
+
/*CHECK_EXCEPTION();*/
ZEND_VM_NEXT_OPCODE();
} else {
@@ -1775,11 +2017,14 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H
zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval);
}
efree(lcname);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
+
call->object = NULL;
call->called_scope = NULL;
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else if (IS_VAR != IS_CONST && IS_VAR != IS_TMP_VAR &&
@@ -1789,15 +2034,18 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H
if (call->object) {
Z_ADDREF_P(call->object);
}
- if (IS_VAR == IS_VAR && (free_op2.var != NULL) &&
+ if (IS_VAR == IS_VAR && (free_op2.var != NULL) && Z_REFCOUNT_P(function_name) == 1 &&
call->fbc->common.fn_flags & ZEND_ACC_CLOSURE) {
/* Delay closure destruction until its invocation */
call->fbc->common.prototype = (zend_function*)function_name;
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else if (IS_VAR != IS_CONST &&
@@ -1863,9 +2111,12 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H
if (UNEXPECTED(call->fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, Z_STRVAL_PP(method));
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else {
@@ -1973,10 +2224,13 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA
} else {
CACHE_PTR(opline->op2.literal->cache_slot, call->fbc);
}
+
call->object = NULL;
call->called_scope = NULL;
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
+
/*CHECK_EXCEPTION();*/
ZEND_VM_NEXT_OPCODE();
} else {
@@ -2003,8 +2257,10 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA
call->object = NULL;
call->called_scope = NULL;
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else if (IS_CV != IS_CONST && IS_CV != IS_TMP_VAR &&
@@ -2014,15 +2270,18 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA
if (call->object) {
Z_ADDREF_P(call->object);
}
- if (IS_CV == IS_VAR && 0 &&
+ if (IS_CV == IS_VAR && 0 && Z_REFCOUNT_P(function_name) == 1 &&
call->fbc->common.fn_flags & ZEND_ACC_CLOSURE) {
/* Delay closure destruction until its invocation */
call->fbc->common.prototype = (zend_function*)function_name;
} else {
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else if (IS_CV != IS_CONST &&
@@ -2088,6 +2347,8 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA
if (UNEXPECTED(call->fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, Z_STRVAL_PP(method));
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -2327,9 +2588,11 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
} else {
CACHE_PTR(opline->op1.literal->cache_slot, EX(function_state).function);
}
+
call->fbc = EX(function_state).function;
call->object = NULL;
call->called_scope = NULL;
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -2346,9 +2609,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
retval_ptr = opline->op1.zv;
if (!EG(return_value_ptr_ptr)) {
- if (IS_CONST == IS_TMP_VAR) {
- }
} else {
if (IS_CONST == IS_CONST ||
IS_CONST == IS_TMP_VAR ||
@@ -2361,18 +2622,23 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
zval_copy_ctor(ret);
}
*EG(return_value_ptr_ptr) = ret;
+
} else if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) &&
retval_ptr == &EG(uninitialized_zval)) {
zval *ret;
+ if (IS_CONST == IS_VAR) {
+ Z_DELREF_P(retval_ptr);
+ }
ALLOC_INIT_ZVAL(ret);
*EG(return_value_ptr_ptr) = ret;
} else {
*EG(return_value_ptr_ptr) = retval_ptr;
- Z_ADDREF_P(retval_ptr);
+ if (IS_CONST == IS_CV) {
+ Z_ADDREF_P(retval_ptr);
+ }
}
}
-
return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
@@ -2386,7 +2652,8 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
do {
- if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
+ if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR ||
+ (IS_CONST == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) {
/* Not supposed to happen, but we'll allow it */
zend_error(E_NOTICE, "Only variable references should be returned by reference");
@@ -2482,10 +2749,12 @@ static int ZEND_FASTCALL ZEND_SEND_VAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
USE_OPLINE
SAVE_OPLINE();
- if (opline->extended_value==ZEND_DO_FCALL_BY_NAME
- && ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
- zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.opline_num);
+ if (opline->extended_value == ZEND_DO_FCALL_BY_NAME) {
+ if (ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
+ zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.num);
+ }
}
+
{
zval *valptr;
zval *value;
@@ -2577,7 +2846,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(&retval);
} else {
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
}
@@ -2735,7 +3004,6 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
EX(original_return_value) = EG(return_value_ptr_ptr);
EG(active_op_array) = new_op_array;
if (RETURN_VALUE_USED(opline)) {
- EX_T(opline->result.var).var.ptr = NULL;
EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
EG(return_value_ptr_ptr) = EX_T(opline->result.var).var.ptr_ptr;
} else {
@@ -2773,7 +3041,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
ALLOC_ZVAL(retval);
ZVAL_BOOL(retval, failure_retval);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
ZEND_VM_NEXT_OPCODE();
}
@@ -2835,19 +3103,27 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
if (!ce || !ce->get_iterator) {
- Z_ADDREF_P(array_ptr);
+ if (IS_CONST == IS_CV) {
+ Z_ADDREF_P(array_ptr);
+ }
}
} else if (IS_CONST == IS_CONST ||
- ((IS_CONST == IS_CV || IS_CONST == IS_VAR) &&
+ (IS_CONST == IS_CV &&
!Z_ISREF_P(array_ptr) &&
- Z_REFCOUNT_P(array_ptr) > 1)) {
+ Z_REFCOUNT_P(array_ptr) > 1) ||
+ (IS_CONST == IS_VAR &&
+ !Z_ISREF_P(array_ptr) &&
+ Z_REFCOUNT_P(array_ptr) > 2)) {
zval *tmp;
+ if (IS_CONST == IS_VAR) {
+ Z_DELREF_P(array_ptr);
+ }
ALLOC_ZVAL(tmp);
INIT_PZVAL_COPY(tmp, array_ptr);
zval_copy_ctor(tmp);
array_ptr = tmp;
- } else {
+ } else if (IS_CONST == IS_CV) {
Z_ADDREF_P(array_ptr);
}
}
@@ -2855,10 +3131,15 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
if (ce && ce->get_iterator) {
iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
+ if (IS_CONST == IS_VAR && !(opline->extended_value & ZEND_FE_RESET_VARIABLE)) {
+
+ }
if (iter && EXPECTED(EG(exception) == NULL)) {
array_ptr = zend_iterator_wrap(iter TSRMLS_CC);
} else {
+ if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ }
if (!EG(exception)) {
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name);
}
@@ -2875,14 +3156,18 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
iter->funcs->rewind(iter TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(&array_ptr);
+ if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ }
HANDLE_EXCEPTION();
}
}
is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS;
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(&array_ptr);
+ if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ }
HANDLE_EXCEPTION();
}
iter->index = -1; /* will be set to 0 before using next handler */
@@ -2912,6 +3197,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
is_empty = 1;
}
+ if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+
+ }
if (is_empty) {
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
} else {
@@ -3377,10 +3665,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_CONST(int type
*/
if (IS_CONST == IS_CONST) {
hash_value = Z_HASH_P(varname);
- } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
- hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
} else {
- hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
+ hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname));
}
if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
@@ -3412,7 +3698,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_CONST(int type
break;
case ZEND_FETCH_STATIC:
- zval_update_constant(retval, (void*) 1 TSRMLS_CC);
+ zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_CONST == IS_VAR && !free_op1.var) {
@@ -3433,7 +3719,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_CONST(int type
switch (type) {
case BP_VAR_R:
case BP_VAR_IS:
- AI_SET_PTR(&EX_T(opline->result.var), *retval);
+ EX_T(opline->result.var).var.ptr = *retval;
break;
case BP_VAR_UNSET: {
zend_free_op free_res;
@@ -3473,7 +3759,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
{
USE_OPLINE
- return zend_fetch_var_address_helper_SPEC_CONST_CONST(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ return zend_fetch_var_address_helper_SPEC_CONST_CONST(zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC) ? BP_VAR_W : BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -3493,14 +3779,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_
zval *container;
SAVE_OPLINE();
-
- if (IS_CONST == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
container = opline->op1.zv;
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
+ if (IS_CONST != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
+ }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -3516,13 +3800,13 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_TMP_VAR_SPEC_CONST_CONST_HANDLER(ZEND_O
if (UNEXPECTED(Z_TYPE_P(container) != IS_ARRAY)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
} else {
zval *value = *zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
CHECK_EXCEPTION();
@@ -3634,7 +3918,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
+ zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
} else {
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
@@ -3645,6 +3929,8 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(
call->called_scope = Z_OBJCE_P(call->object);
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -3658,9 +3944,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
- if (IS_CONST==IS_VAR) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
is_equal_function(&EX_T(opline->result.var).tmp_var,
opline->op1.zv,
opline->op2.zv TSRMLS_CC);
@@ -3702,8 +3985,6 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
retval = &EX_T(opline->result.var).tmp_var;
ZVAL_COPY_VALUE(retval, &c->value);
zval_copy_ctor(retval);
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
} else {
/* class constant */
zend_class_entry *ce;
@@ -3714,8 +3995,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
value = CACHED_PTR(opline->op2.literal->cache_slot);
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
+ goto constant_fetch_end;
} else if (CACHED_PTR(opline->op1.literal->cache_slot)) {
ce = CACHED_PTR(opline->op1.literal->cache_slot);
} else {
@@ -3733,18 +4013,16 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
if ((value = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce)) != NULL) {
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
+ goto constant_fetch_end;
}
}
if (EXPECTED(zend_hash_quick_find(&ce->constants_table, Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv)+1, Z_HASH_P(opline->op2.zv), (void **) &value) == SUCCESS)) {
- if (Z_TYPE_PP(value) == IS_CONSTANT_ARRAY ||
- (Z_TYPE_PP(value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
+ if (IS_CONSTANT_TYPE(Z_TYPE_PP(value))) {
zend_class_entry *old_scope = EG(scope);
EG(scope) = ce;
- zval_update_constant(value, (void *) 1 TSRMLS_CC);
+ zval_update_constant(value, 1 TSRMLS_CC);
EG(scope) = old_scope;
}
if (IS_CONST == IS_CONST) {
@@ -3754,16 +4032,16 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
}
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
- } else if (Z_STRLEN_P(opline->op2.zv) == sizeof("class")-1 && strcmp(Z_STRVAL_P(opline->op2.zv), "class") == 0) {
+ } else if (Z_STRLEN_P(opline->op2.zv) == sizeof("class")-1 && memcmp(Z_STRVAL_P(opline->op2.zv), "class", sizeof("class") - 1) == 0) {
/* "class" is assigned as a case-sensitive keyword from zend_do_resolve_class_name */
ZVAL_STRINGL(&EX_T(opline->result.var).tmp_var, ce->name, ce->name_length, 1);
} else {
zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
}
-
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
}
+constant_fetch_end:
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -3797,7 +4075,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_O
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
- } else {
+
+ } else if (IS_CONST == IS_CV) {
Z_ADDREF_P(expr_ptr);
}
}
@@ -3822,11 +4101,7 @@ num_index:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -3845,8 +4120,6 @@ num_index:
}
if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) {
- } else {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -4041,23 +4314,29 @@ static int ZEND_FASTCALL ZEND_DECLARE_CONST_SPEC_CONST_CONST_HANDLER(ZEND_OPCOD
name = opline->op1.zv;
val = opline->op2.zv;
- if ((Z_TYPE_P(val) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT || Z_TYPE_P(val) == IS_CONSTANT_ARRAY) {
+ if (IS_CONSTANT_TYPE(Z_TYPE_P(val))) {
zval tmp;
zval *tmp_ptr = &tmp;
ZVAL_COPY_VALUE(&tmp, val);
- if (Z_TYPE_P(val) == IS_CONSTANT_ARRAY) {
- zval_copy_ctor(&tmp);
- }
INIT_PZVAL(&tmp);
- zval_update_constant(&tmp_ptr, NULL TSRMLS_CC);
+ zval_update_constant(&tmp_ptr, 0 TSRMLS_CC);
c.value = *tmp_ptr;
} else {
INIT_PZVAL_COPY(&c.value, val);
- zval_copy_ctor(&c.value);
+ if (Z_TYPE(c.value) == IS_ARRAY) {
+ HashTable *ht;
+
+ ALLOC_HASHTABLE(ht);
+ zend_hash_init(ht, zend_hash_num_elements(Z_ARRVAL(c.value)), NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_copy(ht, Z_ARRVAL(c.value), (copy_ctor_func_t) zval_deep_copy, NULL, sizeof(zval *));
+ Z_ARRVAL(c.value) = ht;
+ } else {
+ zval_copy_ctor(&c.value);
+ }
}
c.flags = CONST_CS; /* non persistent, case sensetive */
- c.name = IS_INTERNED(Z_STRVAL_P(name)) ? Z_STRVAL_P(name) : zend_strndup(Z_STRVAL_P(name), Z_STRLEN_P(name));
+ c.name = str_strndup(Z_STRVAL_P(name), Z_STRLEN_P(name));
c.name_len = Z_STRLEN_P(name)+1;
c.module_number = PHP_USER_CONSTANT;
@@ -4141,7 +4420,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLE
/* Consts, temporary variables and references need copying */
if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -4154,11 +4433,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLE
}
generator->value = copy;
+
} else {
- Z_ADDREF_P(value);
+ if (IS_CONST == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
}
} else {
/* If no value was specified yield null */
@@ -4226,6 +4507,21 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLE
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_POW_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+
+
+ SAVE_OPLINE();
+ pow_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ opline->op2.zv TSRMLS_CC);
+
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -4509,14 +4805,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HA
zval *container;
SAVE_OPLINE();
-
- if (IS_CONST == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
container = opline->op1.zv;
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
zval_dtor(free_op2.var);
+ if (IS_CONST != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
+ }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -4626,7 +4920,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
+ zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
} else {
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
@@ -4637,6 +4931,8 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE
call->called_scope = Z_OBJCE_P(call->object);
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -4650,9 +4946,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
zend_free_op free_op2;
SAVE_OPLINE();
- if (IS_CONST==IS_VAR) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
is_equal_function(&EX_T(opline->result.var).tmp_var,
opline->op1.zv,
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
@@ -4693,7 +4986,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPC
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
- } else {
+
+ } else if (IS_CONST == IS_CV) {
Z_ADDREF_P(expr_ptr);
}
}
@@ -4718,11 +5012,7 @@ num_index:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -4741,8 +5031,6 @@ num_index:
}
if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) {
- } else {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -4834,7 +5122,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_
/* Consts, temporary variables and references need copying */
if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -4847,11 +5135,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_
}
generator->value = copy;
+
} else {
- Z_ADDREF_P(value);
+ if (IS_CONST == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
}
} else {
/* If no value was specified yield null */
@@ -4919,6 +5209,21 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_POW_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+ zend_free_op free_op2;
+
+ SAVE_OPLINE();
+ pow_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+
+ zval_dtor(free_op2.var);
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -4929,7 +5234,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
opline->op1.zv,
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -4944,7 +5249,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
opline->op1.zv,
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -4959,7 +5264,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
opline->op1.zv,
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -4974,7 +5279,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
opline->op1.zv,
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -4989,7 +5294,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
opline->op1.zv,
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5004,7 +5309,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
opline->op1.zv,
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5019,7 +5324,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
opline->op1.zv,
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5034,7 +5339,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER
opline->op1.zv,
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5049,7 +5354,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_H
opline->op1.zv,
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5066,7 +5371,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCO
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
Z_LVAL_P(result) = !Z_LVAL_P(result);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5082,7 +5387,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDL
opline->op1.zv,
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC));
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5098,7 +5403,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_H
opline->op1.zv,
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC));
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5114,7 +5419,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAN
opline->op1.zv,
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC));
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5130,7 +5435,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_O
opline->op1.zv,
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC));
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5145,7 +5450,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_
opline->op1.zv,
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5160,7 +5465,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER
opline->op1.zv,
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5175,7 +5480,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER
opline->op1.zv,
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5190,7 +5495,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDL
opline->op1.zv,
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5250,10 +5555,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_VAR(int type,
*/
if (IS_CONST == IS_CONST) {
hash_value = Z_HASH_P(varname);
- } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
- hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
} else {
- hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
+ hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname));
}
if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
@@ -5285,7 +5588,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_VAR(int type,
break;
case ZEND_FETCH_STATIC:
- zval_update_constant(retval, (void*) 1 TSRMLS_CC);
+ zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_CONST == IS_VAR && !free_op1.var) {
@@ -5306,7 +5609,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_VAR(int type,
switch (type) {
case BP_VAR_R:
case BP_VAR_IS:
- AI_SET_PTR(&EX_T(opline->result.var), *retval);
+ EX_T(opline->result.var).var.ptr = *retval;
break;
case BP_VAR_UNSET: {
zend_free_op free_res;
@@ -5346,7 +5649,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE
{
USE_OPLINE
- return zend_fetch_var_address_helper_SPEC_CONST_VAR(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ return zend_fetch_var_address_helper_SPEC_CONST_VAR(zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC) ? BP_VAR_W : BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -5366,14 +5669,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HA
zval *container;
SAVE_OPLINE();
-
- if (IS_CONST == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
container = opline->op1.zv;
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
+ if (IS_CONST != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
+ }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5462,7 +5763,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE
}
}
if (IS_VAR != IS_CONST) {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
} else {
if (UNEXPECTED(ce->constructor == NULL)) {
@@ -5483,7 +5784,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
+ zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
} else {
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
@@ -5494,6 +5795,8 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE
call->called_scope = Z_OBJCE_P(call->object);
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -5507,14 +5810,11 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
zend_free_op free_op2;
SAVE_OPLINE();
- if (IS_CONST==IS_VAR) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
is_equal_function(&EX_T(opline->result.var).tmp_var,
opline->op1.zv,
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5550,7 +5850,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPC
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
- } else {
+
+ } else if (IS_CONST == IS_CV) {
Z_ADDREF_P(expr_ptr);
}
}
@@ -5575,11 +5876,7 @@ num_index:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -5592,14 +5889,12 @@ num_index:
/* do nothing */
break;
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
} else {
zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
}
if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) {
- } else {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -5854,7 +6149,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_
/* Consts, temporary variables and references need copying */
if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -5867,11 +6162,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_
}
generator->value = copy;
+
} else {
- Z_ADDREF_P(value);
+ if (IS_CONST == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
}
} else {
/* If no value was specified yield null */
@@ -5910,7 +6207,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_
generator->largest_used_integer_key = Z_LVAL_P(generator->key);
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
} else {
/* If no key was specified we use auto-increment keys */
generator->largest_used_integer_key++;
@@ -5940,6 +6237,21 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_POW_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+ zend_free_op free_op2;
+
+ SAVE_OPLINE();
+ pow_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+
+ zval_ptr_dtor_nogc(&free_op2.var);
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_UNUSED(int type, ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -5995,10 +6307,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_UNUSED(int typ
*/
if (IS_CONST == IS_CONST) {
hash_value = Z_HASH_P(varname);
- } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
- hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
} else {
- hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
+ hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname));
}
if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
@@ -6030,7 +6340,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_UNUSED(int typ
break;
case ZEND_FETCH_STATIC:
- zval_update_constant(retval, (void*) 1 TSRMLS_CC);
+ zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_CONST == IS_VAR && !free_op1.var) {
@@ -6051,7 +6361,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_UNUSED(int typ
switch (type) {
case BP_VAR_R:
case BP_VAR_IS:
- AI_SET_PTR(&EX_T(opline->result.var), *retval);
+ EX_T(opline->result.var).var.ptr = *retval;
break;
case BP_VAR_UNSET: {
zend_free_op free_res;
@@ -6091,7 +6401,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CONST_UNUSED_HANDLER(ZEND_OPC
{
USE_OPLINE
- return zend_fetch_var_address_helper_SPEC_CONST_UNUSED(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ return zend_fetch_var_address_helper_SPEC_CONST_UNUSED(zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC) ? BP_VAR_W : BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6209,7 +6519,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
+ zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
} else {
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
@@ -6220,6 +6530,8 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER
call->called_scope = Z_OBJCE_P(call->object);
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -6258,7 +6570,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
- } else {
+
+ } else if (IS_CONST == IS_CV) {
Z_ADDREF_P(expr_ptr);
}
}
@@ -6283,11 +6596,7 @@ num_index:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -6306,8 +6615,6 @@ num_index:
}
if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) {
- } else {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -6586,7 +6893,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDL
/* Consts, temporary variables and references need copying */
if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -6599,11 +6906,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDL
}
generator->value = copy;
+
} else {
- Z_ADDREF_P(value);
+ if (IS_CONST == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
}
} else {
/* If no value was specified yield null */
@@ -6954,14 +7263,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HAN
zval *container;
SAVE_OPLINE();
-
- if (IS_CONST == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
container = opline->op1.zv;
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
+ if (IS_CONST != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
+ }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -7071,7 +7378,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
+ zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
} else {
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
@@ -7082,6 +7389,8 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN
call->called_scope = Z_OBJCE_P(call->object);
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -7155,9 +7464,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
- if (IS_CONST==IS_VAR) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
is_equal_function(&EX_T(opline->result.var).tmp_var,
opline->op1.zv,
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
@@ -7197,7 +7503,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCO
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
- } else {
+
+ } else if (IS_CONST == IS_CV) {
Z_ADDREF_P(expr_ptr);
}
}
@@ -7222,11 +7529,7 @@ num_index:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -7245,8 +7548,6 @@ num_index:
}
if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) {
- } else {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -7338,7 +7639,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A
/* Consts, temporary variables and references need copying */
if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -7351,11 +7652,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A
}
generator->value = copy;
+
} else {
- Z_ADDREF_P(value);
+ if (IS_CONST == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
}
} else {
/* If no value was specified yield null */
@@ -7423,6 +7726,21 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_POW_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+
+
+ SAVE_OPLINE();
+ pow_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
static int ZEND_FASTCALL ZEND_BW_NOT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -7656,9 +7974,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
retval_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (!EG(return_value_ptr_ptr)) {
- if (IS_TMP_VAR == IS_TMP_VAR) {
- zval_dtor(free_op1.var);
- }
+ zval_dtor(free_op1.var);
} else {
if (IS_TMP_VAR == IS_CONST ||
IS_TMP_VAR == IS_TMP_VAR ||
@@ -7671,18 +7987,23 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval_copy_ctor(ret);
}
*EG(return_value_ptr_ptr) = ret;
+
} else if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) &&
retval_ptr == &EG(uninitialized_zval)) {
zval *ret;
+ if (IS_TMP_VAR == IS_VAR) {
+ Z_DELREF_P(retval_ptr);
+ }
ALLOC_INIT_ZVAL(ret);
*EG(return_value_ptr_ptr) = ret;
} else {
*EG(return_value_ptr_ptr) = retval_ptr;
- Z_ADDREF_P(retval_ptr);
+ if (IS_TMP_VAR == IS_CV) {
+ Z_ADDREF_P(retval_ptr);
+ }
}
}
-
return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
@@ -7696,7 +8017,8 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
do {
- if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) {
+ if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR ||
+ (IS_TMP_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) {
/* Not supposed to happen, but we'll allow it */
zend_error(E_NOTICE, "Only variable references should be returned by reference");
@@ -7792,10 +8114,12 @@ static int ZEND_FASTCALL ZEND_SEND_VAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
USE_OPLINE
SAVE_OPLINE();
- if (opline->extended_value==ZEND_DO_FCALL_BY_NAME
- && ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
- zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.opline_num);
+ if (opline->extended_value == ZEND_DO_FCALL_BY_NAME) {
+ if (ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
+ zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.num);
+ }
}
+
{
zval *valptr;
zval *value;
@@ -7888,7 +8212,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(&retval);
} else {
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
}
@@ -8046,7 +8370,6 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
EX(original_return_value) = EG(return_value_ptr_ptr);
EG(active_op_array) = new_op_array;
if (RETURN_VALUE_USED(opline)) {
- EX_T(opline->result.var).var.ptr = NULL;
EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
EG(return_value_ptr_ptr) = EX_T(opline->result.var).var.ptr_ptr;
} else {
@@ -8084,7 +8407,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
ALLOC_ZVAL(retval);
ZVAL_BOOL(retval, failure_retval);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
ZEND_VM_NEXT_OPCODE();
}
@@ -8146,19 +8469,27 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
if (!ce || !ce->get_iterator) {
- Z_ADDREF_P(array_ptr);
+ if (IS_TMP_VAR == IS_CV) {
+ Z_ADDREF_P(array_ptr);
+ }
}
} else if (IS_TMP_VAR == IS_CONST ||
- ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) &&
+ (IS_TMP_VAR == IS_CV &&
+ !Z_ISREF_P(array_ptr) &&
+ Z_REFCOUNT_P(array_ptr) > 1) ||
+ (IS_TMP_VAR == IS_VAR &&
!Z_ISREF_P(array_ptr) &&
- Z_REFCOUNT_P(array_ptr) > 1)) {
+ Z_REFCOUNT_P(array_ptr) > 2)) {
zval *tmp;
+ if (IS_TMP_VAR == IS_VAR) {
+ Z_DELREF_P(array_ptr);
+ }
ALLOC_ZVAL(tmp);
INIT_PZVAL_COPY(tmp, array_ptr);
zval_copy_ctor(tmp);
array_ptr = tmp;
- } else {
+ } else if (IS_TMP_VAR == IS_CV) {
Z_ADDREF_P(array_ptr);
}
}
@@ -8166,10 +8497,15 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (ce && ce->get_iterator) {
iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
+ if (IS_TMP_VAR == IS_VAR && !(opline->extended_value & ZEND_FE_RESET_VARIABLE)) {
+
+ }
if (iter && EXPECTED(EG(exception) == NULL)) {
array_ptr = zend_iterator_wrap(iter TSRMLS_CC);
} else {
+ if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ }
if (!EG(exception)) {
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name);
}
@@ -8186,14 +8522,18 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
iter->funcs->rewind(iter TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(&array_ptr);
+ if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ }
HANDLE_EXCEPTION();
}
}
is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS;
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(&array_ptr);
+ if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ }
HANDLE_EXCEPTION();
}
iter->index = -1; /* will be set to 0 before using next handler */
@@ -8223,6 +8563,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
is_empty = 1;
}
+ if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+
+ }
if (is_empty) {
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
} else {
@@ -8740,10 +9083,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_CONST(int type,
*/
if (IS_TMP_VAR == IS_CONST) {
hash_value = Z_HASH_P(varname);
- } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
- hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
} else {
- hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
+ hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname));
}
if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
@@ -8775,7 +9116,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_CONST(int type,
zval_dtor(free_op1.var);
break;
case ZEND_FETCH_STATIC:
- zval_update_constant(retval, (void*) 1 TSRMLS_CC);
+ zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_TMP_VAR == IS_VAR && !free_op1.var) {
@@ -8796,7 +9137,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_CONST(int type,
switch (type) {
case BP_VAR_R:
case BP_VAR_IS:
- AI_SET_PTR(&EX_T(opline->result.var), *retval);
+ EX_T(opline->result.var).var.ptr = *retval;
break;
case BP_VAR_UNSET: {
zend_free_op free_res;
@@ -8836,7 +9177,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE
{
USE_OPLINE
- return zend_fetch_var_address_helper_SPEC_TMP_CONST(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ return zend_fetch_var_address_helper_SPEC_TMP_CONST(zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC) ? BP_VAR_W : BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -8856,14 +9197,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HA
zval *container;
SAVE_OPLINE();
-
- if (IS_TMP_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
- zval_dtor(free_op1.var);
+ if (IS_TMP_VAR != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
+ zval_dtor(free_op1.var);
+ }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -8879,13 +9218,13 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_TMP_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPC
if (UNEXPECTED(Z_TYPE_P(container) != IS_ARRAY)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
} else {
zval *value = *zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
CHECK_EXCEPTION();
@@ -8993,7 +9332,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER(ZEND_OPCO
HANDLE_EXCEPTION();
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object)));
}
if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
@@ -9009,6 +9348,8 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER(ZEND_OPCO
call->object = this_ptr;
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -9023,9 +9364,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
zend_free_op free_op1;
SAVE_OPLINE();
- if (IS_TMP_VAR==IS_VAR) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC);
@@ -9065,7 +9403,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPC
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
- } else {
+
+ } else if (IS_TMP_VAR == IS_CV) {
Z_ADDREF_P(expr_ptr);
}
}
@@ -9090,11 +9429,7 @@ num_index:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -9113,8 +9448,6 @@ num_index:
}
if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) {
- } else {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -9369,7 +9702,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_
/* Consts, temporary variables and references need copying */
if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -9382,11 +9715,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_
}
generator->value = copy;
+
} else {
- Z_ADDREF_P(value);
+ if (IS_TMP_VAR == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
}
} else {
/* If no value was specified yield null */
@@ -9454,6 +9789,21 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_POW_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+ zend_free_op free_op1;
+
+ SAVE_OPLINE();
+ pow_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
+ zval_dtor(free_op1.var);
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -9737,14 +10087,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAND
zval *container;
SAVE_OPLINE();
-
- if (IS_TMP_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
zval_dtor(free_op2.var);
- zval_dtor(free_op1.var);
+ if (IS_TMP_VAR != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
+ zval_dtor(free_op1.var);
+ }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -9849,7 +10197,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE
zval_dtor(free_op2.var);
HANDLE_EXCEPTION();
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object)));
}
if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
@@ -9865,6 +10213,8 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE
call->object = this_ptr;
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -9880,9 +10230,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_free_op free_op1, free_op2;
SAVE_OPLINE();
- if (IS_TMP_VAR==IS_VAR) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
@@ -9923,7 +10270,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCOD
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
- } else {
+
+ } else if (IS_TMP_VAR == IS_CV) {
Z_ADDREF_P(expr_ptr);
}
}
@@ -9948,11 +10296,7 @@ num_index:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -9971,8 +10315,6 @@ num_index:
}
if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) {
- } else {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10064,7 +10406,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
/* Consts, temporary variables and references need copying */
if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -10077,11 +10419,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
}
generator->value = copy;
+
} else {
- Z_ADDREF_P(value);
+ if (IS_TMP_VAR == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
}
} else {
/* If no value was specified yield null */
@@ -10149,6 +10493,21 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_POW_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+ zend_free_op free_op1, free_op2;
+
+ SAVE_OPLINE();
+ pow_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ zval_dtor(free_op1.var);
+ zval_dtor(free_op2.var);
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -10159,7 +10518,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10174,7 +10533,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10189,7 +10548,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10204,7 +10563,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10219,7 +10578,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10234,7 +10593,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10249,7 +10608,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10264,7 +10623,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10279,7 +10638,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAN
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10296,7 +10655,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
Z_LVAL_P(result) = !Z_LVAL_P(result);
zval_dtor(free_op1.var);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10312,7 +10671,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC));
zval_dtor(free_op1.var);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10328,7 +10687,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAN
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC));
zval_dtor(free_op1.var);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10344,7 +10703,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDL
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC));
zval_dtor(free_op1.var);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10360,7 +10719,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPC
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC));
zval_dtor(free_op1.var);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10375,7 +10734,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10390,7 +10749,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10405,7 +10764,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10420,7 +10779,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10480,10 +10839,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_VAR(int type, ZE
*/
if (IS_TMP_VAR == IS_CONST) {
hash_value = Z_HASH_P(varname);
- } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
- hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
} else {
- hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
+ hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname));
}
if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
@@ -10515,7 +10872,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_VAR(int type, ZE
zval_dtor(free_op1.var);
break;
case ZEND_FETCH_STATIC:
- zval_update_constant(retval, (void*) 1 TSRMLS_CC);
+ zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_TMP_VAR == IS_VAR && !free_op1.var) {
@@ -10536,7 +10893,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_VAR(int type, ZE
switch (type) {
case BP_VAR_R:
case BP_VAR_IS:
- AI_SET_PTR(&EX_T(opline->result.var), *retval);
+ EX_T(opline->result.var).var.ptr = *retval;
break;
case BP_VAR_UNSET: {
zend_free_op free_res;
@@ -10576,7 +10933,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_H
{
USE_OPLINE
- return zend_fetch_var_address_helper_SPEC_TMP_VAR(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ return zend_fetch_var_address_helper_SPEC_TMP_VAR(zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC) ? BP_VAR_W : BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -10596,14 +10953,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAND
zval *container;
SAVE_OPLINE();
-
- if (IS_TMP_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
- zval_dtor(free_op1.var);
+ zval_ptr_dtor_nogc(&free_op2.var);
+ if (IS_TMP_VAR != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
+ zval_dtor(free_op1.var);
+ }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10647,7 +11002,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_
* which aren't affected by FREE_OP(Ts, )'s anyway, unless they're
* string offsets or overloaded objects
*/
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10705,10 +11060,10 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE
}
} else {
if (UNEXPECTED(EG(exception) != NULL)) {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
HANDLE_EXCEPTION();
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object)));
}
if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
@@ -10724,10 +11079,12 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE
call->object = this_ptr;
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10739,14 +11096,11 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_free_op free_op1, free_op2;
SAVE_OPLINE();
- if (IS_TMP_VAR==IS_VAR) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10782,7 +11136,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
- } else {
+
+ } else if (IS_TMP_VAR == IS_CV) {
Z_ADDREF_P(expr_ptr);
}
}
@@ -10807,11 +11162,7 @@ num_index:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -10824,14 +11175,12 @@ num_index:
/* do nothing */
break;
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
} else {
zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
}
if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) {
- } else {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -11086,7 +11435,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
/* Consts, temporary variables and references need copying */
if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -11099,11 +11448,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
}
generator->value = copy;
+
} else {
- Z_ADDREF_P(value);
+ if (IS_TMP_VAR == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
}
} else {
/* If no value was specified yield null */
@@ -11142,7 +11493,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
generator->largest_used_integer_key = Z_LVAL_P(generator->key);
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
} else {
/* If no key was specified we use auto-increment keys */
generator->largest_used_integer_key++;
@@ -11172,6 +11523,21 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_POW_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+ zend_free_op free_op1, free_op2;
+
+ SAVE_OPLINE();
+ pow_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ zval_dtor(free_op1.var);
+ zval_ptr_dtor_nogc(&free_op2.var);
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_UNUSED(int type, ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -11227,10 +11593,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_UNUSED(int type,
*/
if (IS_TMP_VAR == IS_CONST) {
hash_value = Z_HASH_P(varname);
- } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
- hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
} else {
- hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
+ hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname));
}
if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
@@ -11262,7 +11626,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_UNUSED(int type,
zval_dtor(free_op1.var);
break;
case ZEND_FETCH_STATIC:
- zval_update_constant(retval, (void*) 1 TSRMLS_CC);
+ zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_TMP_VAR == IS_VAR && !free_op1.var) {
@@ -11283,7 +11647,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_UNUSED(int type,
switch (type) {
case BP_VAR_R:
case BP_VAR_IS:
- AI_SET_PTR(&EX_T(opline->result.var), *retval);
+ EX_T(opline->result.var).var.ptr = *retval;
break;
case BP_VAR_UNSET: {
zend_free_op free_res;
@@ -11323,7 +11687,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCOD
{
USE_OPLINE
- return zend_fetch_var_address_helper_SPEC_TMP_UNUSED(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ return zend_fetch_var_address_helper_SPEC_TMP_UNUSED(zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC) ? BP_VAR_W : BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -11367,7 +11731,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OP
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
- } else {
+
+ } else if (IS_TMP_VAR == IS_CV) {
Z_ADDREF_P(expr_ptr);
}
}
@@ -11392,11 +11757,7 @@ num_index:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -11415,8 +11776,6 @@ num_index:
}
if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) {
- } else {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -11671,7 +12030,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER
/* Consts, temporary variables and references need copying */
if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -11684,11 +12043,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER
}
generator->value = copy;
+
} else {
- Z_ADDREF_P(value);
+ if (IS_TMP_VAR == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
}
} else {
/* If no value was specified yield null */
@@ -12039,14 +12400,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDL
zval *container;
SAVE_OPLINE();
-
- if (IS_TMP_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
- zval_dtor(free_op1.var);
+ if (IS_TMP_VAR != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
+ zval_dtor(free_op1.var);
+ }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12150,7 +12509,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_
HANDLE_EXCEPTION();
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object)));
}
if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
@@ -12166,6 +12525,8 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_
call->object = this_ptr;
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -12180,9 +12541,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_free_op free_op1;
SAVE_OPLINE();
- if (IS_TMP_VAR==IS_VAR) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
@@ -12222,7 +12580,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
- } else {
+
+ } else if (IS_TMP_VAR == IS_CV) {
Z_ADDREF_P(expr_ptr);
}
}
@@ -12247,11 +12606,7 @@ num_index:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -12270,8 +12625,6 @@ num_index:
}
if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) {
- } else {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -12363,7 +12716,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
/* Consts, temporary variables and references need copying */
if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -12376,11 +12729,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
generator->value = copy;
+
} else {
- Z_ADDREF_P(value);
+ if (IS_TMP_VAR == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
}
} else {
/* If no value was specified yield null */
@@ -12448,6 +12803,21 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_POW_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+ zend_free_op free_op1;
+
+ SAVE_OPLINE();
+ pow_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ zval_dtor(free_op1.var);
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
static int ZEND_FASTCALL ZEND_BW_NOT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -12456,7 +12826,7 @@ static int ZEND_FASTCALL ZEND_BW_NOT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
bitwise_not_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12469,7 +12839,7 @@ static int ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
boolean_not_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12489,9 +12859,9 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
if (IS_VAR == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12513,10 +12883,10 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12536,9 +12906,9 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
if (IS_VAR == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12560,10 +12930,10 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12582,7 +12952,7 @@ static int ZEND_FASTCALL ZEND_POST_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
if (IS_VAR == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) {
ZVAL_NULL(&EX_T(opline->result.var).tmp_var);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12606,7 +12976,7 @@ static int ZEND_FASTCALL ZEND_POST_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
fast_increment_function(*var_ptr);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12625,7 +12995,7 @@ static int ZEND_FASTCALL ZEND_POST_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
if (IS_VAR == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) {
ZVAL_NULL(&EX_T(opline->result.var).tmp_var);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12649,7 +13019,7 @@ static int ZEND_FASTCALL ZEND_POST_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
fast_decrement_function(*var_ptr);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12668,7 +13038,7 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
zend_print_variable(z);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -12695,7 +13065,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ret = Z_LVAL_P(val);
} else {
ret = i_zend_is_true(val);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -12725,7 +13095,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ret = Z_LVAL_P(val);
} else {
ret = i_zend_is_true(val);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -12755,7 +13125,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
retval = Z_LVAL_P(val);
} else {
retval = i_zend_is_true(val);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -12789,7 +13159,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
retval = Z_LVAL_P(val);
} else {
retval = i_zend_is_true(val);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -12820,7 +13190,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
retval = Z_LVAL_P(val);
} else {
retval = i_zend_is_true(val);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -12861,9 +13231,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
retval_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (!EG(return_value_ptr_ptr)) {
- if (IS_VAR == IS_TMP_VAR) {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- }
+ zval_ptr_dtor_nogc(&free_op1.var);
} else {
if (IS_VAR == IS_CONST ||
IS_VAR == IS_TMP_VAR ||
@@ -12876,18 +13244,23 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval_copy_ctor(ret);
}
*EG(return_value_ptr_ptr) = ret;
+ zval_ptr_dtor_nogc(&free_op1.var);
} else if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) &&
retval_ptr == &EG(uninitialized_zval)) {
zval *ret;
+ if (IS_VAR == IS_VAR) {
+ Z_DELREF_P(retval_ptr);
+ }
ALLOC_INIT_ZVAL(ret);
*EG(return_value_ptr_ptr) = ret;
} else {
*EG(return_value_ptr_ptr) = retval_ptr;
- Z_ADDREF_P(retval_ptr);
+ if (IS_VAR == IS_CV) {
+ Z_ADDREF_P(retval_ptr);
+ }
}
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
@@ -12901,14 +13274,15 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
do {
- if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) {
+ if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR ||
+ (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) {
/* Not supposed to happen, but we'll allow it */
zend_error(E_NOTICE, "Only variable references should be returned by reference");
retval_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (!EG(return_value_ptr_ptr)) {
if (IS_VAR == IS_TMP_VAR) {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
}
} else if (!0) { /* Not a temp var */
zval *ret;
@@ -12958,7 +13332,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE
}
} while (0);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
@@ -12989,7 +13363,7 @@ static int ZEND_FASTCALL ZEND_THROW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_throw_exception_object(exception TSRMLS_CC);
zend_exception_restore(TSRMLS_C);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
HANDLE_EXCEPTION();
}
@@ -13001,21 +13375,26 @@ static int ZEND_FASTCALL zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_AR
varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (varptr == &EG(uninitialized_zval)) {
- ALLOC_ZVAL(varptr);
- INIT_ZVAL(*varptr);
- Z_SET_REFCOUNT_P(varptr, 0);
+ if (IS_VAR == IS_VAR) {
+ Z_DELREF_P(varptr);
+ }
+ ALLOC_INIT_ZVAL(varptr);
} else if (PZVAL_IS_REF(varptr)) {
- zval *original_var = varptr;
+ if (IS_VAR == IS_CV ||
+ (IS_VAR == IS_VAR && Z_REFCOUNT_P(varptr) > 2)) {
+ zval *original_var = varptr;
- ALLOC_ZVAL(varptr);
- ZVAL_COPY_VALUE(varptr, original_var);
- Z_UNSET_ISREF_P(varptr);
- Z_SET_REFCOUNT_P(varptr, 0);
- zval_copy_ctor(varptr);
+ ALLOC_ZVAL(varptr);
+ INIT_PZVAL_COPY(varptr, original_var);
+ zval_copy_ctor(varptr);
+ zval_ptr_dtor_nogc(&free_op1.var);
+ } else {
+ Z_UNSET_ISREF_P(varptr);
+ }
+ } else if (IS_VAR == IS_CV) {
+ Z_ADDREF_P(varptr);
}
- Z_ADDREF_P(varptr);
zend_vm_stack_push(varptr TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; /* for string offsets */
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -13032,33 +13411,28 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) {
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
- } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
- return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
- }
-
- if (IS_VAR == IS_VAR &&
- (opline->extended_value & ZEND_ARG_SEND_FUNCTION) &&
- EX_T(opline->op1.var).var.fcall_returned_reference &&
- EX_T(opline->op1.var).var.ptr) {
- varptr = EX_T(opline->op1.var).var.ptr;
- PZVAL_UNLOCK_EX(varptr, &free_op1, 0);
} else {
- varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
+ if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
+ return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ }
}
+
+ varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) ||
EX_T(opline->op1.var).var.fcall_returned_reference) &&
varptr != &EG(uninitialized_zval) &&
- (PZVAL_IS_REF(varptr) ||
- (Z_REFCOUNT_P(varptr) == 1 && (IS_VAR == IS_CV || free_op1.var)))) {
+ (PZVAL_IS_REF(varptr) || Z_REFCOUNT_P(varptr) == 1)) {
Z_SET_ISREF_P(varptr);
- Z_ADDREF_P(varptr);
+ if (IS_VAR == IS_CV) {
+ Z_ADDREF_P(varptr);
+ }
zend_vm_stack_push(varptr TSRMLS_CC);
} else {
zval *valptr;
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
- !ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
+ !ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
zend_error(E_STRICT, "Only variables should be passed by reference");
}
ALLOC_ZVAL(valptr);
@@ -13066,9 +13440,9 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
if (!0) {
zval_copy_ctor(valptr);
}
+ zval_ptr_dtor_nogc(&free_op1.var);
zend_vm_stack_push(valptr TSRMLS_CC);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13095,9 +13469,10 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
- EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
- !ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
- return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) {
+ if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
+ return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ }
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
@@ -13105,7 +13480,7 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
Z_ADDREF_P(varptr);
zend_vm_stack_push(varptr TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13114,9 +13489,10 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
{
USE_OPLINE
- if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME)
- && ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
- return ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ if (opline->extended_value == ZEND_DO_FCALL_BY_NAME) {
+ if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
+ return ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ }
}
SAVE_OPLINE();
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@@ -13131,7 +13507,7 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
/* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */
ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)));
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -13205,10 +13581,10 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(&retval);
} else {
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13250,7 +13626,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (use_copy) {
ZVAL_COPY_VALUE(result, &var_copy);
if (0) {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
}
} else {
ZVAL_COPY_VALUE(result, expr);
@@ -13267,7 +13643,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
convert_to_object(result);
break;
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13356,14 +13732,13 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
if (tmp_inc_filename) {
zval_ptr_dtor(&tmp_inc_filename);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
} else if (EXPECTED(new_op_array != NULL)) {
EX(original_return_value) = EG(return_value_ptr_ptr);
EG(active_op_array) = new_op_array;
if (RETURN_VALUE_USED(opline)) {
- EX_T(opline->result.var).var.ptr = NULL;
EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
EG(return_value_ptr_ptr) = EX_T(opline->result.var).var.ptr_ptr;
} else {
@@ -13401,7 +13776,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
ALLOC_ZVAL(retval);
ZVAL_BOOL(retval, failure_retval);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
ZEND_VM_NEXT_OPCODE();
}
@@ -13463,19 +13838,27 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
if (!ce || !ce->get_iterator) {
- Z_ADDREF_P(array_ptr);
+ if (IS_VAR == IS_CV) {
+ Z_ADDREF_P(array_ptr);
+ }
}
} else if (IS_VAR == IS_CONST ||
- ((IS_VAR == IS_CV || IS_VAR == IS_VAR) &&
+ (IS_VAR == IS_CV &&
+ !Z_ISREF_P(array_ptr) &&
+ Z_REFCOUNT_P(array_ptr) > 1) ||
+ (IS_VAR == IS_VAR &&
!Z_ISREF_P(array_ptr) &&
- Z_REFCOUNT_P(array_ptr) > 1)) {
+ Z_REFCOUNT_P(array_ptr) > 2)) {
zval *tmp;
+ if (IS_VAR == IS_VAR) {
+ Z_DELREF_P(array_ptr);
+ }
ALLOC_ZVAL(tmp);
INIT_PZVAL_COPY(tmp, array_ptr);
zval_copy_ctor(tmp);
array_ptr = tmp;
- } else {
+ } else if (IS_VAR == IS_CV) {
Z_ADDREF_P(array_ptr);
}
}
@@ -13483,10 +13866,15 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (ce && ce->get_iterator) {
iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
+ if (IS_VAR == IS_VAR && !(opline->extended_value & ZEND_FE_RESET_VARIABLE)) {
+ zval_ptr_dtor_nogc(&free_op1.var);
+ }
if (iter && EXPECTED(EG(exception) == NULL)) {
array_ptr = zend_iterator_wrap(iter TSRMLS_CC);
} else {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
+ }
if (!EG(exception)) {
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name);
}
@@ -13503,14 +13891,18 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
iter->funcs->rewind(iter TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(&array_ptr);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
+ }
HANDLE_EXCEPTION();
}
}
is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS;
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(&array_ptr);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
+ }
HANDLE_EXCEPTION();
}
iter->index = -1; /* will be set to 0 before using next handler */
@@ -13540,7 +13932,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
is_empty = 1;
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
+ }
if (is_empty) {
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
} else {
@@ -13672,7 +14066,7 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
Z_ADDREF_PP(value);
} else {
PZVAL_LOCK(*value);
- AI_SET_PTR(&EX_T(opline->result.var), *value);
+ EX_T(opline->result.var).var.ptr = *value;
}
CHECK_EXCEPTION();
@@ -13695,7 +14089,7 @@ static int ZEND_FASTCALL ZEND_EXIT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
zend_print_variable(ptr);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
}
#endif
zend_bailout();
@@ -13716,14 +14110,14 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
if (!0) {
zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
#if DEBUG_ZEND>=2
printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
ZEND_VM_JMP(opline->op2.jmp_addr);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13751,14 +14145,14 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_
zval_copy_ctor(EX_T(opline->result.var).var.ptr);
}
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
#if DEBUG_ZEND>=2
printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
ZEND_VM_JMP(opline->op2.jmp_addr);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13776,7 +14170,7 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
if (!0) {
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13804,7 +14198,7 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE
}
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13825,7 +14219,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
result = 0;
}
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -13839,7 +14233,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
fast_add_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -13854,7 +14248,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
fast_sub_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -13869,7 +14263,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
fast_mul_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -13884,7 +14278,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
fast_div_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -13899,7 +14293,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
fast_mod_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -13914,7 +14308,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
shift_left_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -13929,7 +14323,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
shift_right_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -13944,7 +14338,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
concat_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -13959,7 +14353,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
is_identical_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -13976,7 +14370,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCO
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC);
Z_LVAL_P(result) = !Z_LVAL_P(result);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -13992,7 +14386,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDL
ZVAL_BOOL(result, fast_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC));
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -14008,7 +14402,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
ZVAL_BOOL(result, fast_not_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC));
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -14024,7 +14418,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
ZVAL_BOOL(result, fast_is_smaller_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC));
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -14040,7 +14434,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_O
ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC));
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -14055,7 +14449,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_
bitwise_or_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -14070,7 +14464,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
bitwise_and_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -14085,7 +14479,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -14100,7 +14494,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDL
boolean_xor_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -14131,7 +14525,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
} else {
/* here we are sure we are dealing with an object */
@@ -14151,7 +14544,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*zptr);
EX_T(opline->result.var).var.ptr = *zptr;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
}
@@ -14191,7 +14583,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(z);
EX_T(opline->result.var).var.ptr = z;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
zval_ptr_dtor(&z);
} else {
@@ -14199,7 +14590,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
zval_ptr_dtor(&object);
@@ -14213,7 +14603,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
FREE_OP(free_op_data1);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -14265,10 +14655,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binar
if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
if (opline->extended_value == ZEND_ASSIGN_DIM) {
ZEND_VM_INC_OPCODE();
@@ -14293,17 +14683,17 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binar
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
if (opline->extended_value == ZEND_ASSIGN_DIM) {
FREE_OP(free_op_data1);
FREE_OP_VAR_PTR(free_op_data2);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
} else {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
@@ -14393,7 +14783,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
PZVAL_LOCK(&EG(uninitialized_zval));
*retval = &EG(uninitialized_zval);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -14457,7 +14847,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
} else {
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -14498,7 +14888,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
ZVAL_NULL(retval);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -14561,7 +14951,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
} else {
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -14610,7 +15000,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type,
if (IS_VAR != IS_CONST && varname == &tmp_varname) {
zval_dtor(&tmp_varname);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -14620,7 +15010,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type,
ce = EX_T(opline->op2.var).class_entry;
}
retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
} else {
target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
/*
@@ -14631,10 +15021,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type,
*/
if (IS_VAR == IS_CONST) {
hash_value = Z_HASH_P(varname);
- } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
- hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
} else {
- hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
+ hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname));
}
if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
@@ -14659,14 +15047,14 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type,
switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) {
case ZEND_FETCH_GLOBAL:
if (IS_VAR != IS_TMP_VAR) {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
}
break;
case ZEND_FETCH_LOCAL:
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
break;
case ZEND_FETCH_STATIC:
- zval_update_constant(retval, (void*) 1 TSRMLS_CC);
+ zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_VAR == IS_VAR && !free_op1.var) {
@@ -14687,7 +15075,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type,
switch (type) {
case BP_VAR_R:
case BP_VAR_IS:
- AI_SET_PTR(&EX_T(opline->result.var), *retval);
+ EX_T(opline->result.var).var.ptr = *retval;
break;
case BP_VAR_UNSET: {
zend_free_op free_res;
@@ -14727,7 +15115,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
{
USE_OPLINE
- return zend_fetch_var_address_helper_SPEC_VAR_CONST(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ return zend_fetch_var_address_helper_SPEC_VAR_CONST(zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC) ? BP_VAR_W : BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -14747,14 +15135,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA
zval *container;
SAVE_OPLINE();
-
- if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (IS_VAR != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
+ zval_ptr_dtor_nogc(&free_op1.var);
+ }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -14776,7 +15162,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* We are going to assign the result by reference */
if (UNEXPECTED(opline->extended_value != 0)) {
@@ -14810,7 +15196,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -14825,7 +15211,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_IS TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -14837,9 +15223,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP
SAVE_OPLINE();
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
zval **container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
-
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -14848,7 +15233,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
} else {
zval *container;
@@ -14858,7 +15243,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -14886,7 +15271,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
if (UNEXPECTED(EX_T(opline->result.var).var.ptr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_NEXT_OPCODE();
@@ -14921,7 +15306,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CONST(
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
} else {
zval *retval;
@@ -14934,7 +15319,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CONST(
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (0) {
zval_ptr_dtor(&offset);
@@ -14943,7 +15328,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CONST(
}
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -14980,7 +15365,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* We are going to assign the result by reference */
if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
@@ -15023,7 +15408,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -15043,7 +15428,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
} else {
zval *retval;
@@ -15056,7 +15441,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (0) {
zval_ptr_dtor(&offset);
@@ -15065,7 +15450,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
}
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -15074,7 +15459,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP
{
USE_OPLINE
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1;
zval *property;
@@ -15099,7 +15484,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else {
@@ -15138,7 +15523,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
@@ -15173,7 +15558,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
} else {
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -15223,11 +15608,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
ALLOC_ZVAL(retval);
ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
} else if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
if (IS_TMP_FREE(free_op_data1)) {
@@ -15235,7 +15620,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else {
if ((opline+1)->op1_type == IS_TMP_VAR) {
@@ -15247,13 +15632,13 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
}
FREE_OP_VAR_PTR(free_op_data2);
FREE_OP_IF_VAR(free_op_data1);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* assign_dim has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -15279,11 +15664,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
ALLOC_ZVAL(retval);
ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
} else if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else if (IS_VAR == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
if (0) {
@@ -15291,7 +15676,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else {
if (IS_CONST == IS_TMP_VAR) {
@@ -15303,11 +15688,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* zend_assign_to_variable() always takes care of op2, never free it! */
@@ -15370,7 +15755,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCO
HANDLE_EXCEPTION();
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object)));
}
if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
@@ -15386,10 +15771,12 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCO
call->object = this_ptr;
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -15500,7 +15887,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
+ zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
} else {
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
@@ -15511,6 +15898,8 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE
call->called_scope = Z_OBJCE_P(call->object);
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -15524,9 +15913,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
zend_free_op free_op1;
SAVE_OPLINE();
- if (IS_VAR==IS_VAR) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
opline->op2.zv TSRMLS_CC);
@@ -15568,8 +15954,6 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
retval = &EX_T(opline->result.var).tmp_var;
ZVAL_COPY_VALUE(retval, &c->value);
zval_copy_ctor(retval);
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
} else {
/* class constant */
zend_class_entry *ce;
@@ -15580,8 +15964,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
value = CACHED_PTR(opline->op2.literal->cache_slot);
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
+ goto constant_fetch_end;
} else if (CACHED_PTR(opline->op1.literal->cache_slot)) {
ce = CACHED_PTR(opline->op1.literal->cache_slot);
} else {
@@ -15599,18 +15982,16 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
if ((value = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce)) != NULL) {
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
+ goto constant_fetch_end;
}
}
if (EXPECTED(zend_hash_quick_find(&ce->constants_table, Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv)+1, Z_HASH_P(opline->op2.zv), (void **) &value) == SUCCESS)) {
- if (Z_TYPE_PP(value) == IS_CONSTANT_ARRAY ||
- (Z_TYPE_PP(value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
+ if (IS_CONSTANT_TYPE(Z_TYPE_PP(value))) {
zend_class_entry *old_scope = EG(scope);
EG(scope) = ce;
- zval_update_constant(value, (void *) 1 TSRMLS_CC);
+ zval_update_constant(value, 1 TSRMLS_CC);
EG(scope) = old_scope;
}
if (IS_VAR == IS_CONST) {
@@ -15620,16 +16001,16 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
}
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
- } else if (Z_STRLEN_P(opline->op2.zv) == sizeof("class")-1 && strcmp(Z_STRVAL_P(opline->op2.zv), "class") == 0) {
+ } else if (Z_STRLEN_P(opline->op2.zv) == sizeof("class")-1 && memcmp(Z_STRVAL_P(opline->op2.zv), "class", sizeof("class") - 1) == 0) {
/* "class" is assigned as a case-sensitive keyword from zend_do_resolve_class_name */
ZVAL_STRINGL(&EX_T(opline->result.var).tmp_var, ce->name, ce->name_length, 1);
} else {
zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
}
-
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
}
+constant_fetch_end:
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -15663,7 +16044,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPC
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
- } else {
+ zval_ptr_dtor_nogc(&free_op1.var);
+ } else if (IS_VAR == IS_CV) {
Z_ADDREF_P(expr_ptr);
}
}
@@ -15688,11 +16070,7 @@ num_index:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -15710,9 +16088,7 @@ num_index:
zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
}
if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- } else {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -15781,7 +16157,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
} else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
zval_ptr_dtor(&varname);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
HANDLE_EXCEPTION();
}
if (UNEXPECTED(ce == NULL)) {
@@ -15805,7 +16181,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
} else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
zval_ptr_dtor(&varname);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -15849,11 +16225,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (ht == &EG(symbol_table)) {
zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
@@ -15904,7 +16276,7 @@ num_index_dim:
} else {
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -15945,7 +16317,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
} else {
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -16015,7 +16387,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPC
if (IS_VAR != IS_CONST && varname == &tmp) {
zval_dtor(&tmp);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
}
if (opline->extended_value & ZEND_ISSET) {
@@ -16048,7 +16420,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST(
SAVE_OPLINE();
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
-
offset = opline->op2.zv;
if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
@@ -16075,11 +16446,7 @@ num_index_prop:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
isset = 1;
@@ -16172,7 +16539,7 @@ num_index_prop:
Z_LVAL(EX_T(opline->result.var).tmp_var) = !result;
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -16254,14 +16621,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_
generator->value = *value_ptr;
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
}
} else {
zval *value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
/* Consts, temporary variables and references need copying */
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -16274,12 +16641,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_
}
generator->value = copy;
+ zval_ptr_dtor_nogc(&free_op1.var);
} else {
- Z_ADDREF_P(value);
+ if (IS_VAR == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
}
} else {
/* If no value was specified yield null */
@@ -16347,6 +16715,26 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_POW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+ zend_free_op free_op1;
+
+ SAVE_OPLINE();
+ pow_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
+ zval_ptr_dtor_nogc(&free_op1.var);
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
+static int ZEND_FASTCALL ZEND_ASSIGN_POW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ return zend_binary_assign_op_helper_SPEC_VAR_CONST(pow_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+}
+
static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -16356,7 +16744,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
fast_add_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
zval_dtor(free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -16371,7 +16759,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
fast_sub_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
zval_dtor(free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -16386,7 +16774,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
fast_mul_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
zval_dtor(free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -16401,7 +16789,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
fast_div_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
zval_dtor(free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -16416,7 +16804,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
fast_mod_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
zval_dtor(free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -16431,7 +16819,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
shift_left_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
zval_dtor(free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -16446,7 +16834,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
shift_right_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
zval_dtor(free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -16461,7 +16849,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
concat_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
zval_dtor(free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -16476,7 +16864,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN
is_identical_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
zval_dtor(free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -16493,7 +16881,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
Z_LVAL_P(result) = !Z_LVAL_P(result);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
zval_dtor(free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -16509,7 +16897,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER
ZVAL_BOOL(result, fast_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC));
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
zval_dtor(free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -16525,7 +16913,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN
ZVAL_BOOL(result, fast_not_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC));
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
zval_dtor(free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -16541,7 +16929,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL
ZVAL_BOOL(result, fast_is_smaller_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC));
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
zval_dtor(free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -16557,7 +16945,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPC
ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC));
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
zval_dtor(free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -16572,7 +16960,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
bitwise_or_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
zval_dtor(free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -16587,7 +16975,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
bitwise_and_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
zval_dtor(free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -16602,7 +16990,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
zval_dtor(free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -16617,7 +17005,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER
boolean_xor_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
zval_dtor(free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -16648,7 +17036,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
} else {
/* here we are sure we are dealing with an object */
@@ -16668,7 +17055,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*zptr);
EX_T(opline->result.var).var.ptr = *zptr;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
}
@@ -16708,7 +17094,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(z);
EX_T(opline->result.var).var.ptr = z;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
zval_ptr_dtor(&z);
} else {
@@ -16716,7 +17101,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
zval_ptr_dtor(&object);
@@ -16730,7 +17114,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin
FREE_OP(free_op_data1);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -16782,10 +17166,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_TMP(int (*binary_
if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
zval_dtor(free_op2.var);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
if (opline->extended_value == ZEND_ASSIGN_DIM) {
ZEND_VM_INC_OPCODE();
@@ -16810,18 +17194,18 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_TMP(int (*binary_
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
zval_dtor(free_op2.var);
if (opline->extended_value == ZEND_ASSIGN_DIM) {
FREE_OP(free_op_data1);
FREE_OP_VAR_PTR(free_op_data2);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
} else {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
@@ -16911,7 +17295,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t i
PZVAL_LOCK(&EG(uninitialized_zval));
*retval = &EG(uninitialized_zval);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -16975,7 +17359,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t i
} else {
zval_dtor(free_op2.var);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -17016,7 +17400,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
zval_dtor(free_op2.var);
ZVAL_NULL(retval);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -17079,7 +17463,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t
} else {
zval_dtor(free_op2.var);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -17101,14 +17485,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND
zval *container;
SAVE_OPLINE();
-
- if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
zval_dtor(free_op2.var);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (IS_VAR != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
+ zval_ptr_dtor_nogc(&free_op1.var);
+ }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -17130,7 +17512,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* We are going to assign the result by reference */
if (UNEXPECTED(opline->extended_value != 0)) {
@@ -17164,7 +17546,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -17179,7 +17561,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_IS TSRMLS_CC);
zval_dtor(free_op2.var);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -17191,9 +17573,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO
SAVE_OPLINE();
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
zval **container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
-
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -17202,7 +17583,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
zval_dtor(free_op2.var);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
} else {
zval *container;
@@ -17212,7 +17593,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
zval_dtor(free_op2.var);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -17240,7 +17621,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
if (UNEXPECTED(EX_T(opline->result.var).var.ptr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_NEXT_OPCODE();
@@ -17275,7 +17656,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_TMP(ZE
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
zval_dtor(free_op2.var);
} else {
zval *retval;
@@ -17288,7 +17669,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_TMP(ZE
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (1) {
zval_ptr_dtor(&offset);
@@ -17297,7 +17678,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_TMP(ZE
}
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -17334,7 +17715,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* We are going to assign the result by reference */
if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
@@ -17377,7 +17758,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -17397,7 +17778,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN
if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
zval_dtor(free_op2.var);
} else {
zval *retval;
@@ -17410,7 +17791,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (1) {
zval_ptr_dtor(&offset);
@@ -17419,7 +17800,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN
}
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -17428,7 +17809,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO
{
USE_OPLINE
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1, free_op2;
zval *property;
@@ -17453,7 +17834,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else {
@@ -17492,7 +17873,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
@@ -17527,7 +17908,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL
} else {
zval_dtor(free_op2.var);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -17578,11 +17959,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL
ALLOC_ZVAL(retval);
ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
} else if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
if (IS_TMP_FREE(free_op_data1)) {
@@ -17590,7 +17971,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else {
if ((opline+1)->op1_type == IS_TMP_VAR) {
@@ -17602,13 +17983,13 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
}
FREE_OP_VAR_PTR(free_op_data2);
FREE_OP_IF_VAR(free_op_data1);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* assign_dim has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -17634,11 +18015,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
ALLOC_ZVAL(retval);
ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
} else if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else if (IS_VAR == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
if (1) {
@@ -17646,7 +18027,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else {
if (IS_TMP_VAR == IS_TMP_VAR) {
@@ -17658,11 +18039,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* zend_assign_to_variable() always takes care of op2, never free it! */
@@ -17725,7 +18106,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE
zval_dtor(free_op2.var);
HANDLE_EXCEPTION();
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object)));
}
if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
@@ -17741,11 +18122,13 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE
call->object = this_ptr;
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
zval_dtor(free_op2.var);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -17856,7 +18239,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
+ zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
} else {
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
@@ -17867,6 +18250,8 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND
call->called_scope = Z_OBJCE_P(call->object);
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -17880,9 +18265,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_free_op free_op1, free_op2;
SAVE_OPLINE();
- if (IS_VAR==IS_VAR) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
@@ -17923,7 +18305,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCOD
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
- } else {
+ zval_ptr_dtor_nogc(&free_op1.var);
+ } else if (IS_VAR == IS_CV) {
Z_ADDREF_P(expr_ptr);
}
}
@@ -17948,11 +18331,7 @@ num_index:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -17970,9 +18349,7 @@ num_index:
zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
}
if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- } else {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -18031,11 +18408,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (ht == &EG(symbol_table)) {
zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
@@ -18086,7 +18459,7 @@ num_index_dim:
} else {
zval_dtor(free_op2.var);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -18127,7 +18500,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE
} else {
zval_dtor(free_op2.var);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -18145,7 +18518,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(in
SAVE_OPLINE();
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
-
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
@@ -18172,11 +18544,7 @@ num_index_prop:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
isset = 1;
@@ -18269,7 +18637,7 @@ num_index_prop:
Z_LVAL(EX_T(opline->result.var).tmp_var) = !result;
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -18351,14 +18719,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
generator->value = *value_ptr;
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
}
} else {
zval *value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
/* Consts, temporary variables and references need copying */
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -18371,12 +18739,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
}
generator->value = copy;
+ zval_ptr_dtor_nogc(&free_op1.var);
} else {
- Z_ADDREF_P(value);
+ if (IS_VAR == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
}
} else {
/* If no value was specified yield null */
@@ -18444,6 +18813,26 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_POW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+ zend_free_op free_op1, free_op2;
+
+ SAVE_OPLINE();
+ pow_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ zval_ptr_dtor_nogc(&free_op1.var);
+ zval_dtor(free_op2.var);
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
+static int ZEND_FASTCALL ZEND_ASSIGN_POW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ return zend_binary_assign_op_helper_SPEC_VAR_TMP(pow_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+}
+
static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -18453,8 +18842,8 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
fast_add_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18468,8 +18857,8 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
fast_sub_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18483,8 +18872,8 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
fast_mul_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18498,8 +18887,8 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
fast_div_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18513,8 +18902,8 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
fast_mod_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18528,8 +18917,8 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
shift_left_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18543,8 +18932,8 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
shift_right_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18558,8 +18947,8 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
concat_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18573,8 +18962,8 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN
is_identical_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18590,8 +18979,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
Z_LVAL_P(result) = !Z_LVAL_P(result);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18606,8 +18995,8 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER
ZVAL_BOOL(result, fast_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC));
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18622,8 +19011,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN
ZVAL_BOOL(result, fast_not_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC));
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18638,8 +19027,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
ZVAL_BOOL(result, fast_is_smaller_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC));
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18654,8 +19043,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPC
ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC));
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18669,8 +19058,8 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
bitwise_or_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18684,8 +19073,8 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
bitwise_and_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18699,8 +19088,8 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18714,8 +19103,8 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER
boolean_xor_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18739,13 +19128,12 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
FREE_OP(free_op_data1);
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
} else {
/* here we are sure we are dealing with an object */
@@ -18765,7 +19153,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*zptr);
EX_T(opline->result.var).var.ptr = *zptr;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
}
@@ -18805,7 +19192,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(z);
EX_T(opline->result.var).var.ptr = z;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
zval_ptr_dtor(&z);
} else {
@@ -18813,7 +19199,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
zval_ptr_dtor(&object);
@@ -18822,12 +19207,12 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin
if (0) {
zval_ptr_dtor(&property);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
FREE_OP(free_op_data1);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -18879,10 +19264,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_VAR(int (*binary_
if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
if (opline->extended_value == ZEND_ASSIGN_DIM) {
ZEND_VM_INC_OPCODE();
@@ -18907,18 +19292,18 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_VAR(int (*binary_
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
if (opline->extended_value == ZEND_ASSIGN_DIM) {
FREE_OP(free_op_data1);
FREE_OP_VAR_PTR(free_op_data2);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
} else {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
@@ -19003,12 +19388,12 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t i
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
*retval = &EG(uninitialized_zval);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -19070,9 +19455,9 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t i
if (0) {
zval_ptr_dtor(&property);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -19111,9 +19496,9 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
ZVAL_NULL(retval);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -19174,9 +19559,9 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t
if (0) {
zval_ptr_dtor(&property);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -19225,7 +19610,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE
if (IS_VAR != IS_CONST && varname == &tmp_varname) {
zval_dtor(&tmp_varname);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -19235,7 +19620,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE
ce = EX_T(opline->op2.var).class_entry;
}
retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
} else {
target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
/*
@@ -19246,10 +19631,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE
*/
if (IS_VAR == IS_CONST) {
hash_value = Z_HASH_P(varname);
- } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
- hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
} else {
- hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
+ hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname));
}
if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
@@ -19274,14 +19657,14 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE
switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) {
case ZEND_FETCH_GLOBAL:
if (IS_VAR != IS_TMP_VAR) {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
}
break;
case ZEND_FETCH_LOCAL:
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
break;
case ZEND_FETCH_STATIC:
- zval_update_constant(retval, (void*) 1 TSRMLS_CC);
+ zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_VAR == IS_VAR && !free_op1.var) {
@@ -19302,7 +19685,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE
switch (type) {
case BP_VAR_R:
case BP_VAR_IS:
- AI_SET_PTR(&EX_T(opline->result.var), *retval);
+ EX_T(opline->result.var).var.ptr = *retval;
break;
case BP_VAR_UNSET: {
zend_free_op free_res;
@@ -19342,7 +19725,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_H
{
USE_OPLINE
- return zend_fetch_var_address_helper_SPEC_VAR_VAR(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ return zend_fetch_var_address_helper_SPEC_VAR_VAR(zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC) ? BP_VAR_W : BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -19362,14 +19745,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND
zval *container;
SAVE_OPLINE();
-
- if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
+ if (IS_VAR != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
+ zval_ptr_dtor_nogc(&free_op1.var);
+ }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -19387,11 +19768,11 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_W TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* We are going to assign the result by reference */
if (UNEXPECTED(opline->extended_value != 0)) {
@@ -19421,11 +19802,11 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_RW TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -19439,8 +19820,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_IS TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -19452,9 +19833,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCO
SAVE_OPLINE();
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
zval **container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
-
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -19462,8 +19842,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCO
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
} else {
zval *container;
@@ -19472,8 +19852,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCO
}
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
+ zval_ptr_dtor_nogc(&free_op1.var);
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -19497,11 +19877,11 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_UNSET TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
if (UNEXPECTED(EX_T(opline->result.var).var.ptr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_NEXT_OPCODE();
@@ -19536,8 +19916,8 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_VAR(ZE
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
+ zval_ptr_dtor_nogc(&free_op2.var);
} else {
zval *retval;
@@ -19549,16 +19929,16 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_VAR(ZE
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (0) {
zval_ptr_dtor(&offset);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -19590,12 +19970,12 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND
if (0) {
zval_ptr_dtor(&property);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* We are going to assign the result by reference */
if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
@@ -19633,12 +20013,12 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN
if (0) {
zval_ptr_dtor(&property);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -19658,8 +20038,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN
if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
+ zval_ptr_dtor_nogc(&free_op2.var);
} else {
zval *retval;
@@ -19671,16 +20051,16 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (0) {
zval_ptr_dtor(&offset);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -19689,7 +20069,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCO
{
USE_OPLINE
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1, free_op2;
zval *property;
@@ -19709,12 +20089,12 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCO
if (0) {
zval_ptr_dtor(&property);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else {
@@ -19748,12 +20128,12 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_
if (0) {
zval_ptr_dtor(&property);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
@@ -19786,9 +20166,9 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
if (0) {
zval_ptr_dtor(&property_name);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -19818,7 +20198,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
if (0) {
zval_ptr_dtor(&property_name);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
} else {
zend_free_op free_op2, free_op_data1, free_op_data2;
@@ -19827,7 +20207,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
zval **variable_ptr_ptr;
zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_VAR, BP_VAR_W TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
@@ -19839,11 +20219,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
ALLOC_ZVAL(retval);
ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
} else if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
if (IS_TMP_FREE(free_op_data1)) {
@@ -19851,7 +20231,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else {
if ((opline+1)->op1_type == IS_TMP_VAR) {
@@ -19863,13 +20243,13 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
}
FREE_OP_VAR_PTR(free_op_data2);
FREE_OP_IF_VAR(free_op_data1);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* assign_dim has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -19895,11 +20275,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
ALLOC_ZVAL(retval);
ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
} else if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else if (IS_VAR == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
if (0) {
@@ -19907,7 +20287,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else {
if (IS_VAR == IS_TMP_VAR) {
@@ -19919,14 +20299,14 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* zend_assign_to_variable() always takes care of op2, never free it! */
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -19952,7 +20332,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
}
zend_error(E_STRICT, "Only variables should be assigned by reference");
if (UNEXPECTED(EG(exception) != NULL)) {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ if (free_op2.var) {zval_ptr_dtor_nogc(&free_op2.var);};
HANDLE_EXCEPTION();
}
return ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@@ -19976,11 +20356,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*variable_ptr_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *variable_ptr_ptr);
+ EX_T(opline->result.var).var.ptr = *variable_ptr_ptr;
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
+ if (free_op2.var) {zval_ptr_dtor_nogc(&free_op2.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -20038,10 +20418,10 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE
}
} else {
if (UNEXPECTED(EG(exception) != NULL)) {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
HANDLE_EXCEPTION();
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object)));
}
if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
@@ -20057,11 +20437,13 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE
call->object = this_ptr;
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -20151,7 +20533,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND
}
}
if (IS_VAR != IS_CONST) {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
} else {
if (UNEXPECTED(ce->constructor == NULL)) {
@@ -20172,7 +20554,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
+ zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
} else {
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
@@ -20183,6 +20565,8 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND
call->called_scope = Z_OBJCE_P(call->object);
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -20196,14 +20580,11 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_free_op free_op1, free_op2;
SAVE_OPLINE();
- if (IS_VAR==IS_VAR) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20239,7 +20620,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
- } else {
+ zval_ptr_dtor_nogc(&free_op1.var);
+ } else if (IS_VAR == IS_CV) {
Z_ADDREF_P(expr_ptr);
}
}
@@ -20264,11 +20646,7 @@ num_index:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -20281,14 +20659,12 @@ num_index:
/* do nothing */
break;
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
} else {
zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
}
if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- } else {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -20357,7 +20733,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
} else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
zval_ptr_dtor(&varname);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
HANDLE_EXCEPTION();
}
if (UNEXPECTED(ce == NULL)) {
@@ -20381,7 +20757,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
} else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
zval_ptr_dtor(&varname);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20425,11 +20801,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (ht == &EG(symbol_table)) {
zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
@@ -20453,7 +20825,7 @@ num_index_dim:
zend_error(E_WARNING, "Illegal offset type in unset");
break;
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
break;
}
case IS_OBJECT:
@@ -20467,20 +20839,20 @@ num_index_dim:
if (0) {
zval_ptr_dtor(&offset);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
break;
case IS_STRING:
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
break;
}
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -20513,15 +20885,15 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
if (0) {
zval_ptr_dtor(&offset);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -20591,7 +20963,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD
if (IS_VAR != IS_CONST && varname == &tmp) {
zval_dtor(&tmp);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
}
if (opline->extended_value & ZEND_ISSET) {
@@ -20624,7 +20996,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(in
SAVE_OPLINE();
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
-
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
@@ -20651,11 +21022,7 @@ num_index_prop:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
isset = 1;
@@ -20684,7 +21051,7 @@ num_index_prop:
result = 1;
}
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
} else if (Z_TYPE_P(container) == IS_OBJECT) {
if (0) {
MAKE_REAL_ZVAL_PTR(offset);
@@ -20707,7 +21074,7 @@ num_index_prop:
if (0) {
zval_ptr_dtor(&offset);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
} else if (Z_TYPE_P(container) == IS_STRING && !prop_dim) { /* string offsets */
zval tmp;
@@ -20736,9 +21103,9 @@ num_index_prop:
}
}
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
@@ -20748,7 +21115,7 @@ num_index_prop:
Z_LVAL(EX_T(opline->result.var).tmp_var) = !result;
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -20830,14 +21197,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
generator->value = *value_ptr;
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
}
} else {
zval *value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
/* Consts, temporary variables and references need copying */
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -20850,12 +21217,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
}
generator->value = copy;
+ zval_ptr_dtor_nogc(&free_op1.var);
} else {
- Z_ADDREF_P(value);
+ if (IS_VAR == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
}
} else {
/* If no value was specified yield null */
@@ -20894,7 +21262,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
generator->largest_used_integer_key = Z_LVAL_P(generator->key);
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
} else {
/* If no key was specified we use auto-increment keys */
generator->largest_used_integer_key++;
@@ -20924,6 +21292,26 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_POW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+ zend_free_op free_op1, free_op2;
+
+ SAVE_OPLINE();
+ pow_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+ zval_ptr_dtor_nogc(&free_op1.var);
+ zval_ptr_dtor_nogc(&free_op2.var);
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
+static int ZEND_FASTCALL ZEND_ASSIGN_POW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ return zend_binary_assign_op_helper_SPEC_VAR_VAR(pow_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+}
+
static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -20949,7 +21337,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
} else {
/* here we are sure we are dealing with an object */
@@ -20969,7 +21356,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*zptr);
EX_T(opline->result.var).var.ptr = *zptr;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
}
@@ -21009,7 +21395,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(z);
EX_T(opline->result.var).var.ptr = z;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
zval_ptr_dtor(&z);
} else {
@@ -21017,7 +21402,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
zval_ptr_dtor(&object);
@@ -21031,7 +21415,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*
FREE_OP(free_op_data1);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -21083,10 +21467,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_UNUSED(int (*bina
if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
if (opline->extended_value == ZEND_ASSIGN_DIM) {
ZEND_VM_INC_OPCODE();
@@ -21111,17 +21495,17 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_UNUSED(int (*bina
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
if (opline->extended_value == ZEND_ASSIGN_DIM) {
FREE_OP(free_op_data1);
FREE_OP_VAR_PTR(free_op_data2);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
} else {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
@@ -21216,7 +21600,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type,
if (IS_VAR != IS_CONST && varname == &tmp_varname) {
zval_dtor(&tmp_varname);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -21226,7 +21610,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type,
ce = EX_T(opline->op2.var).class_entry;
}
retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
} else {
target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
/*
@@ -21237,10 +21621,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type,
*/
if (IS_VAR == IS_CONST) {
hash_value = Z_HASH_P(varname);
- } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
- hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
} else {
- hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
+ hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname));
}
if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
@@ -21265,14 +21647,14 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type,
switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) {
case ZEND_FETCH_GLOBAL:
if (IS_VAR != IS_TMP_VAR) {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
}
break;
case ZEND_FETCH_LOCAL:
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
break;
case ZEND_FETCH_STATIC:
- zval_update_constant(retval, (void*) 1 TSRMLS_CC);
+ zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_VAR == IS_VAR && !free_op1.var) {
@@ -21293,7 +21675,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type,
switch (type) {
case BP_VAR_R:
case BP_VAR_IS:
- AI_SET_PTR(&EX_T(opline->result.var), *retval);
+ EX_T(opline->result.var).var.ptr = *retval;
break;
case BP_VAR_UNSET: {
zend_free_op free_res;
@@ -21333,7 +21715,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCOD
{
USE_OPLINE
- return zend_fetch_var_address_helper_SPEC_VAR_UNUSED(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ return zend_fetch_var_address_helper_SPEC_VAR_UNUSED(zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC) ? BP_VAR_W : BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -21363,7 +21745,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_H
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* We are going to assign the result by reference */
if (UNEXPECTED(opline->extended_value != 0)) {
@@ -21397,7 +21779,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -21409,9 +21791,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_O
SAVE_OPLINE();
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
zval **container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
-
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -21420,7 +21801,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_O
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
} else {
zval *container;
@@ -21430,7 +21811,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_O
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, NULL, IS_UNUSED, BP_VAR_R TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -21479,11 +21860,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HA
ALLOC_ZVAL(retval);
ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
} else if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
if (IS_TMP_FREE(free_op_data1)) {
@@ -21491,7 +21872,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HA
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else {
if ((opline+1)->op1_type == IS_TMP_VAR) {
@@ -21503,13 +21884,13 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HA
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
}
FREE_OP_VAR_PTR(free_op_data2);
FREE_OP_IF_VAR(free_op_data1);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* assign_dim has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -21621,7 +22002,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
+ zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
} else {
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
@@ -21632,6 +22013,8 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z
call->called_scope = Z_OBJCE_P(call->object);
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -21670,7 +22053,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OP
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
- } else {
+ zval_ptr_dtor_nogc(&free_op1.var);
+ } else if (IS_VAR == IS_CV) {
Z_ADDREF_P(expr_ptr);
}
}
@@ -21695,11 +22079,7 @@ num_index:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -21717,9 +22097,7 @@ num_index:
zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
}
if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- } else {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -21788,7 +22166,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAN
} else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
zval_ptr_dtor(&varname);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
HANDLE_EXCEPTION();
}
if (UNEXPECTED(ce == NULL)) {
@@ -21812,7 +22190,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAN
} else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
zval_ptr_dtor(&varname);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -21881,7 +22259,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OP
if (IS_VAR != IS_CONST && varname == &tmp) {
zval_dtor(&tmp);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
}
if (opline->extended_value & ZEND_ISSET) {
@@ -21989,14 +22367,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER
generator->value = *value_ptr;
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
}
} else {
zval *value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
/* Consts, temporary variables and references need copying */
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -22009,12 +22387,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER
}
generator->value = copy;
+ zval_ptr_dtor_nogc(&free_op1.var);
} else {
- Z_ADDREF_P(value);
+ if (IS_VAR == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
}
} else {
/* If no value was specified yield null */
@@ -22082,6 +22461,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_ASSIGN_POW_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(pow_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+}
+
static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -22091,7 +22475,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
fast_add_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -22106,7 +22490,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
fast_sub_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -22121,7 +22505,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
fast_mul_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -22136,7 +22520,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
fast_div_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -22151,7 +22535,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
fast_mod_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -22166,7 +22550,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
shift_left_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -22181,7 +22565,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
shift_right_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -22196,7 +22580,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
concat_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -22211,7 +22595,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
is_identical_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -22228,7 +22612,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
Z_LVAL_P(result) = !Z_LVAL_P(result);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -22244,7 +22628,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_
ZVAL_BOOL(result, fast_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC));
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -22260,7 +22644,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
ZVAL_BOOL(result, fast_not_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC));
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -22276,7 +22660,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
ZVAL_BOOL(result, fast_is_smaller_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC));
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -22292,7 +22676,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCO
ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC));
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -22307,7 +22691,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
bitwise_or_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -22322,7 +22706,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
bitwise_and_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -22337,7 +22721,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -22352,7 +22736,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_
boolean_xor_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -22383,7 +22767,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
} else {
/* here we are sure we are dealing with an object */
@@ -22403,7 +22786,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*zptr);
EX_T(opline->result.var).var.ptr = *zptr;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
}
@@ -22443,7 +22825,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(z);
EX_T(opline->result.var).var.ptr = z;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
zval_ptr_dtor(&z);
} else {
@@ -22451,7 +22832,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
zval_ptr_dtor(&object);
@@ -22465,7 +22845,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina
FREE_OP(free_op_data1);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -22517,10 +22897,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CV(int (*binary_o
if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
if (opline->extended_value == ZEND_ASSIGN_DIM) {
ZEND_VM_INC_OPCODE();
@@ -22545,17 +22925,17 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CV(int (*binary_o
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
if (opline->extended_value == ZEND_ASSIGN_DIM) {
FREE_OP(free_op_data1);
FREE_OP_VAR_PTR(free_op_data2);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
} else {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
@@ -22645,7 +23025,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in
PZVAL_LOCK(&EG(uninitialized_zval));
*retval = &EG(uninitialized_zval);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22709,7 +23089,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in
} else {
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22750,7 +23130,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
ZVAL_NULL(retval);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22813,7 +23193,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i
} else {
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22835,14 +23215,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL
zval *container;
SAVE_OPLINE();
-
- if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (IS_VAR != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
+ zval_ptr_dtor_nogc(&free_op1.var);
+ }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22864,7 +23242,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* We are going to assign the result by reference */
if (UNEXPECTED(opline->extended_value != 0)) {
@@ -22898,7 +23276,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22913,7 +23291,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_IS TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -22925,9 +23303,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD
SAVE_OPLINE();
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
zval **container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
-
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -22936,7 +23313,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
} else {
zval *container;
@@ -22946,7 +23323,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -22974,7 +23351,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_H
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
if (UNEXPECTED(EX_T(opline->result.var).var.ptr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_NEXT_OPCODE();
@@ -23009,7 +23386,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CV(ZEN
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
} else {
zval *retval;
@@ -23022,7 +23399,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CV(ZEN
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (0) {
zval_ptr_dtor(&offset);
@@ -23031,7 +23408,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CV(ZEN
}
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -23068,7 +23445,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* We are going to assign the result by reference */
if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
@@ -23111,7 +23488,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -23131,7 +23508,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
} else {
zval *retval;
@@ -23144,7 +23521,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (0) {
zval_ptr_dtor(&offset);
@@ -23153,7 +23530,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
}
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -23162,7 +23539,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD
{
USE_OPLINE
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1;
zval *property;
@@ -23187,7 +23564,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else {
@@ -23226,7 +23603,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_H
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
@@ -23261,7 +23638,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
} else {
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* assign_obj has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -23311,11 +23688,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
ALLOC_ZVAL(retval);
ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
} else if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
if (IS_TMP_FREE(free_op_data1)) {
@@ -23323,7 +23700,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else {
if ((opline+1)->op1_type == IS_TMP_VAR) {
@@ -23335,13 +23712,13 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
}
FREE_OP_VAR_PTR(free_op_data2);
FREE_OP_IF_VAR(free_op_data1);
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* assign_dim has two opcodes! */
CHECK_EXCEPTION();
ZEND_VM_INC_OPCODE();
@@ -23367,11 +23744,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
ALLOC_ZVAL(retval);
ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
} else if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else if (IS_VAR == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
if (0) {
@@ -23379,7 +23756,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else {
if (IS_CV == IS_TMP_VAR) {
@@ -23391,11 +23768,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
/* zend_assign_to_variable() always takes care of op2, never free it! */
@@ -23447,10 +23824,10 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*variable_ptr_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *variable_ptr_ptr);
+ EX_T(opline->result.var).var.ptr = *variable_ptr_ptr;
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -23511,7 +23888,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_
HANDLE_EXCEPTION();
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object)));
}
if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
@@ -23527,10 +23904,12 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_
call->object = this_ptr;
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -23641,7 +24020,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
- zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
+ zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
} else {
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name);
@@ -23652,6 +24031,8 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_
call->called_scope = Z_OBJCE_P(call->object);
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -23665,9 +24046,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_free_op free_op1;
SAVE_OPLINE();
- if (IS_VAR==IS_VAR) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
@@ -23707,7 +24085,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
- } else {
+ zval_ptr_dtor_nogc(&free_op1.var);
+ } else if (IS_VAR == IS_CV) {
Z_ADDREF_P(expr_ptr);
}
}
@@ -23732,11 +24111,7 @@ num_index:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -23754,9 +24129,7 @@ num_index:
zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
}
if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- } else {
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -23815,11 +24188,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (ht == &EG(symbol_table)) {
zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
@@ -23870,7 +24239,7 @@ num_index_dim:
} else {
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -23911,7 +24280,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
} else {
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -23929,7 +24298,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(int
SAVE_OPLINE();
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
-
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
@@ -23956,11 +24324,7 @@ num_index_prop:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
isset = 1;
@@ -24053,7 +24417,7 @@ num_index_prop:
Z_LVAL(EX_T(opline->result.var).tmp_var) = !result;
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -24135,14 +24499,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
generator->value = *value_ptr;
}
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);};
}
} else {
zval *value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
/* Consts, temporary variables and references need copying */
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -24155,12 +24519,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
generator->value = copy;
+ zval_ptr_dtor_nogc(&free_op1.var);
} else {
- Z_ADDREF_P(value);
+ if (IS_VAR == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
- if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
}
} else {
/* If no value was specified yield null */
@@ -24228,6 +24593,26 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_POW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+ zend_free_op free_op1;
+
+ SAVE_OPLINE();
+ pow_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC),
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ zval_ptr_dtor_nogc(&free_op1.var);
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
+static int ZEND_FASTCALL ZEND_ASSIGN_POW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ return zend_binary_assign_op_helper_SPEC_VAR_CV(pow_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+}
+
static int ZEND_FASTCALL ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -24286,7 +24671,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(&retval);
} else {
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
}
@@ -24341,7 +24726,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
} else {
/* here we are sure we are dealing with an object */
@@ -24361,7 +24745,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*zptr);
EX_T(opline->result.var).var.ptr = *zptr;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
}
@@ -24401,7 +24784,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(z);
EX_T(opline->result.var).var.ptr = z;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
zval_ptr_dtor(&z);
} else {
@@ -24409,7 +24791,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
zval_ptr_dtor(&object);
@@ -24474,7 +24855,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_CONST(int (*bi
if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
@@ -24502,7 +24883,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_CONST(int (*bi
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
if (opline->extended_value == ZEND_ASSIGN_DIM) {
@@ -24801,7 +25182,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_CON
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
} else {
zval *retval;
@@ -24814,7 +25195,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_CON
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (0) {
zval_ptr_dtor(&offset);
@@ -24921,7 +25302,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCOD
if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
} else {
zval *retval;
@@ -24934,7 +25315,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCOD
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (0) {
zval_ptr_dtor(&offset);
@@ -24951,7 +25332,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER(ZEND
{
USE_OPLINE
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1;
zval *property;
@@ -25157,7 +25538,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_O
HANDLE_EXCEPTION();
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object)));
}
if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
@@ -25173,6 +25554,8 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_O
call->object = this_ptr;
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -25214,8 +25597,6 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
retval = &EX_T(opline->result.var).tmp_var;
ZVAL_COPY_VALUE(retval, &c->value);
zval_copy_ctor(retval);
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
} else {
/* class constant */
zend_class_entry *ce;
@@ -25226,8 +25607,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
value = CACHED_PTR(opline->op2.literal->cache_slot);
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
+ goto constant_fetch_end;
} else if (CACHED_PTR(opline->op1.literal->cache_slot)) {
ce = CACHED_PTR(opline->op1.literal->cache_slot);
} else {
@@ -25245,18 +25625,16 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
if ((value = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce)) != NULL) {
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
+ goto constant_fetch_end;
}
}
if (EXPECTED(zend_hash_quick_find(&ce->constants_table, Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv)+1, Z_HASH_P(opline->op2.zv), (void **) &value) == SUCCESS)) {
- if (Z_TYPE_PP(value) == IS_CONSTANT_ARRAY ||
- (Z_TYPE_PP(value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
+ if (IS_CONSTANT_TYPE(Z_TYPE_PP(value))) {
zend_class_entry *old_scope = EG(scope);
EG(scope) = ce;
- zval_update_constant(value, (void *) 1 TSRMLS_CC);
+ zval_update_constant(value, 1 TSRMLS_CC);
EG(scope) = old_scope;
}
if (IS_UNUSED == IS_CONST) {
@@ -25266,16 +25644,16 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
}
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
- } else if (Z_STRLEN_P(opline->op2.zv) == sizeof("class")-1 && strcmp(Z_STRVAL_P(opline->op2.zv), "class") == 0) {
+ } else if (Z_STRLEN_P(opline->op2.zv) == sizeof("class")-1 && memcmp(Z_STRVAL_P(opline->op2.zv), "class", sizeof("class") - 1) == 0) {
/* "class" is assigned as a case-sensitive keyword from zend_do_resolve_class_name */
ZVAL_STRINGL(&EX_T(opline->result.var).tmp_var, ce->name, ce->name_length, 1);
} else {
zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
}
-
- CHECK_EXCEPTION();
- ZEND_VM_NEXT_OPCODE();
}
+constant_fetch_end:
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -25331,11 +25709,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (ht == &EG(symbol_table)) {
zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
@@ -25443,7 +25817,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CON
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(TSRMLS_C);
-
offset = opline->op2.zv;
if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
@@ -25470,11 +25843,7 @@ num_index_prop:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
isset = 1;
@@ -25653,7 +26022,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDL
/* Consts, temporary variables and references need copying */
if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -25666,11 +26035,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDL
}
generator->value = copy;
+
} else {
- Z_ADDREF_P(value);
+ if (IS_UNUSED == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
}
} else {
/* If no value was specified yield null */
@@ -25738,6 +26109,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDL
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_ASSIGN_POW_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(pow_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+}
+
static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -25763,7 +26139,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
} else {
/* here we are sure we are dealing with an object */
@@ -25783,7 +26158,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*zptr);
EX_T(opline->result.var).var.ptr = *zptr;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
}
@@ -25823,7 +26197,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(z);
EX_T(opline->result.var).var.ptr = z;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
zval_ptr_dtor(&z);
} else {
@@ -25831,7 +26204,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
zval_ptr_dtor(&object);
@@ -25896,7 +26268,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_TMP(int (*bina
if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
zval_dtor(free_op2.var);
@@ -25924,7 +26296,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_TMP(int (*bina
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
zval_dtor(free_op2.var);
@@ -26224,7 +26596,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
zval_dtor(free_op2.var);
} else {
zval *retval;
@@ -26237,7 +26609,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (1) {
zval_ptr_dtor(&offset);
@@ -26344,7 +26716,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_
if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
zval_dtor(free_op2.var);
} else {
zval *retval;
@@ -26357,7 +26729,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (1) {
zval_ptr_dtor(&offset);
@@ -26374,7 +26746,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMP_HANDLER(ZEND_O
{
USE_OPLINE
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1, free_op2;
zval *property;
@@ -26579,7 +26951,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPC
zval_dtor(free_op2.var);
HANDLE_EXCEPTION();
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object)));
}
if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
@@ -26595,6 +26967,8 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPC
call->object = this_ptr;
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -26657,11 +27031,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (ht == &EG(symbol_table)) {
zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
@@ -26769,7 +27139,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(TSRMLS_C);
-
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
@@ -26796,11 +27165,7 @@ num_index_prop:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
isset = 1;
@@ -26979,7 +27344,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER
/* Consts, temporary variables and references need copying */
if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -26992,11 +27357,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER
}
generator->value = copy;
+
} else {
- Z_ADDREF_P(value);
+ if (IS_UNUSED == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
}
} else {
/* If no value was specified yield null */
@@ -27064,6 +27431,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_ASSIGN_POW_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(pow_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+}
+
static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -27083,13 +27455,12 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
FREE_OP(free_op_data1);
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
} else {
/* here we are sure we are dealing with an object */
@@ -27109,7 +27480,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*zptr);
EX_T(opline->result.var).var.ptr = *zptr;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
}
@@ -27149,7 +27519,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(z);
EX_T(opline->result.var).var.ptr = z;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
zval_ptr_dtor(&z);
} else {
@@ -27157,7 +27526,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
zval_ptr_dtor(&object);
@@ -27166,7 +27534,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*
if (0) {
zval_ptr_dtor(&property);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
FREE_OP(free_op_data1);
}
@@ -27222,9 +27590,9 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_VAR(int (*bina
if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
if (opline->extended_value == ZEND_ASSIGN_DIM) {
@@ -27250,9 +27618,9 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_VAR(int (*bina
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
if (opline->extended_value == ZEND_ASSIGN_DIM) {
FREE_OP(free_op_data1);
@@ -27346,7 +27714,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
*retval = &EG(uninitialized_zval);
@@ -27413,7 +27781,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_
if (0) {
zval_ptr_dtor(&property);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
CHECK_EXCEPTION();
@@ -27454,7 +27822,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
ZVAL_NULL(retval);
CHECK_EXCEPTION();
@@ -27517,7 +27885,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec
if (0) {
zval_ptr_dtor(&property);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
CHECK_EXCEPTION();
@@ -27550,8 +27918,8 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
+ zval_ptr_dtor_nogc(&free_op2.var);
} else {
zval *retval;
@@ -27563,12 +27931,12 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (0) {
zval_ptr_dtor(&offset);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
}
@@ -27603,7 +27971,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_H
if (0) {
zval_ptr_dtor(&property);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
@@ -27645,7 +28013,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_
if (0) {
zval_ptr_dtor(&property);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
@@ -27670,8 +28038,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_
if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
+ zval_ptr_dtor_nogc(&free_op2.var);
} else {
zval *retval;
@@ -27683,12 +28051,12 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (0) {
zval_ptr_dtor(&offset);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
}
@@ -27700,7 +28068,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_HANDLER(ZEND_O
{
USE_OPLINE
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1, free_op2;
zval *property;
@@ -27720,7 +28088,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_HANDLER(ZEND_O
if (0) {
zval_ptr_dtor(&property);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
@@ -27759,7 +28127,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCO
if (0) {
zval_ptr_dtor(&property);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
@@ -27796,7 +28164,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HA
if (0) {
zval_ptr_dtor(&property_name);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
/* assign_obj has two opcodes! */
@@ -27844,7 +28212,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDL
* which aren't affected by FREE_OP(Ts, )'s anyway, unless they're
* string offsets or overloaded objects
*/
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -27902,10 +28270,10 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPC
}
} else {
if (UNEXPECTED(EG(exception) != NULL)) {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
HANDLE_EXCEPTION();
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object)));
}
if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
@@ -27921,10 +28289,12 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPC
call->object = this_ptr;
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -27983,11 +28353,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (ht == &EG(symbol_table)) {
zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
@@ -28011,7 +28377,7 @@ num_index_dim:
zend_error(E_WARNING, "Illegal offset type in unset");
break;
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
break;
}
case IS_OBJECT:
@@ -28025,18 +28391,18 @@ num_index_dim:
if (0) {
zval_ptr_dtor(&offset);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
break;
case IS_STRING:
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
break;
}
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
CHECK_EXCEPTION();
@@ -28070,13 +28436,13 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN
if (0) {
zval_ptr_dtor(&offset);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
CHECK_EXCEPTION();
@@ -28095,7 +28461,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(TSRMLS_C);
-
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
@@ -28122,11 +28487,7 @@ num_index_prop:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
isset = 1;
@@ -28155,7 +28516,7 @@ num_index_prop:
result = 1;
}
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
} else if (Z_TYPE_P(container) == IS_OBJECT) {
if (0) {
MAKE_REAL_ZVAL_PTR(offset);
@@ -28178,7 +28539,7 @@ num_index_prop:
if (0) {
zval_ptr_dtor(&offset);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
} else if (Z_TYPE_P(container) == IS_STRING && !prop_dim) { /* string offsets */
zval tmp;
@@ -28207,9 +28568,9 @@ num_index_prop:
}
}
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
@@ -28305,7 +28666,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER
/* Consts, temporary variables and references need copying */
if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -28318,11 +28679,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER
}
generator->value = copy;
+
} else {
- Z_ADDREF_P(value);
+ if (IS_UNUSED == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
}
} else {
/* If no value was specified yield null */
@@ -28361,7 +28724,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER
generator->largest_used_integer_key = Z_LVAL_P(generator->key);
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
} else {
/* If no key was specified we use auto-increment keys */
generator->largest_used_integer_key++;
@@ -28391,6 +28754,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_ASSIGN_POW_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(pow_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+}
+
static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -28416,7 +28784,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
} else {
/* here we are sure we are dealing with an object */
@@ -28436,7 +28803,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*zptr);
EX_T(opline->result.var).var.ptr = *zptr;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
}
@@ -28476,7 +28842,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(z);
EX_T(opline->result.var).var.ptr = z;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
zval_ptr_dtor(&z);
} else {
@@ -28484,7 +28849,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
zval_ptr_dtor(&object);
@@ -28549,7 +28913,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(int (*b
if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
@@ -28577,7 +28941,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(int (*b
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
if (opline->extended_value == ZEND_ASSIGN_DIM) {
@@ -28734,7 +29098,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HAND
/* Consts, temporary variables and references need copying */
if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -28747,11 +29111,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HAND
}
generator->value = copy;
+
} else {
- Z_ADDREF_P(value);
+ if (IS_UNUSED == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
}
} else {
/* If no value was specified yield null */
@@ -28819,6 +29185,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HAND
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_ASSIGN_POW_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(pow_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+}
+
static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -28844,7 +29215,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
} else {
/* here we are sure we are dealing with an object */
@@ -28864,7 +29234,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*zptr);
EX_T(opline->result.var).var.ptr = *zptr;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
}
@@ -28904,7 +29273,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(z);
EX_T(opline->result.var).var.ptr = z;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
zval_ptr_dtor(&z);
} else {
@@ -28912,7 +29280,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
zval_ptr_dtor(&object);
@@ -28977,7 +29344,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_CV(int (*binar
if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
@@ -29005,7 +29372,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_CV(int (*binar
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
if (opline->extended_value == ZEND_ASSIGN_DIM) {
@@ -29304,7 +29671,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
} else {
zval *retval;
@@ -29317,7 +29684,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (0) {
zval_ptr_dtor(&offset);
@@ -29424,7 +29791,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_H
if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
} else {
zval *retval;
@@ -29437,7 +29804,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_H
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (0) {
zval_ptr_dtor(&offset);
@@ -29454,7 +29821,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER(ZEND_OP
{
USE_OPLINE
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1;
zval *property;
@@ -29658,7 +30025,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCO
HANDLE_EXCEPTION();
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object)));
}
if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
@@ -29674,6 +30041,8 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCO
call->object = this_ptr;
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -29735,11 +30104,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (ht == &EG(symbol_table)) {
zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
@@ -29847,7 +30212,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV(
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(TSRMLS_C);
-
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
@@ -29874,11 +30238,7 @@ num_index_prop:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
isset = 1;
@@ -30057,7 +30417,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_
/* Consts, temporary variables and references need copying */
if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -30070,11 +30430,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_
}
generator->value = copy;
+
} else {
- Z_ADDREF_P(value);
+ if (IS_UNUSED == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
}
} else {
/* If no value was specified yield null */
@@ -30142,6 +30504,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_ASSIGN_POW_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ return zend_binary_assign_op_helper_SPEC_UNUSED_CV(pow_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+}
+
static int ZEND_FASTCALL ZEND_BW_NOT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -30183,7 +30550,7 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (IS_CV == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
CHECK_EXCEPTION();
@@ -30207,7 +30574,7 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
CHECK_EXCEPTION();
@@ -30229,7 +30596,7 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (IS_CV == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
CHECK_EXCEPTION();
@@ -30253,7 +30620,7 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
CHECK_EXCEPTION();
@@ -30536,9 +30903,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
retval_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
if (!EG(return_value_ptr_ptr)) {
- if (IS_CV == IS_TMP_VAR) {
- }
} else {
if (IS_CV == IS_CONST ||
IS_CV == IS_TMP_VAR ||
@@ -30551,18 +30916,23 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval_copy_ctor(ret);
}
*EG(return_value_ptr_ptr) = ret;
+
} else if ((IS_CV == IS_CV || IS_CV == IS_VAR) &&
retval_ptr == &EG(uninitialized_zval)) {
zval *ret;
+ if (IS_CV == IS_VAR) {
+ Z_DELREF_P(retval_ptr);
+ }
ALLOC_INIT_ZVAL(ret);
*EG(return_value_ptr_ptr) = ret;
} else {
*EG(return_value_ptr_ptr) = retval_ptr;
- Z_ADDREF_P(retval_ptr);
+ if (IS_CV == IS_CV) {
+ Z_ADDREF_P(retval_ptr);
+ }
}
}
-
return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
@@ -30576,7 +30946,8 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
do {
- if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) {
+ if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR ||
+ (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) {
/* Not supposed to happen, but we'll allow it */
zend_error(E_NOTICE, "Only variable references should be returned by reference");
@@ -30675,21 +31046,26 @@ static int ZEND_FASTCALL zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARG
varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
if (varptr == &EG(uninitialized_zval)) {
- ALLOC_ZVAL(varptr);
- INIT_ZVAL(*varptr);
- Z_SET_REFCOUNT_P(varptr, 0);
+ if (IS_CV == IS_VAR) {
+ Z_DELREF_P(varptr);
+ }
+ ALLOC_INIT_ZVAL(varptr);
} else if (PZVAL_IS_REF(varptr)) {
- zval *original_var = varptr;
+ if (IS_CV == IS_CV ||
+ (IS_CV == IS_VAR && Z_REFCOUNT_P(varptr) > 2)) {
+ zval *original_var = varptr;
- ALLOC_ZVAL(varptr);
- ZVAL_COPY_VALUE(varptr, original_var);
- Z_UNSET_ISREF_P(varptr);
- Z_SET_REFCOUNT_P(varptr, 0);
- zval_copy_ctor(varptr);
+ ALLOC_ZVAL(varptr);
+ INIT_PZVAL_COPY(varptr, original_var);
+ zval_copy_ctor(varptr);
+
+ } else {
+ Z_UNSET_ISREF_P(varptr);
+ }
+ } else if (IS_CV == IS_CV) {
+ Z_ADDREF_P(varptr);
}
- Z_ADDREF_P(varptr);
zend_vm_stack_push(varptr TSRMLS_CC);
- ; /* for string offsets */
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -30698,7 +31074,7 @@ static int ZEND_FASTCALL zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARG
static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
- zend_free_op free_op1;
+
zval *varptr;
SAVE_OPLINE();
@@ -30706,33 +31082,28 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) {
return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
- } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
- return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
- }
-
- if (IS_CV == IS_VAR &&
- (opline->extended_value & ZEND_ARG_SEND_FUNCTION) &&
- EX_T(opline->op1.var).var.fcall_returned_reference &&
- EX_T(opline->op1.var).var.ptr) {
- varptr = EX_T(opline->op1.var).var.ptr;
- PZVAL_UNLOCK_EX(varptr, &free_op1, 0);
} else {
- varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
+ return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ }
}
+
+ varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) ||
EX_T(opline->op1.var).var.fcall_returned_reference) &&
varptr != &EG(uninitialized_zval) &&
- (PZVAL_IS_REF(varptr) ||
- (Z_REFCOUNT_P(varptr) == 1 && (IS_CV == IS_CV || free_op1.var)))) {
+ (PZVAL_IS_REF(varptr) || Z_REFCOUNT_P(varptr) == 1)) {
Z_SET_ISREF_P(varptr);
- Z_ADDREF_P(varptr);
+ if (IS_CV == IS_CV) {
+ Z_ADDREF_P(varptr);
+ }
zend_vm_stack_push(varptr TSRMLS_CC);
} else {
zval *valptr;
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
- !ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
+ !ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
zend_error(E_STRICT, "Only variables should be passed by reference");
}
ALLOC_ZVAL(valptr);
@@ -30740,9 +31111,9 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
if (!0) {
zval_copy_ctor(valptr);
}
+
zend_vm_stack_push(valptr TSRMLS_CC);
}
-
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -30769,9 +31140,10 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
- EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
- !ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
- return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) {
+ if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
+ return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ }
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
@@ -30787,9 +31159,10 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
{
USE_OPLINE
- if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME)
- && ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
- return ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ if (opline->extended_value == ZEND_DO_FCALL_BY_NAME) {
+ if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
+ return ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ }
}
SAVE_OPLINE();
return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@@ -30867,7 +31240,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(&retval);
} else {
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
}
@@ -31025,7 +31398,6 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
EX(original_return_value) = EG(return_value_ptr_ptr);
EG(active_op_array) = new_op_array;
if (RETURN_VALUE_USED(opline)) {
- EX_T(opline->result.var).var.ptr = NULL;
EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
EG(return_value_ptr_ptr) = EX_T(opline->result.var).var.ptr_ptr;
} else {
@@ -31063,7 +31435,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
ALLOC_ZVAL(retval);
ZVAL_BOOL(retval, failure_retval);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
ZEND_VM_NEXT_OPCODE();
}
@@ -31125,19 +31497,27 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
if (!ce || !ce->get_iterator) {
- Z_ADDREF_P(array_ptr);
+ if (IS_CV == IS_CV) {
+ Z_ADDREF_P(array_ptr);
+ }
}
} else if (IS_CV == IS_CONST ||
- ((IS_CV == IS_CV || IS_CV == IS_VAR) &&
+ (IS_CV == IS_CV &&
+ !Z_ISREF_P(array_ptr) &&
+ Z_REFCOUNT_P(array_ptr) > 1) ||
+ (IS_CV == IS_VAR &&
!Z_ISREF_P(array_ptr) &&
- Z_REFCOUNT_P(array_ptr) > 1)) {
+ Z_REFCOUNT_P(array_ptr) > 2)) {
zval *tmp;
+ if (IS_CV == IS_VAR) {
+ Z_DELREF_P(array_ptr);
+ }
ALLOC_ZVAL(tmp);
INIT_PZVAL_COPY(tmp, array_ptr);
zval_copy_ctor(tmp);
array_ptr = tmp;
- } else {
+ } else if (IS_CV == IS_CV) {
Z_ADDREF_P(array_ptr);
}
}
@@ -31145,10 +31525,15 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
if (ce && ce->get_iterator) {
iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
+ if (IS_CV == IS_VAR && !(opline->extended_value & ZEND_FE_RESET_VARIABLE)) {
+
+ }
if (iter && EXPECTED(EG(exception) == NULL)) {
array_ptr = zend_iterator_wrap(iter TSRMLS_CC);
} else {
+ if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ }
if (!EG(exception)) {
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name);
}
@@ -31165,14 +31550,18 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
iter->funcs->rewind(iter TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(&array_ptr);
+ if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ }
HANDLE_EXCEPTION();
}
}
is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS;
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(&array_ptr);
+ if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ }
HANDLE_EXCEPTION();
}
iter->index = -1; /* will be set to 0 before using next handler */
@@ -31202,6 +31591,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
is_empty = 1;
}
+ if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+
+ }
if (is_empty) {
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
} else {
@@ -31658,7 +32050,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
} else {
/* here we are sure we are dealing with an object */
@@ -31678,7 +32069,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*zptr);
EX_T(opline->result.var).var.ptr = *zptr;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
}
@@ -31718,7 +32108,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(z);
EX_T(opline->result.var).var.ptr = z;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
zval_ptr_dtor(&z);
} else {
@@ -31726,7 +32115,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
zval_ptr_dtor(&object);
@@ -31791,7 +32179,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CONST(int (*binary
if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
@@ -31819,7 +32207,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CONST(int (*binary
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
if (opline->extended_value == ZEND_ASSIGN_DIM) {
@@ -32157,10 +32545,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_CONST(int type, Z
*/
if (IS_CV == IS_CONST) {
hash_value = Z_HASH_P(varname);
- } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
- hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
} else {
- hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
+ hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname));
}
if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
@@ -32192,7 +32578,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_CONST(int type, Z
break;
case ZEND_FETCH_STATIC:
- zval_update_constant(retval, (void*) 1 TSRMLS_CC);
+ zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_CV == IS_VAR && !free_op1.var) {
@@ -32213,7 +32599,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_CONST(int type, Z
switch (type) {
case BP_VAR_R:
case BP_VAR_IS:
- AI_SET_PTR(&EX_T(opline->result.var), *retval);
+ EX_T(opline->result.var).var.ptr = *retval;
break;
case BP_VAR_UNSET: {
zend_free_op free_res;
@@ -32253,7 +32639,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_
{
USE_OPLINE
- return zend_fetch_var_address_helper_SPEC_CV_CONST(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ return zend_fetch_var_address_helper_SPEC_CV_CONST(zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC) ? BP_VAR_W : BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -32273,14 +32659,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN
zval *container;
SAVE_OPLINE();
-
- if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
+ if (IS_CV != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
+ }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -32362,9 +32746,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPC
SAVE_OPLINE();
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
zval **container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
-
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -32446,7 +32829,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_CONST(Z
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
} else {
zval *retval;
@@ -32459,7 +32842,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_CONST(Z
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (0) {
zval_ptr_dtor(&offset);
@@ -32566,7 +32949,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA
if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
} else {
zval *retval;
@@ -32579,7 +32962,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (0) {
zval_ptr_dtor(&offset);
@@ -32596,7 +32979,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPC
{
USE_OPLINE
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1;
zval *property;
@@ -32744,11 +33127,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND
ALLOC_ZVAL(retval);
ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
} else if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
if (IS_TMP_FREE(free_op_data1)) {
@@ -32756,7 +33139,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else {
if ((opline+1)->op1_type == IS_TMP_VAR) {
@@ -32768,7 +33151,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
}
FREE_OP_VAR_PTR(free_op_data2);
@@ -32800,11 +33183,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_
ALLOC_ZVAL(retval);
ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
} else if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else if (IS_CV == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
if (0) {
@@ -32812,7 +33195,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else {
if (IS_CONST == IS_TMP_VAR) {
@@ -32824,7 +33207,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
}
@@ -32889,7 +33272,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER(ZEND_OPCOD
HANDLE_EXCEPTION();
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object)));
}
if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
@@ -32905,6 +33288,8 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER(ZEND_OPCOD
call->object = this_ptr;
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -32919,9 +33304,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
- if (IS_CV==IS_VAR) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
opline->op2.zv TSRMLS_CC);
@@ -32961,7 +33343,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCO
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
- } else {
+
+ } else if (IS_CV == IS_CV) {
Z_ADDREF_P(expr_ptr);
}
}
@@ -32986,11 +33369,7 @@ num_index:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -33009,8 +33388,6 @@ num_index:
}
if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) {
- } else {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -33147,11 +33524,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (ht == &EG(symbol_table)) {
zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
@@ -33344,7 +33717,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(i
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
-
offset = opline->op2.zv;
if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
@@ -33371,11 +33743,7 @@ num_index_prop:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
isset = 1;
@@ -33554,7 +33922,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
/* Consts, temporary variables and references need copying */
if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -33567,11 +33935,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
}
generator->value = copy;
+
} else {
- Z_ADDREF_P(value);
+ if (IS_CV == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
}
} else {
/* If no value was specified yield null */
@@ -33639,6 +34009,26 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_POW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+
+
+ SAVE_OPLINE();
+ pow_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
+
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
+static int ZEND_FASTCALL ZEND_ASSIGN_POW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ return zend_binary_assign_op_helper_SPEC_CV_CONST(pow_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+}
+
static int ZEND_FASTCALL ZEND_ADD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -33940,7 +34330,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
} else {
/* here we are sure we are dealing with an object */
@@ -33960,7 +34349,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*zptr);
EX_T(opline->result.var).var.ptr = *zptr;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
}
@@ -34000,7 +34388,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(z);
EX_T(opline->result.var).var.ptr = z;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
zval_ptr_dtor(&z);
} else {
@@ -34008,7 +34395,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
zval_ptr_dtor(&object);
@@ -34073,7 +34459,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_TMP(int (*binary_o
if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
zval_dtor(free_op2.var);
@@ -34101,7 +34487,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_TMP(int (*binary_o
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
zval_dtor(free_op2.var);
@@ -34392,14 +34778,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL
zval *container;
SAVE_OPLINE();
-
- if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
zval_dtor(free_op2.var);
+ if (IS_CV != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
+ }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -34481,9 +34865,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCOD
SAVE_OPLINE();
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
zval **container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
-
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -34565,7 +34948,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_TMP(ZEN
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
zval_dtor(free_op2.var);
} else {
zval *retval;
@@ -34578,7 +34961,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_TMP(ZEN
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (1) {
zval_ptr_dtor(&offset);
@@ -34685,7 +35068,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND
if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
zval_dtor(free_op2.var);
} else {
zval *retval;
@@ -34698,7 +35081,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (1) {
zval_ptr_dtor(&offset);
@@ -34715,7 +35098,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCOD
{
USE_OPLINE
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1, free_op2;
zval *property;
@@ -34864,11 +35247,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE
ALLOC_ZVAL(retval);
ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
} else if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
if (IS_TMP_FREE(free_op_data1)) {
@@ -34876,7 +35259,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else {
if ((opline+1)->op1_type == IS_TMP_VAR) {
@@ -34888,7 +35271,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
}
FREE_OP_VAR_PTR(free_op_data2);
@@ -34920,11 +35303,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
ALLOC_ZVAL(retval);
ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
} else if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else if (IS_CV == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
if (1) {
@@ -34932,7 +35315,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else {
if (IS_TMP_VAR == IS_TMP_VAR) {
@@ -34944,7 +35327,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
}
@@ -35009,7 +35392,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_
zval_dtor(free_op2.var);
HANDLE_EXCEPTION();
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object)));
}
if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
@@ -35025,6 +35408,8 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_
call->object = this_ptr;
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -35040,9 +35425,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_free_op free_op2;
SAVE_OPLINE();
- if (IS_CV==IS_VAR) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
@@ -35083,7 +35465,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
- } else {
+
+ } else if (IS_CV == IS_CV) {
Z_ADDREF_P(expr_ptr);
}
}
@@ -35108,11 +35491,7 @@ num_index:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -35131,8 +35510,6 @@ num_index:
}
if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) {
- } else {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -35191,11 +35568,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (ht == &EG(symbol_table)) {
zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
@@ -35303,7 +35676,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(int
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
-
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
@@ -35330,11 +35702,7 @@ num_index_prop:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
isset = 1;
@@ -35513,7 +35881,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
/* Consts, temporary variables and references need copying */
if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -35526,11 +35894,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
generator->value = copy;
+
} else {
- Z_ADDREF_P(value);
+ if (IS_CV == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
}
} else {
/* If no value was specified yield null */
@@ -35598,6 +35968,26 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_POW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+ zend_free_op free_op2;
+
+ SAVE_OPLINE();
+ pow_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+
+ zval_dtor(free_op2.var);
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
+static int ZEND_FASTCALL ZEND_ASSIGN_POW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ return zend_binary_assign_op_helper_SPEC_CV_TMP(pow_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+}
+
static int ZEND_FASTCALL ZEND_ADD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -35608,7 +35998,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -35623,7 +36013,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -35638,7 +36028,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -35653,7 +36043,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -35668,7 +36058,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -35683,7 +36073,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -35698,7 +36088,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -35713,7 +36103,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -35728,7 +36118,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -35745,7 +36135,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
Z_LVAL_P(result) = !Z_LVAL_P(result);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -35761,7 +36151,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC));
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -35777,7 +36167,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC));
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -35793,7 +36183,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC));
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -35809,7 +36199,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCO
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC));
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -35824,7 +36214,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -35839,7 +36229,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -35854,7 +36244,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -35869,7 +36259,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -35893,13 +36283,12 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
FREE_OP(free_op_data1);
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
} else {
/* here we are sure we are dealing with an object */
@@ -35919,7 +36308,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*zptr);
EX_T(opline->result.var).var.ptr = *zptr;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
}
@@ -35959,7 +36347,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(z);
EX_T(opline->result.var).var.ptr = z;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
zval_ptr_dtor(&z);
} else {
@@ -35967,7 +36354,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
zval_ptr_dtor(&object);
@@ -35976,7 +36362,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina
if (0) {
zval_ptr_dtor(&property);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
FREE_OP(free_op_data1);
}
@@ -36032,9 +36418,9 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_VAR(int (*binary_o
if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
if (opline->extended_value == ZEND_ASSIGN_DIM) {
@@ -36060,9 +36446,9 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_VAR(int (*binary_o
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
if (opline->extended_value == ZEND_ASSIGN_DIM) {
FREE_OP(free_op_data1);
@@ -36156,7 +36542,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t in
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
*retval = &EG(uninitialized_zval);
@@ -36223,7 +36609,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t in
if (0) {
zval_ptr_dtor(&property);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
CHECK_EXCEPTION();
@@ -36264,7 +36650,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t i
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
ZVAL_NULL(retval);
CHECK_EXCEPTION();
@@ -36327,7 +36713,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t i
if (0) {
zval_ptr_dtor(&property);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
CHECK_EXCEPTION();
@@ -36399,10 +36785,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type, ZEN
*/
if (IS_CV == IS_CONST) {
hash_value = Z_HASH_P(varname);
- } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
- hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
} else {
- hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
+ hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname));
}
if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
@@ -36434,7 +36818,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type, ZEN
break;
case ZEND_FETCH_STATIC:
- zval_update_constant(retval, (void*) 1 TSRMLS_CC);
+ zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_CV == IS_VAR && !free_op1.var) {
@@ -36455,7 +36839,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type, ZEN
switch (type) {
case BP_VAR_R:
case BP_VAR_IS:
- AI_SET_PTR(&EX_T(opline->result.var), *retval);
+ EX_T(opline->result.var).var.ptr = *retval;
break;
case BP_VAR_UNSET: {
zend_free_op free_res;
@@ -36495,7 +36879,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HA
{
USE_OPLINE
- return zend_fetch_var_address_helper_SPEC_CV_VAR(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ return zend_fetch_var_address_helper_SPEC_CV_VAR(zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC) ? BP_VAR_W : BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -36515,14 +36899,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL
zval *container;
SAVE_OPLINE();
-
- if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
+ if (IS_CV != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
+ }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -36540,7 +36922,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_W TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
@@ -36573,7 +36955,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_RW TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
@@ -36591,7 +36973,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_IS TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -36604,9 +36986,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCOD
SAVE_OPLINE();
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
zval **container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
-
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -36614,7 +36995,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCOD
if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
} else {
zval *container;
@@ -36624,7 +37005,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCOD
}
container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
CHECK_EXCEPTION();
@@ -36649,7 +37030,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_H
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_UNSET TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
}
@@ -36688,8 +37069,8 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_VAR(ZEN
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
+ zval_ptr_dtor_nogc(&free_op2.var);
} else {
zval *retval;
@@ -36701,12 +37082,12 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_VAR(ZEN
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (0) {
zval_ptr_dtor(&offset);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
}
@@ -36741,7 +37122,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL
if (0) {
zval_ptr_dtor(&property);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
@@ -36783,7 +37164,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND
if (0) {
zval_ptr_dtor(&property);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
@@ -36808,8 +37189,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND
if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
+ zval_ptr_dtor_nogc(&free_op2.var);
} else {
zval *retval;
@@ -36821,12 +37202,12 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (0) {
zval_ptr_dtor(&offset);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
}
@@ -36838,7 +37219,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCOD
{
USE_OPLINE
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1, free_op2;
zval *property;
@@ -36858,7 +37239,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCOD
if (0) {
zval_ptr_dtor(&property);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
@@ -36897,7 +37278,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_H
if (0) {
zval_ptr_dtor(&property);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
@@ -36934,7 +37315,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
if (0) {
zval_ptr_dtor(&property_name);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
/* assign_obj has two opcodes! */
@@ -36966,7 +37347,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
if (0) {
zval_ptr_dtor(&property_name);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
} else {
zend_free_op free_op2, free_op_data1, free_op_data2;
@@ -36975,7 +37356,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
zval **variable_ptr_ptr;
zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_VAR, BP_VAR_W TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
@@ -36987,11 +37368,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
ALLOC_ZVAL(retval);
ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
} else if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
if (IS_TMP_FREE(free_op_data1)) {
@@ -36999,7 +37380,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else {
if ((opline+1)->op1_type == IS_TMP_VAR) {
@@ -37011,7 +37392,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
}
FREE_OP_VAR_PTR(free_op_data2);
@@ -37043,11 +37424,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
ALLOC_ZVAL(retval);
ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
} else if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else if (IS_CV == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
if (0) {
@@ -37055,7 +37436,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else {
if (IS_VAR == IS_TMP_VAR) {
@@ -37067,12 +37448,12 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
}
/* zend_assign_to_variable() always takes care of op2, never free it! */
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -37098,7 +37479,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
}
zend_error(E_STRICT, "Only variables should be assigned by reference");
if (UNEXPECTED(EG(exception) != NULL)) {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ if (free_op2.var) {zval_ptr_dtor_nogc(&free_op2.var);};
HANDLE_EXCEPTION();
}
return ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@@ -37122,10 +37503,10 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*variable_ptr_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *variable_ptr_ptr);
+ EX_T(opline->result.var).var.ptr = *variable_ptr_ptr;
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ if (free_op2.var) {zval_ptr_dtor_nogc(&free_op2.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -37183,10 +37564,10 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_
}
} else {
if (UNEXPECTED(EG(exception) != NULL)) {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
HANDLE_EXCEPTION();
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object)));
}
if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
@@ -37202,10 +37583,12 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_
call->object = this_ptr;
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -37217,14 +37600,11 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_free_op free_op2;
SAVE_OPLINE();
- if (IS_CV==IS_VAR) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -37260,7 +37640,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
- } else {
+
+ } else if (IS_CV == IS_CV) {
Z_ADDREF_P(expr_ptr);
}
}
@@ -37285,11 +37666,7 @@ num_index:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -37302,14 +37679,12 @@ num_index:
/* do nothing */
break;
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
} else {
zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL);
}
if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) {
- } else {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -37446,11 +37821,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (ht == &EG(symbol_table)) {
zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
@@ -37474,7 +37845,7 @@ num_index_dim:
zend_error(E_WARNING, "Illegal offset type in unset");
break;
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
break;
}
case IS_OBJECT:
@@ -37488,18 +37859,18 @@ num_index_dim:
if (0) {
zval_ptr_dtor(&offset);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
break;
case IS_STRING:
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
break;
}
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
CHECK_EXCEPTION();
@@ -37533,13 +37904,13 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER
if (0) {
zval_ptr_dtor(&offset);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
CHECK_EXCEPTION();
@@ -37643,7 +38014,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(int
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
-
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
@@ -37670,11 +38040,7 @@ num_index_prop:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
isset = 1;
@@ -37703,7 +38069,7 @@ num_index_prop:
result = 1;
}
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
} else if (Z_TYPE_P(container) == IS_OBJECT) {
if (0) {
MAKE_REAL_ZVAL_PTR(offset);
@@ -37726,7 +38092,7 @@ num_index_prop:
if (0) {
zval_ptr_dtor(&offset);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
} else if (Z_TYPE_P(container) == IS_STRING && !prop_dim) { /* string offsets */
zval tmp;
@@ -37755,9 +38121,9 @@ num_index_prop:
}
}
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
} else {
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
}
Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
@@ -37853,7 +38219,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
/* Consts, temporary variables and references need copying */
if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -37866,11 +38232,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
generator->value = copy;
+
} else {
- Z_ADDREF_P(value);
+ if (IS_CV == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
}
} else {
/* If no value was specified yield null */
@@ -37909,7 +38277,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
generator->largest_used_integer_key = Z_LVAL_P(generator->key);
}
- if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ zval_ptr_dtor_nogc(&free_op2.var);
} else {
/* If no key was specified we use auto-increment keys */
generator->largest_used_integer_key++;
@@ -37939,6 +38307,26 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_POW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+ zend_free_op free_op2;
+
+ SAVE_OPLINE();
+ pow_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC);
+
+ zval_ptr_dtor_nogc(&free_op2.var);
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
+static int ZEND_FASTCALL ZEND_ASSIGN_POW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ return zend_binary_assign_op_helper_SPEC_CV_VAR(pow_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+}
+
static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -37964,7 +38352,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*b
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
} else {
/* here we are sure we are dealing with an object */
@@ -37984,7 +38371,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*b
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*zptr);
EX_T(opline->result.var).var.ptr = *zptr;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
}
@@ -38024,7 +38410,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*b
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(z);
EX_T(opline->result.var).var.ptr = z;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
zval_ptr_dtor(&z);
} else {
@@ -38032,7 +38417,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*b
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
zval_ptr_dtor(&object);
@@ -38097,7 +38481,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_UNUSED(int (*binar
if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
@@ -38125,7 +38509,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_UNUSED(int (*binar
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
if (opline->extended_value == ZEND_ASSIGN_DIM) {
@@ -38251,10 +38635,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_UNUSED(int type,
*/
if (IS_CV == IS_CONST) {
hash_value = Z_HASH_P(varname);
- } else if (IS_INTERNED(Z_STRVAL_P(varname))) {
- hash_value = INTERNED_HASH(Z_STRVAL_P(varname));
} else {
- hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
+ hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname));
}
if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
@@ -38286,7 +38668,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_UNUSED(int type,
break;
case ZEND_FETCH_STATIC:
- zval_update_constant(retval, (void*) 1 TSRMLS_CC);
+ zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_CV == IS_VAR && !free_op1.var) {
@@ -38307,7 +38689,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_UNUSED(int type,
switch (type) {
case BP_VAR_R:
case BP_VAR_IS:
- AI_SET_PTR(&EX_T(opline->result.var), *retval);
+ EX_T(opline->result.var).var.ptr = *retval;
break;
case BP_VAR_UNSET: {
zend_free_op free_res;
@@ -38347,7 +38729,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE
{
USE_OPLINE
- return zend_fetch_var_address_helper_SPEC_CV_UNUSED(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ return zend_fetch_var_address_helper_SPEC_CV_UNUSED(zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC) ? BP_VAR_W : BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -38422,9 +38804,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OP
SAVE_OPLINE();
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
zval **container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
-
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -38492,11 +38873,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAN
ALLOC_ZVAL(retval);
ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
} else if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
if (IS_TMP_FREE(free_op_data1)) {
@@ -38504,7 +38885,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAN
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else {
if ((opline+1)->op1_type == IS_TMP_VAR) {
@@ -38516,7 +38897,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAN
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
}
FREE_OP_VAR_PTR(free_op_data2);
@@ -38560,7 +38941,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPC
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
- } else {
+
+ } else if (IS_CV == IS_CV) {
Z_ADDREF_P(expr_ptr);
}
}
@@ -38585,11 +38967,7 @@ num_index:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -38608,8 +38986,6 @@ num_index:
}
if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) {
- } else {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -38864,7 +39240,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_
/* Consts, temporary variables and references need copying */
if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -38877,11 +39253,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_
}
generator->value = copy;
+
} else {
- Z_ADDREF_P(value);
+ if (IS_CV == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
}
} else {
/* If no value was specified yield null */
@@ -38949,6 +39327,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_ASSIGN_POW_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ return zend_binary_assign_op_helper_SPEC_CV_UNUSED(pow_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+}
+
static int ZEND_FASTCALL ZEND_ADD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -39250,7 +39633,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
} else {
/* here we are sure we are dealing with an object */
@@ -39270,7 +39652,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*zptr);
EX_T(opline->result.var).var.ptr = *zptr;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
}
@@ -39310,7 +39691,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(z);
EX_T(opline->result.var).var.ptr = z;
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
zval_ptr_dtor(&z);
} else {
@@ -39318,7 +39698,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
- EX_T(opline->result.var).var.ptr_ptr = NULL;
}
}
zval_ptr_dtor(&object);
@@ -39383,7 +39762,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CV(int (*binary_op
if (UNEXPECTED(*var_ptr == &EG(error_zval))) {
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
@@ -39411,7 +39790,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CV(int (*binary_op
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*var_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *var_ptr);
+ EX_T(opline->result.var).var.ptr = *var_ptr;
}
if (opline->extended_value == ZEND_ASSIGN_DIM) {
@@ -39701,14 +40080,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE
zval *container;
SAVE_OPLINE();
-
- if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
+ if (IS_CV != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
+ }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -39790,9 +40167,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
zval **container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
-
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -39874,7 +40250,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_CV(ZEND
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
} else {
zval *retval;
@@ -39887,7 +40263,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_CV(ZEND
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (0) {
zval_ptr_dtor(&offset);
@@ -39994,7 +40370,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL
if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
} else {
zval *retval;
@@ -40007,7 +40383,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL
retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
PZVAL_LOCK(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
if (0) {
zval_ptr_dtor(&offset);
@@ -40024,7 +40400,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE
{
USE_OPLINE
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1;
zval *property;
@@ -40172,11 +40548,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER
ALLOC_ZVAL(retval);
ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
} else if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
if (IS_TMP_FREE(free_op_data1)) {
@@ -40184,7 +40560,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else {
if ((opline+1)->op1_type == IS_TMP_VAR) {
@@ -40196,7 +40572,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
}
FREE_OP_VAR_PTR(free_op_data2);
@@ -40228,11 +40604,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
ALLOC_ZVAL(retval);
ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1);
INIT_PZVAL(retval);
- AI_SET_PTR(&EX_T(opline->result.var), retval);
+ EX_T(opline->result.var).var.ptr = retval;
}
} else if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else if (IS_CV == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) {
if (0) {
@@ -40240,7 +40616,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(&EG(uninitialized_zval));
- AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval));
+ EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
} else {
if (IS_CV == IS_TMP_VAR) {
@@ -40252,7 +40628,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(value);
- AI_SET_PTR(&EX_T(opline->result.var), value);
+ EX_T(opline->result.var).var.ptr = value;
}
}
@@ -40306,7 +40682,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER
if (RETURN_VALUE_USED(opline)) {
PZVAL_LOCK(*variable_ptr_ptr);
- AI_SET_PTR(&EX_T(opline->result.var), *variable_ptr_ptr);
+ EX_T(opline->result.var).var.ptr = *variable_ptr_ptr;
}
@@ -40369,7 +40745,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_H
HANDLE_EXCEPTION();
}
- zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
+ zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object)));
}
if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
@@ -40385,6 +40761,8 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_H
call->object = this_ptr;
}
}
+
+ call->num_additional_args = 0;
call->is_ctor_call = 0;
EX(call) = call;
@@ -40399,9 +40777,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
- if (IS_CV==IS_VAR) {
- PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
- }
is_equal_function(&EX_T(opline->result.var).tmp_var,
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
@@ -40441,7 +40816,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
- } else {
+
+ } else if (IS_CV == IS_CV) {
Z_ADDREF_P(expr_ptr);
}
}
@@ -40466,11 +40842,7 @@ num_index:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
@@ -40489,8 +40861,6 @@ num_index:
}
if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) {
- } else {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -40549,11 +40919,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (ht == &EG(symbol_table)) {
zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
@@ -40661,7 +41027,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(int
SAVE_OPLINE();
container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
-
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
@@ -40688,11 +41053,7 @@ num_index_prop:
hval = Z_HASH_P(offset);
} else {
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop);
- if (IS_INTERNED(Z_STRVAL_P(offset))) {
- hval = INTERNED_HASH(Z_STRVAL_P(offset));
- } else {
- hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
- }
+ hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset));
}
if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
isset = 1;
@@ -40871,7 +41232,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
/* Consts, temporary variables and references need copying */
if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR
- || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0)
+ || PZVAL_IS_REF(value)
) {
zval *copy;
@@ -40884,11 +41245,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
generator->value = copy;
+
} else {
- Z_ADDREF_P(value);
+ if (IS_CV == IS_CV) {
+ Z_ADDREF_P(value);
+ }
generator->value = value;
}
-
}
} else {
/* If no value was specified yield null */
@@ -40956,6 +41319,26 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
ZEND_VM_RETURN();
}
+static int ZEND_FASTCALL ZEND_POW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+
+
+ SAVE_OPLINE();
+ pow_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
+static int ZEND_FASTCALL ZEND_ASSIGN_POW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ return zend_binary_assign_op_helper_SPEC_CV_CV(pow_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+}
+
static int ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_error_noreturn(E_ERROR, "Invalid opcode %d/%d/%d.", OPLINE->opcode, OPLINE->op1_type, OPLINE->op2_type);
@@ -45066,6 +45449,106 @@ void zend_init_opcodes_handlers(void)
ZEND_FAST_RET_SPEC_HANDLER,
ZEND_FAST_RET_SPEC_HANDLER,
ZEND_FAST_RET_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_SEND_UNPACK_SPEC_HANDLER,
+ ZEND_POW_SPEC_CONST_CONST_HANDLER,
+ ZEND_POW_SPEC_CONST_TMP_HANDLER,
+ ZEND_POW_SPEC_CONST_VAR_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_POW_SPEC_CONST_CV_HANDLER,
+ ZEND_POW_SPEC_TMP_CONST_HANDLER,
+ ZEND_POW_SPEC_TMP_TMP_HANDLER,
+ ZEND_POW_SPEC_TMP_VAR_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_POW_SPEC_TMP_CV_HANDLER,
+ ZEND_POW_SPEC_VAR_CONST_HANDLER,
+ ZEND_POW_SPEC_VAR_TMP_HANDLER,
+ ZEND_POW_SPEC_VAR_VAR_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_POW_SPEC_VAR_CV_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_POW_SPEC_CV_CONST_HANDLER,
+ ZEND_POW_SPEC_CV_TMP_HANDLER,
+ ZEND_POW_SPEC_CV_VAR_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_POW_SPEC_CV_CV_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_ASSIGN_POW_SPEC_VAR_CONST_HANDLER,
+ ZEND_ASSIGN_POW_SPEC_VAR_TMP_HANDLER,
+ ZEND_ASSIGN_POW_SPEC_VAR_VAR_HANDLER,
+ ZEND_ASSIGN_POW_SPEC_VAR_UNUSED_HANDLER,
+ ZEND_ASSIGN_POW_SPEC_VAR_CV_HANDLER,
+ ZEND_ASSIGN_POW_SPEC_UNUSED_CONST_HANDLER,
+ ZEND_ASSIGN_POW_SPEC_UNUSED_TMP_HANDLER,
+ ZEND_ASSIGN_POW_SPEC_UNUSED_VAR_HANDLER,
+ ZEND_ASSIGN_POW_SPEC_UNUSED_UNUSED_HANDLER,
+ ZEND_ASSIGN_POW_SPEC_UNUSED_CV_HANDLER,
+ ZEND_ASSIGN_POW_SPEC_CV_CONST_HANDLER,
+ ZEND_ASSIGN_POW_SPEC_CV_TMP_HANDLER,
+ ZEND_ASSIGN_POW_SPEC_CV_VAR_HANDLER,
+ ZEND_ASSIGN_POW_SPEC_CV_UNUSED_HANDLER,
+ ZEND_ASSIGN_POW_SPEC_CV_CV_HANDLER,
ZEND_NULL_HANDLER
};
zend_opcode_handlers = (opcode_handler_t*)labels;
diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php
index f963a7a43d..0834b78676 100644
--- a/Zend/zend_vm_gen.php
+++ b/Zend/zend_vm_gen.php
@@ -143,6 +143,8 @@ $op1_get_zval_ptr_ptr = array(
"UNUSED" => "NULL",
"CV" => "_get_zval_ptr_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)",
);
+$op1_get_zval_ptr_ptr_fast = $op1_get_zval_ptr_ptr;
+$op1_get_zval_ptr_ptr_fast["VAR"] = "_get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)";
$op2_get_zval_ptr_ptr = array(
"ANY" => "get_zval_ptr_ptr(opline->op2_type, &opline->op2, execute_data, &free_op2, \\1)",
@@ -152,6 +154,8 @@ $op2_get_zval_ptr_ptr = array(
"UNUSED" => "NULL",
"CV" => "_get_zval_ptr_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)",
);
+$op2_get_zval_ptr_ptr_fast = $op2_get_zval_ptr_ptr;
+$op2_get_zval_ptr_ptr_fast["VAR"] = "_get_zval_ptr_ptr_var_fast(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)";
$op1_get_obj_zval_ptr = array(
"ANY" => "get_obj_zval_ptr(opline->op1_type, &opline->op1, execute_data, &free_op1, \\1)",
@@ -179,6 +183,8 @@ $op1_get_obj_zval_ptr_ptr = array(
"UNUSED" => "_get_obj_zval_ptr_ptr_unused(TSRMLS_C)",
"CV" => "_get_zval_ptr_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)",
);
+$op1_get_obj_zval_ptr_ptr_fast = $op1_get_obj_zval_ptr_ptr;
+$op1_get_obj_zval_ptr_ptr_fast["VAR"] = "_get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)";
$op2_get_obj_zval_ptr_ptr = array(
"ANY" => "get_obj_zval_ptr_ptr(opline->op2_type, &opline->op2, execute_data, &free_op2, \\1)",
@@ -188,6 +194,8 @@ $op2_get_obj_zval_ptr_ptr = array(
"UNUSED" => "_get_obj_zval_ptr_ptr_unused(TSRMLS_C)",
"CV" => "_get_zval_ptr_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)",
);
+$op2_get_obj_zval_ptr_ptr_fast = $op2_get_obj_zval_ptr_ptr;
+$op2_get_obj_zval_ptr_ptr_fast["VAR"] = "_get_zval_ptr_ptr_var_fast(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)";
$op1_is_tmp_free = array(
"ANY" => "IS_TMP_FREE(free_op1)",
@@ -210,7 +218,7 @@ $op2_is_tmp_free = array(
$op1_free_op = array(
"ANY" => "FREE_OP(free_op1)",
"TMP" => "zval_dtor(free_op1.var)",
- "VAR" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}",
+ "VAR" => "zval_ptr_dtor_nogc(&free_op1.var)",
"CONST" => "",
"UNUSED" => "",
"CV" => "",
@@ -219,7 +227,7 @@ $op1_free_op = array(
$op2_free_op = array(
"ANY" => "FREE_OP(free_op2)",
"TMP" => "zval_dtor(free_op2.var)",
- "VAR" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}",
+ "VAR" => "zval_ptr_dtor_nogc(&free_op2.var)",
"CONST" => "",
"UNUSED" => "",
"CV" => "",
@@ -228,7 +236,7 @@ $op2_free_op = array(
$op1_free_op_if_var = array(
"ANY" => "FREE_OP_IF_VAR(free_op1)",
"TMP" => "",
- "VAR" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}",
+ "VAR" => "zval_ptr_dtor_nogc(&free_op1.var)",
"CONST" => "",
"UNUSED" => "",
"CV" => "",
@@ -237,29 +245,33 @@ $op1_free_op_if_var = array(
$op2_free_op_if_var = array(
"ANY" => "FREE_OP_IF_VAR(free_op2)",
"TMP" => "",
- "VAR" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}",
+ "VAR" => "zval_ptr_dtor_nogc(&free_op2.var)",
"CONST" => "",
"UNUSED" => "",
"CV" => "",
);
$op1_free_op_var_ptr = array(
- "ANY" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}",
+ "ANY" => "if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}",
"TMP" => "",
- "VAR" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}",
+ "VAR" => "if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}",
"CONST" => "",
"UNUSED" => "",
"CV" => "",
);
+$op1_free_op_var_ptr_fast = $op1_free_op_var_ptr;
+$op1_free_op_var_ptr_fast["VAR"] = "zval_ptr_dtor_nogc(&free_op1.var)";
$op2_free_op_var_ptr = array(
- "ANY" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}",
+ "ANY" => "if (free_op2.var) {zval_ptr_dtor_nogc(&free_op2.var);}",
"TMP" => "",
- "VAR" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}",
+ "VAR" => "if (free_op2.var) {zval_ptr_dtor_nogc(&free_op2.var);}",
"CONST" => "",
"UNUSED" => "",
"CV" => "",
);
+$op2_free_op_var_ptr_fast = $op2_free_op_var_ptr;
+$op2_free_op_var_ptr_fast["VAR"] = "zval_ptr_dtor_nogc(&free_op2.var)";
$list = array(); // list of opcode handlers and helpers in original order
$opcodes = array(); // opcode handlers by code
@@ -311,7 +323,10 @@ function gen_code($f, $spec, $kind, $export, $code, $op1, $op2, $name) {
$op1_get_obj_zval_ptr_ptr, $op2_get_obj_zval_ptr_ptr,
$op1_is_tmp_free, $op2_is_tmp_free, $op1_free, $op2_free,
$op1_free_op, $op2_free_op, $op1_free_op_if_var, $op2_free_op_if_var,
- $op1_free_op_var_ptr, $op2_free_op_var_ptr, $prefix;
+ $op1_free_op_var_ptr, $op2_free_op_var_ptr, $prefix,
+ $op1_get_zval_ptr_ptr_fast, $op2_get_zval_ptr_ptr_fast,
+ $op1_get_obj_zval_ptr_ptr_fast, $op2_get_obj_zval_ptr_ptr_fast,
+ $op1_free_op_var_ptr_fast, $op2_free_op_var_ptr_fast;
// Specializing
$code = preg_replace(
@@ -336,6 +351,12 @@ function gen_code($f, $spec, $kind, $export, $code, $op1, $op2, $name) {
"/FREE_OP2_IF_VAR\(\)/",
"/FREE_OP1_VAR_PTR\(\)/",
"/FREE_OP2_VAR_PTR\(\)/",
+ "/GET_OP1_ZVAL_PTR_PTR_FAST\(([^)]*)\)/",
+ "/GET_OP2_ZVAL_PTR_PTR_FAST\(([^)]*)\)/",
+ "/GET_OP1_OBJ_ZVAL_PTR_PTR_FAST\(([^)]*)\)/",
+ "/GET_OP2_OBJ_ZVAL_PTR_PTR_FAST\(([^)]*)\)/",
+ "/FREE_OP1_VAR_PTR_FAST\(\)/",
+ "/FREE_OP2_VAR_PTR_FAST\(\)/",
"/^#ifdef\s+ZEND_VM_SPEC\s*\n/m",
"/^#ifndef\s+ZEND_VM_SPEC\s*\n/m",
"/\!defined\(ZEND_VM_SPEC\)/m",
@@ -368,6 +389,12 @@ function gen_code($f, $spec, $kind, $export, $code, $op1, $op2, $name) {
$op2_free_op_if_var[$op2],
$op1_free_op_var_ptr[$op1],
$op2_free_op_var_ptr[$op2],
+ $op1_get_zval_ptr_ptr_fast[$op1],
+ $op2_get_zval_ptr_ptr_fast[$op2],
+ $op1_get_obj_zval_ptr_ptr_fast[$op1],
+ $op2_get_obj_zval_ptr_ptr_fast[$op2],
+ $op1_free_op_var_ptr_fast[$op1],
+ $op2_free_op_var_ptr_fast[$op2],
($op1!="ANY"||$op2!="ANY")?"#if 1\n":"#if 0\n",
($op1!="ANY"||$op2!="ANY")?"#if 0\n":"#if 1\n",
($op1!="ANY"||$op2!="ANY")?"0":"1",
diff --git a/Zend/zend_vm_opcodes.c b/Zend/zend_vm_opcodes.c
index e23789de65..6fb93d4f12 100644
--- a/Zend/zend_vm_opcodes.c
+++ b/Zend/zend_vm_opcodes.c
@@ -21,7 +21,7 @@
#include <stdio.h>
#include <zend.h>
-const char *zend_vm_opcodes_map[164] = {
+const char *zend_vm_opcodes_map[168] = {
"ZEND_NOP",
"ZEND_ADD",
"ZEND_SUB",
@@ -186,6 +186,10 @@ const char *zend_vm_opcodes_map[164] = {
"ZEND_GENERATOR_RETURN",
"ZEND_FAST_CALL",
"ZEND_FAST_RET",
+ "ZEND_RECV_VARIADIC",
+ "ZEND_SEND_UNPACK",
+ "ZEND_POW",
+ "ZEND_ASSIGN_POW",
};
ZEND_API const char* zend_get_opcode_name(zend_uchar opcode) {
diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h
index 89a07acfa4..76b5f4c6e9 100644
--- a/Zend/zend_vm_opcodes.h
+++ b/Zend/zend_vm_opcodes.h
@@ -173,5 +173,9 @@ END_EXTERN_C()
#define ZEND_GENERATOR_RETURN 161
#define ZEND_FAST_CALL 162
#define ZEND_FAST_RET 163
+#define ZEND_RECV_VARIADIC 164
+#define ZEND_SEND_UNPACK 165
+#define ZEND_POW 166
+#define ZEND_ASSIGN_POW 167
#endif