diff --git a/.gitattributes b/.gitattributes index f48ad38757f..f26eb409464 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,159 +1,20 @@ -ext/mysqlnd/mysqlnd.h ident -ext/ext_skel.php ident -ext/phar/phar/pharcommand.inc ident -ext/dba/libinifile/inifile.c ident -ext/dba/libflatfile/flatfile.c ident -ext/dba/libcdb/cdb_make.c ident -ext/dba/libcdb/cdb.c ident -run-tests.php ident -NEWS merge=NEWS -UPGRADING merge=NEWS -UPGRADING.INTERNALS merge=NEWS -/ext/bz2/tests/with_strings.phpt -crlf -/ext/dom/tests/bug40836.phpt -crlf -/ext/dom/tests/domelement.phpt -crlf -/ext/iconv/tests/iconv004.phpt -crlf -/ext/iconv/tests/iconv_basic.phpt -crlf -/ext/iconv/tests/iconv_strpos.phpt -crlf -/ext/iconv/tests/iconv_strpos_variation2.phpt -crlf -/ext/mbstring/tests/mb_strtoupper_error2.phpt -crlf -/ext/phar/tests/delete_in_phar_confirm.phpt -crlf -/ext/phar/tests/frontcontroller12.phpt -crlf -/ext/phar/tests/security.phpt -crlf -/ext/phar/tests/test_signaturealgos.phpt -crlf -/ext/reflection/tests/ReflectionMethod_invokeArgs_basic.phpt -crlf -/ext/reflection/tests/ReflectionProperty_getModifiers_basic.phpt -crlf -/ext/spl/tests/dllist_007.phpt -crlf -/ext/spl/tests/iterator_012.phpt -crlf -/ext/spl/tests/SplArray_fromArray.phpt -crlf -/ext/standard/tests/dir/scandir_variation3.phpt -crlf -/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt -crlf -/ext/standard/tests/strings/bug26817.phpt -crlf -/ext/standard/tests/strings/bug26973.phpt -crlf -/ext/standard/tests/strings/bug27457.phpt -crlf -/ext/standard/tests/strings/bug28386.phpt -crlf -/ext/standard/tests/strings/bug37262.phpt -crlf -/ext/standard/tests/strings/bug40637.phpt -crlf -/ext/standard/tests/strings/bug40915.phpt -crlf -/ext/standard/tests/strings/bug61374.phpt -crlf -/ext/standard/tests/strings/chop_error.phpt -crlf -/ext/standard/tests/strings/chop_variation2.phpt -crlf -/ext/standard/tests/strings/chunk_split_variation10.phpt -crlf -/ext/standard/tests/strings/chunk_split_variation8.phpt -crlf -/ext/standard/tests/strings/count_chars_variation2.phpt -crlf -/ext/standard/tests/strings/dirname_error.phpt -crlf -/ext/standard/tests/strings/fprintf_variation_007_64bit.phpt -crlf -/ext/standard/tests/strings/highlight_file.phpt -crlf -/ext/standard/tests/strings/htmlentities03.phpt -crlf -/ext/standard/tests/strings/htmlentities04.phpt -crlf -/ext/standard/tests/strings/htmlentities08.phpt -crlf -/ext/standard/tests/strings/htmlentities15.phpt -crlf -/ext/standard/tests/strings/http_build_query.phpt -crlf -/ext/standard/tests/strings/metaphone.phpt -crlf -/ext/standard/tests/strings/ord_error.phpt -crlf -/ext/standard/tests/strings/printf_basic2.phpt -crlf -/ext/standard/tests/strings/printf_variation2.phpt -crlf -/ext/standard/tests/strings/quoted_printable_decode_basic.phpt -crlf -/ext/standard/tests/strings/rtrim.phpt -crlf -/ext/standard/tests/strings/setlocale_variation1.phpt -crlf -/ext/standard/tests/strings/sha1_basic.phpt -crlf -/ext/standard/tests/strings/similar_text_basic.phpt -crlf -/ext/standard/tests/strings/soundex.phpt -crlf -/ext/standard/tests/strings/sprintf_basic1.phpt -crlf -/ext/standard/tests/strings/sprintf_basic4.phpt -crlf -/ext/standard/tests/strings/sprintf_basic7.phpt -crlf -/ext/standard/tests/strings/sprintf_variation12.phpt -crlf -/ext/standard/tests/strings/sprintf_variation28.phpt -crlf -/ext/standard/tests/strings/sprintf_variation29.phpt -crlf -/ext/standard/tests/strings/sprintf_variation30.phpt -crlf -/ext/standard/tests/strings/sprintf_variation31.phpt -crlf -/ext/standard/tests/strings/sprintf_variation38.phpt -crlf -/ext/standard/tests/strings/sprintf_variation42.phpt -crlf -/ext/standard/tests/strings/sprintf_variation6.phpt -crlf -/ext/standard/tests/strings/sscanf_basic2.phpt -crlf -/ext/standard/tests/strings/sscanf_basic3.phpt -crlf -/ext/standard/tests/strings/str_getcsv_001.phpt -crlf -/ext/standard/tests/strings/stripcslashes_basic.phpt -crlf -/ext/standard/tests/strings/stripos_variation11.phpt -crlf -/ext/standard/tests/strings/stripos_variation13.phpt -crlf -/ext/standard/tests/strings/stripslashes_variation1.phpt -crlf -/ext/standard/tests/strings/stripslashes_variation2.phpt -crlf -/ext/standard/tests/strings/stristr_error.phpt -crlf -/ext/standard/tests/strings/strnatcasecmp_basic.phpt -crlf -/ext/standard/tests/strings/strncasecmp_variation6.phpt -crlf -/ext/standard/tests/strings/strncasecmp_variation7.phpt -crlf -/ext/standard/tests/strings/strncasecmp_variation8.phpt -crlf -/ext/standard/tests/strings/strrchr_error.phpt -crlf -/ext/standard/tests/strings/strrchr.phpt -crlf -/ext/standard/tests/strings/strrchr_variation11.phpt -crlf -/ext/standard/tests/strings/strrpos_error.phpt -crlf -/ext/standard/tests/strings/strrpos_variation4.phpt -crlf -/ext/standard/tests/strings/strrpos_variation8.phpt -crlf -/ext/standard/tests/strings/strstr2.phpt -crlf -/ext/standard/tests/strings/strtok_error.phpt -crlf -/ext/standard/tests/strings/strtok_variation2.phpt -crlf -/ext/standard/tests/strings/strtolower-win32.phpt -crlf -/ext/standard/tests/strings/substr_compare.phpt -crlf -/ext/standard/tests/strings/ucwords_variation1.phpt -crlf -/ext/standard/tests/strings/unpack.phpt -crlf -/ext/standard/tests/strings/vfprintf_basic7_64bit.phpt -crlf -/ext/standard/tests/strings/vfprintf_variation11_64bit.phpt -crlf -/ext/standard/tests/strings/vfprintf_variation12_64bit.phpt -crlf -/ext/standard/tests/strings/vfprintf_variation12.phpt -crlf -/ext/standard/tests/strings/vfprintf_variation13_64bit.phpt -crlf -/ext/standard/tests/strings/vfprintf_variation7.phpt -crlf -/ext/standard/tests/strings/vprintf_basic2.phpt -crlf -/ext/standard/tests/strings/vprintf_basic7_64bit.phpt -crlf -/ext/standard/tests/strings/vprintf_variation10.phpt -crlf -/ext/standard/tests/strings/vprintf_variation14_64bit.phpt -crlf -/ext/standard/tests/strings/vprintf_variation17.phpt -crlf -/ext/standard/tests/strings/vprintf_variation4.phpt -crlf -/ext/standard/tests/strings/vsprintf_basic4.phpt -crlf -/ext/standard/tests/strings/vsprintf_basic8.phpt -crlf -/ext/standard/tests/strings/vsprintf_variation12_64bit.phpt -crlf -/ext/standard/tests/strings/vsprintf_variation13_64bit.phpt -crlf -/ext/standard/tests/strings/vsprintf_variation15_64bit.phpt -crlf -/ext/standard/tests/strings/vsprintf_variation17.phpt -crlf -/ext/standard/tests/strings/vsprintf_variation4_64bit.phpt -crlf -/ext/standard/tests/strings/vsprintf_variation7.phpt -crlf -/ext/standard/tests/strings/wordwrap.phpt -crlf -/ext/standard/tests/strings/wordwrap_variation5.phpt -crlf -/ext/standard/tests/url/rawurldecode_variation_001.phpt -crlf -/ext/tidy/tests/009.phpt -crlf -/ext/tidy/tests/013.phpt -crlf -/ext/tidy/tests/021.phpt -crlf -/ext/tidy/tests/tidy_error.phpt -crlf -/ext/tokenizer/tests/002.phpt -crlf -/ext/tokenizer/tests/bug26463.phpt -crlf -/ext/tokenizer/tests/token_get_all_error.phpt -crlf -/ext/tokenizer/tests/token_get_all_variation11.phpt -crlf -/ext/tokenizer/tests/token_get_all_variation12.phpt -crlf -/ext/tokenizer/tests/token_get_all_variation13.phpt -crlf -/ext/tokenizer/tests/token_get_all_variation14.phpt -crlf -/ext/tokenizer/tests/token_get_all_variation15.phpt -crlf -/ext/tokenizer/tests/token_get_all_variation18.phpt -crlf -/ext/tokenizer/tests/token_get_all_variation19.phpt -crlf -/ext/tokenizer/tests/token_get_all_variation1.phpt -crlf -/ext/tokenizer/tests/token_get_all_variation2.phpt -crlf -/ext/tokenizer/tests/token_get_all_variation3.phpt -crlf -/ext/tokenizer/tests/token_get_all_variation5.phpt -crlf -/ext/tokenizer/tests/token_get_all_variation8.phpt -crlf -/ext/xml/tests/bug32001b.phpt -crlf -/ext/xmlwriter/tests/OO_003.phpt -crlf -/ext/xmlwriter/tests/xmlwriter_write_attribute_ns_error_001.phpt -crlf -/ext/zlib/tests/008.phpt -crlf -/ext/zlib/tests/gzopen_variation4.phpt -crlf -/ext/zlib/tests/gzrewind_error.phpt -crlf -/ext/zlib/tests/readgzfile_variation7.phpt -crlf -/ext/zlib/tests/readgzfile_variation8.phpt -crlf -/ext/zlib/tests/zlib_scheme_stat_basic.phpt -crlf -/sapi/cli/tests/006.phpt -crlf -/tests/run-test/test009.phpt -crlf -/Zend/tests/012.phpt -crlf -/Zend/tests/bug28072.phpt -crlf -/Zend/tests/bug38624.phpt -crlf -/Zend/tests/bug40784.phpt -crlf -/Zend/tests/bug43053.phpt -crlf -/Zend/tests/bug51176.phpt -crlf -/Zend/tests/each_003.phpt -crlf -/Zend/tests/errmsg_006.phpt -crlf +# Replace $Id$ strings with 40-character hexadecimal blob object name. +/ext/mysqlnd/mysqlnd.h ident +/ext/ext_skel.php ident +/ext/phar/phar/pharcommand.inc ident +/ext/dba/libinifile/inifile.c ident +/ext/dba/libflatfile/flatfile.c ident +/ext/dba/libcdb/cdb_make.c ident +/ext/dba/libcdb/cdb.c ident +/run-tests.php ident + +# A custom merge driver to avoid automatic merges. These are manually merged. +# See https://wiki.php.net/vcs/gitfaq +/NEWS merge=NEWS +/UPGRADING merge=NEWS +/UPGRADING.INTERNALS merge=NEWS + +# Enable commit diffs for binary PHP test files. Some PHP test files include +# special characters, such as ASCII control characters. Git recognizes these as +# binary and wouldn't generate diffs. +*.phpt diff diff --git a/.gitignore b/.gitignore index 0a3be5145c8..a23f574fef2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ *~ .#* *. -*.slo *.mk *.mem *.gcda diff --git a/Makefile.frag b/Makefile.frag deleted file mode 100644 index 7c65cfab3c7..00000000000 --- a/Makefile.frag +++ /dev/null @@ -1,22 +0,0 @@ -# -# Zend -# - -$(builddir)/zend_language_scanner.lo: $(srcdir)/zend_language_parser.h -$(builddir)/zend_ini_scanner.lo: $(srcdir)/zend_ini_parser.h - -$(srcdir)/zend_language_scanner.c: $(srcdir)/zend_language_scanner.l - @(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_language_scanner_defs.h -oZend/zend_language_scanner.c Zend/zend_language_scanner.l) - -$(srcdir)/zend_language_parser.h: $(srcdir)/zend_language_parser.c -$(srcdir)/zend_language_parser.c: $(srcdir)/zend_language_parser.y - @$(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o $@ - -$(srcdir)/zend_ini_parser.h: $(srcdir)/zend_ini_parser.c -$(srcdir)/zend_ini_parser.c: $(srcdir)/zend_ini_parser.y - @$(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o $@ - -$(srcdir)/zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l - @(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_ini_scanner_defs.h -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l) - -$(builddir)/zend_highlight.lo $(builddir)/zend_compile.lo: $(srcdir)/zend_language_parser.h diff --git a/README.SELF-CONTAINED-EXTENSIONS b/README.SELF-CONTAINED-EXTENSIONS index 0cc097f90c0..8e36ce39be4 100644 --- a/README.SELF-CONTAINED-EXTENSIONS +++ b/README.SELF-CONTAINED-EXTENSIONS @@ -16,7 +16,6 @@ PREPARING YOUR SYSTEM tools: GNU autoconf - GNU automake GNU libtool GNU m4 diff --git a/README.UNIX-BUILD-SYSTEM b/README.UNIX-BUILD-SYSTEM index 54dcae3fc66..a184b909ba3 100644 --- a/README.UNIX-BUILD-SYSTEM +++ b/README.UNIX-BUILD-SYSTEM @@ -16,7 +16,7 @@ PHP Build System V5 Overview build-modules: builds and copies dynamic modules into modules/ install-cli: installs the CLI only, so that the install-sapi target does only what its name says -- finally abandoned automake (still requires aclocal at this time) +- finally abandoned automake - changed some configure-time constructs to run at buildconf-time - upgraded shtool to 1.5.4 - removed $(moduledir) (use EXTENSION_DIR) diff --git a/Zend/Makefile.frag b/Zend/Makefile.frag index 3ab617d7155..cca9c2c697f 100644 --- a/Zend/Makefile.frag +++ b/Zend/Makefile.frag @@ -1 +1,24 @@ +# +# Zend +# + +$(builddir)/zend_language_scanner.lo: $(srcdir)/zend_language_parser.h +$(builddir)/zend_ini_scanner.lo: $(srcdir)/zend_ini_parser.h + +$(srcdir)/zend_language_scanner.c: $(srcdir)/zend_language_scanner.l + @(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_language_scanner_defs.h -oZend/zend_language_scanner.c Zend/zend_language_scanner.l) + +$(srcdir)/zend_language_parser.h: $(srcdir)/zend_language_parser.c +$(srcdir)/zend_language_parser.c: $(srcdir)/zend_language_parser.y + @$(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o $@ + +$(srcdir)/zend_ini_parser.h: $(srcdir)/zend_ini_parser.c +$(srcdir)/zend_ini_parser.c: $(srcdir)/zend_ini_parser.y + @$(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o $@ + +$(srcdir)/zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l + @(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_ini_scanner_defs.h -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l) + +$(builddir)/zend_highlight.lo $(builddir)/zend_compile.lo: $(srcdir)/zend_language_parser.h + Zend/zend_execute.lo: $(srcdir)/zend_vm_execute.h $(srcdir)/zend_vm_opcodes.h diff --git a/Zend/configure.ac b/Zend/configure.ac index 8252cfb3426..824a54f13d8 100644 --- a/Zend/configure.ac +++ b/Zend/configure.ac @@ -50,10 +50,18 @@ int zend_sprintf(char *buffer, const char *format, ...); # define zend_sprintf sprintf #endif +#if defined(__cplusplus) && __cplusplus >= 201103L +extern "C++" { +#include +#define zend_isnan std::isnan +#define zend_isinf std::isinf +#define zend_finite std::isfinite +} +#else #include #ifndef zend_isnan -#if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L) +#if HAVE_DECL_ISNAN #define zend_isnan(a) isnan(a) #elif defined(HAVE_FPCLASS) #define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN)) @@ -62,7 +70,7 @@ int zend_sprintf(char *buffer, const char *format, ...); #endif #endif -#if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L) +#if HAVE_DECL_ISINF #define zend_isinf(a) isinf(a) #elif defined(INFINITY) /* Might not work, but is required by ISO C99 */ @@ -73,7 +81,7 @@ int zend_sprintf(char *buffer, const char *format, ...); #define zend_isinf(a) 0 #endif -#if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L) +#if HAVE_DECL_ISFINITE #define zend_finite(a) isfinite(a) #elif defined(HAVE_FINITE) #define zend_finite(a) finite(a) @@ -83,6 +91,8 @@ int zend_sprintf(char *buffer, const char *format, ...); #define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1) #endif +#endif + #endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */ ]) diff --git a/Zend/tests/foreach_shadowed_dyn_property.phpt b/Zend/tests/foreach_shadowed_dyn_property.phpt new file mode 100644 index 00000000000..8f71cdf2408 --- /dev/null +++ b/Zend/tests/foreach_shadowed_dyn_property.phpt @@ -0,0 +1,29 @@ +--TEST-- +Dynamic property shadowed by private property +--FILE-- + $v) { + echo "$k => $v\n"; + } + var_dump(get_object_vars($this)); + } +} +class Test2 extends Test { +} + +$test2 = new Test2; +$test2->prop = "Test2"; +$test2->run(); + +?> +--EXPECT-- +prop => Test +array(1) { + ["prop"]=> + string(4) "Test" +} diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 22ce397bd34..0672ec15104 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -1189,7 +1189,7 @@ ZEND_API int zend_update_class_constants(zend_class_entry *class_type) /* {{{ */ } /* }}} */ -ZEND_API void object_properties_init(zend_object *object, zend_class_entry *class_type) /* {{{ */ +static zend_always_inline void _object_properties_init(zend_object *object, zend_class_entry *class_type) /* {{{ */ { if (class_type->default_properties_count) { zval *src = class_type->default_properties_table; @@ -1209,11 +1209,17 @@ ZEND_API void object_properties_init(zend_object *object, zend_class_entry *clas dst++; } while (src != end); } - object->properties = NULL; } } /* }}} */ +ZEND_API void object_properties_init(zend_object *object, zend_class_entry *class_type) /* {{{ */ +{ + object->properties = NULL; + _object_properties_init(object, class_type); +} +/* }}} */ + ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properties) /* {{{ */ { object->properties = properties; @@ -1298,7 +1304,7 @@ ZEND_API void object_properties_load(zend_object *object, HashTable *properties) * class and all props being public. If only a subset is given or the class * has protected members then you need to merge the properties separately by * calling zend_merge_properties(). */ -ZEND_API int object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties) /* {{{ */ +static zend_always_inline int _object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties) /* {{{ */ { if (UNEXPECTED(class_type->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))) { if (class_type->ce_flags & ZEND_ACC_INTERFACE) { @@ -1322,11 +1328,13 @@ ZEND_API int object_and_properties_init(zval *arg, zend_class_entry *class_type, } if (class_type->create_object == NULL) { - ZVAL_OBJ(arg, zend_objects_new(class_type)); + zend_object *obj = zend_objects_new(class_type); + + ZVAL_OBJ(arg, obj); if (properties) { - object_properties_init_ex(Z_OBJ_P(arg), properties); + object_properties_init_ex(obj, properties); } else { - object_properties_init(Z_OBJ_P(arg), class_type); + _object_properties_init(obj, class_type); } } else { ZVAL_OBJ(arg, class_type->create_object(class_type)); @@ -1335,9 +1343,15 @@ ZEND_API int object_and_properties_init(zval *arg, zend_class_entry *class_type, } /* }}} */ +ZEND_API int object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties) /* {{{ */ +{ + return _object_and_properties_init(arg, class_type, properties); +} +/* }}} */ + ZEND_API int object_init_ex(zval *arg, zend_class_entry *class_type) /* {{{ */ { - return object_and_properties_init(arg, class_type, 0); + return _object_and_properties_init(arg, class_type, NULL); } /* }}} */ diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 07a314028e4..8302ab91d31 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1191,18 +1191,18 @@ ZEND_FUNCTION(get_object_vars) array_init_size(return_value, zend_hash_num_elements(properties)); ZEND_HASH_FOREACH_KEY_VAL(properties, num_key, key, value) { - zend_bool unmangle = 0; + zend_bool is_dynamic = 1; if (Z_TYPE_P(value) == IS_INDIRECT) { value = Z_INDIRECT_P(value); if (UNEXPECTED(Z_ISUNDEF_P(value))) { continue; } - ZEND_ASSERT(key); - if (zend_check_property_access(zobj, key) == FAILURE) { - continue; - } - unmangle = 1; + is_dynamic = 0; + } + + if (key && zend_check_property_access(zobj, key, is_dynamic) == FAILURE) { + continue; } if (Z_ISREF_P(value) && Z_REFCOUNT_P(value) == 1) { @@ -1213,7 +1213,7 @@ ZEND_FUNCTION(get_object_vars) if (UNEXPECTED(!key)) { /* This case is only possible due to loopholes, e.g. ArrayObject */ zend_hash_index_add(Z_ARRVAL_P(return_value), num_key, value); - } else if (unmangle && ZSTR_VAL(key)[0] == 0) { + } else if (!is_dynamic && ZSTR_VAL(key)[0] == 0) { const char *prop_name, *class_name; size_t prop_len; zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_len); diff --git a/Zend/zend_config.w32.h b/Zend/zend_config.w32.h index 71d550e57ba..db42c49fee2 100644 --- a/Zend/zend_config.w32.h +++ b/Zend/zend_config.w32.h @@ -50,9 +50,18 @@ typedef unsigned int uint; #endif #define strcasecmp(s1, s2) _stricmp(s1, s2) #define strncasecmp(s1, s2, n) _strnicmp(s1, s2, n) +#if defined(__cplusplus) && __cplusplus >= 201103L +extern "C++" { +#include +#define zend_isnan std::isnan +#define zend_isinf std::isinf +#define zend_finite std::isfinite +} +#else #define zend_isinf(a) ((_fpclass(a) == _FPCLASS_PINF) || (_fpclass(a) == _FPCLASS_NINF)) #define zend_finite(x) _finite(x) #define zend_isnan(x) _isnan(x) +#endif #define zend_sprintf sprintf diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 48549dfb999..ba1eaf1acc3 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -525,7 +525,7 @@ found: } /* }}} */ -ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_info_name) /* {{{ */ +ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_info_name, zend_bool is_dynamic) /* {{{ */ { zend_property_info *property_info; const char *class_name = NULL; @@ -534,19 +534,18 @@ ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_inf size_t prop_name_len; if (ZSTR_VAL(prop_info_name)[0] == 0) { + if (is_dynamic) { + return SUCCESS; + } + zend_unmangle_property_name_ex(prop_info_name, &class_name, &prop_name, &prop_name_len); member = zend_string_init(prop_name, prop_name_len, 0); property_info = zend_get_property_info(zobj->ce, member, 1); zend_string_release_ex(member, 0); - if (property_info == NULL) { - if (class_name[0] != '*') { - /* we we're looking for a private prop */ - return FAILURE; - } - return SUCCESS; - } else if (property_info == ZEND_WRONG_PROPERTY_INFO) { + if (property_info == NULL || property_info == ZEND_WRONG_PROPERTY_INFO) { return FAILURE; } + if (class_name[0] != '*') { if (!(property_info->flags & ZEND_ACC_PRIVATE)) { /* we we're looking for a private prop but found a non private one of the same name */ @@ -562,6 +561,7 @@ ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_inf } else { property_info = zend_get_property_info(zobj->ce, prop_info_name, 1); if (property_info == NULL) { + ZEND_ASSERT(is_dynamic); return SUCCESS; } else if (property_info == ZEND_WRONG_PROPERTY_INFO) { return FAILURE; diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h index 6d347f4d5f9..b3373f40494 100644 --- a/Zend/zend_object_handlers.h +++ b/Zend/zend_object_handlers.h @@ -224,7 +224,7 @@ ZEND_API void rebuild_object_properties(zend_object *zobj); ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope); -ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_info_name); +ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_info_name, zend_bool is_dynamic); ZEND_API zend_function *zend_get_call_trampoline_func(zend_class_entry *ce, zend_string *method_name, int is_static); diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c index d979d733efa..ae178132a38 100644 --- a/Zend/zend_objects.c +++ b/Zend/zend_objects.c @@ -25,7 +25,7 @@ #include "zend_interfaces.h" #include "zend_exceptions.h" -ZEND_API void ZEND_FASTCALL zend_object_std_init(zend_object *object, zend_class_entry *ce) +static zend_always_inline void _zend_object_std_init(zend_object *object, zend_class_entry *ce) { GC_SET_REFCOUNT(object, 1); GC_TYPE_INFO(object) = IS_OBJECT | (GC_COLLECTABLE << GC_FLAGS_SHIFT); @@ -37,6 +37,11 @@ ZEND_API void ZEND_FASTCALL zend_object_std_init(zend_object *object, zend_class } } +ZEND_API void ZEND_FASTCALL zend_object_std_init(zend_object *object, zend_class_entry *ce) +{ + _zend_object_std_init(object, ce); +} + ZEND_API void zend_object_std_dtor(zend_object *object) { zval *p, *end; @@ -174,7 +179,7 @@ ZEND_API zend_object* ZEND_FASTCALL zend_objects_new(zend_class_entry *ce) { zend_object *object = emalloc(sizeof(zend_object) + zend_object_properties_size(ce)); - zend_object_std_init(object, ce); + _zend_object_std_init(object, ce); object->handlers = &std_object_handlers; return object; } diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 8c43cbaa101..2fbbf475d0f 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -780,10 +780,20 @@ ZEND_VM_COLD_HELPER(zend_abstract_method_helper, ANY, ANY, zend_function *fbc) HANDLE_EXCEPTION(); } -ZEND_VM_COLD_HELPER(zend_undefined_function_helper, ANY, ANY, zval *function_name) +ZEND_VM_COLD_HELPER(zend_undefined_function_helper, ANY, ANY) { + USE_OPLINE + zval *function_name; + char *name; + SAVE_OPLINE(); - zend_throw_error(NULL, "Call to undefined function %s()", Z_STRVAL_P(function_name)); + function_name = RT_CONSTANT(opline, opline->op2); + if (opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME) { + name = Z_STRVAL_P(function_name + 2); + } else { + name = Z_STRVAL_P(function_name); + } + zend_throw_error(NULL, "Call to undefined function %s()", name); HANDLE_EXCEPTION(); } @@ -3263,7 +3273,7 @@ ZEND_VM_HOT_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST, NUM|CACHE_SLOT) function_name = (zval*)RT_CONSTANT(opline, opline->op2); func = zend_hash_find_ex(EG(function_table), Z_STR_P(function_name+1), 1); if (UNEXPECTED(func == NULL)) { - ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper, function_name, function_name); + ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper); } fbc = Z_FUNC_P(func); if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { @@ -3426,7 +3436,7 @@ ZEND_VM_HOT_HANDLER(69, ZEND_INIT_NS_FCALL_BY_NAME, ANY, CONST, NUM|CACHE_SLOT) func_name++; func = zend_hash_find_ex(EG(function_table), Z_STR_P(func_name), 1); if (UNEXPECTED(func == NULL)) { - ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper, function_name, func_name); + ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper); } } fbc = Z_FUNC_P(func); @@ -3447,7 +3457,6 @@ ZEND_VM_HOT_HANDLER(69, ZEND_INIT_NS_FCALL_BY_NAME, ANY, CONST, NUM|CACHE_SLOT) ZEND_VM_HOT_HANDLER(61, ZEND_INIT_FCALL, NUM, CONST, NUM|CACHE_SLOT) { USE_OPLINE - zend_free_op free_op2; zval *fname; zval *func; zend_function *fbc; @@ -3455,10 +3464,10 @@ ZEND_VM_HOT_HANDLER(61, ZEND_INIT_FCALL, NUM, CONST, NUM|CACHE_SLOT) fbc = CACHED_PTR(opline->result.num); if (UNEXPECTED(fbc == NULL)) { - fname = GET_OP2_ZVAL_PTR(BP_VAR_R); + fname = (zval*)RT_CONSTANT(opline, opline->op2); func = zend_hash_find_ex(EG(function_table), Z_STR_P(fname), 1); if (UNEXPECTED(func == NULL)) { - ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper, function_name, fname); + ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper); } fbc = Z_FUNC_P(func); if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { @@ -5845,10 +5854,12 @@ ZEND_VM_C_LABEL(fe_fetch_r_exit): value = Z_INDIRECT_P(value); value_type = Z_TYPE_INFO_P(value); if (EXPECTED(value_type != IS_UNDEF) - && EXPECTED(zend_check_property_access(Z_OBJ_P(array), p->key) == SUCCESS)) { + && EXPECTED(zend_check_property_access(Z_OBJ_P(array), p->key, 0) == SUCCESS)) { break; } - } else { + } else if (EXPECTED(Z_OBJCE_P(array)->default_properties_count == 0) + || !p->key + || zend_check_property_access(Z_OBJ_P(array), p->key, 1) == SUCCESS) { break; } } @@ -5995,10 +6006,12 @@ ZEND_VM_HANDLER(126, ZEND_FE_FETCH_RW, VAR, ANY, JMP_ADDR) value = Z_INDIRECT_P(value); value_type = Z_TYPE_INFO_P(value); if (EXPECTED(value_type != IS_UNDEF) - && EXPECTED(zend_check_property_access(Z_OBJ_P(array), p->key) == SUCCESS)) { + && EXPECTED(zend_check_property_access(Z_OBJ_P(array), p->key, 0) == SUCCESS)) { break; } - } else { + } else if (EXPECTED(Z_OBJCE_P(array)->default_properties_count == 0) + || !p->key + || zend_check_property_access(Z_OBJ_P(array), p->key, 1) == SUCCESS) { break; } } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 20d55eb1ba2..c0e4bf1a721 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -470,10 +470,20 @@ static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_ab HANDLE_EXCEPTION(); } -static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_undefined_function_helper_SPEC(zval *function_name ZEND_OPCODE_HANDLER_ARGS_DC) +static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_undefined_function_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) { + USE_OPLINE + zval *function_name; + char *name; + SAVE_OPLINE(); - zend_throw_error(NULL, "Call to undefined function %s()", Z_STRVAL_P(function_name)); + function_name = RT_CONSTANT(opline, opline->op2); + if (opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME) { + name = Z_STRVAL_P(function_name + 2); + } else { + name = Z_STRVAL_P(function_name); + } + zend_throw_error(NULL, "Call to undefined function %s()", name); HANDLE_EXCEPTION(); } @@ -2023,7 +2033,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME function_name = (zval*)RT_CONSTANT(opline, opline->op2); func = zend_hash_find_ex(EG(function_table), Z_STR_P(function_name+1), 1); if (UNEXPECTED(func == NULL)) { - ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(function_name ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); + ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); } fbc = Z_FUNC_P(func); if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { @@ -2111,7 +2121,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_NS_FCALL_BY_N func_name++; func = zend_hash_find_ex(EG(function_table), Z_STR_P(func_name), 1); if (UNEXPECTED(func == NULL)) { - ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(func_name ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); + ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); } } fbc = Z_FUNC_P(func); @@ -2132,7 +2142,6 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_NS_FCALL_BY_N static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_FCALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE - zval *fname; zval *func; zend_function *fbc; @@ -2140,10 +2149,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_FCALL_SPEC_CO fbc = CACHED_PTR(opline->result.num); if (UNEXPECTED(fbc == NULL)) { - fname = RT_CONSTANT(opline, opline->op2); + fname = (zval*)RT_CONSTANT(opline, opline->op2); func = zend_hash_find_ex(EG(function_table), Z_STR_P(fname), 1); if (UNEXPECTED(func == NULL)) { - ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(fname ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); + ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); } fbc = Z_FUNC_P(func); if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { @@ -21258,10 +21267,12 @@ fe_fetch_r_exit: value = Z_INDIRECT_P(value); value_type = Z_TYPE_INFO_P(value); if (EXPECTED(value_type != IS_UNDEF) - && EXPECTED(zend_check_property_access(Z_OBJ_P(array), p->key) == SUCCESS)) { + && EXPECTED(zend_check_property_access(Z_OBJ_P(array), p->key, 0) == SUCCESS)) { break; } - } else { + } else if (EXPECTED(Z_OBJCE_P(array)->default_properties_count == 0) + || !p->key + || zend_check_property_access(Z_OBJ_P(array), p->key, 1) == SUCCESS) { break; } } @@ -21408,10 +21419,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_FETCH_RW_SPEC_VAR_HANDLER(Z value = Z_INDIRECT_P(value); value_type = Z_TYPE_INFO_P(value); if (EXPECTED(value_type != IS_UNDEF) - && EXPECTED(zend_check_property_access(Z_OBJ_P(array), p->key) == SUCCESS)) { + && EXPECTED(zend_check_property_access(Z_OBJ_P(array), p->key, 0) == SUCCESS)) { break; } - } else { + } else if (EXPECTED(Z_OBJCE_P(array)->default_properties_count == 0) + || !p->key + || zend_check_property_access(Z_OBJ_P(array), p->key, 1) == SUCCESS) { break; } } diff --git a/build/buildcheck.sh b/build/buildcheck.sh index 6601fc9943c..8857a34b18f 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -28,16 +28,16 @@ fi # autoconf 2.68 or newer ac_version=`$PHP_AUTOCONF --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` if test -z "$ac_version"; then -echo "buildconf: autoconf not found." -echo " You need autoconf version 2.68 or newer installed" -echo " to build PHP from Git." +echo "buildconf: autoconf not found." >&2 +echo " You need autoconf version 2.68 or newer installed" >&2 +echo " to build PHP from Git." >&2 exit 1 fi IFS=.; set $ac_version; IFS=' ' if test "$1" = "2" -a "$2" -lt "68" || test "$1" -lt "2"; then -echo "buildconf: autoconf version $ac_version found." -echo " You need autoconf version 2.68 or newer installed" -echo " to build PHP from Git." +echo "buildconf: autoconf version $ac_version found." >&2 +echo " You need autoconf version 2.68 or newer installed" >&2 +echo " to build PHP from Git." >&2 exit 1 else echo "buildconf: autoconf version $ac_version (ok)" diff --git a/build/genif.sh b/build/genif.sh index 1df7c931646..a6eb627b0c5 100755 --- a/build/genif.sh +++ b/build/genif.sh @@ -12,7 +12,7 @@ awk=$1 shift if test -z "$infile" || test -z "$srcdir"; then - echo "please supply infile and srcdir" + echo "please supply infile and srcdir" >&2 exit 1 fi diff --git a/build/mkdep.awk b/build/mkdep.awk deleted file mode 100644 index 4bd4f3a07f1..00000000000 --- a/build/mkdep.awk +++ /dev/null @@ -1,73 +0,0 @@ -# +----------------------------------------------------------------------+ -# | PHP Version 7 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 2000-2006 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. | -# +----------------------------------------------------------------------+ -# | Author: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# Usage: -# -# echo top_srcdir top_builddir srcdir CPP [CPP-ARGS] filenames | \ -# awk -f mkdep.awk > dependencies - - -{ - top_srcdir=$1 - top_builddir=$2 - srcdir=$3 - cmd=$4 - - for (i = 5; i <= NF; i++) { - if (match($i, "^-[A-Z]") == 0) - break; - cmd=cmd " " $i - } - - dif=i-1 - - for (; i <= NF; i++) - filenames[i-dif]=$i - - no_files=NF-dif - - for(i = 1; i <= no_files; i++) { - if (system("test -r " filenames[i]) != 0) - continue - - target=filenames[i] - sub(srcdir "/", "", target) - target2=target - sub("\.(c|cpp)$", ".lo", target); - sub("\.(c|cpp)$", ".slo", target2); - - for (e in used) - delete used[e] - - cmdx=cmd " " filenames[i] - done=0 - while ((cmdx | getline) > 0) { - if (match($0, "^# [0-9]* \".*\.h\"") != 0) { - if (sub(top_srcdir, "$(top_srcdir)", $3) == 0) - sub(top_builddir, "$(top_builddir)", $3) - if (substr($3,2,1) != "/" && used[$3] != 1) { - if (done == 0) - printf(target " " target2 ":") - done=1 - printf(" \\\n\t" substr($3,2,length($3)-2)) - used[$3] = 1; - } - } - } - if (done == 1) - print "\n" - } -} diff --git a/buildconf b/buildconf index 23d10061f2d..4b72ef8efba 100755 --- a/buildconf +++ b/buildconf @@ -27,8 +27,8 @@ while test $# -gt 0; do done if test "$dev" = "0" -a "$devok" = "0"; then - echo "You should not run buildconf in a release package." - echo "use buildconf --force to override this check." + echo "You should not run buildconf in a release package." >&2 + echo "use buildconf --force to override this check." >&2 exit 1 fi diff --git a/configure.ac b/configure.ac index 2eda8f440f3..46a69753184 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ dnl include Zend specific macro definitions first dnl ------------------------------------------------------------------------- sinclude(Zend/acinclude.m4) -dnl Basic autoconf + automake initialization, generation of config.nice. +dnl Basic autoconf initialization, generation of config.nice. dnl ------------------------------------------------------------------------- AC_PREREQ([2.68]) @@ -59,10 +59,18 @@ int zend_sprintf(char *buffer, const char *format, ...); # define zend_sprintf sprintf #endif +#if defined(__cplusplus) && __cplusplus >= 201103L +extern "C++" { +#include +#define zend_isnan std::isnan +#define zend_isinf std::isinf +#define zend_finite std::isfinite +} +#else #include #ifndef zend_isnan -#if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L) +#if HAVE_DECL_ISNAN #define zend_isnan(a) isnan(a) #elif defined(HAVE_FPCLASS) #define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN)) @@ -71,7 +79,7 @@ int zend_sprintf(char *buffer, const char *format, ...); #endif #endif -#if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L) +#if HAVE_DECL_ISINF #define zend_isinf(a) isinf(a) #elif defined(INFINITY) /* Might not work, but is required by ISO C99 */ @@ -82,7 +90,7 @@ int zend_sprintf(char *buffer, const char *format, ...); #define zend_isinf(a) 0 #endif -#if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L) +#if HAVE_DECL_ISFINITE #define zend_finite(a) isfinite(a) #elif defined(HAVE_FINITE) #define zend_finite(a) finite(a) @@ -92,6 +100,7 @@ int zend_sprintf(char *buffer, const char *format, ...); #define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1) #endif +#endif #endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */ #undef PTHREADS @@ -1429,7 +1438,7 @@ case $host_alias in esac dnl Silence warning: `ar: 'u' modifier ignored since 'D' is the default` -dnl SEE https://www.mail-archive.com/automake-patches@gnu.org/msg07705.html +dnl See https://github.com/php/php-src/pull/3017 AC_SUBST(AR_FLAGS, [cr]) dnl Only allow AC_PROG_CXX and AC_PROG_CXXCPP if they are explicitly called (by PHP_REQUIRE_CXX). @@ -1526,7 +1535,6 @@ PHP_ADD_BUILD_DIR(TSRM) PHP_ADD_BUILD_DIR(Zend) PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/scripts/Makefile.frag,$abs_srcdir/scripts,scripts) -PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/Makefile.frag,$abs_srcdir/Zend,Zend) PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/Zend/Makefile.frag,$abs_srcdir/Zend,Zend) PHP_GEN_BUILD_DIRS diff --git a/ext/curl/tests/bug27023.phpt b/ext/curl/tests/bug27023.phpt index c878ebac312..3d649b3f738 100644 --- a/ext/curl/tests/bug27023.phpt +++ b/ext/curl/tests/bug27023.phpt @@ -11,7 +11,7 @@ include 'server.inc'; $host = curl_cli_server_start(); $ch = curl_init(); curl_setopt($ch, CURLOPT_SAFE_UPLOAD, 1); -curl_setopt($ch, CURLOPT_URL, "{$host}/get.php?test=file"); +curl_setopt($ch, CURLOPT_URL, "{$host}/get.inc?test=file"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $file = curl_file_create(__DIR__ . '/curl_testdata1.txt'); diff --git a/ext/curl/tests/bug48207.phpt b/ext/curl/tests/bug48207.phpt index a3cd81544b8..566b84b2460 100644 --- a/ext/curl/tests/bug48207.phpt +++ b/ext/curl/tests/bug48207.phpt @@ -19,7 +19,7 @@ $host = curl_cli_server_start(); if(!empty($host)) { // Use the set Environment variable - $url = "$host/get.php?test=1"; + $url = "$host/get.inc?test=1"; } else { diff --git a/ext/curl/tests/bug54995.phpt b/ext/curl/tests/bug54995.phpt index 0a120550567..ea2b7397620 100644 --- a/ext/curl/tests/bug54995.phpt +++ b/ext/curl/tests/bug54995.phpt @@ -13,7 +13,7 @@ if ($curl_version['version_number'] > 0x070a08) { include 'server.inc'; $host = curl_cli_server_start(); $ch = curl_init(); -curl_setopt($ch, CURLOPT_URL, "{$host}/get.php"); +curl_setopt($ch, CURLOPT_URL, "{$host}/get.inc"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); var_dump(curl_getinfo($ch, CURLINFO_HTTP_CODE) == curl_getinfo($ch, CURLINFO_RESPONSE_CODE)); diff --git a/ext/curl/tests/bug55767.phpt b/ext/curl/tests/bug55767.phpt index 2b35e1bcea8..2231c94bd4c 100644 --- a/ext/curl/tests/bug55767.phpt +++ b/ext/curl/tests/bug55767.phpt @@ -18,7 +18,7 @@ include 'skipif.inc'; // start testing echo '*** Testing curl sending through GET an POST ***' . "\n"; - $url = "{$host}/get.php?test=getpost&get_param=Hello%20World"; + $url = "{$host}/get.inc?test=getpost&get_param=Hello%20World"; $ch = curl_init(); ob_start(); // start output buffering diff --git a/ext/curl/tests/bug66109.phpt b/ext/curl/tests/bug66109.phpt index c40d1e96676..4a4ae30698b 100644 --- a/ext/curl/tests/bug66109.phpt +++ b/ext/curl/tests/bug66109.phpt @@ -7,7 +7,7 @@ Bug #66109 (Option CURLOPT_CUSTOMREQUEST can't be reset to default.) include 'server.inc'; $host = curl_cli_server_start(); $ch = curl_init(); -curl_setopt($ch, CURLOPT_URL, "{$host}/get.php?test=method"); +curl_setopt($ch, CURLOPT_URL, "{$host}/get.inc?test=method"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); diff --git a/ext/curl/tests/bug68937.phpt b/ext/curl/tests/bug68937.phpt index f9869143bfb..4f2ed12e427 100644 --- a/ext/curl/tests/bug68937.phpt +++ b/ext/curl/tests/bug68937.phpt @@ -10,7 +10,7 @@ include 'skipif.inc'; include 'server.inc'; $host = curl_cli_server_start(); -$url = "{$host}/get.php"; +$url = "{$host}/get.inc"; $ch = curl_init($url); curl_setopt_array($ch, array( diff --git a/ext/curl/tests/bug68937_2.phpt b/ext/curl/tests/bug68937_2.phpt index 50afbb890eb..8ebbc8eaa6f 100644 --- a/ext/curl/tests/bug68937_2.phpt +++ b/ext/curl/tests/bug68937_2.phpt @@ -9,7 +9,7 @@ include 'skipif.inc'; include 'server.inc'; $host = curl_cli_server_start(); -$url = "{$host}/get.php"; +$url = "{$host}/get.inc"; $ch = curl_init($url); curl_setopt_array($ch, array( diff --git a/ext/curl/tests/bug69316.phpt b/ext/curl/tests/bug69316.phpt index 16a655eef85..082b565d457 100644 --- a/ext/curl/tests/bug69316.phpt +++ b/ext/curl/tests/bug69316.phpt @@ -19,7 +19,7 @@ Bug #69316: Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEA include 'server.inc'; $host = curl_cli_server_start(); $temp_file = dirname(__FILE__) . '/body.tmp'; - $url = "{$host}/get.php?test=getpost"; + $url = "{$host}/get.inc?test=getpost"; $ch = curl_init(); $f_file = fopen($temp_file, "w") or die("failed to open file\n"); curl_setopt($ch, CURLOPT_BUFFERSIZE, 10); diff --git a/ext/curl/tests/curl_CURLOPT_READDATA.phpt b/ext/curl/tests/curl_CURLOPT_READDATA.phpt index eebf4a0c03f..1bf5493acd3 100644 --- a/ext/curl/tests/curl_CURLOPT_READDATA.phpt +++ b/ext/curl/tests/curl_CURLOPT_READDATA.phpt @@ -11,7 +11,7 @@ Mattijs Hoitink mattijshoitink@gmail.com include 'server.inc'; $host = curl_cli_server_start(); // The URL to POST to -$url = $host . '/get.php?test=post'; +$url = $host . '/get.inc?test=post'; // Create a temporary file to read the data from $tempname = tempnam(sys_get_temp_dir(), 'CURL_DATA'); diff --git a/ext/curl/tests/curl_basic_001.phpt b/ext/curl/tests/curl_basic_001.phpt index 6ece95f95ba..1d906c43eaa 100644 --- a/ext/curl/tests/curl_basic_001.phpt +++ b/ext/curl/tests/curl_basic_001.phpt @@ -18,7 +18,7 @@ TestFest 2009 - AFUP - Jean-Marc Fontaine // start testing echo "*** Testing curl_exec() : basic functionality ***\n"; - $url = "{$host}/get.php?test=get"; + $url = "{$host}/get.inc?test=get"; $ch = curl_init(); ob_start(); // start output buffering diff --git a/ext/curl/tests/curl_basic_002.phpt b/ext/curl/tests/curl_basic_002.phpt index 1b388267b0b..c067406caf1 100644 --- a/ext/curl/tests/curl_basic_002.phpt +++ b/ext/curl/tests/curl_basic_002.phpt @@ -19,7 +19,7 @@ TestFest 2009 - AFUP - Jean-Marc Fontaine // start testing echo '*** Testing curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); ***' . "\n"; - $url = "{$host}/get.php?test=get"; + $url = "{$host}/get.inc?test=get"; $ch = curl_init(); ob_start(); // start output buffering diff --git a/ext/curl/tests/curl_basic_003.phpt b/ext/curl/tests/curl_basic_003.phpt index ce9216d5359..57ac6063b9b 100644 --- a/ext/curl/tests/curl_basic_003.phpt +++ b/ext/curl/tests/curl_basic_003.phpt @@ -19,7 +19,7 @@ TestFest 2009 - AFUP - Jean-Marc Fontaine // start testing echo '*** Testing curl sending through GET an POST ***' . "\n"; - $url = "{$host}/get.php?test=getpost&get_param=Hello%20World"; + $url = "{$host}/get.inc?test=getpost&get_param=Hello%20World"; $ch = curl_init(); ob_start(); // start output buffering diff --git a/ext/curl/tests/curl_basic_004.phpt b/ext/curl/tests/curl_basic_004.phpt index c25ec850f4f..27842db1b09 100644 --- a/ext/curl/tests/curl_basic_004.phpt +++ b/ext/curl/tests/curl_basic_004.phpt @@ -19,7 +19,7 @@ TestFest 2009 - AFUP - Jean-Marc Fontaine // start testing echo '*** Testing curl setting referer ***' . "\n"; - $url = "{$host}/get.php?test=referer"; + $url = "{$host}/get.inc?test=referer"; $ch = curl_init(); ob_start(); // start output buffering diff --git a/ext/curl/tests/curl_basic_005.phpt b/ext/curl/tests/curl_basic_005.phpt index 3ec8906be82..6f9a4f98e13 100644 --- a/ext/curl/tests/curl_basic_005.phpt +++ b/ext/curl/tests/curl_basic_005.phpt @@ -19,7 +19,7 @@ TestFest 2009 - AFUP - Jean-Marc Fontaine // start testing echo '*** Testing curl with user agent ***' . "\n"; - $url = "{$host}/get.php?test=useragent"; + $url = "{$host}/get.inc?test=useragent"; $ch = curl_init(); ob_start(); // start output buffering diff --git a/ext/curl/tests/curl_basic_006.phpt b/ext/curl/tests/curl_basic_006.phpt index 03db7787944..9ccc2c554bd 100644 --- a/ext/curl/tests/curl_basic_006.phpt +++ b/ext/curl/tests/curl_basic_006.phpt @@ -19,7 +19,7 @@ TestFest 2009 - AFUP - Jean-Marc Fontaine // start testing echo '*** Testing curl_setopt($ch, CURLOPT_WRITEFUNCTION, ); ***' . "\n"; - $url = "{$host}/get.php?test=get"; + $url = "{$host}/get.inc?test=get"; $ch = curl_init(); $alldata = ''; ob_start(); // start output buffering diff --git a/ext/curl/tests/curl_basic_011.phpt b/ext/curl/tests/curl_basic_011.phpt index cbbc1f59eda..e6412c36d9f 100644 --- a/ext/curl/tests/curl_basic_011.phpt +++ b/ext/curl/tests/curl_basic_011.phpt @@ -18,7 +18,7 @@ TestFest 2009 - AFUP - Xavier Gorse // start testing echo '*** Testing curl with cookie ***' . "\n"; - $url = "{$host}/get.php?test=cookie"; + $url = "{$host}/get.inc?test=cookie"; $ch = curl_init(); ob_start(); // start output buffering diff --git a/ext/curl/tests/curl_basic_012.phpt b/ext/curl/tests/curl_basic_012.phpt index 6cc5d599e2c..812fab789d1 100644 --- a/ext/curl/tests/curl_basic_012.phpt +++ b/ext/curl/tests/curl_basic_012.phpt @@ -18,7 +18,7 @@ TestFest 2009 - AFUP - Xavier Gorse // start testing echo '*** Testing curl with HTTP/1.0 ***' . "\n"; - $url = "{$host}/get.php?test=httpversion"; + $url = "{$host}/get.inc?test=httpversion"; $ch = curl_init(); ob_start(); // start output buffering diff --git a/ext/curl/tests/curl_basic_013.phpt b/ext/curl/tests/curl_basic_013.phpt index 8aff6fc7070..34ec249ad35 100644 --- a/ext/curl/tests/curl_basic_013.phpt +++ b/ext/curl/tests/curl_basic_013.phpt @@ -18,7 +18,7 @@ TestFest 2009 - AFUP - Xavier Gorse // start testing echo '*** Testing curl with HTTP/1.1 ***' . "\n"; - $url = "{$host}/get.php?test=httpversion"; + $url = "{$host}/get.inc?test=httpversion"; $ch = curl_init(); ob_start(); // start output buffering diff --git a/ext/curl/tests/curl_basic_017.phpt b/ext/curl/tests/curl_basic_017.phpt index 9f1bdaf6362..9891039f9ec 100644 --- a/ext/curl/tests/curl_basic_017.phpt +++ b/ext/curl/tests/curl_basic_017.phpt @@ -18,7 +18,7 @@ TestFest 2009 - AFUP - Thomas Rabaix // start testing echo "*** Testing curl_exec() : basic functionality ***\n"; - $url = "{$host}/get.php?test=get"; + $url = "{$host}/get.inc?test=get"; $chs = array( 0 => curl_init(), 1 => curl_init(), diff --git a/ext/curl/tests/curl_basic_018.phpt b/ext/curl/tests/curl_basic_018.phpt index 33db8db3b5c..114cb599199 100644 --- a/ext/curl/tests/curl_basic_018.phpt +++ b/ext/curl/tests/curl_basic_018.phpt @@ -18,7 +18,7 @@ TestFest 2009 - AFUP - Thomas Rabaix // start testing echo "*** Testing curl_exec() : basic functionality ***\n"; - $url = "{$host}/get.php?test=get"; + $url = "{$host}/get.inc?test=get"; $chs = array( 0 => curl_init(), 1 => curl_init(), diff --git a/ext/curl/tests/curl_basic_019.phpt b/ext/curl/tests/curl_basic_019.phpt index fde4dccb3db..6f896b51e79 100644 --- a/ext/curl/tests/curl_basic_019.phpt +++ b/ext/curl/tests/curl_basic_019.phpt @@ -9,7 +9,7 @@ Jean-Marc Fontaine include 'server.inc'; $host = curl_cli_server_start(); - $url = "http://{$host}/get.php?test="; + $url = "http://{$host}/get.inc?test="; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); diff --git a/ext/curl/tests/curl_basic_020.phpt b/ext/curl/tests/curl_basic_020.phpt index 99ac93d1927..cf0b708d738 100644 --- a/ext/curl/tests/curl_basic_020.phpt +++ b/ext/curl/tests/curl_basic_020.phpt @@ -9,7 +9,7 @@ Jean-Marc Fontaine include 'server.inc'; $host = curl_cli_server_start(); - $url = "{$host}/get.php?test="; + $url = "{$host}/get.inc?test="; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_exec($ch); diff --git a/ext/curl/tests/curl_basic_021.phpt b/ext/curl/tests/curl_basic_021.phpt index 46d21cd81b9..51660735250 100644 --- a/ext/curl/tests/curl_basic_021.phpt +++ b/ext/curl/tests/curl_basic_021.phpt @@ -8,7 +8,7 @@ Jean-Marc Fontaine echo '*** Testing curl copy handle with simple GET ***' . "\n"; - $url = "{$host}/get.php?test=getpost&get_param=Hello%20World"; + $url = "{$host}/get.inc?test=getpost&get_param=Hello%20World"; $ch = curl_init(); ob_start(); // start output buffering diff --git a/ext/curl/tests/curl_copy_handle_basic_002.phpt b/ext/curl/tests/curl_copy_handle_basic_002.phpt index 9542b804eb0..e8ebcce3259 100644 --- a/ext/curl/tests/curl_copy_handle_basic_002.phpt +++ b/ext/curl/tests/curl_copy_handle_basic_002.phpt @@ -12,7 +12,7 @@ Rick Buitenman echo '*** Testing curl copy handle with simple POST ***' . "\n"; - $url = "{$host}/get.php?test=getpost"; + $url = "{$host}/get.inc?test=getpost"; $ch = curl_init(); ob_start(); // start output buffering diff --git a/ext/curl/tests/curl_copy_handle_basic_004.phpt b/ext/curl/tests/curl_copy_handle_basic_004.phpt index ecef566f0bb..c020c3088b7 100644 --- a/ext/curl/tests/curl_copy_handle_basic_004.phpt +++ b/ext/curl/tests/curl_copy_handle_basic_004.phpt @@ -13,7 +13,7 @@ Rick Buitenman echo '*** Test curl_copy_handle() after exec() ***' . "\n"; - $url = "{$host}/get.php?test=getpost&get_param=Hello%20World"; + $url = "{$host}/get.inc?test=getpost&get_param=Hello%20World"; $ch = curl_init(); ob_start(); // start output buffering diff --git a/ext/curl/tests/curl_copy_handle_basic_005.phpt b/ext/curl/tests/curl_copy_handle_basic_005.phpt index e37c52f5509..68df09c21c6 100644 --- a/ext/curl/tests/curl_copy_handle_basic_005.phpt +++ b/ext/curl/tests/curl_copy_handle_basic_005.phpt @@ -13,7 +13,7 @@ Rick Buitenman echo '*** Test curl_copy_handle() after exec() with POST ***' . "\n"; - $url = "{$host}/get.php?test=getpost"; + $url = "{$host}/get.inc?test=getpost"; $ch = curl_init(); ob_start(); // start output buffering diff --git a/ext/curl/tests/curl_copy_handle_basic_006.phpt b/ext/curl/tests/curl_copy_handle_basic_006.phpt index 989ad567628..5d787bdf3c8 100644 --- a/ext/curl/tests/curl_copy_handle_basic_006.phpt +++ b/ext/curl/tests/curl_copy_handle_basic_006.phpt @@ -13,7 +13,7 @@ Rick Buitenman echo '*** Testing curl copy handle with User Agent ***' . "\n"; - $url = "{$host}/get.php?test=useragent"; + $url = "{$host}/get.inc?test=useragent"; $ch = curl_init(); ob_start(); // start output buffering diff --git a/ext/curl/tests/curl_copy_handle_basic_007.phpt b/ext/curl/tests/curl_copy_handle_basic_007.phpt index 9d6dc2dc392..a48d40e270b 100644 --- a/ext/curl/tests/curl_copy_handle_basic_007.phpt +++ b/ext/curl/tests/curl_copy_handle_basic_007.phpt @@ -9,7 +9,7 @@ Test curl_copy_handle() with simple POST echo '*** Testing curl copy handle with simple POST using array as arguments ***' . "\n"; - $url = "{$host}/get.php?test=getpost"; + $url = "{$host}/get.inc?test=getpost"; $ch = curl_init(); ob_start(); // start output buffering diff --git a/ext/curl/tests/curl_copy_handle_basic_008.phpt b/ext/curl/tests/curl_copy_handle_basic_008.phpt index c48c76db225..ecb039b403d 100644 --- a/ext/curl/tests/curl_copy_handle_basic_008.phpt +++ b/ext/curl/tests/curl_copy_handle_basic_008.phpt @@ -7,7 +7,7 @@ Test curl_copy_handle() with CURLOPT_PROGRESSFUNCTION include 'server.inc'; $host = curl_cli_server_start(); - $url = "{$host}/get.php"; + $url = "{$host}/get.inc"; $ch = curl_init($url); curl_setopt($ch, CURLOPT_NOPROGRESS, 0); diff --git a/ext/curl/tests/curl_file_upload.phpt b/ext/curl/tests/curl_file_upload.phpt index 8d304c5f016..73a2f363fbb 100644 --- a/ext/curl/tests/curl_file_upload.phpt +++ b/ext/curl/tests/curl_file_upload.phpt @@ -21,7 +21,7 @@ function testcurl($ch, $name, $mime = '', $postname = '') include 'server.inc'; $host = curl_cli_server_start(); $ch = curl_init(); -curl_setopt($ch, CURLOPT_URL, "{$host}/get.php?test=file"); +curl_setopt($ch, CURLOPT_URL, "{$host}/get.inc?test=file"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); testcurl($ch, __DIR__ . '/curl_testdata1.txt'); @@ -52,7 +52,7 @@ $params = array('file' => '@' . __DIR__ . '/curl_testdata1.txt'); curl_setopt($ch, CURLOPT_POSTFIELDS, $params); var_dump(curl_exec($ch)); -curl_setopt($ch, CURLOPT_URL, "{$host}/get.php?test=post"); +curl_setopt($ch, CURLOPT_URL, "{$host}/get.inc?test=post"); $params = array('file' => '@' . __DIR__ . '/curl_testdata1.txt'); curl_setopt($ch, CURLOPT_POSTFIELDS, $params); var_dump(curl_exec($ch)); diff --git a/ext/curl/tests/curl_multi_getcontent_basic3.phpt b/ext/curl/tests/curl_multi_getcontent_basic3.phpt index 6e5e43b97ac..357f503a03f 100644 --- a/ext/curl/tests/curl_multi_getcontent_basic3.phpt +++ b/ext/curl/tests/curl_multi_getcontent_basic3.phpt @@ -16,7 +16,7 @@ Rein Velt (rein@velt.org) //SET URL AND OTHER OPTIONS include 'server.inc'; $host = curl_cli_server_start(); - curl_setopt($ch1, CURLOPT_URL, "{$host}/get.php?test=getpost&get_param=Hello%20World"); + curl_setopt($ch1, CURLOPT_URL, "{$host}/get.inc?test=getpost&get_param=Hello%20World"); curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__). DIRECTORY_SEPARATOR . "curl_testdata2.txt"); curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true); diff --git a/ext/curl/tests/curl_setopt_array_basic.phpt b/ext/curl/tests/curl_setopt_array_basic.phpt index 0ad8fc7eee4..b0b0b70b149 100644 --- a/ext/curl/tests/curl_setopt_array_basic.phpt +++ b/ext/curl/tests/curl_setopt_array_basic.phpt @@ -19,7 +19,7 @@ include 'server.inc'; $host = curl_cli_server_start(); if (!empty($host)) { // Use the set Environment variable - $url = "{$host}/get.php?test=get"; + $url = "{$host}/get.inc?test=get"; } else { // Create a temporary file for the test $tempname = tempnam(sys_get_temp_dir(), 'CURL_HANDLE'); diff --git a/ext/curl/tests/responder/get.php b/ext/curl/tests/responder/get.inc similarity index 100% rename from ext/curl/tests/responder/get.php rename to ext/curl/tests/responder/get.inc diff --git a/ext/curl/tests/server.inc b/ext/curl/tests/server.inc index b7c1570195e..68a5bde8a80 100644 --- a/ext/curl/tests/server.inc +++ b/ext/curl/tests/server.inc @@ -11,7 +11,7 @@ function curl_cli_server_start() { $php_executable = getenv('TEST_PHP_EXECUTABLE'); $doc_root = __DIR__; - $router = "responder/get.php"; + $router = "responder/get.inc"; if (substr(PHP_OS, 0, 3) == 'WIN') { $descriptorspec = array( diff --git a/ext/intl/tests/formatter_format8.phpt b/ext/intl/tests/formatter_format8.phpt index 55b10ffdfc4..3aad6bced1f 100644 --- a/ext/intl/tests/formatter_format8.phpt +++ b/ext/intl/tests/formatter_format8.phpt @@ -107,20 +107,20 @@ Locale is: de Locale is: fr '1234567.8912345\d+' -'1 234 567,891' -'1 234 567,89 XXX' -'123 456 789 ?%' +'1.+234.+567,891' +'1.+234.+567,89.+(XXX|¤)' +'123.+456.+789(.+)?%' '1.2345678912345\d+E6' 'un million deux cent trente-quatre mille cinq cent soixante-sept virgule huit neuf un deux trois quatre cinq( six)? sept( neuf)?' -'1 234 567e' -'1 234 567' +'1.+234.+567e' +'1.+234.+567' '#####.###' -'1 234 567,89 XXX' +'1.+234.+567,89.+XXX' Locale is: en_UK '1234567.8912345\d+' '1,234,567.891' -'XXX 1,234,567.89' +'(¤|XXX )1,234,567.89' '123,456,789%' '1.2345678912345\d+E6' 'one million,? two hundred (and )?thirty-four thousand,? five hundred (and )?sixty-seven point eight nine one two three four five( six)? seven( nine)?' diff --git a/ext/intl/tests/msgfmt_bug70484.phpt b/ext/intl/tests/msgfmt_bug70484.phpt index c5c0700cfc5..55c516eacdc 100644 --- a/ext/intl/tests/msgfmt_bug70484.phpt +++ b/ext/intl/tests/msgfmt_bug70484.phpt @@ -35,7 +35,7 @@ foreach ($locale as $lc) { ?> ==DONE== ---EXPECT-- +--EXPECTF-- de string key string(8) "42-other" string(11) "42,42-other" @@ -53,15 +53,15 @@ string(4) "five" fr string key string(8) "42-other" string(11) "42,42-other" -string(22) "2 147 483 643-other" -string(26) "2 147 483 643,123-other" +string(%d) "2%s147%s483%s643-other" +string(%d) "2%s147%s483%s643,123-other" string(4) "five" fr numeric key string(8) "42-other" string(11) "42,42-other" -string(22) "2 147 483 643-other" -string(26) "2 147 483 643,123-other" +string(%d) "2%s147%s483%s643-other" +string(%d) "2%s147%s483%s643,123-other" string(4) "five" en string key diff --git a/ext/mbstring/mb_gpc.c b/ext/mbstring/mb_gpc.c index 08b6e2b0a59..c50fb194e8b 100644 --- a/ext/mbstring/mb_gpc.c +++ b/ext/mbstring/mb_gpc.c @@ -90,30 +90,28 @@ MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data) break; } - if (arg == PARSE_POST) { - sapi_handle_post(&v_array); - return; - } - - if (arg == PARSE_GET) { /* GET data */ - c_var = SG(request_info).query_string; - if (c_var && *c_var) { - res = (char *) estrdup(c_var); + switch (arg) { + case PARSE_POST: + sapi_handle_post(&v_array); + return; + case PARSE_GET: /* GET data */ + c_var = SG(request_info).query_string; + if (c_var && *c_var) { + res = (char *) estrdup(c_var); + free_buffer = 1; + } + break; + case PARSE_COOKIE: /* Cookie data */ + c_var = SG(request_info).cookie_data; + if (c_var && *c_var) { + res = (char *) estrdup(c_var); + free_buffer = 1; + } + break; + case PARSE_STRING: /* String data */ + res = str; free_buffer = 1; - } else { - free_buffer = 0; - } - } else if (arg == PARSE_COOKIE) { /* Cookie data */ - c_var = SG(request_info).cookie_data; - if (c_var && *c_var) { - res = (char *) estrdup(c_var); - free_buffer = 1; - } else { - free_buffer = 0; - } - } else if (arg == PARSE_STRING) { /* String data */ - res = str; - free_buffer = 1; + break; } if (!res) { diff --git a/ext/mysqlnd/mysqlnd_connection.c b/ext/mysqlnd/mysqlnd_connection.c index 9f8e1fb5b96..826b47d7173 100644 --- a/ext/mysqlnd/mysqlnd_connection.c +++ b/ext/mysqlnd/mysqlnd_connection.c @@ -1810,10 +1810,17 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option_2d)(MYSQLND_CONN_DATA * cons DBG_INF_FMT("Adding [%s][%s]", key, value); { zval attrz; - zend_string *str = zend_string_init(key, strlen(key), 1); - GC_MAKE_PERSISTENT_LOCAL(str); - ZVAL_NEW_STR(&attrz, zend_string_init(value, strlen(value), conn->persistent)); - GC_MAKE_PERSISTENT_LOCAL(Z_COUNTED(attrz)); + zend_string *str; + + if (conn->persistent) { + str = zend_string_init(key, strlen(key), 1); + GC_MAKE_PERSISTENT_LOCAL(str); + ZVAL_NEW_STR(&attrz, zend_string_init(value, strlen(value), 1)); + GC_MAKE_PERSISTENT_LOCAL(Z_COUNTED(attrz)); + } else { + str = zend_string_init(key, strlen(key), 0); + ZVAL_NEW_STR(&attrz, zend_string_init(value, strlen(value), 0)); + } zend_hash_update(conn->options->connect_attr, str, &attrz); zend_string_release_ex(str, 1); } diff --git a/ext/phar/tests/fatal_error_webphar.phpt b/ext/phar/tests/fatal_error_webphar.phpt index 3db863470ab..ce3e8980adc 100644 --- a/ext/phar/tests/fatal_error_webphar.phpt +++ b/ext/phar/tests/fatal_error_webphar.phpt @@ -9,7 +9,7 @@ SCRIPT_NAME=/fatal_error_webphar.php REQUEST_URI=/fatal_error_webphar.php/index.php PATH_INFO=/index.php --FILE_EXTERNAL-- -files/pear2coverage.phar.php +files/pear2coverage.phar --EXPECTHEADERS-- Content-type: text/html; charset=UTF-8 --EXPECTF-- diff --git a/ext/phar/tests/files/pear2coverage.phar.php b/ext/phar/tests/files/pear2coverage.phar similarity index 100% rename from ext/phar/tests/files/pear2coverage.phar.php rename to ext/phar/tests/files/pear2coverage.phar diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 144851f2e6e..7654c6a3c44 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -296,8 +296,6 @@ static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node) { if (node_ptr == node) { return 0; } - xmlNodeSetName(node, node_ptr->name); - xmlSetNs(node, node_ptr->ns); if (SOAP_GLOBAL(soap_version) == SOAP_1_1) { while (1) { attr = get_attribute(attr, "id"); diff --git a/ext/soap/tests/bugs/bug50675.phpt b/ext/soap/tests/bugs/bug50675.phpt new file mode 100644 index 00000000000..c5feb173ace --- /dev/null +++ b/ext/soap/tests/bugs/bug50675.phpt @@ -0,0 +1,50 @@ +--TEST-- +Bug #50675 SoapClient can't handle object references correctly. +--SKIPIF-- + +--FILE-- + + + + + soapenv:Server.userException + service.EchoServiceException + + + 105 + string param + + steckovic + + + + +EOF; + } +} + +ini_set('soap.wsdl_cache_enabled', 0); + +$parameters = [ + 'trace' => 1, + 'exceptions' => 0, +]; +$client = new TestSoapClient(dirname(__FILE__) . '/bug50675.wsdl', $parameters); + +$person = new stdClass(); +$person->name = 'name'; + +$result = $client->echoPerson($person, $person); + +print($client->__getLastRequest()); +--EXPECT-- + +

name

diff --git a/ext/soap/tests/bugs/bug50675.wsdl b/ext/soap/tests/bugs/bug50675.wsdl new file mode 100644 index 00000000000..998fe9fce64 --- /dev/null +++ b/ext/soap/tests/bugs/bug50675.wsdl @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ext/standard/http.c b/ext/standard/http.c index 18788cc3a62..678fe416d85 100644 --- a/ext/standard/http.c +++ b/ext/standard/http.c @@ -53,17 +53,29 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, } arg_sep_len = strlen(arg_sep); - ZEND_HASH_FOREACH_KEY_VAL_IND(ht, idx, key, zdata) { + ZEND_HASH_FOREACH_KEY_VAL(ht, idx, key, zdata) { + zend_bool is_dynamic = 1; + if (Z_TYPE_P(zdata) == IS_INDIRECT) { + zdata = Z_INDIRECT_P(zdata); + if (Z_ISUNDEF_P(zdata)) { + continue; + } + + is_dynamic = 0; + } + /* handling for private & protected object properties */ if (key) { + prop_name = ZSTR_VAL(key); + prop_len = ZSTR_LEN(key); + + if (type != NULL && zend_check_property_access(Z_OBJ_P(type), key, is_dynamic) != SUCCESS) { + /* property not visible in this scope */ + continue; + } + if (ZSTR_VAL(key)[0] == '\0' && type != NULL) { const char *tmp; - - zend_object *zobj = Z_OBJ_P(type); - if (zend_check_property_access(zobj, key) != SUCCESS) { - /* private or protected property access outside of the class */ - continue; - } zend_unmangle_property_name_ex(key, &tmp, &prop_name, &prop_len); } else { prop_name = ZSTR_VAL(key); diff --git a/ext/standard/php_fopen_wrappers.h b/ext/standard/php_fopen_wrappers.h index b172eb46bb6..e37ade9eb9e 100644 --- a/ext/standard/php_fopen_wrappers.h +++ b/ext/standard/php_fopen_wrappers.h @@ -26,6 +26,6 @@ php_stream *php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pat extern PHPAPI const php_stream_wrapper php_stream_http_wrapper; extern PHPAPI const php_stream_wrapper php_stream_ftp_wrapper; extern PHPAPI const php_stream_wrapper php_stream_php_wrapper; -extern PHPAPI const php_stream_wrapper php_plain_files_wrapper; +extern PHPAPI /*const*/ php_stream_wrapper php_plain_files_wrapper; #endif diff --git a/ext/standard/tests/strings/vfprintf_variation12.phpt b/ext/standard/tests/strings/vfprintf_variation12.phpt index bcb60e0ad0c..51ab97e8bf8 100644 --- a/ext/standard/tests/strings/vfprintf_variation12.phpt +++ b/ext/standard/tests/strings/vfprintf_variation12.phpt @@ -95,31 +95,31 @@ unlink($data_file); -- Iteration 1 -- 2 0 12 361100 o 37777775456 2322 - + 30071 14 37777777764 37777416700 12 361100 2 0 -- Iteration 2 -- 2 37777777776 2 361100 o 37720715133 57062645 - + 57060664 4475347 37721631371 37720717336 2 361100 2 37777777776 -- Iteration 3 -- 0 0 0 173 o 37777777605 173 - + 2322 0 $0 _0 0 173 0 0 -- Iteration 4 -- 1 1 1 1 o 1 1 - + #1 1 $1 _1 1 1 1 1 -- Iteration 5 -- 1 1 0 1 o 0 1 - + #0 1 $1 _0 0 1 1 1 ===DONE=== diff --git a/ext/standard/tests/strings/vfprintf_variation14.phpt b/ext/standard/tests/strings/vfprintf_variation14.phpt index 300cd6b6661..ea2957a18c0 100644 --- a/ext/standard/tests/strings/vfprintf_variation14.phpt +++ b/ext/standard/tests/strings/vfprintf_variation14.phpt @@ -95,31 +95,31 @@ unlink($data_file); -- Iteration 1 -- 2 0 a 1e240 x fffffb2e 4d2 - + 3039 c fffffff4 fffe1dc0 a 1e240 2 0 -- Iteration 2 -- 2 fffffffe 2 1e240 x ff439a5b bc65a5 - + bc61b4 127ae7 ff4732f9 ff439ede 2 1e240 2 fffffffe -- Iteration 3 -- 0 0 0 7b x ffffff85 7b - + 4d2 0 $0 _0 0 7b 0 0 -- Iteration 4 -- 1 1 1 1 x 1 1 - + #1 1 $1 _1 1 1 1 1 -- Iteration 5 -- 1 1 0 1 x 0 1 - + #0 1 $1 _0 0 1 1 1 ===DONE=== diff --git a/ext/standard/tests/strings/vprintf_variation12.phpt b/ext/standard/tests/strings/vprintf_variation12.phpt index b29af411c5b..a4c6139144a 100644 --- a/ext/standard/tests/strings/vprintf_variation12.phpt +++ b/ext/standard/tests/strings/vprintf_variation12.phpt @@ -86,7 +86,7 @@ foreach($args_array as $args) { -- Iteration 1 -- 2 0 12 361100 o 37777775456 2322 - + 30071 14 37777777764 37777416700 12 361100 2 0 int(116) @@ -94,7 +94,7 @@ int(116) -- Iteration 2 -- 2 37777777776 2 361100 o 37720715133 57062645 - + 57060664 4475347 37721631371 37720717336 2 361100 2 37777777776 int(146) @@ -102,7 +102,7 @@ int(146) -- Iteration 3 -- 0 0 0 173 o 37777777605 173 - + 2322 0 $0 _0 0 173 0 0 int(88) @@ -110,7 +110,7 @@ int(88) -- Iteration 4 -- 1 1 1 1 o 1 1 - + #1 1 $1 _1 1 1 1 1 int(75) @@ -118,7 +118,7 @@ int(75) -- Iteration 5 -- 1 1 0 1 o 0 1 - + #0 1 $1 _0 0 1 1 1 int(75) diff --git a/ext/standard/tests/strings/vprintf_variation14.phpt b/ext/standard/tests/strings/vprintf_variation14.phpt index 2e7b14db0d9..830b7f8e15e 100644 --- a/ext/standard/tests/strings/vprintf_variation14.phpt +++ b/ext/standard/tests/strings/vprintf_variation14.phpt @@ -87,7 +87,7 @@ foreach($args_array as $args) { -- Iteration 1 -- 2 0 a 1e240 x fffffb2e 4d2 - + 3039 c fffffff4 fffe1dc0 a 1e240 2 0 int(101) @@ -95,7 +95,7 @@ int(101) -- Iteration 2 -- 2 fffffffe 2 1e240 x ff439a5b bc65a5 - + bc61b4 127ae7 ff4732f9 ff439ede 2 1e240 2 fffffffe int(124) @@ -103,7 +103,7 @@ int(124) -- Iteration 3 -- 0 0 0 7b x ffffff85 7b - + 4d2 0 $0 _0 0 7b 0 0 int(82) @@ -111,7 +111,7 @@ int(82) -- Iteration 4 -- 1 1 1 1 x 1 1 - + #1 1 $1 _1 1 1 1 1 int(75) @@ -119,7 +119,7 @@ int(75) -- Iteration 5 -- 1 1 0 1 x 0 1 - + #0 1 $1 _0 0 1 1 1 int(75) diff --git a/ext/standard/tests/strings/vsprintf_variation12.phpt b/ext/standard/tests/strings/vsprintf_variation12.phpt index e7fbbd03766..4385cdfe393 100644 --- a/ext/standard/tests/strings/vsprintf_variation12.phpt +++ b/ext/standard/tests/strings/vsprintf_variation12.phpt @@ -84,35 +84,35 @@ echo "Done"; -- Iteration 1 -- string(116) "2 0 12 361100 o 37777775456 2322 - + 30071 14 37777777764 37777416700 12 361100 2 0" -- Iteration 2 -- string(146) "2 37777777776 2 361100 o 37720715133 57062645 - + 57060664 4475347 37721631371 37720717336 2 361100 2 37777777776" -- Iteration 3 -- string(88) "0 0 0 173 o 37777777605 173 - + 2322 0 $0 _0 0 173 0 0" -- Iteration 4 -- string(75) "1 1 1 1 o 1 1 - + #1 1 $1 _1 1 1 1 1" -- Iteration 5 -- string(75) "1 1 0 1 o 0 1 - + #0 1 $1 _0 0 1 1 1" Done diff --git a/ext/standard/tests/strings/vsprintf_variation14.phpt b/ext/standard/tests/strings/vsprintf_variation14.phpt index c8994739b62..749d8fa2dfd 100644 --- a/ext/standard/tests/strings/vsprintf_variation14.phpt +++ b/ext/standard/tests/strings/vsprintf_variation14.phpt @@ -85,35 +85,35 @@ echo "Done"; -- Iteration 1 -- string(101) "2 0 a 1e240 x fffffb2e 4d2 - + 3039 c fffffff4 fffe1dc0 a 1e240 2 0" -- Iteration 2 -- string(124) "2 fffffffe 2 1e240 x ff439a5b bc65a5 - + bc61b4 127ae7 ff4732f9 ff439ede 2 1e240 2 fffffffe" -- Iteration 3 -- string(82) "0 0 0 7b x ffffff85 7b - + 4d2 0 $0 _0 0 7b 0 0" -- Iteration 4 -- string(75) "1 1 1 1 x 1 1 - + #1 1 $1 _1 1 1 1 1" -- Iteration 5 -- string(75) "1 1 0 1 x 0 1 - + #0 1 $1 _0 0 1 1 1" Done diff --git a/ext/sysvsem/sysvsem.c b/ext/sysvsem/sysvsem.c index 5628decdfd9..32244071d38 100644 --- a/ext/sysvsem/sysvsem.c +++ b/ext/sysvsem/sysvsem.c @@ -406,7 +406,7 @@ PHP_FUNCTION(sem_remove) #else if (semctl(sem_ptr->semid, 0, IPC_RMID, NULL) < 0) { #endif - php_error_docref(NULL, E_WARNING, "failed for SysV sempphore " ZEND_LONG_FMT ": %s", Z_LVAL_P(arg_id), strerror(errno)); + php_error_docref(NULL, E_WARNING, "failed for SysV semaphore " ZEND_LONG_FMT ": %s", Z_LVAL_P(arg_id), strerror(errno)); RETURN_FALSE; } diff --git a/ext/xmlrpc/config.m4 b/ext/xmlrpc/config.m4 index 93429c68409..206924204d3 100644 --- a/ext/xmlrpc/config.m4 +++ b/ext/xmlrpc/config.m4 @@ -87,6 +87,7 @@ if test "$PHP_XMLRPC" = "yes"; then -I@ext_srcdir@/libxmlrpc -DVERSION="0.50") PHP_ADD_BUILD_DIR($ext_builddir/libxmlrpc) XMLRPC_MODULE_TYPE=builtin + AC_DEFINE(HAVE_XMLRPC_BUNDLED, 1, [ ]) elif test "$PHP_XMLRPC" != "no"; then diff --git a/ext/xmlrpc/config.w32 b/ext/xmlrpc/config.w32 index 87f4412a92e..aeb4b40cab1 100644 --- a/ext/xmlrpc/config.w32 +++ b/ext/xmlrpc/config.w32 @@ -12,7 +12,7 @@ if (PHP_XMLRPC != "no") { ADD_SOURCES(configure_module_dirname + "/libxmlrpc", "base64.c simplestring.c xml_to_dandarpc.c \ xmlrpc_introspection.c encodings.c system_methods.c xml_to_xmlrpc.c \ queue.c xml_element.c xmlrpc.c xml_to_soap.c", "xmlrpc"); - + AC_DEFINE("HAVE_XMLRPC_BUNDLED", 1); } else { WARNING("xmlrpc support can't be enabled, libraries or headers are missing") PHP_XMLRPC = "no"; diff --git a/ext/xmlrpc/libxmlrpc/acinclude.m4 b/ext/xmlrpc/libxmlrpc/acinclude.m4 index b1d99bc3161..b425377b826 100644 --- a/ext/xmlrpc/libxmlrpc/acinclude.m4 +++ b/ext/xmlrpc/libxmlrpc/acinclude.m4 @@ -1,4 +1,4 @@ -# Local macros for automake & autoconf +# Local macros for autoconf AC_DEFUN([XMLRPC_FUNCTION_CHECKS],[ diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c index 82bdd12b8a4..737a3f84a51 100644 --- a/ext/xmlrpc/xmlrpc-epi-php.c +++ b/ext/xmlrpc/xmlrpc-epi-php.c @@ -695,7 +695,11 @@ PHP_FUNCTION(xmlrpc_encode_request) outBuf = XMLRPC_REQUEST_ToXML(xRequest, 0); if (outBuf) { RETVAL_STRING(outBuf); +#ifdef HAVE_XMLRPC_BUNDLED efree(outBuf); +#else + free(outBuf); +#endif } XMLRPC_RequestFree(xRequest, 1); } @@ -729,7 +733,11 @@ PHP_FUNCTION(xmlrpc_encode) if (xOut) { if (outBuf) { RETVAL_STRING(outBuf); +#ifdef HAVE_XMLRPC_BUNDLED efree(outBuf); +#else + free(outBuf); +#endif } /* cleanup */ XMLRPC_CleanupValue(xOut); @@ -1092,7 +1100,11 @@ PHP_FUNCTION(xmlrpc_server_call_method) outBuf = XMLRPC_REQUEST_ToXML(xResponse, &buf_len); if (outBuf) { RETVAL_STRINGL(outBuf, buf_len); +#ifdef HAVE_XMLRPC_BUNDLED efree(outBuf); +#else + free(outBuf); +#endif } /* cleanup after ourselves. what a sty! */ XMLRPC_RequestFree(xResponse, 0); diff --git a/genfiles b/genfiles index a561c3d8f1c..dad4a624318 100755 --- a/genfiles +++ b/genfiles @@ -9,10 +9,14 @@ if [ -z $RE2C ]; then RE2C="re2c" fi -STD="make -f Makefile.frag RE2C='$RE2C' RE2C_FLAGS='-i' YACC='$YACC' srcdir=Zend builddir=Zend top_srcdir=." - +# Generate Zend parser and lexer files +STD="make -f Zend/Makefile.frag RE2C='$RE2C' RE2C_FLAGS='-i' YACC='$YACC' srcdir=Zend builddir=Zend top_srcdir=." (eval "$STD Zend/zend_language_parser.c Zend/zend_language_scanner.c Zend/zend_ini_parser.c Zend/zend_ini_scanner.c") +# Generate phpdbg parser and lexer files +STD="make -f sapi/phpdbg/Makefile.frag RE2C='$RE2C' RE2C_FLAGS='-i' YACC='$YACC' srcdir=sapi/phpdbg builddir=sapi/phpdbg top_srcdir=." +(eval "$STD sapi/phpdbg/phpdbg_parser.c sapi/phpdbg/phpdbg_lexer.c") + set -x CLEANUP_FILES=" \ diff --git a/main/streams/php_stream_plain_wrapper.h b/main/streams/php_stream_plain_wrapper.h index 183a12d2a2e..17c0e720825 100644 --- a/main/streams/php_stream_plain_wrapper.h +++ b/main/streams/php_stream_plain_wrapper.h @@ -20,7 +20,7 @@ /* operations for a plain file; use the php_stream_fopen_XXX funcs below */ PHPAPI extern php_stream_ops php_stream_stdio_ops; -PHPAPI extern const php_stream_wrapper php_plain_files_wrapper; +PHPAPI extern /*const*/ php_stream_wrapper php_plain_files_wrapper; BEGIN_EXTERN_C() diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index b2fc00b2264..fdfc7b4f634 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -1453,7 +1453,8 @@ static const php_stream_wrapper_ops php_plain_files_wrapper_ops = { php_plain_files_metadata }; -PHPAPI const php_stream_wrapper php_plain_files_wrapper = { +/* TODO: We have to make php_plain_files_wrapper writable to support SWOOLE */ +PHPAPI /*const*/ php_stream_wrapper php_plain_files_wrapper = { &php_plain_files_wrapper_ops, NULL, 0 diff --git a/makedist b/makedist index ea17bafa774..452768683aa 100755 --- a/makedist +++ b/makedist @@ -65,8 +65,8 @@ DIR=php-$VER DIRPATH=$MY_OLDPWD/$DIR if test -d "$DIRPATH"; then - echo "The directory $DIR" - echo "already exists, rename or remove it and run makedist again." + echo "The directory $DIR" >&2 + echo "already exists, rename or remove it and run makedist again." >&2 exit 1 fi diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index 640d3eccbe3..4cbab8e5ba7 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -1467,6 +1467,9 @@ static PHP_MINFO_FUNCTION(cgi) } /* }}} */ +ZEND_BEGIN_ARG_INFO(cgi_fcgi_sapi_no_arginfo, 0) +ZEND_END_ARG_INFO() + PHP_FUNCTION(fastcgi_finish_request) /* {{{ */ { fcgi_request *request = (fcgi_request*) SG(server_context); @@ -1489,9 +1492,6 @@ PHP_FUNCTION(fastcgi_finish_request) /* {{{ */ } /* }}} */ -ZEND_BEGIN_ARG_INFO(cgi_fcgi_sapi_no_arginfo, 0) -ZEND_END_ARG_INFO() - PHP_FUNCTION(apache_request_headers) /* {{{ */ { fcgi_request *request; @@ -1510,8 +1510,11 @@ PHP_FUNCTION(apache_request_headers) /* {{{ */ * Returns the status of the fastcgi process manager */ PHP_FUNCTION(fpm_get_status) /* {{{ */ { - int error = fpm_status_export_to_zval(return_value); - if(error){ + if (zend_parse_parameters_none() == FAILURE) { + return; + } + + if (fpm_status_export_to_zval(return_value)) { RETURN_FALSE; } } @@ -1519,7 +1522,7 @@ PHP_FUNCTION(fpm_get_status) /* {{{ */ static const zend_function_entry cgi_fcgi_sapi_functions[] = { PHP_FE(fastcgi_finish_request, cgi_fcgi_sapi_no_arginfo) - PHP_FE(fpm_get_status, NULL) + PHP_FE(fpm_get_status, cgi_fcgi_sapi_no_arginfo) PHP_FE(apache_request_headers, cgi_fcgi_sapi_no_arginfo) PHP_FALIAS(getallheaders, apache_request_headers, cgi_fcgi_sapi_no_arginfo) PHP_FE_END diff --git a/sapi/phpdbg/phpdbg_parser.c b/sapi/phpdbg/phpdbg_parser.c deleted file mode 100644 index ae7533abe4c..00000000000 --- a/sapi/phpdbg/phpdbg_parser.c +++ /dev/null @@ -1,1953 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.7.12-4996. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.7.12-4996" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 1 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - - -/* Substitute the variable and function names. */ -#define yyparse phpdbg_parse -#define yylex phpdbg_lex -#define yyerror phpdbg_error -#define yylval phpdbg_lval -#define yychar phpdbg_char -#define yydebug phpdbg_debug -#define yynerrs phpdbg_nerrs - -/* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 1 "sapi/phpdbg/phpdbg_parser.y" - - -/* - * phpdbg_parser.y - * (from php-src root) - */ - -#include "phpdbg.h" -#include "phpdbg_cmd.h" -#include "phpdbg_utils.h" -#include "phpdbg_cmd.h" -#include "phpdbg_prompt.h" - -#define YYSTYPE phpdbg_param_t - -#include "phpdbg_parser.h" -#include "phpdbg_lexer.h" - -#undef yyerror -static int yyerror(const char *msg); - -ZEND_EXTERN_MODULE_GLOBALS(phpdbg) - -#ifdef _MSC_VER -#define YYMALLOC malloc -#define YYFREE free -#endif - - -/* Line 371 of yacc.c */ -#line 107 "sapi/phpdbg/phpdbg_parser.c" - -# ifndef YY_NULL -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr -# else -# define YY_NULL 0 -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 1 -#endif - -/* In a future release of Bison, this section will be replaced - by #include "phpdbg_parser.h". */ -#ifndef YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED -# define YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int phpdbg_debug; -#endif -/* "%code requires" blocks. */ -/* Line 387 of yacc.c */ -#line 36 "sapi/phpdbg/phpdbg_parser.y" - -#include "phpdbg.h" -#ifndef YY_TYPEDEF_YY_SCANNER_T -#define YY_TYPEDEF_YY_SCANNER_T -typedef void* yyscan_t; -#endif - - -/* Line 387 of yacc.c */ -#line 148 "sapi/phpdbg/phpdbg_parser.c" - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - T_EVAL = 258, - T_RUN = 259, - T_SHELL = 260, - T_IF = 261, - T_TRUTHY = 262, - T_FALSY = 263, - T_STRING = 264, - T_COLON = 265, - T_DCOLON = 266, - T_POUND = 267, - T_SEPARATOR = 268, - T_PROTO = 269, - T_DIGITS = 270, - T_LITERAL = 271, - T_ADDR = 272, - T_OPCODE = 273, - T_ID = 274, - T_INPUT = 275, - T_UNEXPECTED = 276, - T_REQ_ID = 277 - }; -#endif -/* Tokens. */ -#define T_EVAL 258 -#define T_RUN 259 -#define T_SHELL 260 -#define T_IF 261 -#define T_TRUTHY 262 -#define T_FALSY 263 -#define T_STRING 264 -#define T_COLON 265 -#define T_DCOLON 266 -#define T_POUND 267 -#define T_SEPARATOR 268 -#define T_PROTO 269 -#define T_DIGITS 270 -#define T_LITERAL 271 -#define T_ADDR 272 -#define T_OPCODE 273 -#define T_ID 274 -#define T_INPUT 275 -#define T_UNEXPECTED 276 -#define T_REQ_ID 277 - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef int YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif - - -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int phpdbg_parse (void *YYPARSE_PARAM); -#else -int phpdbg_parse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int phpdbg_parse (void); -#else -int phpdbg_parse (); -#endif -#endif /* ! YYPARSE_PARAM */ - -#endif /* !YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED */ - -/* Copy the second part of user declarations. */ - -/* Line 390 of yacc.c */ -#line 229 "sapi/phpdbg/phpdbg_parser.c" - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -#ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if (! defined __GNUC__ || __GNUC__ < 2 \ - || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)) -# define __attribute__(Spec) /* empty */ -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; -#endif -{ - return yyi; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 27 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 50 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 23 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 7 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 30 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 46 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 277 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 5, 9, 10, 12, 14, 16, 19, - 22, 26, 31, 36, 42, 46, 52, 56, 59, 61, - 63, 65, 67, 69, 71, 73, 75, 76, 80, 84, - 87 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 24, 0, -1, 25, -1, 24, 13, 25, -1, -1, - 26, -1, 29, -1, 27, -1, 26, 27, -1, 26, - 28, -1, 19, 10, 15, -1, 19, 10, 12, 15, - -1, 14, 19, 10, 15, -1, 14, 19, 10, 12, - 15, -1, 19, 11, 19, -1, 19, 11, 19, 12, - 15, -1, 19, 12, 15, -1, 6, 20, -1, 18, - -1, 17, -1, 16, -1, 7, -1, 8, -1, 15, - -1, 19, -1, 22, -1, -1, 3, 28, 20, -1, - 5, 28, 20, -1, 4, 28, -1, 4, 28, 20, - -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint8 yyrline[] = -{ - 0, 71, 71, 72, 73, 77, 78, 82, 83, 84, - 88, 93, 98, 108, 118, 123, 129, 135, 140, 141, - 142, 143, 144, 145, 146, 150, 151, 155, 160, 165, - 169 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || 1 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "\"eval\"", "\"run\"", "\"shell\"", - "\"if (condition)\"", "\"truthy (true, on, yes or enabled)\"", - "\"falsy (false, off, no or disabled)\"", - "\"string (some input, perhaps)\"", "\": (colon)\"", - "\":: (double colon)\"", "\"# (pound sign followed by digits)\"", - "\"# (pound sign)\"", "\"protocol (file://)\"", "\"digits (numbers)\"", - "\"literal (string)\"", "\"address\"", "\"opcode\"", - "\"identifier (command or function name)\"", - "\"input (input string or data)\"", "\"input\"", - "\"request id (-r %d)\"", "$accept", "input", "command", "parameters", - "parameter", "req_id", "full_expression", YY_NULL -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 23, 24, 24, 24, 25, 25, 26, 26, 26, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 28, 28, 29, 29, 29, - 29 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 3, 0, 1, 1, 1, 2, 2, - 3, 4, 4, 5, 3, 5, 3, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 3, 3, 2, - 3 -}; - -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 4, 26, 26, 26, 0, 21, 22, 0, 23, 20, - 19, 18, 24, 0, 2, 5, 7, 6, 25, 0, - 29, 0, 17, 0, 0, 0, 0, 1, 0, 8, - 9, 27, 30, 28, 0, 0, 10, 14, 16, 3, - 0, 12, 11, 0, 13, 15 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 13, 14, 15, 16, 19, 17 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -17 -static const yytype_int8 yypact[] = -{ - -3, -16, -16, -16, -10, -17, -17, 2, -17, -17, - -17, -17, 26, 9, -17, 11, -17, -17, -17, 3, - 4, 21, -17, 29, 19, 23, 25, -17, -3, -17, - -17, -17, -17, -17, 20, 28, -17, 32, -17, -17, - 30, -17, -17, 31, -17, -17 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -17, -17, 22, -17, 33, 5, -17 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 -static const yytype_uint8 yytable[] = -{ - 1, 2, 3, 4, 5, 6, 18, 20, 21, 27, - 22, 7, 8, 9, 10, 11, 12, 4, 5, 6, - 30, 23, 28, 31, 32, 7, 8, 9, 10, 11, - 12, 35, 40, 18, 36, 41, 24, 25, 26, 34, - 38, 33, 37, 42, 43, 44, 45, 0, 29, 0, - 39 -}; - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-17))) - -#define yytable_value_is_error(Yytable_value) \ - YYID (0) - -static const yytype_int8 yycheck[] = -{ - 3, 4, 5, 6, 7, 8, 22, 2, 3, 0, - 20, 14, 15, 16, 17, 18, 19, 6, 7, 8, - 15, 19, 13, 20, 20, 14, 15, 16, 17, 18, - 19, 12, 12, 22, 15, 15, 10, 11, 12, 10, - 15, 20, 19, 15, 12, 15, 15, -1, 15, -1, - 28 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 3, 4, 5, 6, 7, 8, 14, 15, 16, - 17, 18, 19, 24, 25, 26, 27, 29, 22, 28, - 28, 28, 20, 19, 10, 11, 12, 0, 13, 27, - 28, 20, 20, 20, 10, 12, 15, 19, 15, 25, - 12, 15, 15, 12, 15, 15 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, YYLEX_PARAM) -#else -# define YYLEX yylex (&yylval) -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - FILE *yyo = yyoutput; - YYUSE (yyo); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - YYUSE (yytype); -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULL; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - YYUSE (yyvaluep); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - YYUSE (yytype); -} - - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void) -#else -int -yyparse () - -#endif -#endif -{ -/* The lookahead symbol. */ -int yychar; - - -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -/* Default value used for initialization, for pacifying older GCCs - or non-GCC compilers. */ -static YYSTYPE yyval_default; -# define YY_INITIAL_VALUE(Value) = Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); - - /* Number of syntax errors so far. */ - int yynerrs; - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -/* Line 1802 of yacc.c */ -#line 71 "sapi/phpdbg/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } - break; - - case 3: -/* Line 1802 of yacc.c */ -#line 72 "sapi/phpdbg/phpdbg_parser.y" - { phpdbg_stack_separate((yyvsp[(1) - (3)]).top); (yyval) = (yyvsp[(3) - (3)]); } - break; - - case 5: -/* Line 1802 of yacc.c */ -#line 77 "sapi/phpdbg/phpdbg_parser.y" - { (yyval).top = PHPDBG_G(parser_stack)->top; } - break; - - case 6: -/* Line 1802 of yacc.c */ -#line 78 "sapi/phpdbg/phpdbg_parser.y" - { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); (yyval).top = PHPDBG_G(parser_stack)->top; } - break; - - case 7: -/* Line 1802 of yacc.c */ -#line 82 "sapi/phpdbg/phpdbg_parser.y" - { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); (yyval).top = PHPDBG_G(parser_stack)->top; } - break; - - case 8: -/* Line 1802 of yacc.c */ -#line 83 "sapi/phpdbg/phpdbg_parser.y" - { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(2) - (2)])); (yyval).top = PHPDBG_G(parser_stack)->top; } - break; - - case 9: -/* Line 1802 of yacc.c */ -#line 84 "sapi/phpdbg/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (2)]); } - break; - - case 10: -/* Line 1802 of yacc.c */ -#line 88 "sapi/phpdbg/phpdbg_parser.y" - { - (yyval).type = FILE_PARAM; - (yyval).file.name = (yyvsp[(2) - (3)]).str; - (yyval).file.line = (yyvsp[(3) - (3)]).num; - } - break; - - case 11: -/* Line 1802 of yacc.c */ -#line 93 "sapi/phpdbg/phpdbg_parser.y" - { - (yyval).type = NUMERIC_FILE_PARAM; - (yyval).file.name = (yyvsp[(1) - (4)]).str; - (yyval).file.line = (yyvsp[(4) - (4)]).num; - } - break; - - case 12: -/* Line 1802 of yacc.c */ -#line 98 "sapi/phpdbg/phpdbg_parser.y" - { - (yyval).type = FILE_PARAM; - (yyval).file.name = malloc((yyvsp[(1) - (4)]).len + (yyvsp[(2) - (4)]).len + 1); - if ((yyval).file.name) { - memcpy(&(yyval).file.name[0], (yyvsp[(1) - (4)]).str, (yyvsp[(1) - (4)]).len); - memcpy(&(yyval).file.name[(yyvsp[(1) - (4)]).len], (yyvsp[(2) - (4)]).str, (yyvsp[(2) - (4)]).len); - (yyval).file.name[(yyvsp[(1) - (4)]).len + (yyvsp[(2) - (4)]).len] = '\0'; - } - (yyval).file.line = (yyvsp[(4) - (4)]).num; - } - break; - - case 13: -/* Line 1802 of yacc.c */ -#line 108 "sapi/phpdbg/phpdbg_parser.y" - { - (yyval).type = NUMERIC_FILE_PARAM; - (yyval).file.name = malloc((yyvsp[(1) - (5)]).len + (yyvsp[(2) - (5)]).len + 1); - if ((yyval).file.name) { - memcpy(&(yyval).file.name[0], (yyvsp[(1) - (5)]).str, (yyvsp[(1) - (5)]).len); - memcpy(&(yyval).file.name[(yyvsp[(1) - (5)]).len], (yyvsp[(2) - (5)]).str, (yyvsp[(2) - (5)]).len); - (yyval).file.name[(yyvsp[(1) - (5)]).len + (yyvsp[(2) - (5)]).len] = '\0'; - } - (yyval).file.line = (yyvsp[(5) - (5)]).num; - } - break; - - case 14: -/* Line 1802 of yacc.c */ -#line 118 "sapi/phpdbg/phpdbg_parser.y" - { - (yyval).type = METHOD_PARAM; - (yyval).method.class = (yyvsp[(1) - (3)]).str; - (yyval).method.name = (yyvsp[(3) - (3)]).str; - } - break; - - case 15: -/* Line 1802 of yacc.c */ -#line 123 "sapi/phpdbg/phpdbg_parser.y" - { - (yyval).type = NUMERIC_METHOD_PARAM; - (yyval).method.class = (yyvsp[(1) - (5)]).str; - (yyval).method.name = (yyvsp[(3) - (5)]).str; - (yyval).num = (yyvsp[(5) - (5)]).num; - } - break; - - case 16: -/* Line 1802 of yacc.c */ -#line 129 "sapi/phpdbg/phpdbg_parser.y" - { - (yyval).type = NUMERIC_FUNCTION_PARAM; - (yyval).str = (yyvsp[(1) - (3)]).str; - (yyval).len = (yyvsp[(1) - (3)]).len; - (yyval).num = (yyvsp[(3) - (3)]).num; - } - break; - - case 17: -/* Line 1802 of yacc.c */ -#line 135 "sapi/phpdbg/phpdbg_parser.y" - { - (yyval).type = COND_PARAM; - (yyval).str = (yyvsp[(2) - (2)]).str; - (yyval).len = (yyvsp[(2) - (2)]).len; - } - break; - - case 18: -/* Line 1802 of yacc.c */ -#line 140 "sapi/phpdbg/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } - break; - - case 19: -/* Line 1802 of yacc.c */ -#line 141 "sapi/phpdbg/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } - break; - - case 20: -/* Line 1802 of yacc.c */ -#line 142 "sapi/phpdbg/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } - break; - - case 21: -/* Line 1802 of yacc.c */ -#line 143 "sapi/phpdbg/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } - break; - - case 22: -/* Line 1802 of yacc.c */ -#line 144 "sapi/phpdbg/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } - break; - - case 23: -/* Line 1802 of yacc.c */ -#line 145 "sapi/phpdbg/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } - break; - - case 24: -/* Line 1802 of yacc.c */ -#line 146 "sapi/phpdbg/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } - break; - - case 25: -/* Line 1802 of yacc.c */ -#line 150 "sapi/phpdbg/phpdbg_parser.y" - { PHPDBG_G(req_id) = (yyvsp[(1) - (1)]).num; } - break; - - case 27: -/* Line 1802 of yacc.c */ -#line 155 "sapi/phpdbg/phpdbg_parser.y" - { - (yyval).type = EVAL_PARAM; - (yyval).str = (yyvsp[(3) - (3)]).str; - (yyval).len = (yyvsp[(3) - (3)]).len; - } - break; - - case 28: -/* Line 1802 of yacc.c */ -#line 160 "sapi/phpdbg/phpdbg_parser.y" - { - (yyval).type = SHELL_PARAM; - (yyval).str = (yyvsp[(3) - (3)]).str; - (yyval).len = (yyvsp[(3) - (3)]).len; - } - break; - - case 29: -/* Line 1802 of yacc.c */ -#line 165 "sapi/phpdbg/phpdbg_parser.y" - { - (yyval).type = RUN_PARAM; - (yyval).len = 0; - } - break; - - case 30: -/* Line 1802 of yacc.c */ -#line 169 "sapi/phpdbg/phpdbg_parser.y" - { - (yyval).type = RUN_PARAM; - (yyval).str = (yyvsp[(3) - (3)]).str; - (yyval).len = (yyvsp[(3) - (3)]).len; - } - break; - - -/* Line 1802 of yacc.c */ -#line 1694 "sapi/phpdbg/phpdbg_parser.c" - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - } - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} - - -/* Line 2050 of yacc.c */ -#line 176 "sapi/phpdbg/phpdbg_parser.y" - - -static int yyerror(const char *msg) { - phpdbg_error("command", "type=\"parseerror\" msg=\"%s\"", "Parse Error: %s", msg); - - { - const phpdbg_param_t *top = PHPDBG_G(parser_stack); - - while (top) { - phpdbg_param_debug(top, "--> "); - top = top->next; - } - } - return 0; -} - -int phpdbg_do_parse(phpdbg_param_t *stack, char *input) { - if (!*input) { - return 0; - } - - if (PHPDBG_G(cur_command)) { - free(PHPDBG_G(cur_command)); - } - PHPDBG_G(cur_command) = strdup(input); - - phpdbg_init_lexer(stack, input); - - return yyparse(); -} diff --git a/sapi/phpdbg/phpdbg_parser.h b/sapi/phpdbg/phpdbg_parser.h deleted file mode 100644 index 2a27a4e7dff..00000000000 --- a/sapi/phpdbg/phpdbg_parser.h +++ /dev/null @@ -1,130 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.7.12-4996. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -#ifndef YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED -# define YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int phpdbg_debug; -#endif -/* "%code requires" blocks. */ -/* Line 2060 of yacc.c */ -#line 36 "sapi/phpdbg/phpdbg_parser.y" - -#include "phpdbg.h" -#ifndef YY_TYPEDEF_YY_SCANNER_T -#define YY_TYPEDEF_YY_SCANNER_T -typedef void* yyscan_t; -#endif - - -/* Line 2060 of yacc.c */ -#line 55 "sapi/phpdbg/phpdbg_parser.h" - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - T_EVAL = 258, - T_RUN = 259, - T_SHELL = 260, - T_IF = 261, - T_TRUTHY = 262, - T_FALSY = 263, - T_STRING = 264, - T_COLON = 265, - T_DCOLON = 266, - T_POUND = 267, - T_SEPARATOR = 268, - T_PROTO = 269, - T_DIGITS = 270, - T_LITERAL = 271, - T_ADDR = 272, - T_OPCODE = 273, - T_ID = 274, - T_INPUT = 275, - T_UNEXPECTED = 276, - T_REQ_ID = 277 - }; -#endif -/* Tokens. */ -#define T_EVAL 258 -#define T_RUN 259 -#define T_SHELL 260 -#define T_IF 261 -#define T_TRUTHY 262 -#define T_FALSY 263 -#define T_STRING 264 -#define T_COLON 265 -#define T_DCOLON 266 -#define T_POUND 267 -#define T_SEPARATOR 268 -#define T_PROTO 269 -#define T_DIGITS 270 -#define T_LITERAL 271 -#define T_ADDR 272 -#define T_OPCODE 273 -#define T_ID 274 -#define T_INPUT 275 -#define T_UNEXPECTED 276 -#define T_REQ_ID 277 - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef int YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif - - -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int phpdbg_parse (void *YYPARSE_PARAM); -#else -int phpdbg_parse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int phpdbg_parse (void); -#else -int phpdbg_parse (); -#endif -#endif /* ! YYPARSE_PARAM */ - -#endif /* !YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED */ diff --git a/sapi/phpdbg/phpdbg_parser.y b/sapi/phpdbg/phpdbg_parser.y index b61c9c0a26c..cecb7b2c552 100644 --- a/sapi/phpdbg/phpdbg_parser.y +++ b/sapi/phpdbg/phpdbg_parser.y @@ -68,7 +68,7 @@ typedef void* yyscan_t; input : command { $$ = $1; } | input T_SEPARATOR command { phpdbg_stack_separate($1.top); $$ = $3; } - | /* nothing */ + | /* empty */ ; command @@ -79,7 +79,7 @@ command parameters : parameter { phpdbg_stack_push(PHPDBG_G(parser_stack), &$1); $$.top = PHPDBG_G(parser_stack)->top; } | parameters parameter { phpdbg_stack_push(PHPDBG_G(parser_stack), &$2); $$.top = PHPDBG_G(parser_stack)->top; } - | parameters req_id { $$ = $1; } + | parameters T_REQ_ID { $$ = $1; PHPDBG_G(req_id) = $2.num; } ; parameter diff --git a/scripts/Makefile.frag b/scripts/Makefile.frag index fdf67f04388..d7f8475014e 100644 --- a/scripts/Makefile.frag +++ b/scripts/Makefile.frag @@ -7,7 +7,6 @@ phpbuilddir = $(libdir)/build BUILD_FILES = \ scripts/phpize.m4 \ - build/mkdep.awk \ build/scan_makefile_in.awk \ build/libtool.m4 \ build/ax_check_compile_flag.m4 \ diff --git a/scripts/phpize.in b/scripts/phpize.in index 3e863852f68..5cb62a3736a 100644 --- a/scripts/phpize.in +++ b/scripts/phpize.in @@ -9,7 +9,7 @@ includedir="`eval echo @includedir@`/php" builddir="`pwd`" SED="@SED@" -FILES_BUILD="mkdep.awk scan_makefile_in.awk shtool libtool.m4 ax_check_compile_flag.m4 ax_gcc_func_attribute.m4 php_cxx_compile_stdcxx.m4" +FILES_BUILD="scan_makefile_in.awk shtool libtool.m4 ax_check_compile_flag.m4 ax_gcc_func_attribute.m4 php_cxx_compile_stdcxx.m4" FILES="acinclude.m4 Makefile.global config.sub config.guess ltmain.sh run-tests*.php" CLEAN_FILES="$FILES *.o *.lo *.la .libs/ build/ modules/ install-sh \ mkinstalldirs missing config.nice config.sub config.guess configure configure.ac \