diff --git a/.travis.yml b/.travis.yml index d149772e3144c..07653040dd9a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,4 +29,4 @@ before_script: - . ./travis/ext/pdo_pgsql/setup.sh # Run PHPs run-tests.php -script: ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff +script: ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff --set-timeout 120 diff --git a/CODING_STANDARDS b/CODING_STANDARDS index 16ec36b681307..a05d761cf14bb 100644 --- a/CODING_STANDARDS +++ b/CODING_STANDARDS @@ -151,7 +151,7 @@ Naming Conventions 7. Classes should be given descriptive names. Avoid using abbreviations where possible. Each word in the class name should start with a capital letter, - without underscore delimiters (CampelCaps starting with a capital letter). + without underscore delimiters (CamelCaps starting with a capital letter). The class name should be prefixed with the name of the 'parent set' (e.g. the name of the extension):: diff --git a/NEWS b/NEWS index 0c94ea23e12c7..57c2938bbf967 100644 --- a/NEWS +++ b/NEWS @@ -6,15 +6,28 @@ PHP NEWS . Improved IS_VAR operands fetching. (Laruence, Dmitry) . Implemented internal operator overloading (RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita) + . Made calls from incompatible context issue an E_DEPRECATED warning instead + of E_STRICT (phase 1 of RFC: https://wiki.php.net/rfc/incompat_ctx). + (Gustavo) + . Uploads equal or greater than 2GB in size are now accepted. + (Ralf Lang, Mike) + . Reduced POST data memory usage by 200-300%. Removed INI setting + always_populate_raw_post_data and the $HTTP_RAW_POST_DATA global + variable. (Mike) + . Implemented dedicated syntax for variadic functions + (RFC: https://wiki.php.net/rfc/variadics). (Nikita) -- Session: - . Fixed Bug #65315 (session.hash_function silently fallback to default md5) - (Yasuo) - . Implemented Request #54649 (Create session_serializer_name()). (Yasuo) - . Implemented Request #17860 (Session write short circuit). (Yasuo) - . Implemented Request #20421 (session_abort() and session_reset() function). - (Yasuo) - . Implemented Request #11100 (session_gc() function). (Yasuo) +- cURL: + . Implemented FR #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir + or safe_mode). (Adam) + +- GMP: + . Moved GMP to use object as the underlying structure and implemented various + improvements based on this. + (RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita) + +- Hash: + . Added gost-crypto (CryptoPro S-box) GOST hash algo. (Manuel Mausz) - mysqlnd: . Disabled flag for SP OUT variables for 5.5+ servers as they are not natively @@ -27,14 +40,32 @@ PHP NEWS cache_slots) in op_array->literals table. (Laruence, Dmitry) . Added script level constant replacement optimization pass. (Dmitry) +- Openssl: + . Added crypto_method option for the ssl stream context. (Martin Jansen) + . Added certificate fingerprint support. (Tjerk Meesters) + . Added explicit TLSv1.1 and TLSv1.2 stream transports. (Daniel Lowrey) + . Fixed bug #65729 (CN_match gives false positive). (Tjerk Meesters) + - PDO_pgsql: . Fixed Bug #42614 (PDO_pgsql: add pg_get_notify support). (Matteo) . Fixed Bug #63657 (pgsqlCopyFromFile, pgsqlCopyToArray use Postgres < 7.3 syntax). (Matteo) -- GMP: - . Moved GMP to use object as the underlying structure and implemented various - improvements based on this. - (RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita) +- Session: + . Fixed Bug #65315 (session.hash_function silently fallback to default md5) + (Yasuo) + . Implemented Request #54649 (Create session_serializer_name()). (Yasuo) + . Implemented Request #17860 (Session write short circuit). (Yasuo) + . Implemented Request #20421 (session_abort() and session_reset() function). + (Yasuo) + . Implemented Request #11100 (session_gc() function). (Yasuo) + +- Standard: + . Implemented FR #65634 (HTTP wrapper is very slow with protocol_version + 1.1). (Adam) + +- XMLReader: + . Fixed bug #55285 (XMLReader::getAttribute/No/Ns methods inconsistency). + (Mike) <<< NOTE: Insert NEWS from last stable release here prior to actual release! >>> diff --git a/README.EXT_SKEL b/README.EXT_SKEL index b0db843a42ba0..d44fcc5c6a92c 100644 --- a/README.EXT_SKEL +++ b/README.EXT_SKEL @@ -31,6 +31,11 @@ HOW TO USE IT ./buildconf; ./configure --enable-module_name; make + The definition of PHP_MODULE_NAME_VERSION will be present in the + php_module_name.h and injected into the zend_module_entry definition. This + is required by the PECL website for the version string conformity checks + against package.xml + But if you already have planned the overall scheme of your module, what functions it will contain, their return types and the arguments they take (a very good idea) and don't want to bother yourself with creating function diff --git a/README.SELF-CONTAINED-EXTENSIONS b/README.SELF-CONTAINED-EXTENSIONS index e6a375331b4a5..5287230e1aea0 100644 --- a/README.SELF-CONTAINED-EXTENSIONS +++ b/README.SELF-CONTAINED-EXTENSIONS @@ -153,3 +153,18 @@ ADDING SHARED MODULE SUPPORT TO A MODULE #ifdef COMPILE_DL_FOO ZEND_GET_MODULE(foo) #endif + +PECL SITE CONFORMITY + + If you plan to release an extension to the PECL website, there are several + points to be regarded. + + 1. Add LICENSE or COPYING to the package.xml + + 2. The following should be defined in one of the extension header files + + #define PHP_FOO_VERSION "1.2.3" + + This macros has to be used within your foo_module_entry to indicate the + extension version. + diff --git a/UPGRADING b/UPGRADING index 431ad79e999b9..b19c3dd5410e5 100755 --- a/UPGRADING +++ b/UPGRADING @@ -20,11 +20,32 @@ PHP X.Y UPGRADE NOTES 1. Backward Incompatible Changes ======================================== +- Core: + Removed $HTTP_RAW_POST_DATA global variable. Restore backwards compatibility + by: + ======================================== 2. New Features ======================================== +- Added dedicated syntax for variadic functions. + (https://wiki.php.net/rfc/variadics) + +- The php://input stream is now re-usable and can be used concurrently with + enable_post_data_reading=0. + +- Added gost-crypto (CryptoPro S-box) hash algo. + +- Added openssl certificate fingerprint support (inclusive stream context + option). + +- Added openssl crypto method stream context option. ======================================== 2. Changes in SAPI modules @@ -35,6 +56,9 @@ PHP X.Y UPGRADE NOTES 3. Deprecated Functionality ======================================== +- Incompatible context calls: + Instance calls from an incompatible context are now deprecated and issue + E_DEPRECATED instead of E_STRICT. See https://wiki.php.net/rfc/incompat_ctx ======================================== 4. Changed Functions @@ -44,10 +68,16 @@ PHP X.Y UPGRADE NOTES CURLOPT_SAFE_UPLOAD is now turned on by default and uploads with @file do not work unless it is explicitly set to false. +- XMLReader: + XMLReader::getAttributeNs and XMLReader::getAttributeNo now return NULL if + the attribute could not be found, just like XMLReader::getAttribute. + ======================================== 5. New Functions ======================================== +- Openssl: + Added string openssl_x509_fingerprint($x509, $type, $binary). ======================================== 6. New Classes and Interfaces @@ -88,6 +118,8 @@ PHP X.Y UPGRADE NOTES 10. Changes to INI File Handling ======================================== +- Core: + Removed always_populate_raw_post_data. ======================================== 11. Other Changes @@ -95,3 +127,7 @@ PHP X.Y UPGRADE NOTES - File upload: Uploads equal or greater than 2GB in size are now accepted. + +- HTTP stream wrapper: + HTTP 1.1 requests now include a Connection: close header unless explicitly + overridden by setting a Connection header via the header context option. diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 566f310998738..d1aca29dc4533 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -4,6 +4,9 @@ UPGRADE NOTES - PHP X.Y 1. Internal API changes a. Addition of do_operation and compare object handlers + b. return_value_ptr now always available, RETVAL_ZVAL_FAST macros + c. POST data handling + d. Arginfo changes 2. Build system changes a. Unix build system changes @@ -43,6 +46,70 @@ UPGRADE NOTES - PHP X.Y Further docs in the RFC: https://wiki.php.net/rfc/operator_overloading_gmp + b. return_value_ptr now always available, RETVAL_ZVAL_FAST macros + + The return_value_ptr argument to internal functions is now always set. + Previously it was only available for functions returning by-reference. + return_value_ptr can now be used to return zvals without copying them. + For this purpose two new macros are provided: + + RETVAL_ZVAL_FAST(zv); /* analog to RETVAL_ZVAL(zv, 1, 0) */ + RETURN_ZVAL_FAST(zv); /* analog to RETURN_ZVAL(zv, 1, 0) */ + + The macros behave similarly to the non-FAST variants with copy=1 and + dtor=0, but will try to return the zval without making a copy by utilizing + return_value_ptr. + + c. POST data handling + + The sapi_request_info's members post_data, post_data_len and raw_post_data as + well as raw_post_data_len have been replaced with a temp PHP stream + request_body. + + The recommended way to access raw POST data is to open and use a php://input + stream wrapper. It is safe to be used concurrently and more than once. + + d. Arginfo changes + + The pass_rest_by_reference argument of the ZEND_BEGIN_ARG_INFO and + ZEND_BEGIN_ARG_INFO_EX() is no longer used. The value passed to it is ignored. + + Instead a variadic argument is created using ZEND_ARG_VARIADIC_INFO(): + + ZEND_ARG_VARIADIC_INFO(0, name) /* pass rest by value */ + ZEND_ARG_VARIADIC_INFO(1, name) /* pass rest by reference */ + ZEND_ARG_VARIADIC_INFO(ZEND_SEND_PREFER_REF, name) + /* pass rest by prefer-ref */ + + ZEND_ARG_VARIADIC_INFO() should only be used for the last argument. + + The following changes were applied to the zend_arg_info struct: + + typedef struct _zend_arg_info { + const char *class_name; + zend_uint class_name_len; + zend_uchar type_hint; + + zend_uchar pass_by_reference; + zend_bool allow_null; + - zend_bool pass_by_reference; + + zend_bool is_variadic; + } zend_arg_info; + + The following changes were applied to the zend_internal_function_info struct: + + typedef struct _zend_internal_function_info { + zend_uint required_num_args; + zend_uchar _type_hint; + zend_bool return_reference; + - zend_bool pass_rest_by_reference; + + zend_bool _allow_null; + + zend_bool _is_variadic; + } zend_internal_function_info; + + The CHECK_ARG_SEND_TYPE(), ARG_MUST_BE_SENT_BY_REF(), + ARG_SHOULD_BE_SENT_BY_REF() and ARG_MAY_BE_SENT_BY_REF() macros now assume + that the argument passed to them is a zend_function* and that it is non-NULL. + ======================== 2. Build system changes ======================== diff --git a/Zend/RFCs/003.txt b/Zend/RFCs/003.txt index 30fb4cec4912f..ac042183d426c 100644 --- a/Zend/RFCs/003.txt +++ b/Zend/RFCs/003.txt @@ -9,11 +9,11 @@ Modified: 2001-09-17 1. Background/Need ================== -Many internal function of PHP will reject parameters because of their +Many internal functions of PHP will reject parameters because of their type (the array and variable function come to mind). For userland this is not an easy task as there is no uniform way to do it. An addition to the engine for requiring loose types would allow -delevopers to know that the data passed to their functions is of the +developers to know that the data passed to their functions are of the correct type and reduce the need for duplicating the same code in every function to check for the type of data. @@ -57,7 +57,7 @@ function foo (array $var){ =========== Mis-matches in type should be reported as fatal errors and should halt -the execution of a script as that function can not be run and code +the execution of a script as that function cannot be run and code following could not reliably run. diff --git a/Zend/acinclude.m4 b/Zend/acinclude.m4 index fe3ab63beb4c6..7fa8c99940596 100644 --- a/Zend/acinclude.m4 +++ b/Zend/acinclude.m4 @@ -9,7 +9,7 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[ # non-working versions, e.g. "3.0 3.2"; # remove "none" when introducing the first incompatible bison version an # separate any following additions by spaces - bison_version_exclude="none" + bison_version_exclude="3.0" # for standalone build of Zend Engine test -z "$SED" && SED=sed diff --git a/Zend/tests/bug60598.phpt b/Zend/tests/bug60598.phpt new file mode 100644 index 0000000000000..eeee75a19d9ce --- /dev/null +++ b/Zend/tests/bug60598.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #60598 (cli/apache sapi segfault on objects manipulation) +--FILE-- +guid = 1; + $containers[spl_object_hash($this)] = $this; + } + public function __destruct() { + global $containers; + $containers[spl_object_hash($this)] = NULL; + } +} + +for ($i = 0; $i < OBJECT_COUNT; ++$i) { + new Object(); +} + +// You probably won't see this because of the "zend_mm_heap corrupted" +?> +If you see this, try to increase OBJECT_COUNT to 100,000 +--EXPECT-- +If you see this, try to increase OBJECT_COUNT to 100,000 diff --git a/Zend/tests/bug64896.phpt b/Zend/tests/bug64896.phpt new file mode 100644 index 0000000000000..3e955bbece7de --- /dev/null +++ b/Zend/tests/bug64896.phpt @@ -0,0 +1,47 @@ +--TEST-- +Bug #64896 (Segfault with gc_collect_cycles using unserialize on certain objects) +--XFAIL-- +We can not fix this bug without a significant (performace slow down) change to gc +--FILE-- +_private[] = 'php'; + } + + public function __destruct() + { + global $bar; + $bar = $this; + } +} + +$foo = new stdclass; +$foo->foo = $foo; +$foo->bad = new bad; + +gc_disable(); + +unserialize(serialize($foo)); +gc_collect_cycles(); +var_dump($bar); +/* will output: +object(bad)#4 (1) { + ["_private":"bad":private]=> + &UNKNOWN:0 +} +*/ +?> +--EXPECTF-- +bject(bad)#%d (1) { + ["_private":"bad":private]=> + array(1) { + [0]=> + string(3) "php" + } +} diff --git a/Zend/tests/bug64979.phpt b/Zend/tests/bug64979.phpt index 09de555546420..5bc8e5a6ab2a4 100644 --- a/Zend/tests/bug64979.phpt +++ b/Zend/tests/bug64979.phpt @@ -1,15 +1,13 @@ --TEST-- -Bug #64578 (Closures with static variables can be generators) ---XFAIL-- -Bug #64979 not fixed yet. +Bug #64979 (Wrong behavior of static variables in closure generators) --FILE-- diff --git a/Zend/tests/bug65322.phpt b/Zend/tests/bug65322.phpt new file mode 100644 index 0000000000000..aab163d915e11 --- /dev/null +++ b/Zend/tests/bug65322.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #65322: compile time errors won't trigger auto loading +--FILE-- + +--EXPECTF-- +string(50) "Redefining already defined constructor for class A" +string(%d) "%s(%d) : eval()'d code" +string(1) "B" diff --git a/Zend/tests/bug65911.phpt b/Zend/tests/bug65911.phpt new file mode 100644 index 0000000000000..b9f37b7bd6a45 --- /dev/null +++ b/Zend/tests/bug65911.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #65911 (scope resolution operator - strange behavior with $this) +--FILE-- +foo = 'bar'; + echo A::$this->foo; // should not output 'bar' + } +} + +$obj = new B(); +$obj->go(); +?> +--EXPECTF-- +Fatal error: Access to undeclared static property: A::$this in %s on line %d diff --git a/Zend/tests/errmsg_045.phpt b/Zend/tests/errmsg_045.phpt new file mode 100644 index 0000000000000..b27f67ade4caa --- /dev/null +++ b/Zend/tests/errmsg_045.phpt @@ -0,0 +1,18 @@ +--TEST-- +Error message in error handler during compilation +--FILE-- + +--EXPECTF-- +string(50) "Redefining already defined constructor for class A" +string(%d) "%s(%d) : eval()'d code" + +Notice: Undefined variable: undefined in %s on line %d diff --git a/Zend/tests/incompat_ctx_user.phpt b/Zend/tests/incompat_ctx_user.phpt new file mode 100644 index 0000000000000..2d9b59c1e8030 --- /dev/null +++ b/Zend/tests/incompat_ctx_user.phpt @@ -0,0 +1,20 @@ +--TEST-- +Incompatible context call (non-internal function) +--INI-- +error_reporting=E_ALL +--FILE-- +bar(); + +?> +--EXPECTF-- +Deprecated: Non-static method A::foo() should not be called statically, assuming $this from incompatible context in %s on line %d +string(1) "B" diff --git a/Zend/tests/variadic/adding_additional_optional_parameter.phpt b/Zend/tests/variadic/adding_additional_optional_parameter.phpt new file mode 100644 index 0000000000000..b4e797803dcf2 --- /dev/null +++ b/Zend/tests/variadic/adding_additional_optional_parameter.phpt @@ -0,0 +1,17 @@ +--TEST-- +It's possible to add additional optional arguments with matching signature +--FILE-- + +===DONE=== +--EXPECT-- +===DONE=== diff --git a/Zend/tests/variadic/adding_additional_optional_parameter_error.phpt b/Zend/tests/variadic/adding_additional_optional_parameter_error.phpt new file mode 100644 index 0000000000000..2f31d47dc6969 --- /dev/null +++ b/Zend/tests/variadic/adding_additional_optional_parameter_error.phpt @@ -0,0 +1,16 @@ +--TEST-- +Additional optional parameters must have a matching prototype +--FILE-- + +--EXPECTF-- +Fatal error: Declaration of MySQL::query() must be compatible with DB::query($query, string ...$params) in %s on line %d diff --git a/Zend/tests/variadic/basic.phpt b/Zend/tests/variadic/basic.phpt new file mode 100644 index 0000000000000..810d4756aa087 --- /dev/null +++ b/Zend/tests/variadic/basic.phpt @@ -0,0 +1,57 @@ +--TEST-- +Basic variadic function +--FILE-- + +--EXPECT-- +array(0) { +} +array(1) { + [0]=> + int(1) +} +array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) +} +int(1) +int(2) +array(0) { +} +int(1) +int(2) +array(1) { + [0]=> + int(3) +} +int(1) +int(2) +array(3) { + [0]=> + int(3) + [1]=> + int(4) + [2]=> + int(5) +} diff --git a/Zend/tests/variadic/by_ref.phpt b/Zend/tests/variadic/by_ref.phpt new file mode 100644 index 0000000000000..e1635f4ecf20a --- /dev/null +++ b/Zend/tests/variadic/by_ref.phpt @@ -0,0 +1,24 @@ +--TEST-- +Variadic arguments with by-reference passing +--FILE-- + +--EXPECT-- +int(0) +int(0) +int(1) +int(2) diff --git a/Zend/tests/variadic/by_ref_error.phpt b/Zend/tests/variadic/by_ref_error.phpt new file mode 100644 index 0000000000000..7f21014146406 --- /dev/null +++ b/Zend/tests/variadic/by_ref_error.phpt @@ -0,0 +1,12 @@ +--TEST-- +By-ref variadics enforce the reference +--FILE-- + +--EXPECTF-- +Fatal error: Only variables can be passed by reference in %s on line %d diff --git a/Zend/tests/variadic/no_default_error.phpt b/Zend/tests/variadic/no_default_error.phpt new file mode 100644 index 0000000000000..427ebed0289a9 --- /dev/null +++ b/Zend/tests/variadic/no_default_error.phpt @@ -0,0 +1,10 @@ +--TEST-- +Variadic argument cannot have a default value +--FILE-- + +--EXPECTF-- +Fatal error: Variadic parameter cannot have a default value in %s on line %d diff --git a/Zend/tests/variadic/non_variadic_implements_variadic_error.phpt b/Zend/tests/variadic/non_variadic_implements_variadic_error.phpt new file mode 100644 index 0000000000000..f447837ca4afb --- /dev/null +++ b/Zend/tests/variadic/non_variadic_implements_variadic_error.phpt @@ -0,0 +1,16 @@ +--TEST-- +It's not possible to turn a variadic function into a non-variadic one +--FILE-- + +--EXPECTF-- +Fatal error: Declaration of MySQL::query() must be compatible with DB::query($query, ...$params) in %s on line %d diff --git a/Zend/tests/variadic/only_last_error.phpt b/Zend/tests/variadic/only_last_error.phpt new file mode 100644 index 0000000000000..ee6ff3f777c46 --- /dev/null +++ b/Zend/tests/variadic/only_last_error.phpt @@ -0,0 +1,10 @@ +--TEST-- +Only the last argument can be variadic +--FILE-- + +--EXPECTF-- +Fatal error: Only the last parameter can be variadic in %s on line %d diff --git a/Zend/tests/variadic/optional_params.phpt b/Zend/tests/variadic/optional_params.phpt new file mode 100644 index 0000000000000..ba965e538c4f9 --- /dev/null +++ b/Zend/tests/variadic/optional_params.phpt @@ -0,0 +1,49 @@ +--TEST-- +Optional parameter before variadic parameter +--FILE-- + +--EXPECT-- +int(1) +NULL +array(0) { +} +int(1) +int(2) +array(0) { +} +int(1) +int(2) +array(1) { + [0]=> + int(3) +} +int(1) +int(2) +array(2) { + [0]=> + int(3) + [1]=> + int(4) +} +int(1) +int(2) +array(3) { + [0]=> + int(3) + [1]=> + int(4) + [2]=> + int(5) +} diff --git a/Zend/tests/variadic/removing_parameter_error.phpt b/Zend/tests/variadic/removing_parameter_error.phpt new file mode 100644 index 0000000000000..a189e5cf094b7 --- /dev/null +++ b/Zend/tests/variadic/removing_parameter_error.phpt @@ -0,0 +1,20 @@ +--TEST-- +It's not possible to remove required parameter before a variadic parameter +--FILE-- + +--EXPECTF-- +Fatal error: Declaration of MySQL::query() must be compatible with DB::query($query, ...$params) in %s on line %d diff --git a/Zend/tests/variadic/typehint_error.phpt b/Zend/tests/variadic/typehint_error.phpt new file mode 100644 index 0000000000000..3006b999576c6 --- /dev/null +++ b/Zend/tests/variadic/typehint_error.phpt @@ -0,0 +1,36 @@ +--TEST-- +Variadic arguments enforce typehints +--FILE-- + +--EXPECTF-- +array(0) { +} +array(3) { + [0]=> + array(1) { + [0]=> + int(0) + } + [1]=> + array(1) { + [0]=> + int(1) + } + [2]=> + array(1) { + [0]=> + int(2) + } +} + +Catchable fatal error: Argument 3 passed to test() must be of the type array, integer given, called in %s on line %d diff --git a/Zend/tests/variadic/typehint_suppressed_error.phpt b/Zend/tests/variadic/typehint_suppressed_error.phpt new file mode 100644 index 0000000000000..5048e1c1bb5ab --- /dev/null +++ b/Zend/tests/variadic/typehint_suppressed_error.phpt @@ -0,0 +1,33 @@ +--TEST-- +Error suppression for typehints on variadic arguments works +--FILE-- + +--EXPECTF-- +string(%d) "Argument 3 passed to test() must be of the type array, integer given, called in %s on line %d and defined" +array(3) { + [0]=> + array(1) { + [0]=> + int(0) + } + [1]=> + array(1) { + [0]=> + int(1) + } + [2]=> + int(2) +} diff --git a/Zend/tests/variadic/variadic_changed_byref_error.phpt b/Zend/tests/variadic/variadic_changed_byref_error.phpt new file mode 100644 index 0000000000000..14fb6ae5eb0d9 --- /dev/null +++ b/Zend/tests/variadic/variadic_changed_byref_error.phpt @@ -0,0 +1,16 @@ +--TEST-- +Variadic arguments must have compatible passing modes +--FILE-- + +--EXPECTF-- +Fatal error: Declaration of MySQL::query() must be compatible with DB::query($query, &...$params) in %s on line %d diff --git a/Zend/tests/variadic/variadic_changed_typehint_error.phpt b/Zend/tests/variadic/variadic_changed_typehint_error.phpt new file mode 100644 index 0000000000000..00df33a0424a4 --- /dev/null +++ b/Zend/tests/variadic/variadic_changed_typehint_error.phpt @@ -0,0 +1,16 @@ +--TEST-- +Typehints for variadic arguments have to be compatible +--FILE-- + +--EXPECTF-- +Fatal error: Declaration of MySQL::query() must be compatible with DB::query($query, string ...$params) in %s on line %d diff --git a/Zend/tests/variadic/variadic_implements_non_variadic.phpt b/Zend/tests/variadic/variadic_implements_non_variadic.phpt new file mode 100644 index 0000000000000..a66ec280b8626 --- /dev/null +++ b/Zend/tests/variadic/variadic_implements_non_variadic.phpt @@ -0,0 +1,17 @@ +--TEST-- +A non-variadic function can be turned into a variadic one +--FILE-- + +===DONE=== +--EXPECT-- +===DONE=== diff --git a/Zend/zend.c b/Zend/zend.c index f9069c8e1b515..11baf34c93566 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -1184,7 +1184,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ * such scripts recursivly, but some CG() variables may be * inconsistent. */ - in_compilation = zend_is_compiling(TSRMLS_C); + in_compilation = CG(in_compilation); if (in_compilation) { saved_class_entry = CG(active_class_entry); CG(active_class_entry) = NULL; @@ -1196,6 +1196,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ SAVE_STACK(declare_stack); SAVE_STACK(list_stack); SAVE_STACK(context_stack); + CG(in_compilation) = 0; } if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL TSRMLS_CC) == SUCCESS) { @@ -1220,6 +1221,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ RESTORE_STACK(declare_stack); RESTORE_STACK(list_stack); RESTORE_STACK(context_stack); + CG(in_compilation) = 1; } if (!EG(user_error_handler)) { diff --git a/Zend/zend.h b/Zend/zend.h index 1377fd566594b..acbb6acaf76ce 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -670,8 +670,8 @@ END_EXTERN_C() /* FIXME: Check if we can save if (ptr) too */ -#define STR_FREE(ptr) if (ptr && !IS_INTERNED(ptr)) { efree(ptr); } -#define STR_FREE_REL(ptr) if (ptr && !IS_INTERNED(ptr)) { efree_rel(ptr); } +#define STR_FREE(ptr) if (ptr) { str_efree(ptr); } +#define STR_FREE_REL(ptr) if (ptr) { str_efree_rel(ptr); } #define STR_EMPTY_ALLOC() estrndup("", sizeof("")-1) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index b59faab28458d..5fa7fb908e500 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2029,7 +2029,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio const zend_function_entry *ptr = functions; zend_function function, *reg_function; zend_internal_function *internal_function = (zend_internal_function *)&function; - int count=0, unload=0, result=0; + int count=0, unload=0; HashTable *target_function_table = function_table; int error_type; zend_function *ctor = NULL, *dtor = NULL, *clone = NULL, *__get = NULL, *__set = NULL, *__unset = NULL, *__isset = NULL, *__call = NULL, *__callstatic = NULL, *__tostring = NULL; @@ -2037,6 +2037,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio int fname_len; const char *lc_class_name = NULL; int class_name_len = 0; + zend_ulong hash; if (type==MODULE_PERSISTENT) { error_type = E_CORE_WARNING; @@ -2089,16 +2090,12 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio } else { internal_function->required_num_args = info->required_num_args; } - if (info->pass_rest_by_reference) { - if (info->pass_rest_by_reference == ZEND_SEND_PREFER_REF) { - internal_function->fn_flags |= ZEND_ACC_PASS_REST_PREFER_REF; - } else { - internal_function->fn_flags |= ZEND_ACC_PASS_REST_BY_REFERENCE; - } - } if (info->return_reference) { internal_function->fn_flags |= ZEND_ACC_RETURN_REFERENCE; } + if (ptr->arg_info[ptr->num_args].is_variadic) { + internal_function->fn_flags |= ZEND_ACC_VARIADIC; + } } else { internal_function->arg_info = NULL; internal_function->num_args = 0; @@ -2135,12 +2132,8 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio } fname_len = strlen(ptr->fname); lowercase_name = zend_new_interned_string(zend_str_tolower_dup(ptr->fname, fname_len), fname_len + 1, 1 TSRMLS_CC); - if (IS_INTERNED(lowercase_name)) { - result = zend_hash_quick_add(target_function_table, lowercase_name, fname_len+1, INTERNED_HASH(lowercase_name), &function, sizeof(zend_function), (void**)®_function); - } else { - result = zend_hash_add(target_function_table, lowercase_name, fname_len+1, &function, sizeof(zend_function), (void**)®_function); - } - if (result == FAILURE) { + hash = str_hash(lowercase_name, fname_len); + if (zend_hash_quick_add(target_function_table, lowercase_name, fname_len+1, hash, &function, sizeof(zend_function), (void**)®_function) == FAILURE) { unload=1; str_efree(lowercase_name); break; @@ -2493,6 +2486,7 @@ static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class { zend_class_entry *class_entry = malloc(sizeof(zend_class_entry)); char *lowercase_name = emalloc(orig_class_entry->name_length + 1); + zend_ulong hash; *class_entry = *orig_class_entry; class_entry->type = ZEND_INTERNAL_CLASS; @@ -2506,11 +2500,8 @@ static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class zend_str_tolower_copy(lowercase_name, orig_class_entry->name, class_entry->name_length); lowercase_name = (char*)zend_new_interned_string(lowercase_name, class_entry->name_length + 1, 1 TSRMLS_CC); - if (IS_INTERNED(lowercase_name)) { - zend_hash_quick_update(CG(class_table), lowercase_name, class_entry->name_length+1, INTERNED_HASH(lowercase_name), &class_entry, sizeof(zend_class_entry *), NULL); - } else { - zend_hash_update(CG(class_table), lowercase_name, class_entry->name_length+1, &class_entry, sizeof(zend_class_entry *), NULL); - } + hash = str_hash(lowercase_name, class_entry->name_length); + zend_hash_quick_update(CG(class_table), lowercase_name, class_entry->name_length+1, hash, &class_entry, sizeof(zend_class_entry *), NULL); str_efree(lowercase_name); return class_entry; } diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 1a7c66e906d02..007d9896092be 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -98,16 +98,18 @@ typedef struct _zend_fcall_info_cache { #define ZEND_FE_END { NULL, NULL, NULL, 0, 0 } -#define ZEND_ARG_INFO(pass_by_ref, name) { #name, sizeof(#name)-1, NULL, 0, 0, 0, pass_by_ref}, -#define ZEND_ARG_PASS_INFO(pass_by_ref) { NULL, 0, NULL, 0, 0, 0, pass_by_ref}, -#define ZEND_ARG_OBJ_INFO(pass_by_ref, name, classname, allow_null) { #name, sizeof(#name)-1, #classname, sizeof(#classname)-1, IS_OBJECT, allow_null, pass_by_ref}, -#define ZEND_ARG_ARRAY_INFO(pass_by_ref, name, allow_null) { #name, sizeof(#name)-1, NULL, 0, IS_ARRAY, allow_null, pass_by_ref}, -#define ZEND_ARG_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) { #name, sizeof(#name)-1, NULL, 0, type_hint, allow_null, pass_by_ref}, -#define ZEND_BEGIN_ARG_INFO_EX(name, pass_rest_by_reference, return_reference, required_num_args) \ +#define ZEND_ARG_INFO(pass_by_ref, name) { #name, sizeof(#name)-1, NULL, 0, 0, pass_by_ref, 0, 0 }, +#define ZEND_ARG_PASS_INFO(pass_by_ref) { NULL, 0, NULL, 0, 0, pass_by_ref, 0, 0 }, +#define ZEND_ARG_OBJ_INFO(pass_by_ref, name, classname, allow_null) { #name, sizeof(#name)-1, #classname, sizeof(#classname)-1, IS_OBJECT, pass_by_ref, allow_null, 0 }, +#define ZEND_ARG_ARRAY_INFO(pass_by_ref, name, allow_null) { #name, sizeof(#name)-1, NULL, 0, IS_ARRAY, pass_by_ref, allow_null, 0 }, +#define ZEND_ARG_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) { #name, sizeof(#name)-1, NULL, 0, type_hint, pass_by_ref, allow_null, 0 }, +#define ZEND_ARG_VARIADIC_INFO(pass_by_ref, name) { #name, sizeof(#name)-1, NULL, 0, 0, pass_by_ref, 0, 1 }, + +#define ZEND_BEGIN_ARG_INFO_EX(name, _unused, return_reference, required_num_args) \ static const zend_arg_info name[] = { \ - { NULL, 0, NULL, required_num_args, 0, return_reference, pass_rest_by_reference}, -#define ZEND_BEGIN_ARG_INFO(name, pass_rest_by_reference) \ - ZEND_BEGIN_ARG_INFO_EX(name, pass_rest_by_reference, ZEND_RETURN_VALUE, -1) + { NULL, 0, NULL, required_num_args, 0, return_reference, 0, 0 }, +#define ZEND_BEGIN_ARG_INFO(name, _unused) \ + ZEND_BEGIN_ARG_INFO_EX(name, 0, ZEND_RETURN_VALUE, -1) #define ZEND_END_ARG_INFO() }; /* Name macros */ @@ -636,6 +638,18 @@ END_EXTERN_C() #define RETURN_FALSE { RETVAL_FALSE; return; } #define RETURN_TRUE { RETVAL_TRUE; return; } +#define RETVAL_ZVAL_FAST(z) do { \ + zval *_z = (z); \ + if (Z_ISREF_P(_z)) { \ + RETVAL_ZVAL(_z, 1, 0); \ + } else { \ + zval_ptr_dtor(&return_value); \ + Z_ADDREF_P(_z); \ + *return_value_ptr = _z; \ + } \ +} while (0) +#define RETURN_ZVAL_FAST(z) { RETVAL_ZVAL_FAST(z); return; } + #define SET_VAR_STRING(n, v) { \ { \ zval *var; \ diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 1ad64e74eaf47..ed136f5e12917 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -706,7 +706,7 @@ ZEND_FUNCTION(define) zval_ptr_dtor(&val_free); } c.flags = case_sensitive; /* non persistent */ - c.name = IS_INTERNED(name) ? name : zend_strndup(name, name_len); + c.name = str_strndup(name, name_len); if(c.name == NULL) { RETURN_FALSE; } @@ -1388,12 +1388,11 @@ ZEND_FUNCTION(function_exists) Creates an alias for user defined class */ ZEND_FUNCTION(class_alias) { - char *class_name, *lc_name, *alias_name; + char *class_name, *alias_name; zend_class_entry **ce; int class_name_len, alias_name_len; int found; zend_bool autoload = 1; - ALLOCA_FLAG(use_heap) if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &class_name, &class_name_len, &alias_name, &alias_name_len, &autoload) == FAILURE) { return; diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 5faefbd2241a4..fcad86f171058 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -59,14 +59,8 @@ ZEND_METHOD(Closure, __invoke) /* {{{ */ } else if (call_user_function_ex(CG(function_table), NULL, this_ptr, &closure_result_ptr, ZEND_NUM_ARGS(), arguments, 1, NULL TSRMLS_CC) == FAILURE) { RETVAL_FALSE; } else if (closure_result_ptr) { - if (Z_ISREF_P(closure_result_ptr) && return_value_ptr) { - if (return_value) { - zval_ptr_dtor(&return_value); - } - *return_value_ptr = closure_result_ptr; - } else { - RETVAL_ZVAL(closure_result_ptr, 1, 1); - } + zval_ptr_dtor(&return_value); + *return_value_ptr = closure_result_ptr; } efree(arguments); diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index f250b2be20879..7ee8dd1e74db3 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -61,11 +61,8 @@ } while (0) #define CALCULATE_LITERAL_HASH(num) do { \ - if (IS_INTERNED(Z_STRVAL(CONSTANT(num)))) { \ - Z_HASH_P(&CONSTANT(num)) = INTERNED_HASH(Z_STRVAL(CONSTANT(num))); \ - } else { \ - Z_HASH_P(&CONSTANT(num)) = zend_hash_func(Z_STRVAL(CONSTANT(num)), Z_STRLEN(CONSTANT(num))+1); \ - } \ + zval *c = &CONSTANT(num); \ + Z_HASH_P(c) = str_hash(Z_STRVAL_P(c), Z_STRLEN_P(c)); \ } while (0) #define GET_CACHE_SLOT(literal) do { \ @@ -107,9 +104,7 @@ ZEND_API zend_executor_globals executor_globals; static void zend_duplicate_property_info(zend_property_info *property_info) /* {{{ */ { - if (!IS_INTERNED(property_info->name)) { - property_info->name = estrndup(property_info->name, property_info->name_length); - } + property_info->name = str_estrndup(property_info->name, property_info->name_length); if (property_info->doc_comment) { property_info->doc_comment = estrndup(property_info->doc_comment, property_info->doc_comment_len); } @@ -118,9 +113,7 @@ static void zend_duplicate_property_info(zend_property_info *property_info) /* { static void zend_duplicate_property_info_internal(zend_property_info *property_info) /* {{{ */ { - if (!IS_INTERNED(property_info->name)) { - property_info->name = zend_strndup(property_info->name, property_info->name_length); - } + property_info->name = str_strndup(property_info->name, property_info->name_length); } /* }}} */ @@ -153,12 +146,12 @@ static void build_runtime_defined_function_key(zval *result, const char *name, i } /* NULL, name length, filename length, last accepting char position length */ - result->value.str.len = 1+name_length+strlen(filename)+char_pos_len; + Z_STRLEN_P(result) = 1+name_length+strlen(filename)+char_pos_len; /* must be binary safe */ - result->value.str.val = (char *) safe_emalloc(result->value.str.len, 1, 1); - result->value.str.val[0] = '\0'; - sprintf(result->value.str.val+1, "%s%s%s", name, filename, char_pos_buf); + Z_STRVAL_P(result) = (char *) safe_emalloc(Z_STRLEN_P(result), 1, 1); + Z_STRVAL_P(result)[0] = '\0'; + sprintf(Z_STRVAL_P(result)+1, "%s%s%s", name, filename, char_pos_buf); result->type = IS_STRING; Z_SET_REFCOUNT_P(result, 1); @@ -657,21 +650,21 @@ void fetch_simple_variable_ex(znode *result, znode *varname, int bp, zend_uchar zend_llist *fetch_list_ptr; if (varname->op_type == IS_CONST) { - ulong hash = 0; + ulong hash; if (Z_TYPE(varname->u.constant) != IS_STRING) { convert_to_string(&varname->u.constant); - } else if (IS_INTERNED(Z_STRVAL(varname->u.constant))) { - hash = INTERNED_HASH(Z_STRVAL(varname->u.constant)); } - if (!zend_is_auto_global_quick(varname->u.constant.value.str.val, varname->u.constant.value.str.len, hash TSRMLS_CC) && - !(varname->u.constant.value.str.len == (sizeof("this")-1) && - !memcmp(varname->u.constant.value.str.val, "this", sizeof("this"))) && + + hash = str_hash(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant)); + if (!zend_is_auto_global_quick(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant), hash TSRMLS_CC) && + !(Z_STRLEN(varname->u.constant) == (sizeof("this")-1) && + !memcmp(Z_STRVAL(varname->u.constant), "this", sizeof("this"))) && (CG(active_op_array)->last == 0 || CG(active_op_array)->opcodes[CG(active_op_array)->last-1].opcode != ZEND_BEGIN_SILENCE)) { result->op_type = IS_CV; - result->u.op.var = lookup_cv(CG(active_op_array), varname->u.constant.value.str.val, varname->u.constant.value.str.len, hash TSRMLS_CC); - varname->u.constant.value.str.val = (char*)CG(active_op_array)->vars[result->u.op.var].name; + result->u.op.var = lookup_cv(CG(active_op_array), Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant), hash TSRMLS_CC); + Z_STRVAL(varname->u.constant) = (char*)CG(active_op_array)->vars[result->u.op.var].name; result->EA = 0; return; } @@ -694,7 +687,7 @@ void fetch_simple_variable_ex(znode *result, znode *varname, int bp, zend_uchar if (varname->op_type == IS_CONST) { CALCULATE_LITERAL_HASH(opline_ptr->op1.constant); - if (zend_is_auto_global_quick(varname->u.constant.value.str.val, varname->u.constant.value.str.len, Z_HASH_P(&CONSTANT(opline_ptr->op1.constant)) TSRMLS_CC)) { + if (zend_is_auto_global_quick(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant), Z_HASH_P(&CONSTANT(opline_ptr->op1.constant)) TSRMLS_CC)) { opline_ptr->extended_value = ZEND_FETCH_GLOBAL; } } @@ -723,7 +716,7 @@ void zend_do_fetch_static_member(znode *result, znode *class_name TSRMLS_DC) /* if (class_name->op_type == IS_CONST && ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant))) { - zend_resolve_class_name(class_name, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC); + zend_resolve_class_name(class_name TSRMLS_CC); class_node = *class_name; } else { zend_do_fetch_class(&class_node, class_name TSRMLS_CC); @@ -882,9 +875,9 @@ void zend_do_abstract_method(const znode *function_name, znode *modifiers, const method_type = "Abstract"; } - if (modifiers->u.constant.value.lval & ZEND_ACC_ABSTRACT) { - if(modifiers->u.constant.value.lval & ZEND_ACC_PRIVATE) { - zend_error(E_COMPILE_ERROR, "%s function %s::%s() cannot be declared private", method_type, CG(active_class_entry)->name, function_name->u.constant.value.str.val); + if (Z_LVAL(modifiers->u.constant) & ZEND_ACC_ABSTRACT) { + if(Z_LVAL(modifiers->u.constant) & ZEND_ACC_PRIVATE) { + zend_error_noreturn(E_COMPILE_ERROR, "%s function %s::%s() cannot be declared private", method_type, CG(active_class_entry)->name, Z_STRVAL(function_name->u.constant)); } if (Z_LVAL(body->u.constant) == ZEND_ACC_ABSTRACT) { zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); @@ -894,11 +887,11 @@ void zend_do_abstract_method(const znode *function_name, znode *modifiers, const SET_UNUSED(opline->op2); } else { /* we had code in the function body */ - zend_error(E_COMPILE_ERROR, "%s function %s::%s() cannot contain body", method_type, CG(active_class_entry)->name, function_name->u.constant.value.str.val); + zend_error_noreturn(E_COMPILE_ERROR, "%s function %s::%s() cannot contain body", method_type, CG(active_class_entry)->name, Z_STRVAL(function_name->u.constant)); } } else { - if (body->u.constant.value.lval == ZEND_ACC_ABSTRACT) { - zend_error(E_COMPILE_ERROR, "Non-abstract method %s::%s() must contain body", CG(active_class_entry)->name, function_name->u.constant.value.str.val); + if (Z_LVAL(body->u.constant) == ZEND_ACC_ABSTRACT) { + zend_error_noreturn(E_COMPILE_ERROR, "Non-abstract method %s::%s() must contain body", CG(active_class_entry)->name, Z_STRVAL(function_name->u.constant)); } } } @@ -908,6 +901,7 @@ static zend_bool opline_is_fetch_this(const zend_op *opline TSRMLS_DC) /* {{{ */ { if ((opline->opcode == ZEND_FETCH_W) && (opline->op1_type == IS_CONST) && (Z_TYPE(CONSTANT(opline->op1.constant)) == IS_STRING) + && ((opline->extended_value & ZEND_FETCH_STATIC_MEMBER) != ZEND_FETCH_STATIC_MEMBER) && (Z_HASH_P(&CONSTANT(opline->op1.constant)) == THIS_HASHVAL) && (Z_STRLEN(CONSTANT(opline->op1.constant)) == (sizeof("this")-1)) && !memcmp(Z_STRVAL(CONSTANT(opline->op1.constant)), "this", sizeof("this"))) { @@ -957,7 +951,7 @@ void zend_do_assign(znode *result, znode *variable, znode *value TSRMLS_DC) /* { if (variable->op_type == IS_CV) { if (variable->u.op.var == CG(active_op_array)->this_var) { - zend_error(E_COMPILE_ERROR, "Cannot re-assign $this"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign $this"); } } else if (variable->op_type == IS_VAR) { int n = 0; @@ -1003,7 +997,7 @@ void zend_do_assign(znode *result, znode *variable, znode *value TSRMLS_DC) /* { GET_NODE(result, last_op->result); return; } else if (opline_is_fetch_this(last_op TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Cannot re-assign $this"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign $this"); } else { break; } @@ -1027,7 +1021,7 @@ void zend_do_assign_ref(znode *result, const znode *lvar, const znode *rvar TSRM if (lvar->op_type == IS_CV) { if (lvar->u.op.var == CG(active_op_array)->this_var) { - zend_error(E_COMPILE_ERROR, "Cannot re-assign $this"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign $this"); } } else if (lvar->op_type == IS_VAR) { int last_op_number = get_next_op_number(CG(active_op_array)); @@ -1035,7 +1029,7 @@ void zend_do_assign_ref(znode *result, const znode *lvar, const znode *rvar TSRM if (last_op_number > 0) { opline = &CG(active_op_array)->opcodes[last_op_number-1]; if (opline_is_fetch_this(opline TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Cannot re-assign $this"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign $this"); } } } @@ -1277,10 +1271,10 @@ void zend_check_writable_variable(const znode *variable) /* {{{ */ zend_uint type = variable->EA; if (type & ZEND_PARSED_METHOD_CALL) { - zend_error(E_COMPILE_ERROR, "Can't use method return value in write context"); + zend_error_noreturn(E_COMPILE_ERROR, "Can't use method return value in write context"); } if (type == ZEND_PARSED_FUNCTION_CALL) { - zend_error(E_COMPILE_ERROR, "Can't use function return value in write context"); + zend_error_noreturn(E_COMPILE_ERROR, "Can't use function return value in write context"); } } /* }}} */ @@ -1353,7 +1347,7 @@ void zend_do_end_variable_parse(znode *variable, int type, int arg_offset TSRMLS switch (type) { case BP_VAR_R: if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2_type == IS_UNUSED) { - zend_error(E_COMPILE_ERROR, "Cannot use [] for reading"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading"); } opline->opcode -= 3; break; @@ -1364,7 +1358,7 @@ void zend_do_end_variable_parse(znode *variable, int type, int arg_offset TSRMLS break; case BP_VAR_IS: if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2_type == IS_UNUSED) { - zend_error(E_COMPILE_ERROR, "Cannot use [] for reading"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading"); } opline->opcode += 6; /* 3+3 */ break; @@ -1374,7 +1368,7 @@ void zend_do_end_variable_parse(znode *variable, int type, int arg_offset TSRMLS break; case BP_VAR_UNSET: if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2_type == IS_UNUSED) { - zend_error(E_COMPILE_ERROR, "Cannot use [] for unsetting"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for unsetting"); } opline->opcode += 12; /* 3+3+3+3 */ break; @@ -1502,22 +1496,22 @@ int zend_do_verify_access_types(const znode *current_access_type, const znode *n { if ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_PPP_MASK) && (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_PPP_MASK)) { - zend_error(E_COMPILE_ERROR, "Multiple access type modifiers are not allowed"); + zend_error_noreturn(E_COMPILE_ERROR, "Multiple access type modifiers are not allowed"); } if ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_ABSTRACT) && (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_ABSTRACT)) { - zend_error(E_COMPILE_ERROR, "Multiple abstract modifiers are not allowed"); + zend_error_noreturn(E_COMPILE_ERROR, "Multiple abstract modifiers are not allowed"); } if ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_STATIC) && (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_STATIC)) { - zend_error(E_COMPILE_ERROR, "Multiple static modifiers are not allowed"); + zend_error_noreturn(E_COMPILE_ERROR, "Multiple static modifiers are not allowed"); } if ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_FINAL) && (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_FINAL)) { - zend_error(E_COMPILE_ERROR, "Multiple final modifiers are not allowed"); + zend_error_noreturn(E_COMPILE_ERROR, "Multiple final modifiers are not allowed"); } if (((Z_LVAL(current_access_type->u.constant) | Z_LVAL(new_modifier->u.constant)) & (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) == (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) { - zend_error(E_COMPILE_ERROR, "Cannot use the final modifier on an abstract class member"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use the final modifier on an abstract class member"); } return (Z_LVAL(current_access_type->u.constant) | Z_LVAL(new_modifier->u.constant)); } @@ -1526,8 +1520,8 @@ int zend_do_verify_access_types(const znode *current_access_type, const znode *n void zend_do_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference, znode *fn_flags_znode TSRMLS_DC) /* {{{ */ { zend_op_array op_array; - char *name = function_name->u.constant.value.str.val; - int name_len = function_name->u.constant.value.str.len; + char *name = Z_STRVAL(function_name->u.constant); + int name_len = Z_STRLEN(function_name->u.constant); int function_begin_line = function_token->u.op.opline_num; zend_uint fn_flags; const char *lcname; @@ -1537,7 +1531,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n if (is_method) { if (CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE) { if ((Z_LVAL(fn_flags_znode->u.constant) & ~(ZEND_ACC_STATIC|ZEND_ACC_PUBLIC))) { - zend_error(E_COMPILE_ERROR, "Access type for interface method %s::%s() must be omitted", CG(active_class_entry)->name, function_name->u.constant.value.str.val); + zend_error_noreturn(E_COMPILE_ERROR, "Access type for interface method %s::%s() must be omitted", CG(active_class_entry)->name, Z_STRVAL(function_name->u.constant)); } Z_LVAL(fn_flags_znode->u.constant) |= ZEND_ACC_ABSTRACT; /* propagates to the rest of the parser */ } @@ -1568,17 +1562,12 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n op_array.line_start = zend_get_compiled_lineno(TSRMLS_C); if (is_method) { - int result; + zend_ulong hash; lcname = zend_new_interned_string(zend_str_tolower_dup(name, name_len), name_len + 1, 1 TSRMLS_CC); - - if (IS_INTERNED(lcname)) { - result = zend_hash_quick_add(&CG(active_class_entry)->function_table, lcname, name_len+1, INTERNED_HASH(lcname), &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array)); - } else { - result = zend_hash_add(&CG(active_class_entry)->function_table, lcname, name_len+1, &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array)); - } - if (result == FAILURE) { - zend_error(E_COMPILE_ERROR, "Cannot redeclare %s::%s()", CG(active_class_entry)->name, name); + hash = str_hash(lcname, name_len); + if (zend_hash_quick_add(&CG(active_class_entry)->function_table, lcname, name_len+1, hash, &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array)) == FAILURE) { + zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare %s::%s()", CG(active_class_entry)->name, name); } zend_stack_push(&CG(context_stack), (void *) &CG(context), sizeof(CG(context))); @@ -1749,7 +1738,6 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n zend_op dummy_opline; dummy_opline.result_type = IS_UNUSED; - dummy_opline.op1_type = IS_UNUSED; zend_stack_push(&CG(foreach_copy_stack), (void *) &dummy_opline, sizeof(zend_op)); } @@ -1820,7 +1808,7 @@ void zend_do_end_function_declaration(const znode *function_token TSRMLS_DC) /* zend_str_tolower_copy(lcname, CG(active_op_array)->function_name, MIN(name_len, sizeof(lcname)-1)); lcname[sizeof(lcname)-1] = '\0'; /* zend_str_tolower_copy won't necessarily set the zero byte */ if (name_len == sizeof(ZEND_AUTOLOAD_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_AUTOLOAD_FUNC_NAME, sizeof(ZEND_AUTOLOAD_FUNC_NAME)) && CG(active_op_array)->num_args != 1) { - zend_error(E_COMPILE_ERROR, "%s() must take exactly 1 argument", ZEND_AUTOLOAD_FUNC_NAME); + zend_error_noreturn(E_COMPILE_ERROR, "%s() must take exactly 1 argument", ZEND_AUTOLOAD_FUNC_NAME); } } @@ -1834,26 +1822,17 @@ void zend_do_end_function_declaration(const znode *function_token TSRMLS_DC) /* } /* }}} */ -void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, const znode *initialization, znode *class_type, zend_uchar pass_by_reference TSRMLS_DC) /* {{{ */ +void zend_do_receive_param(zend_uchar op, znode *varname, const znode *initialization, znode *class_type, zend_uchar pass_by_reference, zend_bool is_variadic TSRMLS_DC) /* {{{ */ { zend_op *opline; zend_arg_info *cur_arg_info; znode var; - if (class_type->op_type == IS_CONST && - Z_TYPE(class_type->u.constant) == IS_STRING && - Z_STRLEN(class_type->u.constant) == 0) { - /* Usage of namespace as class name not in namespace */ - zval_dtor(&class_type->u.constant); - zend_error(E_COMPILE_ERROR, "Cannot use 'namespace' as a class name"); - return; - } - - if (zend_is_auto_global_quick(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant), 0 TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Cannot re-assign auto-global variable %s", Z_STRVAL(varname->u.constant)); + if (zend_is_auto_global(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant) TSRMLS_CC)) { + zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign auto-global variable %s", Z_STRVAL(varname->u.constant)); } else { var.op_type = IS_CV; - var.u.op.var = lookup_cv(CG(active_op_array), varname->u.constant.value.str.val, varname->u.constant.value.str.len, 0 TSRMLS_CC); + var.u.op.var = lookup_cv(CG(active_op_array), Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant), 0 TSRMLS_CC); Z_STRVAL(varname->u.constant) = (char*)CG(active_op_array)->vars[var.u.op.var].name; var.EA = 0; if (CG(active_op_array)->vars[var.u.op.var].hash_value == THIS_HASHVAL && @@ -1861,30 +1840,47 @@ void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, con !memcmp(Z_STRVAL(varname->u.constant), "this", sizeof("this")-1)) { if (CG(active_op_array)->scope && (CG(active_op_array)->fn_flags & ZEND_ACC_STATIC) == 0) { - zend_error(E_COMPILE_ERROR, "Cannot re-assign $this"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign $this"); } CG(active_op_array)->this_var = var.u.op.var; } } + if (CG(active_op_array)->fn_flags & ZEND_ACC_VARIADIC) { + zend_error_noreturn(E_COMPILE_ERROR, "Only the last parameter can be variadic"); + } + + if (is_variadic) { + if (op == ZEND_RECV_INIT) { + zend_error_noreturn(E_COMPILE_ERROR, "Variadic parameter cannot have a default value"); + } + + op = ZEND_RECV_VARIADIC; + CG(active_op_array)->fn_flags |= ZEND_ACC_VARIADIC; + } + opline = get_next_op(CG(active_op_array) TSRMLS_CC); CG(active_op_array)->num_args++; opline->opcode = op; SET_NODE(opline->result, &var); - SET_NODE(opline->op1, offset); + opline->op1_type = IS_UNUSED; + opline->op1.num = CG(active_op_array)->num_args; if (op == ZEND_RECV_INIT) { SET_NODE(opline->op2, initialization); } else { - CG(active_op_array)->required_num_args = CG(active_op_array)->num_args; SET_UNUSED(opline->op2); + if (!is_variadic) { + CG(active_op_array)->required_num_args = CG(active_op_array)->num_args; + } } CG(active_op_array)->arg_info = erealloc(CG(active_op_array)->arg_info, sizeof(zend_arg_info)*(CG(active_op_array)->num_args)); cur_arg_info = &CG(active_op_array)->arg_info[CG(active_op_array)->num_args-1]; - cur_arg_info->name = zend_new_interned_string(estrndup(varname->u.constant.value.str.val, varname->u.constant.value.str.len), varname->u.constant.value.str.len + 1, 1 TSRMLS_CC); - cur_arg_info->name_len = varname->u.constant.value.str.len; + cur_arg_info->name = zend_new_interned_string(estrndup(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant)), Z_STRLEN(varname->u.constant) + 1, 1 TSRMLS_CC); + cur_arg_info->name_len = Z_STRLEN(varname->u.constant); cur_arg_info->type_hint = 0; - cur_arg_info->allow_null = 1; cur_arg_info->pass_by_reference = pass_by_reference; + cur_arg_info->allow_null = 1; + cur_arg_info->is_variadic = is_variadic; cur_arg_info->class_name = NULL; cur_arg_info->class_name_len = 0; @@ -1898,7 +1894,7 @@ void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, con if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) { cur_arg_info->allow_null = 1; } else if (Z_TYPE(initialization->u.constant) != IS_ARRAY && Z_TYPE(initialization->u.constant) != IS_CONSTANT_ARRAY) { - zend_error(E_COMPILE_ERROR, "Default value for parameters with array type hint can only be an array or NULL"); + zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with array type hint can only be an array or NULL"); } } } else if (class_type->u.constant.type == IS_CALLABLE) { @@ -1907,22 +1903,22 @@ void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, con if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) { cur_arg_info->allow_null = 1; } else { - zend_error(E_COMPILE_ERROR, "Default value for parameters with callable type hint can only be NULL"); + zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with callable type hint can only be NULL"); } } } else { cur_arg_info->type_hint = IS_OBJECT; if (ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(class_type->u.constant), Z_STRLEN(class_type->u.constant))) { - zend_resolve_class_name(class_type, opline->extended_value, 1 TSRMLS_CC); + zend_resolve_class_name(class_type TSRMLS_CC); } - Z_STRVAL(class_type->u.constant) = (char*)zend_new_interned_string(class_type->u.constant.value.str.val, class_type->u.constant.value.str.len + 1, 1 TSRMLS_CC); - cur_arg_info->class_name = class_type->u.constant.value.str.val; - cur_arg_info->class_name_len = class_type->u.constant.value.str.len; + Z_STRVAL(class_type->u.constant) = (char*)zend_new_interned_string(Z_STRVAL(class_type->u.constant), Z_STRLEN(class_type->u.constant) + 1, 1 TSRMLS_CC); + cur_arg_info->class_name = Z_STRVAL(class_type->u.constant); + cur_arg_info->class_name_len = Z_STRLEN(class_type->u.constant); if (op == ZEND_RECV_INIT) { if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) { cur_arg_info->allow_null = 1; } else { - zend_error(E_COMPILE_ERROR, "Default value for parameters with a class type hint can only be NULL"); + zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with a class type hint can only be NULL"); } } } @@ -1949,16 +1945,16 @@ int zend_do_begin_function_call(znode *function_name, zend_bool check_namespace return 1; } - lcname = zend_str_tolower_dup(function_name->u.constant.value.str.val, function_name->u.constant.value.str.len); - if ((zend_hash_find(CG(function_table), lcname, function_name->u.constant.value.str.len+1, (void **) &function)==FAILURE) || + lcname = zend_str_tolower_dup(Z_STRVAL(function_name->u.constant), Z_STRLEN(function_name->u.constant)); + if ((zend_hash_find(CG(function_table), lcname, Z_STRLEN(function_name->u.constant)+1, (void **) &function)==FAILURE) || ((CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_FUNCTIONS) && (function->type == ZEND_INTERNAL_FUNCTION))) { zend_do_begin_dynamic_function_call(function_name, 0 TSRMLS_CC); efree(lcname); return 1; /* Dynamic */ } - efree(function_name->u.constant.value.str.val); - function_name->u.constant.value.str.val = lcname; + efree(Z_STRVAL(function_name->u.constant)); + Z_STRVAL(function_name->u.constant) = lcname; zend_stack_push(&CG(function_call_stack), (void *) &function, sizeof(zend_function *)); if (CG(context).nested_calls + 1 > CG(active_op_array)->nested_calls) { @@ -1983,7 +1979,7 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC) /* {{{ */ if ((last_op->op2_type == IS_CONST) && (Z_TYPE(CONSTANT(last_op->op2.constant)) == IS_STRING) && (Z_STRLEN(CONSTANT(last_op->op2.constant)) == sizeof(ZEND_CLONE_FUNC_NAME)-1) && !zend_binary_strcasecmp(Z_STRVAL(CONSTANT(last_op->op2.constant)), Z_STRLEN(CONSTANT(last_op->op2.constant)), ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME)-1)) { - zend_error(E_COMPILE_ERROR, "Cannot call __clone() method on objects - use 'clone $obj' instead"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot call __clone() method on objects - use 'clone $obj' instead"); } if (last_op->opcode == ZEND_FETCH_OBJ_R) { @@ -1991,11 +1987,9 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC) /* {{{ */ zval name; name = CONSTANT(last_op->op2.constant); if (Z_TYPE(name) != IS_STRING) { - zend_error(E_COMPILE_ERROR, "Method name must be a string"); - } - if (!IS_INTERNED(Z_STRVAL(name))) { - Z_STRVAL(name) = estrndup(Z_STRVAL(name), Z_STRLEN(name)); + zend_error_noreturn(E_COMPILE_ERROR, "Method name must be a string"); } + Z_STRVAL(name) = str_estrndup(Z_STRVAL(name), Z_STRLEN(name)); FREE_POLYMORPHIC_CACHE_SLOT(last_op->op2.constant); last_op->op2.constant = zend_add_func_name_literal(CG(active_op_array), &name TSRMLS_CC); @@ -2121,7 +2115,7 @@ void zend_resolve_non_class_name(znode *element_name, zend_bool check_namespace memcpy(Z_STRVAL(tmp.u.constant), Z_STRVAL_P(CG(current_namespace)), Z_STRLEN_P(CG(current_namespace))); memcpy(&(Z_STRVAL(tmp.u.constant)[Z_STRLEN_P(CG(current_namespace))]), "\\", sizeof("\\")-1); memcpy(&(Z_STRVAL(tmp.u.constant)[Z_STRLEN_P(CG(current_namespace)) + sizeof("\\")-1]), Z_STRVAL(element_name->u.constant), Z_STRLEN(element_name->u.constant)+1); - STR_FREE(Z_STRVAL(element_name->u.constant)); + str_efree(Z_STRVAL(element_name->u.constant)); *element_name = tmp; } } @@ -2133,12 +2127,12 @@ void zend_do_resolve_class_name(znode *result, znode *class_name, int is_static int lctype; znode constant_name; - lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), class_name->u.constant.value.str.len); + lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant)); lctype = zend_get_class_fetch_type(lcname, strlen(lcname)); switch (lctype) { case ZEND_FETCH_CLASS_SELF: if (!CG(active_class_entry)) { - zend_error(E_COMPILE_ERROR, "Cannot access self::class when no class scope is active"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot access self::class when no class scope is active"); } zval_dtor(&class_name->u.constant); class_name->op_type = IS_CONST; @@ -2148,13 +2142,13 @@ void zend_do_resolve_class_name(znode *result, znode *class_name, int is_static case ZEND_FETCH_CLASS_STATIC: case ZEND_FETCH_CLASS_PARENT: if (is_static) { - zend_error(E_COMPILE_ERROR, + zend_error_noreturn(E_COMPILE_ERROR, "%s::class cannot be used for compile-time class name resolution", lctype == ZEND_FETCH_CLASS_STATIC ? "static" : "parent" ); } if (!CG(active_class_entry)) { - zend_error(E_COMPILE_ERROR, + zend_error_noreturn(E_COMPILE_ERROR, "Cannot access %s::class when no class scope is active", lctype == ZEND_FETCH_CLASS_STATIC ? "static" : "parent" ); @@ -2164,7 +2158,7 @@ void zend_do_resolve_class_name(znode *result, znode *class_name, int is_static zend_do_fetch_constant(result, class_name, &constant_name, ZEND_RT, 1 TSRMLS_CC); break; case ZEND_FETCH_CLASS_DEFAULT: - zend_resolve_class_name(class_name, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC); + zend_resolve_class_name(class_name TSRMLS_CC); *result = *class_name; break; } @@ -2174,7 +2168,7 @@ void zend_do_resolve_class_name(znode *result, znode *class_name, int is_static } /* }}} */ -void zend_resolve_class_name(znode *class_name, ulong fetch_type, int check_ns_name TSRMLS_DC) /* {{{ */ +void zend_resolve_class_name(znode *class_name TSRMLS_DC) /* {{{ */ { char *compound; char *lcname; @@ -2194,7 +2188,7 @@ void zend_resolve_class_name(znode *class_name, ulong fetch_type, int check_ns_n Z_STRLEN(class_name->u.constant) + 1); if (ZEND_FETCH_CLASS_DEFAULT != zend_get_class_fetch_type(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant))) { - zend_error(E_COMPILE_ERROR, "'\\%s' is an invalid class name", Z_STRVAL(class_name->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "'\\%s' is an invalid class name", Z_STRVAL(class_name->u.constant)); } } else { if (CG(current_import)) { @@ -2253,26 +2247,17 @@ void zend_do_fetch_class(znode *result, znode *class_name TSRMLS_DC) /* {{{ */ long fetch_class_op_number; zend_op *opline; - if (class_name->op_type == IS_CONST && - Z_TYPE(class_name->u.constant) == IS_STRING && - Z_STRLEN(class_name->u.constant) == 0) { - /* Usage of namespace as class name not in namespace */ - zval_dtor(&class_name->u.constant); - zend_error(E_COMPILE_ERROR, "Cannot use 'namespace' as a class name"); - return; - } - fetch_class_op_number = get_next_op_number(CG(active_op_array)); opline = get_next_op(CG(active_op_array) TSRMLS_CC); opline->opcode = ZEND_FETCH_CLASS; SET_UNUSED(opline->op1); - opline->extended_value = ZEND_FETCH_CLASS_GLOBAL; + opline->extended_value = ZEND_FETCH_CLASS_DEFAULT; CG(catch_begin) = fetch_class_op_number; if (class_name->op_type == IS_CONST) { int fetch_type; - fetch_type = zend_get_class_fetch_type(class_name->u.constant.value.str.val, class_name->u.constant.value.str.len); + fetch_type = zend_get_class_fetch_type(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant)); switch (fetch_type) { case ZEND_FETCH_CLASS_SELF: case ZEND_FETCH_CLASS_PARENT: @@ -2282,7 +2267,7 @@ void zend_do_fetch_class(znode *result, znode *class_name TSRMLS_DC) /* {{{ */ zval_dtor(&class_name->u.constant); break; default: - zend_resolve_class_name(class_name, opline->extended_value, 0 TSRMLS_CC); + zend_resolve_class_name(class_name TSRMLS_CC); opline->op2_type = IS_CONST; opline->op2.constant = zend_add_class_name_literal(CG(active_op_array), &class_name->u.constant TSRMLS_CC); @@ -2311,7 +2296,7 @@ void zend_do_label(znode *label TSRMLS_DC) /* {{{ */ dest.opline_num = get_next_op_number(CG(active_op_array)); if (zend_hash_add(CG(context).labels, Z_STRVAL(label->u.constant), Z_STRLEN(label->u.constant) + 1, (void**)&dest, sizeof(zend_label), NULL) == FAILURE) { - zend_error(E_COMPILE_ERROR, "Label '%s' already defined", Z_STRVAL(label->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "Label '%s' already defined", Z_STRVAL(label->u.constant)); } /* Done with label now */ @@ -2337,7 +2322,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2 CG(in_compilation) = 1; CG(active_op_array) = op_array; CG(zend_lineno) = opline->lineno; - zend_error(E_COMPILE_ERROR, "'goto' to undefined label '%s'", Z_STRVAL_P(label)); + zend_error_noreturn(E_COMPILE_ERROR, "'goto' to undefined label '%s'", Z_STRVAL_P(label)); } else { /* Label is not defined. Delay to pass 2. */ INC_BPC(op_array); @@ -2358,7 +2343,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2 CG(active_op_array) = op_array; CG(zend_lineno) = opline->lineno; } - zend_error(E_COMPILE_ERROR, "'goto' into loop or switch statement is disallowed"); + zend_error_noreturn(E_COMPILE_ERROR, "'goto' into loop or switch statement is disallowed"); } current = op_array->brk_cont_array[current].parent; } @@ -2419,19 +2404,19 @@ void zend_do_build_full_name(znode *result, znode *prefix, znode *name, int is_c } if (is_class_member) { - length = sizeof("::")-1 + result->u.constant.value.str.len + name->u.constant.value.str.len; - result->u.constant.value.str.val = erealloc(result->u.constant.value.str.val, length+1); - memcpy(&result->u.constant.value.str.val[result->u.constant.value.str.len], "::", sizeof("::")-1); - memcpy(&result->u.constant.value.str.val[result->u.constant.value.str.len + sizeof("::")-1], name->u.constant.value.str.val, name->u.constant.value.str.len+1); - STR_FREE(name->u.constant.value.str.val); - result->u.constant.value.str.len = length; + length = sizeof("::")-1 + Z_STRLEN(result->u.constant) + Z_STRLEN(name->u.constant); + Z_STRVAL(result->u.constant) = erealloc(Z_STRVAL(result->u.constant), length+1); + memcpy(&Z_STRVAL(result->u.constant)[Z_STRLEN(result->u.constant)], "::", sizeof("::")-1); + memcpy(&Z_STRVAL(result->u.constant)[Z_STRLEN(result->u.constant) + sizeof("::")-1], Z_STRVAL(name->u.constant), Z_STRLEN(name->u.constant)+1); + str_efree(Z_STRVAL(name->u.constant)); + Z_STRLEN(result->u.constant) = length; } else { - length = sizeof("\\")-1 + result->u.constant.value.str.len + name->u.constant.value.str.len; - result->u.constant.value.str.val = erealloc(result->u.constant.value.str.val, length+1); - memcpy(&result->u.constant.value.str.val[result->u.constant.value.str.len], "\\", sizeof("\\")-1); - memcpy(&result->u.constant.value.str.val[result->u.constant.value.str.len + sizeof("\\")-1], name->u.constant.value.str.val, name->u.constant.value.str.len+1); - STR_FREE(name->u.constant.value.str.val); - result->u.constant.value.str.len = length; + length = sizeof("\\")-1 + Z_STRLEN(result->u.constant) + Z_STRLEN(name->u.constant); + Z_STRVAL(result->u.constant) = erealloc(Z_STRVAL(result->u.constant), length+1); + memcpy(&Z_STRVAL(result->u.constant)[Z_STRLEN(result->u.constant)], "\\", sizeof("\\")-1); + memcpy(&Z_STRVAL(result->u.constant)[Z_STRLEN(result->u.constant) + sizeof("\\")-1], Z_STRVAL(name->u.constant), Z_STRLEN(name->u.constant)+1); + str_efree(Z_STRVAL(name->u.constant)); + Z_STRLEN(result->u.constant) = length; } } /* }}} */ @@ -2445,7 +2430,7 @@ int zend_do_begin_class_member_function_call(znode *class_name, znode *method_na if (method_name->op_type == IS_CONST) { char *lcname; if (Z_TYPE(method_name->u.constant) != IS_STRING) { - zend_error(E_COMPILE_ERROR, "Method name must be a string"); + zend_error_noreturn(E_COMPILE_ERROR, "Method name must be a string"); } lcname = zend_str_tolower_dup(Z_STRVAL(method_name->u.constant), Z_STRLEN(method_name->u.constant)); if ((sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == Z_STRLEN(method_name->u.constant) && @@ -2458,7 +2443,7 @@ int zend_do_begin_class_member_function_call(znode *class_name, znode *method_na if (class_name->op_type == IS_CONST && ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant))) { - zend_resolve_class_name(class_name, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC); + zend_resolve_class_name(class_name TSRMLS_CC); class_node = *class_name; opline = get_next_op(CG(active_op_array) TSRMLS_CC); } else { @@ -2554,12 +2539,12 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{ function_ptr->common.function_name && function_ptr->common.type == ZEND_USER_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) { - zend_error(E_COMPILE_ERROR, + zend_error_noreturn(E_COMPILE_ERROR, "Call-time pass-by-reference has been removed; " "If you would like to pass argument by reference, modify the declaration of %s().", function_ptr->common.function_name); } else { - zend_error(E_COMPILE_ERROR, "Call-time pass-by-reference has been removed"); + zend_error_noreturn(E_COMPILE_ERROR, "Call-time pass-by-reference has been removed"); } return; } @@ -2600,7 +2585,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{ op = ZEND_SEND_REF; break; default: - zend_error(E_COMPILE_ERROR, "Only variables can be passed by reference"); + zend_error_noreturn(E_COMPILE_ERROR, "Only variables can be passed by reference"); break; } } @@ -2662,7 +2647,7 @@ static int generate_free_switch_expr(const zend_switch_entry *switch_entry TSRML opline->opcode = (switch_entry->cond.op_type == IS_TMP_VAR) ? ZEND_FREE : ZEND_SWITCH_FREE; SET_NODE(opline->op1, &switch_entry->cond); SET_UNUSED(opline->op2); - opline->extended_value = 0; + return 0; } /* }}} */ @@ -2672,7 +2657,7 @@ static int generate_free_foreach_copy(const zend_op *foreach_copy TSRMLS_DC) /* zend_op *opline; /* If we reach the separator then stop applying the stack */ - if (foreach_copy->result_type == IS_UNUSED && foreach_copy->op1_type == IS_UNUSED) { + if (foreach_copy->result_type == IS_UNUSED) { return 1; } @@ -2681,16 +2666,6 @@ static int generate_free_foreach_copy(const zend_op *foreach_copy TSRMLS_DC) /* opline->opcode = (foreach_copy->result_type == IS_TMP_VAR) ? ZEND_FREE : ZEND_SWITCH_FREE; COPY_NODE(opline->op1, foreach_copy->result); SET_UNUSED(opline->op2); - opline->extended_value = 1; - - if (foreach_copy->op1_type != IS_UNUSED) { - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = (foreach_copy->op1_type == IS_TMP_VAR) ? ZEND_FREE : ZEND_SWITCH_FREE; - COPY_NODE(opline->op1, foreach_copy->op1); - SET_UNUSED(opline->op2); - opline->extended_value = 0; - } return 0; } @@ -2759,7 +2734,7 @@ void zend_do_yield(znode *result, znode *value, const znode *key, zend_bool is_v zend_op *opline; if (!CG(active_op_array)->function_name) { - zend_error(E_COMPILE_ERROR, "The \"yield\" expression can only be used inside a function"); + zend_error_noreturn(E_COMPILE_ERROR, "The \"yield\" expression can only be used inside a function"); } CG(active_op_array)->fn_flags |= ZEND_ACC_GENERATOR; @@ -2896,10 +2871,10 @@ void zend_do_begin_catch(znode *catch_token, znode *class_name, znode *catch_var if (class_name->op_type == IS_CONST && ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant))) { - zend_resolve_class_name(class_name, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC); + zend_resolve_class_name(class_name TSRMLS_CC); catch_class = *class_name; } else { - zend_error(E_COMPILE_ERROR, "Bad class name in the catch statement"); + zend_error_noreturn(E_COMPILE_ERROR, "Bad class name in the catch statement"); } catch_op_number = get_next_op_number(CG(active_op_array)); @@ -2912,7 +2887,7 @@ void zend_do_begin_catch(znode *catch_token, znode *class_name, znode *catch_var opline->op1_type = IS_CONST; opline->op1.constant = zend_add_class_name_literal(CG(active_op_array), &catch_class.u.constant TSRMLS_CC); opline->op2_type = IS_CV; - opline->op2.var = lookup_cv(CG(active_op_array), catch_var->u.constant.value.str.val, catch_var->u.constant.value.str.len, 0 TSRMLS_CC); + opline->op2.var = lookup_cv(CG(active_op_array), Z_STRVAL(catch_var->u.constant), Z_STRLEN(catch_var->u.constant), 0 TSRMLS_CC); Z_STRVAL(catch_var->u.constant) = (char*)CG(active_op_array)->vars[opline->op2.var].name; opline->result.num = 0; /* 1 means it's the last catch in the block */ @@ -2948,7 +2923,7 @@ void zend_do_bind_catch(znode *try_token, znode *catch_token TSRMLS_DC) /* {{{ * void zend_do_end_finally(znode *try_token, znode* catch_token, znode *finally_token TSRMLS_DC) /* {{{ */ { if (catch_token->op_type == IS_UNUSED && finally_token->op_type == IS_UNUSED) { - zend_error(E_COMPILE_ERROR, "Cannot use try without catch or finally"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use try without catch or finally"); } if (finally_token->op_type != IS_UNUSED) { zend_op *opline; @@ -3115,7 +3090,7 @@ static void do_inherit_method(zend_function *function) /* {{{ */ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, const zend_function *proto TSRMLS_DC) /* {{{ */ { - zend_uint i; + zend_uint i, num_args; /* If it's a user function then arg_info == NULL means we don't have any parameters but * we still need to do the arg number checks. We are only willing to ignore this for internal @@ -3145,48 +3120,66 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c return 0; } - if (fe->common.type != ZEND_USER_FUNCTION - && (proto->common.fn_flags & ZEND_ACC_PASS_REST_BY_REFERENCE) != 0 - && (fe->common.fn_flags & ZEND_ACC_PASS_REST_BY_REFERENCE) == 0) { - return 0; - } - /* by-ref constraints on return values are covariant */ if ((proto->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) && !(fe->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { return 0; } - for (i=0; i < proto->common.num_args; i++) { - if (ZEND_LOG_XOR(fe->common.arg_info[i].class_name, proto->common.arg_info[i].class_name)) { + if ((proto->common.fn_flags & ZEND_ACC_VARIADIC) + && !(fe->common.fn_flags & ZEND_ACC_VARIADIC)) { + return 0; + } + + /* For variadic functions any additional (optional) arguments that were added must be + * checked against the signature of the variadic argument, so in this case we have to + * go through all the parameters of the function and not just those present in the + * prototype. */ + num_args = proto->common.num_args; + if ((fe->common.fn_flags & ZEND_ACC_VARIADIC) + && fe->common.num_args > proto->common.num_args) { + num_args = fe->common.num_args; + } + + for (i = 0; i < num_args; i++) { + zend_arg_info *fe_arg_info = &fe->common.arg_info[i]; + + zend_arg_info *proto_arg_info; + if (i < proto->common.num_args) { + proto_arg_info = &proto->common.arg_info[i]; + } else { + proto_arg_info = &proto->common.arg_info[proto->common.num_args-1]; + } + + if (ZEND_LOG_XOR(fe_arg_info->class_name, proto_arg_info->class_name)) { /* Only one has a type hint and the other one doesn't */ return 0; } - if (fe->common.arg_info[i].class_name) { + if (fe_arg_info->class_name) { const char *fe_class_name, *proto_class_name; zend_uint fe_class_name_len, proto_class_name_len; - if (!strcasecmp(fe->common.arg_info[i].class_name, "parent") && proto->common.scope) { + if (!strcasecmp(fe_arg_info->class_name, "parent") && proto->common.scope) { fe_class_name = proto->common.scope->name; fe_class_name_len = proto->common.scope->name_length; - } else if (!strcasecmp(fe->common.arg_info[i].class_name, "self") && fe->common.scope) { + } else if (!strcasecmp(fe_arg_info->class_name, "self") && fe->common.scope) { fe_class_name = fe->common.scope->name; fe_class_name_len = fe->common.scope->name_length; } else { - fe_class_name = fe->common.arg_info[i].class_name; - fe_class_name_len = fe->common.arg_info[i].class_name_len; + fe_class_name = fe_arg_info->class_name; + fe_class_name_len = fe_arg_info->class_name_len; } - if (!strcasecmp(proto->common.arg_info[i].class_name, "parent") && proto->common.scope && proto->common.scope->parent) { + if (!strcasecmp(proto_arg_info->class_name, "parent") && proto->common.scope && proto->common.scope->parent) { proto_class_name = proto->common.scope->parent->name; proto_class_name_len = proto->common.scope->parent->name_length; - } else if (!strcasecmp(proto->common.arg_info[i].class_name, "self") && proto->common.scope) { + } else if (!strcasecmp(proto_arg_info->class_name, "self") && proto->common.scope) { proto_class_name = proto->common.scope->name; proto_class_name_len = proto->common.scope->name_length; } else { - proto_class_name = proto->common.arg_info[i].class_name; - proto_class_name_len = proto->common.arg_info[i].class_name_len; + proto_class_name = proto_arg_info->class_name; + proto_class_name_len = proto_arg_info->class_name_len; } if (strcasecmp(fe_class_name, proto_class_name)!=0) { @@ -3213,24 +3206,17 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c } } } - if (fe->common.arg_info[i].type_hint != proto->common.arg_info[i].type_hint) { + if (fe_arg_info->type_hint != proto_arg_info->type_hint) { /* Incompatible type hint */ return 0; } /* by-ref constraints on arguments are invariant */ - if (fe->common.arg_info[i].pass_by_reference != proto->common.arg_info[i].pass_by_reference) { + if (fe_arg_info->pass_by_reference != proto_arg_info->pass_by_reference) { return 0; } } - if (proto->common.fn_flags & ZEND_ACC_PASS_REST_BY_REFERENCE) { - for (i=proto->common.num_args; i < fe->common.num_args; i++) { - if (!fe->common.arg_info[i].pass_by_reference) { - return 0; - } - } - } return 1; } /* }}} */ @@ -3303,6 +3289,13 @@ static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{ if (arg_info->pass_by_reference) { *(offset++) = '&'; } + + if (arg_info->is_variadic) { + *(offset++) = '.'; + *(offset++) = '.'; + *(offset++) = '.'; + } + *(offset++) = '$'; if (arg_info->name) { @@ -3318,7 +3311,7 @@ static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{ idx /= 10; } while (idx > 0); } - if (i >= required) { + if (i >= required && !arg_info->is_variadic) { *(offset++) = ' '; *(offset++) = '='; *(offset++) = ' '; @@ -3413,14 +3406,14 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function * && parent->common.fn_flags & ZEND_ACC_ABSTRACT && parent->common.scope != (child->common.prototype ? child->common.prototype->common.scope : child->common.scope) && child->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_IMPLEMENTED_ABSTRACT)) { - zend_error(E_COMPILE_ERROR, "Can't inherit abstract function %s::%s() (previously declared abstract in %s)", + zend_error_noreturn(E_COMPILE_ERROR, "Can't inherit abstract function %s::%s() (previously declared abstract in %s)", parent->common.scope->name, child->common.function_name, child->common.prototype ? child->common.prototype->common.scope->name : child->common.scope->name); } if (parent_flags & ZEND_ACC_FINAL) { - zend_error(E_COMPILE_ERROR, "Cannot override final method %s::%s()", ZEND_FN_SCOPE_NAME(parent), child->common.function_name); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot override final method %s::%s()", ZEND_FN_SCOPE_NAME(parent), child->common.function_name); } child_flags = child->common.fn_flags; @@ -3428,15 +3421,15 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function * */ if ((child_flags & ZEND_ACC_STATIC) != (parent_flags & ZEND_ACC_STATIC)) { if (child->common.fn_flags & ZEND_ACC_STATIC) { - zend_error(E_COMPILE_ERROR, "Cannot make non static method %s::%s() static in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name, ZEND_FN_SCOPE_NAME(child)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot make non static method %s::%s() static in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name, ZEND_FN_SCOPE_NAME(child)); } else { - zend_error(E_COMPILE_ERROR, "Cannot make static method %s::%s() non static in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name, ZEND_FN_SCOPE_NAME(child)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot make static method %s::%s() non static in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name, ZEND_FN_SCOPE_NAME(child)); } } /* Disallow making an inherited method abstract. */ if ((child_flags & ZEND_ACC_ABSTRACT) && !(parent_flags & ZEND_ACC_ABSTRACT)) { - zend_error(E_COMPILE_ERROR, "Cannot make non abstract method %s::%s() abstract in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name, ZEND_FN_SCOPE_NAME(child)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot make non abstract method %s::%s() abstract in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name, ZEND_FN_SCOPE_NAME(child)); } if (parent_flags & ZEND_ACC_CHANGED) { @@ -3445,7 +3438,7 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function * /* Prevent derived classes from restricting access that was available in parent classes */ if ((child_flags & ZEND_ACC_PPP_MASK) > (parent_flags & ZEND_ACC_PPP_MASK)) { - zend_error(E_COMPILE_ERROR, "Access level to %s::%s() must be %s (as in class %s)%s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_visibility_string(parent_flags), ZEND_FN_SCOPE_NAME(parent), (parent_flags&ZEND_ACC_PUBLIC) ? "" : " or weaker"); + zend_error_noreturn(E_COMPILE_ERROR, "Access level to %s::%s() must be %s (as in class %s)%s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_visibility_string(parent_flags), ZEND_FN_SCOPE_NAME(parent), (parent_flags&ZEND_ACC_PUBLIC) ? "" : " or weaker"); } else if (((child_flags & ZEND_ACC_PPP_MASK) < (parent_flags & ZEND_ACC_PPP_MASK)) && ((parent_flags & ZEND_ACC_PPP_MASK) & ZEND_ACC_PRIVATE)) { child->common.fn_flags |= ZEND_ACC_CHANGED; @@ -3464,7 +3457,7 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function * if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) { if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype TSRMLS_CC)); + zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype TSRMLS_CC)); } } else if (EG(error_reporting) & E_STRICT || EG(user_error_handler)) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */ if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) { @@ -3518,7 +3511,7 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro if (zend_hash_quick_find(&ce->properties_info, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void **) &child_info)==SUCCESS) { if ((parent_info->flags & ZEND_ACC_STATIC) != (child_info->flags & ZEND_ACC_STATIC)) { - zend_error(E_COMPILE_ERROR, "Cannot redeclare %s%s::$%s as %s%s::$%s", + zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare %s%s::$%s as %s%s::$%s", (parent_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", parent_ce->name, hash_key->arKey, (child_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", ce->name, hash_key->arKey); @@ -3529,7 +3522,7 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro } if ((child_info->flags & ZEND_ACC_PPP_MASK) > (parent_info->flags & ZEND_ACC_PPP_MASK)) { - zend_error(E_COMPILE_ERROR, "Access level to %s::$%s must be %s (as in class %s)%s", ce->name, hash_key->arKey, zend_visibility_string(parent_info->flags), parent_ce->name, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker"); + zend_error_noreturn(E_COMPILE_ERROR, "Access level to %s::$%s must be %s (as in class %s)%s", ce->name, hash_key->arKey, zend_visibility_string(parent_info->flags), parent_ce->name, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker"); } else if ((child_info->flags & ZEND_ACC_STATIC) == 0) { zval_ptr_dtor(&(ce->default_properties_table[parent_info->offset])); ce->default_properties_table[parent_info->offset] = ce->default_properties_table[child_info->offset]; @@ -3614,10 +3607,10 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent if ((ce->ce_flags & ZEND_ACC_INTERFACE) && !(parent_ce->ce_flags & ZEND_ACC_INTERFACE)) { - zend_error(E_COMPILE_ERROR, "Interface %s may not inherit from class (%s)", ce->name, parent_ce->name); + zend_error_noreturn(E_COMPILE_ERROR, "Interface %s may not inherit from class (%s)", ce->name, parent_ce->name); } if (parent_ce->ce_flags & ZEND_ACC_FINAL_CLASS) { - zend_error(E_COMPILE_ERROR, "Class %s may not inherit from final class (%s)", ce->name, parent_ce->name); + zend_error_noreturn(E_COMPILE_ERROR, "Class %s may not inherit from final class (%s)", ce->name, parent_ce->name); } ce->parent = parent_ce; @@ -3739,7 +3732,7 @@ static zend_bool do_inherit_constant_check(HashTable *child_constants_table, con if (zend_hash_quick_find(child_constants_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void**)&old_constant) == SUCCESS) { if (*old_constant != *parent_constant) { - zend_error(E_COMPILE_ERROR, "Cannot inherit previously-inherited or override constant %s from interface %s", hash_key->arKey, iface->name); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot inherit previously-inherited or override constant %s from interface %s", hash_key->arKey, iface->name); } return 0; } @@ -3771,7 +3764,7 @@ ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry if (i < parent_iface_num) { ignore = 1; } else { - zend_error(E_COMPILE_ERROR, "Class %s cannot implement previously implemented interface %s", ce->name, iface->name); + zend_error_noreturn(E_COMPILE_ERROR, "Class %s cannot implement previously implemented interface %s", ce->name, iface->name); } } } @@ -3844,7 +3837,7 @@ static void zend_add_magic_methods(zend_class_entry* ce, const char* mname, uint ce->clone = fe; fe->common.fn_flags |= ZEND_ACC_CLONE; } else if (!strncmp(mname, ZEND_CONSTRUCTOR_FUNC_NAME, mname_len)) { if (ce->constructor) { - zend_error(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name); + zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name); } ce->constructor = fe; fe->common.fn_flags |= ZEND_ACC_CTOR; } else if (!strncmp(mname, ZEND_DESTRUCTOR_FUNC_NAME, mname_len)) { @@ -3869,7 +3862,7 @@ static void zend_add_magic_methods(zend_class_entry* ce, const char* mname, uint lowercase_name = (char*)zend_new_interned_string(lowercase_name, ce->name_length + 1, 1 TSRMLS_CC); if (!memcmp(mname, lowercase_name, mname_len)) { if (ce->constructor) { - zend_error(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name); + zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name); } ce->constructor = fe; fe->common.fn_flags |= ZEND_ACC_CTOR; @@ -3893,14 +3886,14 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, const if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) { /* Make sure the trait method is compatible with previosly declared abstract method */ if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", + zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", zend_get_function_declaration(fn TSRMLS_CC), zend_get_function_declaration(existing_fn TSRMLS_CC)); } } else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) { /* Make sure the abstract declaration is compatible with previous declaration */ if (!zend_traits_method_compatibility_check(existing_fn, fn TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", + zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", zend_get_function_declaration(fn TSRMLS_CC), zend_get_function_declaration(existing_fn TSRMLS_CC)); } @@ -3916,25 +3909,25 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, const } else if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) { /* Make sure the trait method is compatible with previosly declared abstract method */ if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", + zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", zend_get_function_declaration(fn TSRMLS_CC), zend_get_function_declaration(existing_fn TSRMLS_CC)); } } else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) { /* Make sure the abstract declaration is compatible with previous declaration */ if (!zend_traits_method_compatibility_check(existing_fn, fn TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", + zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", zend_get_function_declaration(fn TSRMLS_CC), zend_get_function_declaration(existing_fn TSRMLS_CC)); } return; } else if ((existing_fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { - /* two trais can't define the same non-abstract method */ + /* two traits can't define the same non-abstract method */ #if 1 - zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because there are collisions with other trait methods on %s", + zend_error_noreturn(E_COMPILE_ERROR, "Trait method %s has not been applied, because there are collisions with other trait methods on %s", name, ce->name); -#else /* TODO: better errot message */ - zend_error(E_COMPILE_ERROR, "Trait method %s::%s has not been applied as %s::%s, because of collision with %s::%s", +#else /* TODO: better error message */ + zend_error_noreturn(E_COMPILE_ERROR, "Trait method %s::%s has not been applied as %s::%s, because of collision with %s::%s", fn->common.scope->name, fn->common.function_name, ce->name, name, existing_fn->common.scope->name, existing_fn->common.function_name); @@ -4017,7 +4010,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args, } } - lcname = hash_key->arKey; + lcname = (char *) hash_key->arKey; if (exclude_table == NULL || zend_hash_find(exclude_table, lcname, fnname_len, &dummy) == FAILURE) { /* is not in hashtable, thus, function is not to be excluded */ @@ -4058,7 +4051,7 @@ static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait zend_uint i; if ((trait->ce_flags & ZEND_ACC_TRAIT) != ZEND_ACC_TRAIT) { - zend_error(E_COMPILE_ERROR, "Class %s is not a trait, Only traits may be used in 'as' and 'insteadof' statements", trait->name); + zend_error_noreturn(E_COMPILE_ERROR, "Class %s is not a trait, Only traits may be used in 'as' and 'insteadof' statements", trait->name); } for (i = 0; i < ce->num_traits; i++) { @@ -4066,7 +4059,7 @@ static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait return; } } - zend_error(E_COMPILE_ERROR, "Required Trait %s wasn't added to %s", trait->name, ce->name); + zend_error_noreturn(E_COMPILE_ERROR, "Required Trait %s wasn't added to %s", trait->name, ce->name); } /* }}} */ @@ -4087,7 +4080,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* cur_method_ref = cur_precedence->trait_method; if (!(cur_precedence->trait_method->ce = zend_fetch_class(cur_method_ref->class_name, cur_method_ref->cname_len, ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) { - zend_error(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name); + zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name); } zend_check_trait_usage(ce, cur_precedence->trait_method->ce TSRMLS_CC); @@ -4099,7 +4092,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* cur_method_ref->mname_len + 1); efree(lcname); if (!method_exists) { - zend_error(E_COMPILE_ERROR, + zend_error_noreturn(E_COMPILE_ERROR, "A precedence rule was defined for %s::%s but this method does not exist", cur_method_ref->ce->name, cur_method_ref->method_name); @@ -4117,14 +4110,14 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* zend_uint name_length = strlen(class_name); if (!(cur_precedence->exclude_from_classes[j] = zend_fetch_class(class_name, name_length, ZEND_FETCH_CLASS_TRAIT |ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) { - zend_error(E_COMPILE_ERROR, "Could not find trait %s", class_name); + zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", class_name); } zend_check_trait_usage(ce, cur_precedence->exclude_from_classes[j] TSRMLS_CC); /* make sure that the trait method is not from a class mentioned in exclude_from_classes, for consistency */ if (cur_precedence->trait_method->ce == cur_precedence->exclude_from_classes[i]) { - zend_error(E_COMPILE_ERROR, + zend_error_noreturn(E_COMPILE_ERROR, "Inconsistent insteadof definition. " "The method %s is to be used from %s, but %s is also on the exclude list", cur_method_ref->method_name, @@ -4147,7 +4140,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* if (ce->trait_aliases[i]->trait_method->class_name) { cur_method_ref = ce->trait_aliases[i]->trait_method; if (!(cur_method_ref->ce = zend_fetch_class(cur_method_ref->class_name, cur_method_ref->cname_len, ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) { - zend_error(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name); + zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name); } zend_check_trait_usage(ce, cur_method_ref->ce TSRMLS_CC); @@ -4159,7 +4152,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* efree(lcname); if (!method_exists) { - zend_error(E_COMPILE_ERROR, "An alias was defined for %s::%s but this method does not exist", cur_method_ref->ce->name, cur_method_ref->method_name); + zend_error_noreturn(E_COMPILE_ERROR, "An alias was defined for %s::%s but this method does not exist", cur_method_ref->ce->name, cur_method_ref->method_name); } } i++; @@ -4185,7 +4178,7 @@ static void zend_traits_compile_exclude_table(HashTable* exclude_table, zend_tra if (zend_hash_add(exclude_table, lcname, lcname_len, NULL, 0, NULL) == FAILURE) { efree(lcname); - zend_error(E_COMPILE_ERROR, "Failed to evaluate a trait precedence (%s). Method of trait %s was defined to be excluded multiple times", precedences[i]->trait_method->method_name, trait->name); + zend_error_noreturn(E_COMPILE_ERROR, "Failed to evaluate a trait precedence (%s). Method of trait %s was defined to be excluded multiple times", precedences[i]->trait_method->method_name, trait->name); } efree(lcname); } @@ -4310,7 +4303,7 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* { } if (not_compatible) { - zend_error(E_COMPILE_ERROR, + zend_error_noreturn(E_COMPILE_ERROR, "%s and %s define the same property ($%s) in the composition of %s. However, the definition differs and is considered incompatible. Class was composed", find_first_definition(ce, i, prop_name, prop_name_length, prop_hash, coliding_prop->ce)->name, property_info->ce->name, @@ -4359,7 +4352,7 @@ static void zend_do_check_for_inconsistent_traits_aliasing(zend_class_entry *ce if (!cur_alias->trait_method->ce) { if (cur_alias->alias) { /** Plain old inconsistency/typo/bug */ - zend_error(E_COMPILE_ERROR, + zend_error_noreturn(E_COMPILE_ERROR, "An alias (%s) was defined for method %s(), but this method does not exist", cur_alias->alias, cur_alias->trait_method->method_name); @@ -4378,12 +4371,12 @@ static void zend_do_check_for_inconsistent_traits_aliasing(zend_class_entry *ce lc_method_name, cur_alias->trait_method->mname_len+1)) { efree(lc_method_name); - zend_error(E_COMPILE_ERROR, + zend_error_noreturn(E_COMPILE_ERROR, "The modifiers for the trait alias %s() need to be changed in the same statment in which the alias is defined. Error", cur_alias->trait_method->method_name); } else { efree(lc_method_name); - zend_error(E_COMPILE_ERROR, + zend_error_noreturn(E_COMPILE_ERROR, "The modifiers of the trait method %s() are changed, but this method does not exist. Error", cur_alias->trait_method->method_name); @@ -4470,7 +4463,7 @@ void zend_prepare_reference(znode *result, znode *class_name, znode *method_name /* REM: There should not be a need for copying, zend_do_begin_class_declaration is also just using that string */ if (class_name) { - zend_resolve_class_name(class_name, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC); + zend_resolve_class_name(class_name TSRMLS_CC); method_ref->class_name = Z_STRVAL(class_name->u.constant); method_ref->cname_len = Z_STRLEN(class_name->u.constant); } else { @@ -4492,13 +4485,13 @@ void zend_add_trait_alias(znode *method_reference, znode *modifiers, znode *alia zend_trait_alias *trait_alias; if (Z_LVAL(modifiers->u.constant) == ZEND_ACC_STATIC) { - zend_error(E_COMPILE_ERROR, "Cannot use 'static' as method modifier"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use 'static' as method modifier"); return; } else if (Z_LVAL(modifiers->u.constant) == ZEND_ACC_ABSTRACT) { - zend_error(E_COMPILE_ERROR, "Cannot use 'abstract' as method modifier"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use 'abstract' as method modifier"); return; } else if (Z_LVAL(modifiers->u.constant) == ZEND_ACC_FINAL) { - zend_error(E_COMPILE_ERROR, "Cannot use 'final' as method modifier"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use 'final' as method modifier"); return; } @@ -4540,7 +4533,7 @@ ZEND_API zend_class_entry *do_bind_class(const zend_op_array* op_array, const ze op2 = opline->op2.zv; } if (zend_hash_quick_find(class_table, Z_STRVAL_P(op1), Z_STRLEN_P(op1), Z_HASH_P(op1), (void **) &pce)==FAILURE) { - zend_error(E_COMPILE_ERROR, "Internal Zend error - Missing class information for %s", Z_STRVAL_P(op1)); + zend_error_noreturn(E_COMPILE_ERROR, "Internal Zend error - Missing class information for %s", Z_STRVAL_P(op1)); return NULL; } else { ce = *pce; @@ -4554,7 +4547,7 @@ ZEND_API zend_class_entry *do_bind_class(const zend_op_array* op_array, const ze * so we shut up about it. This allows the if (!defined('FOO')) { return; } * approach to work. */ - zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name); } return NULL; } else { @@ -4589,7 +4582,7 @@ ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array * so we shut up about it. This allows the if (!defined('FOO')) { return; } * approach to work. */ - zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", Z_STRVAL_P(op2)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare class %s", Z_STRVAL_P(op2)); } return NULL; } else { @@ -4597,9 +4590,9 @@ ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array } if (parent_ce->ce_flags & ZEND_ACC_INTERFACE) { - zend_error(E_COMPILE_ERROR, "Class %s cannot extend from interface %s", ce->name, parent_ce->name); + zend_error_noreturn(E_COMPILE_ERROR, "Class %s cannot extend from interface %s", ce->name, parent_ce->name); } else if ((parent_ce->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { - zend_error(E_COMPILE_ERROR, "Class %s cannot extend from trait %s", ce->name, parent_ce->name); + zend_error_noreturn(E_COMPILE_ERROR, "Class %s cannot extend from trait %s", ce->name, parent_ce->name); } zend_do_inheritance(ce, parent_ce TSRMLS_CC); @@ -4608,7 +4601,7 @@ ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array /* Register the derived class */ if (zend_hash_quick_add(class_table, Z_STRVAL_P(op2), Z_STRLEN_P(op2)+1, Z_HASH_P(op2), pce, sizeof(zend_class_entry *), NULL)==FAILURE) { - zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name); } return ce; } @@ -4677,7 +4670,7 @@ void zend_do_early_binding(TSRMLS_D) /* {{{ */ /* Classes with traits are handled exactly the same, no early-bind here */ return; default: - zend_error(E_COMPILE_ERROR, "Invalid binding type"); + zend_error_noreturn(E_COMPILE_ERROR, "Invalid binding type"); return; } @@ -4808,9 +4801,9 @@ void zend_do_brk_cont(zend_uchar op, const znode *expr TSRMLS_DC) /* {{{ */ SET_UNUSED(opline->op1); if (expr) { if (expr->op_type != IS_CONST) { - zend_error(E_COMPILE_ERROR, "'%s' operator with non-constant operand is no longer supported", op == ZEND_BRK ? "break" : "continue"); + zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator with non-constant operand is no longer supported", op == ZEND_BRK ? "break" : "continue"); } else if (Z_TYPE(expr->u.constant) != IS_LONG || Z_LVAL(expr->u.constant) < 1) { - zend_error(E_COMPILE_ERROR, "'%s' operator accepts only positive numbers", op == ZEND_BRK ? "break" : "continue"); + zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator accepts only positive numbers", op == ZEND_BRK ? "break" : "continue"); } SET_NODE(opline->op2, expr); } else { @@ -4969,15 +4962,15 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name zval **ns_name, key; if (CG(active_class_entry)) { - zend_error(E_COMPILE_ERROR, "Class declarations may not be nested"); + zend_error_noreturn(E_COMPILE_ERROR, "Class declarations may not be nested"); return; } - lcname = zend_str_tolower_dup(class_name->u.constant.value.str.val, class_name->u.constant.value.str.len); + lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant)); if (!(strcmp(lcname, "self") && strcmp(lcname, "parent"))) { efree(lcname); - zend_error(E_COMPILE_ERROR, "Cannot use '%s' as class name as it is reserved", Z_STRVAL(class_name->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use '%s' as class name as it is reserved", Z_STRVAL(class_name->u.constant)); } /* Class name must not conflict with import names */ @@ -5004,7 +4997,7 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name if (Z_STRLEN_PP(ns_name) != Z_STRLEN(class_name->u.constant) || memcmp(tmp, lcname, Z_STRLEN(class_name->u.constant))) { - zend_error(E_COMPILE_ERROR, "Cannot declare class %s because the name is already in use", Z_STRVAL(class_name->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare class %s because the name is already in use", Z_STRVAL(class_name->u.constant)); } efree(tmp); } @@ -5022,13 +5015,13 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name if (parent_class_name && parent_class_name->op_type != IS_UNUSED) { switch (parent_class_name->EA) { case ZEND_FETCH_CLASS_SELF: - zend_error(E_COMPILE_ERROR, "Cannot use 'self' as class name as it is reserved"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use 'self' as class name as it is reserved"); break; case ZEND_FETCH_CLASS_PARENT: - zend_error(E_COMPILE_ERROR, "Cannot use 'parent' as class name as it is reserved"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use 'parent' as class name as it is reserved"); break; case ZEND_FETCH_CLASS_STATIC: - zend_error(E_COMPILE_ERROR, "Cannot use 'static' as class name as it is reserved"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use 'static' as class name as it is reserved"); break; default: break; @@ -5047,7 +5040,7 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name if (doing_inheritance) { /* Make sure a trait does not try to extend a class */ if ((new_class_entry->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { - zend_error(E_COMPILE_ERROR, "A trait (%s) cannot extend a class. Traits can only be composed from other traits with the 'use' keyword. Error", new_class_entry->name); + zend_error_noreturn(E_COMPILE_ERROR, "A trait (%s) cannot extend a class. Traits can only be composed from other traits with the 'use' keyword. Error", new_class_entry->name); } opline->extended_value = parent_class_name->u.op.var; @@ -5092,19 +5085,19 @@ void zend_do_end_class_declaration(const znode *class_token, const znode *parent if (ce->constructor) { ce->constructor->common.fn_flags |= ZEND_ACC_CTOR; if (ce->constructor->common.fn_flags & ZEND_ACC_STATIC) { - zend_error(E_COMPILE_ERROR, "Constructor %s::%s() cannot be static", ce->name, ce->constructor->common.function_name); + zend_error_noreturn(E_COMPILE_ERROR, "Constructor %s::%s() cannot be static", ce->name, ce->constructor->common.function_name); } } if (ce->destructor) { ce->destructor->common.fn_flags |= ZEND_ACC_DTOR; if (ce->destructor->common.fn_flags & ZEND_ACC_STATIC) { - zend_error(E_COMPILE_ERROR, "Destructor %s::%s() cannot be static", ce->name, ce->destructor->common.function_name); + zend_error_noreturn(E_COMPILE_ERROR, "Destructor %s::%s() cannot be static", ce->name, ce->destructor->common.function_name); } } if (ce->clone) { ce->clone->common.fn_flags |= ZEND_ACC_CLONE; if (ce->clone->common.fn_flags & ZEND_ACC_STATIC) { - zend_error(E_COMPILE_ERROR, "Clone method %s::%s() cannot be static", ce->name, ce->clone->common.function_name); + zend_error_noreturn(E_COMPILE_ERROR, "Clone method %s::%s() cannot be static", ce->name, ce->clone->common.function_name); } } @@ -5153,7 +5146,7 @@ void zend_do_implements_interface(znode *interface_name TSRMLS_DC) /* {{{ */ /* Traits can not implement interfaces */ if ((CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { - zend_error(E_COMPILE_ERROR, "Cannot use '%s' as interface on '%s' since it is a Trait", + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use '%s' as interface on '%s' since it is a Trait", Z_STRVAL(interface_name->u.constant), CG(active_class_entry)->name); } @@ -5162,7 +5155,7 @@ void zend_do_implements_interface(znode *interface_name TSRMLS_DC) /* {{{ */ case ZEND_FETCH_CLASS_SELF: case ZEND_FETCH_CLASS_PARENT: case ZEND_FETCH_CLASS_STATIC: - zend_error(E_COMPILE_ERROR, "Cannot use '%s' as interface name as it is reserved", Z_STRVAL(interface_name->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use '%s' as interface name as it is reserved", Z_STRVAL(interface_name->u.constant)); break; default: break; @@ -5171,7 +5164,7 @@ void zend_do_implements_interface(znode *interface_name TSRMLS_DC) /* {{{ */ opline = get_next_op(CG(active_op_array) TSRMLS_CC); opline->opcode = ZEND_ADD_INTERFACE; SET_NODE(opline->op1, &CG(implementing_class)); - zend_resolve_class_name(interface_name, opline->extended_value, 0 TSRMLS_CC); + zend_resolve_class_name(interface_name TSRMLS_CC); opline->extended_value = (opline->extended_value & ~ZEND_FETCH_CLASS_MASK) | ZEND_FETCH_CLASS_INTERFACE; opline->op2_type = IS_CONST; opline->op2.constant = zend_add_class_name_literal(CG(active_op_array), &interface_name->u.constant TSRMLS_CC); @@ -5184,7 +5177,7 @@ void zend_do_use_trait(znode *trait_name TSRMLS_DC) /* {{{ */ zend_op *opline; if ((CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE)) { - zend_error(E_COMPILE_ERROR, + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use traits inside of interfaces. %s is used in %s", Z_STRVAL(trait_name->u.constant), CG(active_class_entry)->name); } @@ -5194,7 +5187,7 @@ void zend_do_use_trait(znode *trait_name TSRMLS_DC) /* {{{ */ case ZEND_FETCH_CLASS_SELF: case ZEND_FETCH_CLASS_PARENT: case ZEND_FETCH_CLASS_STATIC: - zend_error(E_COMPILE_ERROR, "Cannot use '%s' as trait name as it is reserved", Z_STRVAL(trait_name->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use '%s' as trait name as it is reserved", Z_STRVAL(trait_name->u.constant)); break; default: break; @@ -5203,7 +5196,7 @@ void zend_do_use_trait(znode *trait_name TSRMLS_DC) /* {{{ */ opline = get_next_op(CG(active_op_array) TSRMLS_CC); opline->opcode = ZEND_ADD_TRAIT; SET_NODE(opline->op1, &CG(implementing_class)); - zend_resolve_class_name(trait_name, opline->extended_value, 0 TSRMLS_CC); + zend_resolve_class_name(trait_name TSRMLS_CC); opline->extended_value = ZEND_FETCH_CLASS_TRAIT; opline->op2_type = IS_CONST; opline->op2.constant = zend_add_class_name_literal(CG(active_op_array), &trait_name->u.constant TSRMLS_CC); @@ -5283,20 +5276,20 @@ void zend_do_declare_property(const znode *var_name, const znode *value, zend_ui int comment_len = 0; if (CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE) { - zend_error(E_COMPILE_ERROR, "Interfaces may not include member variables"); + zend_error_noreturn(E_COMPILE_ERROR, "Interfaces may not include member variables"); } if (access_type & ZEND_ACC_ABSTRACT) { - zend_error(E_COMPILE_ERROR, "Properties cannot be declared abstract"); + zend_error_noreturn(E_COMPILE_ERROR, "Properties cannot be declared abstract"); } if (access_type & ZEND_ACC_FINAL) { - zend_error(E_COMPILE_ERROR, "Cannot declare property %s::$%s final, the final modifier is allowed only for methods and classes", - CG(active_class_entry)->name, var_name->u.constant.value.str.val); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare property %s::$%s final, the final modifier is allowed only for methods and classes", + CG(active_class_entry)->name, Z_STRVAL(var_name->u.constant)); } - if (zend_hash_find(&CG(active_class_entry)->properties_info, var_name->u.constant.value.str.val, var_name->u.constant.value.str.len+1, (void **) &existing_property_info)==SUCCESS) { - zend_error(E_COMPILE_ERROR, "Cannot redeclare %s::$%s", CG(active_class_entry)->name, var_name->u.constant.value.str.val); + if (zend_hash_find(&CG(active_class_entry)->properties_info, Z_STRVAL(var_name->u.constant), Z_STRLEN(var_name->u.constant)+1, (void **) &existing_property_info)==SUCCESS) { + zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare %s::$%s", CG(active_class_entry)->name, Z_STRVAL(var_name->u.constant)); } ALLOC_ZVAL(property); @@ -5314,8 +5307,8 @@ void zend_do_declare_property(const znode *var_name, const znode *value, zend_ui CG(doc_comment_len) = 0; } - zend_declare_property_ex(CG(active_class_entry), zend_new_interned_string(var_name->u.constant.value.str.val, var_name->u.constant.value.str.len + 1, 0 TSRMLS_CC), var_name->u.constant.value.str.len, property, access_type, comment, comment_len TSRMLS_CC); - efree(var_name->u.constant.value.str.val); + zend_declare_property_ex(CG(active_class_entry), zend_new_interned_string(Z_STRVAL(var_name->u.constant), Z_STRLEN(var_name->u.constant) + 1, 0 TSRMLS_CC), Z_STRLEN(var_name->u.constant), property, access_type, comment, comment_len TSRMLS_CC); + efree(Z_STRVAL(var_name->u.constant)); } /* }}} */ @@ -5323,30 +5316,25 @@ void zend_do_declare_class_constant(znode *var_name, const znode *value TSRMLS_D { zval *property; const char *cname = NULL; - int result; + zend_ulong hash; if(Z_TYPE(value->u.constant) == IS_CONSTANT_ARRAY) { - zend_error(E_COMPILE_ERROR, "Arrays are not allowed in class constants"); + zend_error_noreturn(E_COMPILE_ERROR, "Arrays are not allowed in class constants"); return; } if ((CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { - zend_error(E_COMPILE_ERROR, "Traits cannot have constants"); + zend_error_noreturn(E_COMPILE_ERROR, "Traits cannot have constants"); return; } ALLOC_ZVAL(property); *property = value->u.constant; - cname = zend_new_interned_string(var_name->u.constant.value.str.val, var_name->u.constant.value.str.len+1, 0 TSRMLS_CC); - - if (IS_INTERNED(cname)) { - result = zend_hash_quick_add(&CG(active_class_entry)->constants_table, cname, var_name->u.constant.value.str.len+1, INTERNED_HASH(cname), &property, sizeof(zval *), NULL); - } else { - result = zend_hash_add(&CG(active_class_entry)->constants_table, cname, var_name->u.constant.value.str.len+1, &property, sizeof(zval *), NULL); - } - if (result == FAILURE) { + cname = zend_new_interned_string(Z_STRVAL(var_name->u.constant), Z_STRLEN(var_name->u.constant)+1, 0 TSRMLS_CC); + hash = str_hash(cname, Z_STRLEN(var_name->u.constant)); + if (zend_hash_quick_add(&CG(active_class_entry)->constants_table, cname, Z_STRLEN(var_name->u.constant)+1, hash, &property, sizeof(zval *), NULL) == FAILURE) { FREE_ZVAL(property); - zend_error(E_COMPILE_ERROR, "Cannot redefine class constant %s::%s", CG(active_class_entry)->name, var_name->u.constant.value.str.val); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot redefine class constant %s::%s", CG(active_class_entry)->name, Z_STRVAL(var_name->u.constant)); } FREE_PNODE(var_name); @@ -5440,7 +5428,7 @@ void zend_do_halt_compiler_register(TSRMLS_D) /* {{{ */ int len, clen; if (CG(has_bracketed_namespaces) && CG(in_namespace)) { - zend_error(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used from the outermost scope"); + zend_error_noreturn(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used from the outermost scope"); } cfilename = zend_get_compiled_filename(TSRMLS_C); @@ -5582,7 +5570,7 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con if (ZEND_FETCH_CLASS_STATIC == type) { zend_error(E_ERROR, "\"static::\" is not allowed in compile-time constants"); } else if (ZEND_FETCH_CLASS_DEFAULT == type) { - zend_resolve_class_name(constant_container, fetch_type, 1 TSRMLS_CC); + zend_resolve_class_name(constant_container TSRMLS_CC); } zend_do_build_full_name(NULL, constant_container, constant_name, 1 TSRMLS_CC); *result = *constant_container; @@ -5591,7 +5579,7 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con case ZEND_RT: if (constant_container->op_type == IS_CONST && ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(constant_container->u.constant), Z_STRLEN(constant_container->u.constant))) { - zend_resolve_class_name(constant_container, fetch_type, 1 TSRMLS_CC); + zend_resolve_class_name(constant_container TSRMLS_CC); } else { zend_do_fetch_class(&tmp, constant_container TSRMLS_CC); constant_container = &tmp; @@ -5791,11 +5779,11 @@ void zend_do_add_static_array_element(znode *result, znode *offset, const znode Z_STRVAL(offset->u.constant) = erealloc(Z_STRVAL(offset->u.constant), Z_STRLEN(offset->u.constant)+3); Z_STRVAL(offset->u.constant)[Z_STRLEN(offset->u.constant)+1] = Z_TYPE(offset->u.constant); Z_STRVAL(offset->u.constant)[Z_STRLEN(offset->u.constant)+2] = 0; - zend_symtable_update(result->u.constant.value.ht, Z_STRVAL(offset->u.constant), Z_STRLEN(offset->u.constant)+3, &element, sizeof(zval *), NULL); + zend_symtable_update(Z_ARRVAL(result->u.constant), Z_STRVAL(offset->u.constant), Z_STRLEN(offset->u.constant)+3, &element, sizeof(zval *), NULL); zval_dtor(&offset->u.constant); break; case IS_STRING: - zend_symtable_update(result->u.constant.value.ht, offset->u.constant.value.str.val, offset->u.constant.value.str.len+1, &element, sizeof(zval *), NULL); + zend_symtable_update(Z_ARRVAL(result->u.constant), Z_STRVAL(offset->u.constant), Z_STRLEN(offset->u.constant)+1, &element, sizeof(zval *), NULL); zval_dtor(&offset->u.constant); break; case IS_NULL: @@ -5972,7 +5960,7 @@ void zend_do_fetch_static_variable(znode *varname, const znode *static_assignmen ALLOC_HASHTABLE(CG(active_op_array)->static_variables); zend_hash_init(CG(active_op_array)->static_variables, 2, NULL, ZVAL_PTR_DTOR, 0); } - zend_hash_update(CG(active_op_array)->static_variables, varname->u.constant.value.str.val, varname->u.constant.value.str.len+1, &tmp, sizeof(zval *), NULL); + zend_hash_update(CG(active_op_array)->static_variables, Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant)+1, &tmp, sizeof(zval *), NULL); if (varname->op_type == IS_CONST) { if (Z_TYPE(varname->u.constant) != IS_STRING) { @@ -6016,7 +6004,7 @@ void zend_do_fetch_lexical_variable(znode *varname, zend_bool is_ref TSRMLS_DC) if (Z_STRLEN(varname->u.constant) == sizeof("this") - 1 && memcmp(Z_STRVAL(varname->u.constant), "this", sizeof("this") - 1) == 0) { - zend_error(E_COMPILE_ERROR, "Cannot use $this as lexical variable"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use $this as lexical variable"); return; } @@ -6101,7 +6089,7 @@ void zend_do_indirect_references(znode *result, const znode *num_references, zno int i; zend_do_end_variable_parse(variable, BP_VAR_R, 0 TSRMLS_CC); - for (i=1; iu.constant.value.lval; i++) { + for (i=1; iu.constant); i++) { fetch_simple_variable_ex(result, variable, 0, ZEND_FETCH_R TSRMLS_CC); *variable = *result; } @@ -6160,7 +6148,7 @@ void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC /* empty(func()) can be transformed to !func() */ zend_do_unary_op(ZEND_BOOL_NOT, result, variable TSRMLS_CC); } else { - zend_error(E_COMPILE_ERROR, "Cannot use isset() on the result of a function call (you can use \"null !== func()\" instead)"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use isset() on the result of a function call (you can use \"null !== func()\" instead)"); } return; @@ -6208,7 +6196,7 @@ void zend_do_instanceof(znode *result, const znode *expr, const znode *class_zno } if (expr->op_type == IS_CONST) { - zend_error(E_COMPILE_ERROR, "instanceof expects an object instance, constant given"); + zend_error_noreturn(E_COMPILE_ERROR, "instanceof expects an object instance, constant given"); } opline = get_next_op(CG(active_op_array) TSRMLS_CC); @@ -6227,7 +6215,6 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno { zend_op *opline; zend_bool is_variable; - zend_bool push_container = 0; zend_op dummy_opline; if (variable) { @@ -6239,14 +6226,6 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno /* save the location of FETCH_W instruction(s) */ open_brackets_token->u.op.opline_num = get_next_op_number(CG(active_op_array)); zend_do_end_variable_parse(array, BP_VAR_W, 0 TSRMLS_CC); - if (CG(active_op_array)->last > 0 && - CG(active_op_array)->opcodes[CG(active_op_array)->last-1].opcode == ZEND_FETCH_OBJ_W) { - /* Only lock the container if we are fetching from a real container and not $this */ - if (CG(active_op_array)->opcodes[CG(active_op_array)->last-1].op1_type == IS_VAR) { - CG(active_op_array)->opcodes[CG(active_op_array)->last-1].extended_value |= ZEND_FETCH_ADD_LOCK; - push_container = 1; - } - } } else { is_variable = 0; open_brackets_token->u.op.opline_num = get_next_op_number(CG(active_op_array)); @@ -6266,11 +6245,6 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno opline->extended_value = is_variable ? ZEND_FE_RESET_VARIABLE : 0; COPY_NODE(dummy_opline.result, opline->result); - if (push_container) { - COPY_NODE(dummy_opline.op1, CG(active_op_array)->opcodes[CG(active_op_array)->last-2].op1); - } else { - dummy_opline.op1_type = IS_UNUSED; - } zend_stack_push(&CG(foreach_copy_stack), (void *) &dummy_opline, sizeof(zend_op)); /* save the location of FE_FETCH */ @@ -6313,10 +6287,10 @@ void zend_do_foreach_cont(znode *foreach_token, const znode *open_brackets_token if ((key->op_type != IS_UNUSED)) { if (key->EA & ZEND_PARSED_REFERENCE_VARIABLE) { - zend_error(E_COMPILE_ERROR, "Key element cannot be a reference"); + zend_error_noreturn(E_COMPILE_ERROR, "Key element cannot be a reference"); } if (key->EA & ZEND_PARSED_LIST_EXPR) { - zend_error(E_COMPILE_ERROR, "Cannot use list as key element"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use list as key element"); } } @@ -6327,7 +6301,6 @@ void zend_do_foreach_cont(znode *foreach_token, const znode *open_brackets_token opline->extended_value |= ZEND_FE_FETCH_BYREF; CG(active_op_array)->opcodes[foreach_token->u.op.opline_num].extended_value |= ZEND_FE_RESET_REFERENCE; } else { - zend_op *foreach_copy; zend_op *fetch = &CG(active_op_array)->opcodes[foreach_token->u.op.opline_num]; zend_op *end = &CG(active_op_array)->opcodes[open_brackets_token->u.op.opline_num]; @@ -6336,7 +6309,7 @@ void zend_do_foreach_cont(znode *foreach_token, const znode *open_brackets_token while (fetch != end) { --fetch; if (fetch->opcode == ZEND_FETCH_DIM_W && fetch->op2_type == IS_UNUSED) { - zend_error(E_COMPILE_ERROR, "Cannot use [] for reading"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading"); } if (fetch->opcode == ZEND_SEPARATE) { MAKE_NOP(fetch); @@ -6344,16 +6317,13 @@ void zend_do_foreach_cont(znode *foreach_token, const znode *open_brackets_token fetch->opcode -= 3; /* FETCH_W -> FETCH_R */ } } - /* prevent double SWITCH_FREE */ - zend_stack_top(&CG(foreach_copy_stack), (void **) &foreach_copy); - foreach_copy->op1_type = IS_UNUSED; } GET_NODE(&value_node, opline->result); if (value->EA & ZEND_PARSED_LIST_EXPR) { if (!CG(list_llist).head) { - zend_error(E_COMPILE_ERROR, "Cannot use empty list"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use empty list"); } zend_do_list_end(&dummy, &value_node TSRMLS_CC); zend_do_free(&dummy TSRMLS_CC); @@ -6416,12 +6386,12 @@ void zend_do_declare_begin(TSRMLS_D) /* {{{ */ void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC) /* {{{ */ { - if (!zend_binary_strcasecmp(var->u.constant.value.str.val, var->u.constant.value.str.len, "ticks", sizeof("ticks")-1)) { + if (!zend_binary_strcasecmp(Z_STRVAL(var->u.constant), Z_STRLEN(var->u.constant), "ticks", sizeof("ticks")-1)) { convert_to_long(&val->u.constant); CG(declarables).ticks = val->u.constant; - } else if (!zend_binary_strcasecmp(var->u.constant.value.str.val, var->u.constant.value.str.len, "encoding", sizeof("encoding")-1)) { + } else if (!zend_binary_strcasecmp(Z_STRVAL(var->u.constant), Z_STRLEN(var->u.constant), "encoding", sizeof("encoding")-1)) { if ((Z_TYPE(val->u.constant) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) { - zend_error(E_COMPILE_ERROR, "Cannot use constants as encoding"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use constants as encoding"); } /* @@ -6440,7 +6410,7 @@ void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC) /* {{{ */ } if (num > 0) { - zend_error(E_COMPILE_ERROR, "Encoding declaration pragma must be the very first statement in the script"); + zend_error_noreturn(E_COMPILE_ERROR, "Encoding declaration pragma must be the very first statement in the script"); } } @@ -6451,9 +6421,9 @@ void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC) /* {{{ */ CG(encoding_declared) = 1; convert_to_string(&val->u.constant); - new_encoding = zend_multibyte_fetch_encoding(val->u.constant.value.str.val TSRMLS_CC); + new_encoding = zend_multibyte_fetch_encoding(Z_STRVAL(val->u.constant) TSRMLS_CC); if (!new_encoding) { - zend_error(E_COMPILE_WARNING, "Unsupported encoding [%s]", val->u.constant.value.str.val); + zend_error(E_COMPILE_WARNING, "Unsupported encoding [%s]", Z_STRVAL(val->u.constant)); } else { old_input_filter = LANG_SCNG(input_filter); old_encoding = LANG_SCNG(script_encoding); @@ -6470,7 +6440,7 @@ void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC) /* {{{ */ } zval_dtor(&val->u.constant); } else { - zend_error(E_COMPILE_WARNING, "Unsupported declare '%s'", var->u.constant.value.str.val); + zend_error(E_COMPILE_WARNING, "Unsupported declare '%s'", Z_STRVAL(var->u.constant)); zval_dtor(&val->u.constant); } zval_dtor(&var->u.constant); @@ -6710,10 +6680,9 @@ void zend_do_ticks(TSRMLS_D) /* {{{ */ } /* }}} */ -zend_bool zend_is_auto_global_quick(const char *name, uint name_len, ulong hashval TSRMLS_DC) /* {{{ */ +zend_bool zend_is_auto_global_quick(const char *name, uint name_len, ulong hash TSRMLS_DC) /* {{{ */ { zend_auto_global *auto_global; - ulong hash = hashval ? hashval : zend_hash_func(name, name_len+1); if (zend_hash_quick_find(CG(auto_globals), name, name_len+1, hash, (void **) &auto_global)==SUCCESS) { if (auto_global->armed) { @@ -6727,7 +6696,7 @@ zend_bool zend_is_auto_global_quick(const char *name, uint name_len, ulong hashv zend_bool zend_is_auto_global(const char *name, uint name_len TSRMLS_DC) /* {{{ */ { - return zend_is_auto_global_quick(name, name_len, 0 TSRMLS_CC); + return zend_is_auto_global_quick(name, name_len, zend_hash_func(name, name_len+1) TSRMLS_CC); } /* }}} */ @@ -6937,15 +6906,15 @@ void zend_do_begin_namespace(const znode *name, zend_bool with_bracket TSRMLS_DC if (CG(current_namespace)) { /* previous namespace declarations were unbracketed */ if (with_bracket) { - zend_error(E_COMPILE_ERROR, "Cannot mix bracketed namespace declarations with unbracketed namespace declarations"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot mix bracketed namespace declarations with unbracketed namespace declarations"); } } } else { /* previous namespace declarations were bracketed */ if (!with_bracket) { - zend_error(E_COMPILE_ERROR, "Cannot mix bracketed namespace declarations with unbracketed namespace declarations"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot mix bracketed namespace declarations with unbracketed namespace declarations"); } else if (CG(current_namespace) || CG(in_namespace)) { - zend_error(E_COMPILE_ERROR, "Namespace declarations cannot be nested"); + zend_error_noreturn(E_COMPILE_ERROR, "Namespace declarations cannot be nested"); } } @@ -6958,7 +6927,7 @@ void zend_do_begin_namespace(const znode *name, zend_bool with_bracket TSRMLS_DC --num; } if (num > 0) { - zend_error(E_COMPILE_ERROR, "Namespace declaration statement has to be the very first statement in the script"); + zend_error_noreturn(E_COMPILE_ERROR, "Namespace declaration statement has to be the very first statement in the script"); } } @@ -6973,7 +6942,7 @@ void zend_do_begin_namespace(const znode *name, zend_bool with_bracket TSRMLS_DC !memcmp(lcname, "self", sizeof("self")-1)) || ((Z_STRLEN(name->u.constant) == sizeof("parent")-1) && !memcmp(lcname, "parent", sizeof("parent")-1))) { - zend_error(E_COMPILE_ERROR, "Cannot use '%s' as namespace name", Z_STRVAL(name->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use '%s' as namespace name", Z_STRVAL(name->u.constant)); } efree(lcname); @@ -7043,7 +7012,7 @@ void zend_do_use(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{ !memcmp(lcname, "self", sizeof("self")-1)) || ((Z_STRLEN_P(name) == sizeof("parent")-1) && !memcmp(lcname, "parent", sizeof("parent")-1))) { - zend_error(E_COMPILE_ERROR, "Cannot use %s as %s because '%s' is a special class name", Z_STRVAL_P(ns), Z_STRVAL_P(name), Z_STRVAL_P(name)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use %s as %s because '%s' is a special class name", Z_STRVAL_P(ns), Z_STRVAL_P(name), Z_STRVAL_P(name)); } if (CG(current_namespace)) { @@ -7058,7 +7027,7 @@ void zend_do_use(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{ if (Z_STRLEN_P(ns) != Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name) || memcmp(tmp2, c_ns_name, Z_STRLEN_P(ns))) { - zend_error(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name)); } efree(tmp2); } @@ -7070,17 +7039,17 @@ void zend_do_use(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{ if (Z_STRLEN_P(ns) != Z_STRLEN_P(name) || memcmp(c_tmp, lcname, Z_STRLEN_P(ns))) { - zend_error(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name)); } efree(c_tmp); } if (zend_hash_add(CG(current_import), lcname, Z_STRLEN_P(name)+1, &ns, sizeof(zval*), NULL) != SUCCESS) { - zend_error(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name)); } if (warn) { if (!strcmp(Z_STRVAL_P(name), "strict")) { - zend_error(E_COMPILE_ERROR, "You seem to be trying to use a different language..."); + zend_error_noreturn(E_COMPILE_ERROR, "You seem to be trying to use a different language..."); } zend_error(E_WARNING, "The use statement with non-compound name '%s' has no effect", Z_STRVAL_P(name)); } @@ -7094,11 +7063,11 @@ void zend_do_declare_constant(znode *name, znode *value TSRMLS_DC) /* {{{ */ zend_op *opline; if(Z_TYPE(value->u.constant) == IS_CONSTANT_ARRAY) { - zend_error(E_COMPILE_ERROR, "Arrays are not allowed as constants"); + zend_error_noreturn(E_COMPILE_ERROR, "Arrays are not allowed as constants"); } if (zend_get_ct_const(&name->u.constant, 0 TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Cannot redeclare constant '%s'", Z_STRVAL(name->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare constant '%s'", Z_STRVAL(name->u.constant)); } if (CG(current_namespace)) { @@ -7123,7 +7092,7 @@ void zend_do_declare_constant(znode *name, znode *value TSRMLS_DC) /* {{{ */ void zend_verify_namespace(TSRMLS_D) /* {{{ */ { if (CG(has_bracketed_namespaces) && !CG(in_namespace)) { - zend_error(E_COMPILE_ERROR, "No code may exist outside of namespace {}"); + zend_error_noreturn(E_COMPILE_ERROR, "No code may exist outside of namespace {}"); } } /* }}} */ diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 9c55b5ebe8812..f9520c98eacf2 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -207,8 +207,7 @@ typedef struct _zend_try_catch_element { /* disable inline caching */ #define ZEND_ACC_NEVER_CACHE 0x400000 -#define ZEND_ACC_PASS_REST_BY_REFERENCE 0x1000000 -#define ZEND_ACC_PASS_REST_PREFER_REF 0x2000000 +#define ZEND_ACC_VARIADIC 0x1000000 #define ZEND_ACC_RETURN_REFERENCE 0x4000000 #define ZEND_ACC_DONE_PASS_TWO 0x8000000 @@ -234,8 +233,9 @@ typedef struct _zend_arg_info { const char *class_name; zend_uint class_name_len; zend_uchar type_hint; + zend_uchar pass_by_reference; zend_bool allow_null; - zend_bool pass_by_reference; + zend_bool is_variadic; } zend_arg_info; /* the following structure repeats the layout of zend_arg_info, @@ -249,7 +249,8 @@ typedef struct _zend_internal_function_info { zend_uint required_num_args; zend_uchar _type_hint; zend_bool return_reference; - zend_bool pass_rest_by_reference; + zend_bool _allow_null; + zend_bool _is_variadic; } zend_internal_function_info; typedef struct _zend_compiled_variable { @@ -438,7 +439,7 @@ ZEND_API int zend_get_compiled_lineno(TSRMLS_D); ZEND_API size_t zend_get_scanned_file_offset(TSRMLS_D); void zend_resolve_non_class_name(znode *element_name, zend_bool check_namespace TSRMLS_DC); -void zend_resolve_class_name(znode *class_name, ulong fetch_type, int check_ns_name TSRMLS_DC); +void zend_resolve_class_name(znode *class_name TSRMLS_DC); ZEND_API const char* zend_get_compiled_variable_name(const zend_op_array *op_array, zend_uint var, int* name_len); #ifdef ZTS @@ -500,7 +501,7 @@ void zend_do_add_variable(znode *result, const znode *op1, const znode *op2 TSRM int zend_do_verify_access_types(const znode *current_access_type, const znode *new_modifier); void zend_do_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference, znode *fn_flags_znode TSRMLS_DC); void zend_do_end_function_declaration(const znode *function_token TSRMLS_DC); -void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, const znode *initialization, znode *class_type, zend_bool pass_by_reference TSRMLS_DC); +void zend_do_receive_param(zend_uchar op, znode *varname, const znode *initialization, znode *class_type, zend_bool pass_by_reference, zend_bool is_variadic TSRMLS_DC); int zend_do_begin_function_call(znode *function_name, zend_bool check_namespace TSRMLS_DC); void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC); void zend_do_clone(znode *result, const znode *expr TSRMLS_DC); @@ -726,8 +727,8 @@ int zend_add_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC); #define ZEND_FETCH_CLASS_DEFAULT 0 #define ZEND_FETCH_CLASS_SELF 1 #define ZEND_FETCH_CLASS_PARENT 2 -#define ZEND_FETCH_CLASS_MAIN 3 -#define ZEND_FETCH_CLASS_GLOBAL 4 +#define ZEND_FETCH_CLASS_MAIN 3 /* unused */ +#define ZEND_FETCH_CLASS_GLOBAL 4 /* unused */ #define ZEND_FETCH_CLASS_AUTO 5 #define ZEND_FETCH_CLASS_INTERFACE 6 #define ZEND_FETCH_CLASS_STATIC 7 @@ -817,21 +818,21 @@ int zend_add_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC); #define ZEND_SEND_BY_REF 1 #define ZEND_SEND_PREFER_REF 2 -#define CHECK_ARG_SEND_TYPE(zf, arg_num, m1, m2) \ - ((zf) && \ - ((((zend_function*)(zf))->common.arg_info && \ - arg_num <= ((zend_function*)(zf))->common.num_args) ? \ - (((zend_function *)(zf))->common.arg_info[arg_num-1].pass_by_reference & (m1)) : \ - (((zend_function *)(zf))->common.fn_flags & (m2)))) +#define CHECK_ARG_SEND_TYPE(zf, arg_num, m) \ + ((zf)->common.arg_info && \ + (arg_num <= (zf)->common.num_args \ + ? ((zf)->common.arg_info[arg_num-1].pass_by_reference & (m)) \ + : ((zf)->common.fn_flags & ZEND_ACC_VARIADIC) \ + ? ((zf)->common.arg_info[(zf)->common.num_args-1].pass_by_reference & (m)) : 0)) #define ARG_MUST_BE_SENT_BY_REF(zf, arg_num) \ - CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_BY_REF, ZEND_ACC_PASS_REST_BY_REFERENCE) + CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_BY_REF) #define ARG_SHOULD_BE_SENT_BY_REF(zf, arg_num) \ - CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_BY_REF|ZEND_SEND_PREFER_REF, ZEND_ACC_PASS_REST_BY_REFERENCE|ZEND_ACC_PASS_REST_PREFER_REF) + CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_BY_REF|ZEND_SEND_PREFER_REF) #define ARG_MAY_BE_SENT_BY_REF(zf, arg_num) \ - CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_PREFER_REF, ZEND_ACC_PASS_REST_PREFER_REF) + CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_PREFER_REF) #define ZEND_RETURN_VAL 0 #define ZEND_RETURN_REF 1 diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c index 594559d58bf06..a53af497cc8d4 100644 --- a/Zend/zend_constants.c +++ b/Zend/zend_constants.c @@ -38,9 +38,7 @@ void free_zend_constant(zend_constant *c) void copy_zend_constant(zend_constant *c) { - if (!IS_INTERNED(c->name)) { - c->name = zend_strndup(c->name, c->name_len - 1); - } + c->name = str_strndup(c->name, c->name_len - 1); if (!(c->flags & CONST_PERSISTENT)) { zval_copy_ctor(&c->value); } @@ -474,7 +472,7 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC) char *lowercase_name = NULL; char *name; int ret = SUCCESS; - ulong chash = 0; + ulong chash; #if 0 printf("Registering constant for module %d\n", c->module_number); @@ -486,23 +484,18 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC) zend_str_tolower(lowercase_name, c->name_len-1); lowercase_name = (char*)zend_new_interned_string(lowercase_name, c->name_len, 1 TSRMLS_CC); name = lowercase_name; - chash = IS_INTERNED(lowercase_name) ? INTERNED_HASH(lowercase_name) : 0; } else { char *slash = strrchr(c->name, '\\'); - if(slash) { + if (slash) { lowercase_name = estrndup(c->name, c->name_len-1); zend_str_tolower(lowercase_name, slash-c->name); lowercase_name = (char*)zend_new_interned_string(lowercase_name, c->name_len, 1 TSRMLS_CC); name = lowercase_name; - - chash = IS_INTERNED(lowercase_name) ? INTERNED_HASH(lowercase_name) : 0; } else { name = c->name; } } - if (chash == 0) { - chash = zend_hash_func(name, c->name_len); - } + chash = str_hash(name, c->name_len-1); /* Check if the user is trying to define the internal pseudo constant name __COMPILER_HALT_OFFSET__ */ if ((c->name_len == sizeof("__COMPILER_HALT_OFFSET__") @@ -521,8 +514,8 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC) } ret = FAILURE; } - if (lowercase_name && !IS_INTERNED(lowercase_name)) { - efree(lowercase_name); + if (lowercase_name) { + str_efree(lowercase_name); } return ret; } diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 14ae75e38d096..c7f157c4d5f2d 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -560,7 +560,7 @@ ZEND_METHOD(exception, getPrevious) RETURN_ZVAL(previous, 1, 0); } -int zend_spprintf(char **message, int max_len, char *format, ...) /* {{{ */ +int zend_spprintf(char **message, int max_len, const char *format, ...) /* {{{ */ { va_list arg; int len; @@ -732,7 +732,7 @@ ZEND_API zend_class_entry *zend_get_error_exception(TSRMLS_D) /* {{{ */ } /* }}} */ -ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, char *message, long code TSRMLS_DC) /* {{{ */ +ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, const char *message, long code TSRMLS_DC) /* {{{ */ { zval *ex; @@ -760,7 +760,7 @@ ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, char *messa } /* }}} */ -ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, char *format, ...) /* {{{ */ +ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, const char *format, ...) /* {{{ */ { va_list arg; char *message; @@ -775,7 +775,7 @@ ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long cod } /* }}} */ -ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, char *message, long code, int severity TSRMLS_DC) /* {{{ */ +ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, long code, int severity TSRMLS_DC) /* {{{ */ { zval *ex = zend_throw_exception(exception_ce, message, code TSRMLS_CC); zend_update_property_long(default_exception_ce, ex, "severity", sizeof("severity")-1, severity TSRMLS_CC); diff --git a/Zend/zend_exceptions.h b/Zend/zend_exceptions.h index 82633530d61ad..81c8a1f21333e 100644 --- a/Zend/zend_exceptions.h +++ b/Zend/zend_exceptions.h @@ -40,12 +40,12 @@ ZEND_API void zend_register_default_classes(TSRMLS_D); /* exception_ce NULL or zend_exception_get_default() or a derived class * message NULL or the message of the exception */ -ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, char *message, long code TSRMLS_DC); -ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, char *format, ...); +ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, const char *message, long code TSRMLS_DC); +ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, const char *format, ...); ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC); ZEND_API void zend_clear_exception(TSRMLS_D); -ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, char *message, long code, int severity TSRMLS_DC); +ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, long code, int severity TSRMLS_DC); extern ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC); @@ -53,7 +53,7 @@ extern ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC); ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC); /* do not export, in php it's available thru spprintf directly */ -int zend_spprintf(char **message, int max_len, char *format, ...); +int zend_spprintf(char **message, int max_len, const char *format, ...); END_EXTERN_C() diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 3c3dd8e3b0b57..9f78218d3de35 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -94,7 +94,7 @@ static zend_always_inline void zend_pzval_unlock_free_func(zval *z TSRMLS_DC) } #undef zval_ptr_dtor -#define zval_ptr_dtor(pzv) i_zval_ptr_dtor(*(pzv) ZEND_FILE_LINE_CC) +#define zval_ptr_dtor(pzv) i_zval_ptr_dtor(*(pzv) ZEND_FILE_LINE_CC TSRMLS_CC) #define PZVAL_UNLOCK(z, f) zend_pzval_unlock_func(z, f, 1 TSRMLS_CC) #define PZVAL_UNLOCK_EX(z, f, u) zend_pzval_unlock_func(z, f, u TSRMLS_CC) @@ -616,12 +616,17 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva char *need_msg; zend_class_entry *ce; - if (!zf->common.arg_info - || arg_num>zf->common.num_args) { + if (!zf->common.arg_info) { return 1; } - cur_arg_info = &zf->common.arg_info[arg_num-1]; + if (arg_num <= zf->common.num_args) { + cur_arg_info = &zf->common.arg_info[arg_num-1]; + } else if (zf->common.fn_flags & ZEND_ACC_VARIADIC) { + cur_arg_info = &zf->common.arg_info[zf->common.num_args-1]; + } else { + return 1; + } if (cur_arg_info->class_name) { const char *class_name; @@ -767,32 +772,21 @@ static inline void zend_assign_to_object(zval **retval, zval **object_ptr, zval static inline int zend_assign_to_string_offset(const temp_variable *T, const zval *value, int value_type TSRMLS_DC) { - if (Z_TYPE_P(T->str_offset.str) == IS_STRING) { - - if (((int)T->str_offset.offset < 0)) { - zend_error(E_WARNING, "Illegal string offset: %d", T->str_offset.offset); + zval *str = T->str_offset.str; + zend_uint offset = T->str_offset.offset; + if (Z_TYPE_P(str) == IS_STRING) { + if ((int)offset < 0) { + zend_error(E_WARNING, "Illegal string offset: %d", offset); return 0; } - if (T->str_offset.offset >= Z_STRLEN_P(T->str_offset.str)) { - if (IS_INTERNED(Z_STRVAL_P(T->str_offset.str))) { - char *tmp = (char *) emalloc(T->str_offset.offset+1+1); - - memcpy(tmp, Z_STRVAL_P(T->str_offset.str), Z_STRLEN_P(T->str_offset.str)+1); - Z_STRVAL_P(T->str_offset.str) = tmp; - } else { - Z_STRVAL_P(T->str_offset.str) = (char *) erealloc(Z_STRVAL_P(T->str_offset.str), T->str_offset.offset+1+1); - } - memset(Z_STRVAL_P(T->str_offset.str) + Z_STRLEN_P(T->str_offset.str), - ' ', - T->str_offset.offset - Z_STRLEN_P(T->str_offset.str)); - Z_STRVAL_P(T->str_offset.str)[T->str_offset.offset+1] = 0; - Z_STRLEN_P(T->str_offset.str) = T->str_offset.offset+1; - } else if (IS_INTERNED(Z_STRVAL_P(T->str_offset.str))) { - char *tmp = (char *) emalloc(Z_STRLEN_P(T->str_offset.str) + 1); - - memcpy(tmp, Z_STRVAL_P(T->str_offset.str), Z_STRLEN_P(T->str_offset.str) + 1); - Z_STRVAL_P(T->str_offset.str) = tmp; + if (offset >= Z_STRLEN_P(str)) { + Z_STRVAL_P(str) = str_erealloc(Z_STRVAL_P(str), offset+1+1); + memset(Z_STRVAL_P(str) + Z_STRLEN_P(str), ' ', offset - Z_STRLEN_P(str)); + Z_STRVAL_P(str)[offset+1] = 0; + Z_STRLEN_P(str) = offset+1; + } else if (IS_INTERNED(Z_STRVAL_P(str))) { + Z_STRVAL_P(str) = estrndup(Z_STRVAL_P(str), Z_STRLEN_P(str)); } if (Z_TYPE_P(value) != IS_STRING) { @@ -803,15 +797,15 @@ static inline int zend_assign_to_string_offset(const temp_variable *T, const zva zval_copy_ctor(&tmp); } convert_to_string(&tmp); - Z_STRVAL_P(T->str_offset.str)[T->str_offset.offset] = Z_STRVAL(tmp)[0]; - STR_FREE(Z_STRVAL(tmp)); + Z_STRVAL_P(str)[offset] = Z_STRVAL(tmp)[0]; + str_efree(Z_STRVAL(tmp)); } else { - Z_STRVAL_P(T->str_offset.str)[T->str_offset.offset] = Z_STRVAL_P(value)[0]; + Z_STRVAL_P(str)[offset] = Z_STRVAL_P(value)[0]; if (value_type == IS_TMP_VAR) { /* we can safely free final_value here * because separation is done only * in case value_type == IS_VAR */ - STR_FREE(Z_STRVAL_P(value)); + str_efree(Z_STRVAL_P(value)); } } /* @@ -1024,11 +1018,7 @@ static inline zval **zend_fetch_dimension_address_inner(HashTable *ht, const zva hval = Z_HASH_P(dim); } else { ZEND_HANDLE_NUMERIC_EX(offset_key, offset_key_length+1, hval, goto num_index); - if (IS_INTERNED(offset_key)) { - hval = INTERNED_HASH(offset_key); - } else { - hval = zend_hash_func(offset_key, offset_key_length+1); - } + hval = str_hash(offset_key, offset_key_length); } fetch_string_dim: if (zend_hash_quick_find(ht, offset_key, offset_key_length+1, hval, (void **) &retval) == FAILURE) { @@ -1487,15 +1477,17 @@ ZEND_API opcode_handler_t *zend_opcode_handlers; ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, zend_fcall_info *fci, int return_value_used TSRMLS_DC) { - if(fci != NULL) { - ((zend_internal_function *) execute_data_ptr->function_state.function)->handler(fci->param_count, - *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC); - + if (fci != NULL) { + execute_data_ptr->function_state.function->internal_function.handler( + fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr, + fci->object_ptr, 1 TSRMLS_CC + ); } else { zval **return_value_ptr = &EX_TMP_VAR(execute_data_ptr, execute_data_ptr->opline->result.var)->var.ptr; - ((zend_internal_function *) execute_data_ptr->function_state.function)->handler(execute_data_ptr->opline->extended_value, *return_value_ptr, - (execute_data_ptr->function_state.function->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)?return_value_ptr:NULL, - execute_data_ptr->object, return_value_used TSRMLS_CC); + execute_data_ptr->function_state.function->internal_function.handler( + execute_data_ptr->opline->extended_value, *return_value_ptr, return_value_ptr, + execute_data_ptr->object, return_value_used TSRMLS_CC + ); } } @@ -1513,7 +1505,7 @@ void zend_clean_and_cache_symbol_table(HashTable *symbol_table TSRMLS_DC) /* {{{ } /* }}} */ -static zend_always_inline void i_free_compiled_variables(zend_execute_data *execute_data) /* {{{ */ +static zend_always_inline void i_free_compiled_variables(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ { zval ***cv = EX_CV_NUM(execute_data, 0); zval ***end = cv + EX(op_array)->last_var; @@ -1526,9 +1518,9 @@ static zend_always_inline void i_free_compiled_variables(zend_execute_data *exec } /* }}} */ -void zend_free_compiled_variables(zend_execute_data *execute_data) /* {{{ */ +void zend_free_compiled_variables(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ { - i_free_compiled_variables(execute_data); + i_free_compiled_variables(execute_data TSRMLS_CC); } /* }}} */ diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index ff0758772e48b..b68a82ef896e9 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -71,18 +71,14 @@ ZEND_API int zend_eval_stringl_ex(char *str, int str_len, zval *retval_ptr, char ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, ulong fetch_type, const char **class_name, zend_class_entry **pce TSRMLS_DC); ZEND_API int zend_verify_arg_error(int error_type, const zend_function *zf, zend_uint arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind TSRMLS_DC); -static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC) +static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC TSRMLS_DC) { if (!Z_DELREF_P(zval_ptr)) { - TSRMLS_FETCH(); - ZEND_ASSERT(zval_ptr != &EG(uninitialized_zval)); GC_REMOVE_ZVAL_FROM_BUFFER(zval_ptr); zval_dtor(zval_ptr); efree_rel(zval_ptr); } else { - TSRMLS_FETCH(); - if (Z_REFCOUNT_P(zval_ptr) == 1) { Z_UNSET_ISREF_P(zval_ptr); } @@ -295,7 +291,7 @@ static zend_always_inline void zend_vm_stack_clear_multiple(int nested TSRMLS_DC while (p != end) { zval *q = (zval *) *(--p); *p = NULL; - i_zval_ptr_dtor(q ZEND_FILE_LINE_CC); + i_zval_ptr_dtor(q ZEND_FILE_LINE_CC TSRMLS_CC); } if (nested) { EG(argument_stack)->top = p; @@ -394,7 +390,7 @@ ZEND_API zval **zend_get_zval_ptr_ptr(int op_type, const znode_op *node, const z ZEND_API int zend_do_fcall(ZEND_OPCODE_HANDLER_ARGS); void zend_clean_and_cache_symbol_table(HashTable *symbol_table TSRMLS_DC); -void zend_free_compiled_variables(zend_execute_data *execute_data); +void zend_free_compiled_variables(zend_execute_data *execute_data TSRMLS_DC); #define CACHED_PTR(num) \ EG(active_op_array)->run_time_cache[(num)] diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 83c221798416f..779e6d886fa4d 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -423,7 +423,8 @@ ZEND_API zend_bool zend_is_executing(TSRMLS_D) /* {{{ */ ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC) /* {{{ */ { - i_zval_ptr_dtor(*zval_ptr ZEND_FILE_LINE_RELAY_CC); + TSRMLS_FETCH(); + i_zval_ptr_dtor(*zval_ptr ZEND_FILE_LINE_RELAY_CC TSRMLS_CC); } /* }}} */ @@ -533,13 +534,13 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco if (fix_save) { save--; } - if (inline_change && !IS_INTERNED(save)) { - efree(save); + if (inline_change) { + str_efree(save); } save = NULL; } - if (inline_change && save && save != actual && !IS_INTERNED(save)) { - efree(save); + if (inline_change && save && save != actual) { + str_efree(save); } zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", actual, actual); p->type = IS_STRING; @@ -551,7 +552,7 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco } } else { if (inline_change) { - STR_FREE(Z_STRVAL_P(p)); + str_efree(Z_STRVAL_P(p)); } *p = const_value; } @@ -952,9 +953,9 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS if (EX(function_state).function->common.scope) { EG(scope) = EX(function_state).function->common.scope; } - if(EXPECTED(zend_execute_internal == NULL)) { + if (EXPECTED(zend_execute_internal == NULL)) { /* saves one function call if zend_execute_internal is not used */ - ((zend_internal_function *) EX(function_state).function)->handler(fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC); + EX(function_state).function->internal_function.handler(fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC); } else { zend_execute_internal(&execute_data, fci, 1 TSRMLS_CC); } diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index 1a805bbd6d61c..e8b1be4445e2e 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -46,7 +46,7 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished zend_op_array *op_array = execute_data->op_array; if (!execute_data->symbol_table) { - zend_free_compiled_variables(execute_data); + zend_free_compiled_variables(execute_data TSRMLS_CC); } else { zend_clean_and_cache_symbol_table(execute_data->symbol_table TSRMLS_CC); } @@ -226,6 +226,16 @@ static zend_object_value zend_generator_create(zend_class_entry *class_type TSRM } /* }}} */ +static void copy_closure_static_var(zval **var TSRMLS_DC, int num_args, va_list args, zend_hash_key *key) /* {{{ */ +{ + HashTable *target = va_arg(args, HashTable *); + + SEPARATE_ZVAL_TO_MAKE_IS_REF(var); + Z_ADDREF_PP(var); + zend_hash_quick_update(target, key->arKey, key->nKeyLength, key->h, var, sizeof(zval *), NULL); +} +/* }}} */ + /* Requires globals EG(scope), EG(current_scope), EG(This), * EG(active_symbol_table) and EG(current_execute_data). */ ZEND_API zval *zend_generator_create_zval(zend_op_array *op_array TSRMLS_DC) /* {{{ */ @@ -242,7 +252,23 @@ ZEND_API zval *zend_generator_create_zval(zend_op_array *op_array TSRMLS_DC) /* if (op_array->fn_flags & ZEND_ACC_CLOSURE) { zend_op_array *op_array_copy = (zend_op_array*)emalloc(sizeof(zend_op_array)); *op_array_copy = *op_array; - function_add_ref((zend_function *) op_array_copy); + + (*op_array->refcount)++; + op_array->run_time_cache = NULL; + if (op_array->static_variables) { + ALLOC_HASHTABLE(op_array_copy->static_variables); + zend_hash_init( + op_array_copy->static_variables, + zend_hash_num_elements(op_array->static_variables), + NULL, ZVAL_PTR_DTOR, 0 + ); + zend_hash_apply_with_arguments( + op_array->static_variables TSRMLS_CC, + (apply_func_args_t) copy_closure_static_var, + 1, op_array_copy->static_variables + ); + } + op_array = op_array_copy; } @@ -430,7 +456,7 @@ ZEND_METHOD(Generator, current) zend_generator_ensure_initialized(generator TSRMLS_CC); if (generator->value) { - RETURN_ZVAL(generator->value, 1, 0); + RETURN_ZVAL_FAST(generator->value); } } /* }}} */ @@ -450,7 +476,7 @@ ZEND_METHOD(Generator, key) zend_generator_ensure_initialized(generator TSRMLS_CC); if (generator->key) { - RETURN_ZVAL(generator->key, 1, 0); + RETURN_ZVAL_FAST(generator->key); } } /* }}} */ @@ -499,7 +525,7 @@ ZEND_METHOD(Generator, send) zend_generator_resume(generator TSRMLS_CC); if (generator->value) { - RETURN_ZVAL(generator->value, 1, 0); + RETURN_ZVAL_FAST(generator->value); } } /* }}} */ @@ -532,7 +558,7 @@ ZEND_METHOD(Generator, throw) zend_generator_resume(generator TSRMLS_CC); if (generator->value) { - RETURN_ZVAL(generator->value, 1, 0); + RETURN_ZVAL_FAST(generator->value); } } else { /* If the generator is already closed throw the exception in the diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index 6a9a24a87ea72..f76b77b555274 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -212,6 +212,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*); %token T_NS_C "__NAMESPACE__ (T_NS_C)" %token T_DIR "__DIR__ (T_DIR)" %token T_NS_SEPARATOR "\\ (T_NS_SEPARATOR)" +%token T_ELLIPSIS "... (T_ELLIPSIS)" %% /* Rules */ @@ -270,7 +271,7 @@ inner_statement: statement | function_declaration_statement | class_declaration_statement - | T_HALT_COMPILER '(' ')' ';' { zend_error(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used from the outermost scope"); } + | T_HALT_COMPILER '(' ')' ';' { zend_error_noreturn(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used from the outermost scope"); } ; @@ -371,10 +372,14 @@ class_declaration_statement: ; is_reference: - /* empty */ { $$.op_type = ZEND_RETURN_VAL; } - | '&' { $$.op_type = ZEND_RETURN_REF; } + /* empty */ { $$.op_type = 0; } + | '&' { $$.op_type = 1; } ; +is_variadic: + /* empty */ { $$.op_type = 0; } + | T_ELLIPSIS { $$.op_type = 1; } +; unticked_function_declaration_statement: function is_reference T_STRING { zend_do_begin_function_declaration(&$1, &$3, 0, $2.op_type, NULL TSRMLS_CC); } @@ -523,14 +528,15 @@ parameter_list: non_empty_parameter_list: - optional_class_type T_VARIABLE { $$.op_type = IS_UNUSED; $$.u.op.num=1; zend_do_receive_arg(ZEND_RECV, &$2, &$$, NULL, &$1, 0 TSRMLS_CC); } - | optional_class_type '&' T_VARIABLE { $$.op_type = IS_UNUSED; $$.u.op.num=1; zend_do_receive_arg(ZEND_RECV, &$3, &$$, NULL, &$1, 1 TSRMLS_CC); } - | optional_class_type '&' T_VARIABLE '=' static_scalar { $$.op_type = IS_UNUSED; $$.u.op.num=1; zend_do_receive_arg(ZEND_RECV_INIT, &$3, &$$, &$5, &$1, 1 TSRMLS_CC); } - | optional_class_type T_VARIABLE '=' static_scalar { $$.op_type = IS_UNUSED; $$.u.op.num=1; zend_do_receive_arg(ZEND_RECV_INIT, &$2, &$$, &$4, &$1, 0 TSRMLS_CC); } - | non_empty_parameter_list ',' optional_class_type T_VARIABLE { $$=$1; $$.u.op.num++; zend_do_receive_arg(ZEND_RECV, &$4, &$$, NULL, &$3, 0 TSRMLS_CC); } - | non_empty_parameter_list ',' optional_class_type '&' T_VARIABLE { $$=$1; $$.u.op.num++; zend_do_receive_arg(ZEND_RECV, &$5, &$$, NULL, &$3, 1 TSRMLS_CC); } - | non_empty_parameter_list ',' optional_class_type '&' T_VARIABLE '=' static_scalar { $$=$1; $$.u.op.num++; zend_do_receive_arg(ZEND_RECV_INIT, &$5, &$$, &$7, &$3, 1 TSRMLS_CC); } - | non_empty_parameter_list ',' optional_class_type T_VARIABLE '=' static_scalar { $$=$1; $$.u.op.num++; zend_do_receive_arg(ZEND_RECV_INIT, &$4, &$$, &$6, &$3, 0 TSRMLS_CC); } + parameter + | non_empty_parameter_list ',' parameter +; + +parameter: + optional_class_type is_reference is_variadic T_VARIABLE + { zend_do_receive_param(ZEND_RECV, &$4, NULL, &$1, $2.op_type, $3.op_type TSRMLS_CC); } + | optional_class_type is_reference is_variadic T_VARIABLE '=' static_scalar + { zend_do_receive_param(ZEND_RECV_INIT, &$4, &$6, &$1, $2.op_type, $3.op_type TSRMLS_CC); } ; @@ -629,8 +635,8 @@ trait_precedence: ; trait_reference_list: - fully_qualified_class_name { zend_resolve_class_name(&$1, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC); zend_init_list(&$$.u.op.ptr, Z_STRVAL($1.u.constant) TSRMLS_CC); } - | trait_reference_list ',' fully_qualified_class_name { zend_resolve_class_name(&$3, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC); zend_add_to_list(&$1.u.op.ptr, Z_STRVAL($3.u.constant) TSRMLS_CC); $$ = $1; } + fully_qualified_class_name { zend_resolve_class_name(&$1 TSRMLS_CC); zend_init_list(&$$.u.op.ptr, Z_STRVAL($1.u.constant) TSRMLS_CC); } + | trait_reference_list ',' fully_qualified_class_name { zend_resolve_class_name(&$3 TSRMLS_CC); zend_add_to_list(&$1.u.op.ptr, Z_STRVAL($3.u.constant) TSRMLS_CC); $$ = $1; } ; trait_method_reference: @@ -1196,7 +1202,7 @@ isset_variables: isset_variable: variable { zend_do_isset_or_isempty(ZEND_ISSET, &$$, &$1 TSRMLS_CC); } - | expr_without_variable { zend_error(E_COMPILE_ERROR, "Cannot use isset() on the result of an expression (you can use \"null !== expression\" instead)"); } + | expr_without_variable { zend_error_noreturn(E_COMPILE_ERROR, "Cannot use isset() on the result of an expression (you can use \"null !== expression\" instead)"); } ; class_constant: diff --git a/Zend/zend_language_scanner.c b/Zend/zend_language_scanner.c index deb799ab763b2..12ee1f59c2da0 100644 --- a/Zend/zend_language_scanner.c +++ b/Zend/zend_language_scanner.c @@ -564,10 +564,8 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR zend_bool original_in_compilation = CG(in_compilation); retval_znode.op_type = IS_CONST; - retval_znode.u.constant.type = IS_LONG; - retval_znode.u.constant.value.lval = 1; - Z_UNSET_ISREF(retval_znode.u.constant); - Z_SET_REFCOUNT(retval_znode.u.constant, 1); + INIT_PZVAL(&retval_znode.u.constant); + ZVAL_LONG(&retval_znode.u.constant, 1); zend_save_lexical_state(&original_lex_state TSRMLS_CC); @@ -624,7 +622,7 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC) convert_to_string(&tmp); filename = &tmp; } - file_handle.filename = filename->value.str.val; + file_handle.filename = Z_STRVAL_P(filename); file_handle.free_filename = 0; file_handle.type = ZEND_HANDLE_FILENAME; file_handle.opened_path = NULL; @@ -635,7 +633,7 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC) int dummy = 1; if (!file_handle.opened_path) { - file_handle.opened_path = opened_path = estrndup(filename->value.str.val, filename->value.str.len); + file_handle.opened_path = opened_path = estrndup(Z_STRVAL_P(filename), Z_STRLEN_P(filename)); } zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL); @@ -657,22 +655,15 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D char *buf; size_t size; - /* enforce two trailing NULLs for flex... */ - if (IS_INTERNED(str->value.str.val)) { - char *tmp = safe_emalloc(1, str->value.str.len, ZEND_MMAP_AHEAD); - memcpy(tmp, str->value.str.val, str->value.str.len + ZEND_MMAP_AHEAD); - str->value.str.val = tmp; - } else { - str->value.str.val = safe_erealloc(str->value.str.val, 1, str->value.str.len, ZEND_MMAP_AHEAD); - } - - memset(str->value.str.val + str->value.str.len, 0, ZEND_MMAP_AHEAD); + /* enforce ZEND_MMAP_AHEAD trailing NULLs for flex... */ + Z_STRVAL_P(str) = str_erealloc(Z_STRVAL_P(str), Z_STRLEN_P(str) + ZEND_MMAP_AHEAD); + memset(Z_STRVAL_P(str) + Z_STRLEN_P(str), 0, ZEND_MMAP_AHEAD); SCNG(yy_in) = NULL; SCNG(yy_start) = NULL; - buf = str->value.str.val; - size = str->value.str.len; + buf = Z_STRVAL_P(str); + size = Z_STRLEN_P(str); if (CG(multibyte)) { SCNG(script_org) = (unsigned char*)buf; @@ -733,7 +724,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC) int compiler_result; zend_bool original_in_compilation = CG(in_compilation); - if (source_string->value.str.len==0) { + if (Z_STRLEN_P(source_string)==0) { efree(op_array); return NULL; } @@ -871,11 +862,11 @@ ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter # define zend_copy_value(zendlval, yytext, yyleng) \ if (SCNG(output_filter)) { \ size_t sz = 0; \ - SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); \ - zendlval->value.str.len = sz; \ + SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); \ + Z_STRLEN_P(zendlval) = sz; \ } else { \ - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); \ - zendlval->value.str.len = yyleng; \ + Z_STRVAL_P(zendlval) = (char *) estrndup(yytext, yyleng); \ + Z_STRLEN_P(zendlval) = yyleng; \ } static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quote_type TSRMLS_DC) @@ -886,8 +877,8 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo ZVAL_STRINGL(zendlval, str, len, 1); /* convert escape sequences */ - s = t = zendlval->value.str.val; - end = s+zendlval->value.str.len; + s = t = Z_STRVAL_P(zendlval); + end = s+Z_STRLEN_P(zendlval); while (svalue.str.len--; + Z_STRLEN_P(zendlval)--; break; case 'r': *t++ = '\r'; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 't': *t++ = '\t'; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 'f': *t++ = '\f'; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 'v': *t++ = '\v'; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 'e': #ifdef PHP_WIN32 @@ -923,7 +914,7 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo #else *t++ = '\e'; #endif - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case '"': case '`': @@ -935,20 +926,20 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo case '\\': case '$': *t++ = *s; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 'x': case 'X': if (ZEND_IS_HEX(*(s+1))) { char hex_buf[3] = { 0, 0, 0 }; - zendlval->value.str.len--; /* for the 'x' */ + Z_STRLEN_P(zendlval)--; /* for the 'x' */ hex_buf[0] = *(++s); - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; if (ZEND_IS_HEX(*(s+1))) { hex_buf[1] = *(++s); - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; } *t++ = (char) strtol(hex_buf, NULL, 16); } else { @@ -962,13 +953,13 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo char octal_buf[4] = { 0, 0, 0, 0 }; octal_buf[0] = *s; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; if (ZEND_IS_OCT(*(s+1))) { octal_buf[1] = *(++s); - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; if (ZEND_IS_OCT(*(s+1))) { octal_buf[2] = *(++s); - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; } } *t++ = (char) strtol(octal_buf, NULL, 8); @@ -990,9 +981,9 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo *t = 0; if (SCNG(output_filter)) { size_t sz = 0; - s = zendlval->value.str.val; - SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)s, (size_t)zendlval->value.str.len TSRMLS_CC); - zendlval->value.str.len = sz; + s = Z_STRVAL_P(zendlval); + SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC); + Z_STRLEN_P(zendlval) = sz; efree(s); } } @@ -1006,7 +997,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yymore_restart: -#line 1010 "Zend/zend_language_scanner.c" +#line 1001 "Zend/zend_language_scanner.c" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -1105,7 +1096,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy3: YYDEBUG(3, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1807 "Zend/zend_language_scanner.l" +#line 1741 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -1152,20 +1143,20 @@ int lex_scan(zval *zendlval TSRMLS_DC) if (SCNG(output_filter)) { int readsize; size_t sz = 0; - readsize = SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); - zendlval->value.str.len = sz; + readsize = SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); + Z_STRLEN_P(zendlval) = sz; if (readsize < yyleng) { yyless(readsize); } } else { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; + Z_STRVAL_P(zendlval) = (char *) estrndup(yytext, yyleng); + Z_STRLEN_P(zendlval) = yyleng; } zendlval->type = IS_STRING; HANDLE_NEWLINES(yytext, yyleng); return T_INLINE_HTML; } -#line 1169 "Zend/zend_language_scanner.c" +#line 1160 "Zend/zend_language_scanner.c" yy4: YYDEBUG(4, *YYCURSOR); yych = *++YYCURSOR; @@ -1183,38 +1174,34 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy6: YYDEBUG(6, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1795 "Zend/zend_language_scanner.l" +#line 1731 "Zend/zend_language_scanner.l" { if (CG(short_tags)) { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } else { goto inline_char_handler; } } -#line 1199 "Zend/zend_language_scanner.c" +#line 1188 "Zend/zend_language_scanner.c" yy7: YYDEBUG(7, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) == '=') goto yy43; YYDEBUG(8, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1772 "Zend/zend_language_scanner.l" +#line 1712 "Zend/zend_language_scanner.l" { if (CG(asp_tags)) { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } else { goto inline_char_handler; } } -#line 1218 "Zend/zend_language_scanner.c" +#line 1205 "Zend/zend_language_scanner.c" yy9: YYDEBUG(9, *YYCURSOR); yych = *++YYCURSOR; @@ -1400,7 +1387,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(38, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1732 "Zend/zend_language_scanner.l" +#line 1678 "Zend/zend_language_scanner.l" { YYCTYPE *bracket = (YYCTYPE*)zend_memrchr(yytext, '<', yyleng - (sizeof("script language=php>") - 1)); @@ -1411,13 +1398,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } HANDLE_NEWLINES(yytext, yyleng); - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } -#line 1421 "Zend/zend_language_scanner.c" +#line 1406 "Zend/zend_language_scanner.c" yy39: YYDEBUG(39, *YYCURSOR); yych = *++YYCURSOR; @@ -1444,33 +1429,29 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(44, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1750 "Zend/zend_language_scanner.l" +#line 1694 "Zend/zend_language_scanner.l" { if (CG(asp_tags)) { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG_WITH_ECHO; } else { goto inline_char_handler; } } -#line 1460 "Zend/zend_language_scanner.c" +#line 1443 "Zend/zend_language_scanner.c" yy45: YYDEBUG(45, *YYCURSOR); ++YYCURSOR; YYDEBUG(46, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1763 "Zend/zend_language_scanner.l" +#line 1705 "Zend/zend_language_scanner.l" { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG_WITH_ECHO; } -#line 1474 "Zend/zend_language_scanner.c" +#line 1455 "Zend/zend_language_scanner.c" yy47: YYDEBUG(47, *YYCURSOR); yych = *++YYCURSOR; @@ -1497,16 +1478,14 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy51: YYDEBUG(51, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1785 "Zend/zend_language_scanner.l" +#line 1723 "Zend/zend_language_scanner.l" { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ HANDLE_NEWLINE(yytext[yyleng-1]); BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } -#line 1510 "Zend/zend_language_scanner.c" +#line 1489 "Zend/zend_language_scanner.c" yy52: YYDEBUG(52, *YYCURSOR); ++YYCURSOR; @@ -1577,7 +1556,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy56: YYDEBUG(56, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2258 "Zend/zend_language_scanner.l" +#line 2186 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -1618,7 +1597,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zend_scan_escape_string(zendlval, yytext, yyleng, '`' TSRMLS_CC); return T_ENCAPSED_AND_WHITESPACE; } -#line 1622 "Zend/zend_language_scanner.c" +#line 1601 "Zend/zend_language_scanner.c" yy57: YYDEBUG(57, *YYCURSOR); yych = *++YYCURSOR; @@ -1629,12 +1608,12 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(59, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2202 "Zend/zend_language_scanner.l" +#line 2130 "Zend/zend_language_scanner.l" { BEGIN(ST_IN_SCRIPTING); return '`'; } -#line 1638 "Zend/zend_language_scanner.c" +#line 1617 "Zend/zend_language_scanner.c" yy60: YYDEBUG(60, *YYCURSOR); yych = *++YYCURSOR; @@ -1644,14 +1623,14 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(62, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2189 "Zend/zend_language_scanner.l" +#line 2117 "Zend/zend_language_scanner.l" { - zendlval->value.lval = (long) '{'; + Z_LVAL_P(zendlval) = (long) '{'; yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); yyless(1); return T_CURLY_OPEN; } -#line 1655 "Zend/zend_language_scanner.c" +#line 1634 "Zend/zend_language_scanner.c" yy63: YYDEBUG(63, *YYCURSOR); yyaccept = 0; @@ -1667,24 +1646,24 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy65: YYDEBUG(65, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1889 "Zend/zend_language_scanner.l" +#line 1823 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1677 "Zend/zend_language_scanner.c" +#line 1656 "Zend/zend_language_scanner.c" yy66: YYDEBUG(66, *YYCURSOR); ++YYCURSOR; YYDEBUG(67, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1465 "Zend/zend_language_scanner.l" +#line 1457 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC); return T_DOLLAR_OPEN_CURLY_BRACES; } -#line 1688 "Zend/zend_language_scanner.c" +#line 1667 "Zend/zend_language_scanner.c" yy68: YYDEBUG(68, *YYCURSOR); yych = *++YYCURSOR; @@ -1698,7 +1677,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(71, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1881 "Zend/zend_language_scanner.l" +#line 1815 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); yy_push_state(ST_VAR_OFFSET TSRMLS_CC); @@ -1706,7 +1685,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1710 "Zend/zend_language_scanner.c" +#line 1689 "Zend/zend_language_scanner.c" yy72: YYDEBUG(72, *YYCURSOR); yych = *++YYCURSOR; @@ -1724,7 +1703,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(74, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1871 "Zend/zend_language_scanner.l" +#line 1805 "Zend/zend_language_scanner.l" { yyless(yyleng - 3); yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); @@ -1732,7 +1711,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1736 "Zend/zend_language_scanner.c" +#line 1715 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_DOUBLE_QUOTES: @@ -1800,7 +1779,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy78: YYDEBUG(78, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2208 "Zend/zend_language_scanner.l" +#line 2136 "Zend/zend_language_scanner.l" { if (GET_DOUBLE_QUOTES_SCANNED_LENGTH()) { YYCURSOR += GET_DOUBLE_QUOTES_SCANNED_LENGTH() - 1; @@ -1849,7 +1828,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zend_scan_escape_string(zendlval, yytext, yyleng, '"' TSRMLS_CC); return T_ENCAPSED_AND_WHITESPACE; } -#line 1853 "Zend/zend_language_scanner.c" +#line 1832 "Zend/zend_language_scanner.c" yy79: YYDEBUG(79, *YYCURSOR); yych = *++YYCURSOR; @@ -1860,12 +1839,12 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(81, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2197 "Zend/zend_language_scanner.l" +#line 2125 "Zend/zend_language_scanner.l" { BEGIN(ST_IN_SCRIPTING); return '"'; } -#line 1869 "Zend/zend_language_scanner.c" +#line 1848 "Zend/zend_language_scanner.c" yy82: YYDEBUG(82, *YYCURSOR); yych = *++YYCURSOR; @@ -1875,14 +1854,14 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(84, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2189 "Zend/zend_language_scanner.l" +#line 2117 "Zend/zend_language_scanner.l" { - zendlval->value.lval = (long) '{'; + Z_LVAL_P(zendlval) = (long) '{'; yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); yyless(1); return T_CURLY_OPEN; } -#line 1886 "Zend/zend_language_scanner.c" +#line 1865 "Zend/zend_language_scanner.c" yy85: YYDEBUG(85, *YYCURSOR); yyaccept = 0; @@ -1898,24 +1877,24 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy87: YYDEBUG(87, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1889 "Zend/zend_language_scanner.l" +#line 1823 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1908 "Zend/zend_language_scanner.c" +#line 1887 "Zend/zend_language_scanner.c" yy88: YYDEBUG(88, *YYCURSOR); ++YYCURSOR; YYDEBUG(89, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1465 "Zend/zend_language_scanner.l" +#line 1457 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC); return T_DOLLAR_OPEN_CURLY_BRACES; } -#line 1919 "Zend/zend_language_scanner.c" +#line 1898 "Zend/zend_language_scanner.c" yy90: YYDEBUG(90, *YYCURSOR); yych = *++YYCURSOR; @@ -1929,7 +1908,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(93, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1881 "Zend/zend_language_scanner.l" +#line 1815 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); yy_push_state(ST_VAR_OFFSET TSRMLS_CC); @@ -1937,7 +1916,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1941 "Zend/zend_language_scanner.c" +#line 1920 "Zend/zend_language_scanner.c" yy94: YYDEBUG(94, *YYCURSOR); yych = *++YYCURSOR; @@ -1955,7 +1934,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(96, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1871 "Zend/zend_language_scanner.l" +#line 1805 "Zend/zend_language_scanner.l" { yyless(yyleng - 3); yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); @@ -1963,7 +1942,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1967 "Zend/zend_language_scanner.c" +#line 1946 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_END_HEREDOC: @@ -1974,7 +1953,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(100, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2175 "Zend/zend_language_scanner.l" +#line 2103 "Zend/zend_language_scanner.l" { zend_heredoc_label *heredoc_label = zend_ptr_stack_pop(&SCNG(heredoc_label_stack)); @@ -1987,7 +1966,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) BEGIN(ST_IN_SCRIPTING); return T_END_HEREDOC; } -#line 1991 "Zend/zend_language_scanner.c" +#line 1970 "Zend/zend_language_scanner.c" /* *********************************** */ yyc_ST_HEREDOC: { @@ -2049,7 +2028,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy104: YYDEBUG(104, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2300 "Zend/zend_language_scanner.l" +#line 2228 "Zend/zend_language_scanner.l" { int newline = 0; @@ -2122,7 +2101,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zend_scan_escape_string(zendlval, yytext, yyleng - newline, 0 TSRMLS_CC); return T_ENCAPSED_AND_WHITESPACE; } -#line 2126 "Zend/zend_language_scanner.c" +#line 2105 "Zend/zend_language_scanner.c" yy105: YYDEBUG(105, *YYCURSOR); yych = *++YYCURSOR; @@ -2137,14 +2116,14 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(108, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2189 "Zend/zend_language_scanner.l" +#line 2117 "Zend/zend_language_scanner.l" { - zendlval->value.lval = (long) '{'; + Z_LVAL_P(zendlval) = (long) '{'; yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); yyless(1); return T_CURLY_OPEN; } -#line 2148 "Zend/zend_language_scanner.c" +#line 2127 "Zend/zend_language_scanner.c" yy109: YYDEBUG(109, *YYCURSOR); yyaccept = 0; @@ -2160,24 +2139,24 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy111: YYDEBUG(111, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1889 "Zend/zend_language_scanner.l" +#line 1823 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); zendlval->type = IS_STRING; return T_VARIABLE; } -#line 2170 "Zend/zend_language_scanner.c" +#line 2149 "Zend/zend_language_scanner.c" yy112: YYDEBUG(112, *YYCURSOR); ++YYCURSOR; YYDEBUG(113, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1465 "Zend/zend_language_scanner.l" +#line 1457 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC); return T_DOLLAR_OPEN_CURLY_BRACES; } -#line 2181 "Zend/zend_language_scanner.c" +#line 2160 "Zend/zend_language_scanner.c" yy114: YYDEBUG(114, *YYCURSOR); yych = *++YYCURSOR; @@ -2191,7 +2170,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(117, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1881 "Zend/zend_language_scanner.l" +#line 1815 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); yy_push_state(ST_VAR_OFFSET TSRMLS_CC); @@ -2199,7 +2178,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zendlval->type = IS_STRING; return T_VARIABLE; } -#line 2203 "Zend/zend_language_scanner.c" +#line 2182 "Zend/zend_language_scanner.c" yy118: YYDEBUG(118, *YYCURSOR); yych = *++YYCURSOR; @@ -2217,7 +2196,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(120, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1871 "Zend/zend_language_scanner.l" +#line 1805 "Zend/zend_language_scanner.l" { yyless(yyleng - 3); yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); @@ -2225,7 +2204,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zendlval->type = IS_STRING; return T_VARIABLE; } -#line 2229 "Zend/zend_language_scanner.c" +#line 2208 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_IN_SCRIPTING: @@ -2302,14 +2281,14 @@ int lex_scan(zval *zendlval TSRMLS_DC) case '\n': case '\r': case ' ': goto yy140; - case '!': goto yy153; + case '!': goto yy154; case '"': goto yy180; case '#': goto yy176; case '$': goto yy165; case '%': goto yy159; case '&': goto yy160; case '\'': goto yy178; - case '(': goto yy147; + case '(': goto yy148; case ')': case ',': case ';': @@ -2317,11 +2296,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) case '[': case ']': case '~': goto yy166; - case '*': goto yy156; - case '+': goto yy152; + case '*': goto yy157; + case '+': goto yy153; case '-': goto yy138; - case '.': goto yy158; - case '/': goto yy157; + case '.': goto yy145; + case '/': goto yy158; case '0': goto yy172; case '1': case '2': @@ -2333,9 +2312,9 @@ int lex_scan(zval *zendlval TSRMLS_DC) case '8': case '9': goto yy174; case ':': goto yy142; - case '<': goto yy154; - case '=': goto yy150; - case '>': goto yy155; + case '<': goto yy155; + case '=': goto yy151; + case '>': goto yy156; case '?': goto yy167; case 'A': case 'a': goto yy133; @@ -2354,9 +2333,9 @@ int lex_scan(zval *zendlval TSRMLS_DC) case 'I': case 'i': goto yy131; case 'L': - case 'l': goto yy151; + case 'l': goto yy152; case 'N': - case 'n': goto yy145; + case 'n': goto yy146; case 'O': case 'o': goto yy163; case 'P': @@ -2368,9 +2347,9 @@ int lex_scan(zval *zendlval TSRMLS_DC) case 'T': case 't': goto yy130; case 'U': - case 'u': goto yy148; + case 'u': goto yy149; case 'V': - case 'v': goto yy146; + case 'v': goto yy147; case 'W': case 'w': goto yy132; case 'X': @@ -2379,7 +2358,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) case 'y': goto yy129; case '\\': goto yy143; case '^': goto yy162; - case '_': goto yy149; + case '_': goto yy150; case '`': goto yy182; case '{': goto yy168; case '|': goto yy161; @@ -2392,48 +2371,48 @@ int lex_scan(zval *zendlval TSRMLS_DC) YYDEBUG(-1, yych); switch ((yych = *YYCURSOR)) { case 'C': - case 'c': goto yy735; + case 'c': goto yy738; case 'L': - case 'l': goto yy736; + case 'l': goto yy739; case 'M': - case 'm': goto yy737; + case 'm': goto yy740; case 'N': - case 'n': goto yy738; + case 'n': goto yy741; case 'V': - case 'v': goto yy739; + case 'v': goto yy742; case 'X': - case 'x': goto yy740; + case 'x': goto yy743; default: goto yy187; } yy124: YYDEBUG(124, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1912 "Zend/zend_language_scanner.l" +#line 1846 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, yytext, yyleng); zendlval->type = IS_STRING; return T_STRING; } -#line 2418 "Zend/zend_language_scanner.c" +#line 2397 "Zend/zend_language_scanner.c" yy125: YYDEBUG(125, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { if (yych <= 'H') { - if (yych == 'E') goto yy717; + if (yych == 'E') goto yy720; goto yy187; } else { - if (yych <= 'I') goto yy718; + if (yych <= 'I') goto yy721; if (yych <= 'N') goto yy187; - goto yy719; + goto yy722; } } else { if (yych <= 'h') { - if (yych == 'e') goto yy717; + if (yych == 'e') goto yy720; goto yy187; } else { - if (yych <= 'i') goto yy718; - if (yych == 'o') goto yy719; + if (yych <= 'i') goto yy721; + if (yych == 'o') goto yy722; goto yy187; } } @@ -2442,20 +2421,20 @@ int lex_scan(zval *zendlval TSRMLS_DC) yych = *++YYCURSOR; if (yych <= 'U') { if (yych <= 'N') { - if (yych == 'I') goto yy693; + if (yych == 'I') goto yy696; goto yy187; } else { - if (yych <= 'O') goto yy694; + if (yych <= 'O') goto yy697; if (yych <= 'T') goto yy187; - goto yy695; + goto yy698; } } else { if (yych <= 'n') { - if (yych == 'i') goto yy693; + if (yych == 'i') goto yy696; goto yy187; } else { - if (yych <= 'o') goto yy694; - if (yych == 'u') goto yy695; + if (yych <= 'o') goto yy697; + if (yych == 'u') goto yy698; goto yy187; } } @@ -2464,48 +2443,48 @@ int lex_scan(zval *zendlval TSRMLS_DC) yych = *++YYCURSOR; if (yych <= 'O') { if (yych <= 'K') { - if (yych == 'A') goto yy658; + if (yych == 'A') goto yy661; goto yy187; } else { - if (yych <= 'L') goto yy659; + if (yych <= 'L') goto yy662; if (yych <= 'N') goto yy187; - goto yy660; + goto yy663; } } else { if (yych <= 'k') { - if (yych == 'a') goto yy658; + if (yych == 'a') goto yy661; goto yy187; } else { - if (yych <= 'l') goto yy659; - if (yych == 'o') goto yy660; + if (yych <= 'l') goto yy662; + if (yych == 'o') goto yy663; goto yy187; } } yy128: YYDEBUG(128, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy640; - if (yych == 'e') goto yy640; + if (yych == 'E') goto yy643; + if (yych == 'e') goto yy643; goto yy187; yy129: YYDEBUG(129, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy635; - if (yych == 'i') goto yy635; + if (yych == 'I') goto yy638; + if (yych == 'i') goto yy638; goto yy187; yy130: YYDEBUG(130, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'R') { - if (yych == 'H') goto yy623; + if (yych == 'H') goto yy626; if (yych <= 'Q') goto yy187; - goto yy624; + goto yy627; } else { if (yych <= 'h') { if (yych <= 'g') goto yy187; - goto yy623; + goto yy626; } else { - if (yych == 'r') goto yy624; + if (yych == 'r') goto yy627; goto yy187; } } @@ -2514,53 +2493,53 @@ int lex_scan(zval *zendlval TSRMLS_DC) yych = *++YYCURSOR; if (yych <= 'S') { if (yych <= 'L') { - if (yych == 'F') goto yy570; + if (yych == 'F') goto yy573; goto yy187; } else { - if (yych <= 'M') goto yy572; - if (yych <= 'N') goto yy573; + if (yych <= 'M') goto yy575; + if (yych <= 'N') goto yy576; if (yych <= 'R') goto yy187; - goto yy574; + goto yy577; } } else { if (yych <= 'm') { - if (yych == 'f') goto yy570; + if (yych == 'f') goto yy573; if (yych <= 'l') goto yy187; - goto yy572; + goto yy575; } else { - if (yych <= 'n') goto yy573; - if (yych == 's') goto yy574; + if (yych <= 'n') goto yy576; + if (yych == 's') goto yy577; goto yy187; } } yy132: YYDEBUG(132, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy565; - if (yych == 'h') goto yy565; + if (yych == 'H') goto yy568; + if (yych == 'h') goto yy568; goto yy187; yy133: YYDEBUG(133, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'S') { if (yych <= 'M') { - if (yych == 'B') goto yy547; + if (yych == 'B') goto yy550; goto yy187; } else { - if (yych <= 'N') goto yy548; + if (yych <= 'N') goto yy551; if (yych <= 'Q') goto yy187; - if (yych <= 'R') goto yy549; - goto yy550; + if (yych <= 'R') goto yy552; + goto yy553; } } else { if (yych <= 'n') { - if (yych == 'b') goto yy547; + if (yych == 'b') goto yy550; if (yych <= 'm') goto yy187; - goto yy548; + goto yy551; } else { if (yych <= 'q') goto yy187; - if (yych <= 'r') goto yy549; - if (yych <= 's') goto yy550; + if (yych <= 'r') goto yy552; + if (yych <= 's') goto yy553; goto yy187; } } @@ -2568,15 +2547,15 @@ int lex_scan(zval *zendlval TSRMLS_DC) YYDEBUG(134, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'W') { - if (yych == 'T') goto yy535; + if (yych == 'T') goto yy538; if (yych <= 'V') goto yy187; - goto yy536; + goto yy539; } else { if (yych <= 't') { if (yych <= 's') goto yy187; - goto yy535; + goto yy538; } else { - if (yych == 'w') goto yy536; + if (yych == 'w') goto yy539; goto yy187; } } @@ -2587,18 +2566,18 @@ int lex_scan(zval *zendlval TSRMLS_DC) if (yych <= ';') { if (yych <= '"') { if (yych <= '!') goto yy187; - goto yy527; + goto yy530; } else { - if (yych == '\'') goto yy528; + if (yych == '\'') goto yy531; goto yy187; } } else { if (yych <= 'R') { - if (yych <= '<') goto yy526; + if (yych <= '<') goto yy529; if (yych <= 'Q') goto yy187; - goto yy529; + goto yy532; } else { - if (yych == 'r') goto yy529; + if (yych == 'r') goto yy532; goto yy187; } } @@ -2606,15 +2585,15 @@ int lex_scan(zval *zendlval TSRMLS_DC) YYDEBUG(136, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { - if (yych == 'L') goto yy516; + if (yych == 'L') goto yy519; if (yych <= 'N') goto yy187; - goto yy517; + goto yy520; } else { if (yych <= 'l') { if (yych <= 'k') goto yy187; - goto yy516; + goto yy519; } else { - if (yych == 'o') goto yy517; + if (yych == 'o') goto yy520; goto yy187; } } @@ -2622,15 +2601,15 @@ int lex_scan(zval *zendlval TSRMLS_DC) YYDEBUG(137, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { - if (yych == 'R') goto yy492; + if (yych == 'R') goto yy495; if (yych <= 'T') goto yy187; - goto yy493; + goto yy496; } else { if (yych <= 'r') { if (yych <= 'q') goto yy187; - goto yy492; + goto yy495; } else { - if (yych == 'u') goto yy493; + if (yych == 'u') goto yy496; goto yy187; } } @@ -2638,214 +2617,217 @@ int lex_scan(zval *zendlval TSRMLS_DC) YYDEBUG(138, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '<') { - if (yych == '-') goto yy488; + if (yych == '-') goto yy491; } else { - if (yych <= '=') goto yy486; - if (yych <= '>') goto yy490; + if (yych <= '=') goto yy489; + if (yych <= '>') goto yy493; } yy139: YYDEBUG(139, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1454 "Zend/zend_language_scanner.l" +#line 1446 "Zend/zend_language_scanner.l" { return yytext[0]; } -#line 2654 "Zend/zend_language_scanner.c" +#line 2633 "Zend/zend_language_scanner.c" yy140: YYDEBUG(140, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy485; + goto yy488; yy141: YYDEBUG(141, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1185 "Zend/zend_language_scanner.l" +#line 1175 "Zend/zend_language_scanner.l" { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ HANDLE_NEWLINES(yytext, yyleng); return T_WHITESPACE; } -#line 2671 "Zend/zend_language_scanner.c" +#line 2648 "Zend/zend_language_scanner.c" yy142: YYDEBUG(142, *YYCURSOR); yych = *++YYCURSOR; - if (yych == ':') goto yy482; + if (yych == ':') goto yy485; goto yy139; yy143: YYDEBUG(143, *YYCURSOR); ++YYCURSOR; YYDEBUG(144, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1214 "Zend/zend_language_scanner.l" +#line 1202 "Zend/zend_language_scanner.l" { return T_NS_SEPARATOR; } -#line 2686 "Zend/zend_language_scanner.c" +#line 2663 "Zend/zend_language_scanner.c" yy145: YYDEBUG(145, *YYCURSOR); + yyaccept = 1; + yych = *(YYMARKER = ++YYCURSOR); + if (yych <= '/') { + if (yych == '.') goto yy482; + goto yy139; + } else { + if (yych <= '9') goto yy478; + if (yych == '=') goto yy480; + goto yy139; + } +yy146: + YYDEBUG(146, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { - if (yych == 'A') goto yy470; + if (yych == 'A') goto yy466; if (yych <= 'D') goto yy187; - goto yy471; + goto yy467; } else { if (yych <= 'a') { if (yych <= '`') goto yy187; - goto yy470; + goto yy466; } else { - if (yych == 'e') goto yy471; + if (yych == 'e') goto yy467; goto yy187; } } -yy146: - YYDEBUG(146, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy467; - if (yych == 'a') goto yy467; - goto yy187; yy147: YYDEBUG(147, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'A') goto yy463; + if (yych == 'a') goto yy463; + goto yy187; +yy148: + YYDEBUG(148, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { if (yych <= 'D') { if (yych <= ' ') { - if (yych == '\t') goto yy392; + if (yych == '\t') goto yy388; if (yych <= 0x1F) goto yy139; - goto yy392; + goto yy388; } else { if (yych <= '@') goto yy139; if (yych == 'C') goto yy139; - goto yy392; + goto yy388; } } else { if (yych <= 'I') { - if (yych == 'F') goto yy392; + if (yych == 'F') goto yy388; if (yych <= 'H') goto yy139; - goto yy392; + goto yy388; } else { - if (yych == 'O') goto yy392; + if (yych == 'O') goto yy388; if (yych <= 'Q') goto yy139; - goto yy392; + goto yy388; } } } else { if (yych <= 'f') { if (yych <= 'b') { - if (yych == 'U') goto yy392; + if (yych == 'U') goto yy388; if (yych <= '`') goto yy139; - goto yy392; + goto yy388; } else { - if (yych == 'd') goto yy392; + if (yych == 'd') goto yy388; if (yych <= 'e') goto yy139; - goto yy392; + goto yy388; } } else { if (yych <= 'o') { - if (yych == 'i') goto yy392; + if (yych == 'i') goto yy388; if (yych <= 'n') goto yy139; - goto yy392; + goto yy388; } else { if (yych <= 's') { if (yych <= 'q') goto yy139; - goto yy392; + goto yy388; } else { - if (yych == 'u') goto yy392; + if (yych == 'u') goto yy388; goto yy139; } } } } -yy148: - YYDEBUG(148, *YYCURSOR); +yy149: + YYDEBUG(149, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'S') { - if (yych == 'N') goto yy383; + if (yych == 'N') goto yy379; if (yych <= 'R') goto yy187; - goto yy384; + goto yy380; } else { if (yych <= 'n') { if (yych <= 'm') goto yy187; - goto yy383; + goto yy379; } else { - if (yych == 's') goto yy384; + if (yych == 's') goto yy380; goto yy187; } } -yy149: - YYDEBUG(149, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '_') goto yy301; - goto yy187; yy150: YYDEBUG(150, *YYCURSOR); yych = *++YYCURSOR; - if (yych <= '<') goto yy139; - if (yych <= '=') goto yy295; - if (yych <= '>') goto yy297; - goto yy139; + if (yych == '_') goto yy297; + goto yy187; yy151: YYDEBUG(151, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy291; - if (yych == 'i') goto yy291; - goto yy187; + if (yych <= '<') goto yy139; + if (yych <= '=') goto yy291; + if (yych <= '>') goto yy293; + goto yy139; yy152: YYDEBUG(152, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '+') goto yy289; - if (yych == '=') goto yy287; - goto yy139; + if (yych == 'I') goto yy287; + if (yych == 'i') goto yy287; + goto yy187; yy153: YYDEBUG(153, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '=') goto yy284; + if (yych == '+') goto yy285; + if (yych == '=') goto yy283; goto yy139; yy154: YYDEBUG(154, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == '=') goto yy280; + goto yy139; +yy155: + YYDEBUG(155, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ';') { - if (yych == '/') goto yy256; + if (yych == '/') goto yy252; goto yy139; } else { - if (yych <= '<') goto yy254; - if (yych <= '=') goto yy257; - if (yych <= '>') goto yy259; + if (yych <= '<') goto yy250; + if (yych <= '=') goto yy253; + if (yych <= '>') goto yy255; goto yy139; } -yy155: - YYDEBUG(155, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '<') goto yy139; - if (yych <= '=') goto yy250; - if (yych <= '>') goto yy248; - goto yy139; yy156: YYDEBUG(156, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '=') goto yy246; + if (yych <= '<') goto yy139; + if (yych <= '=') goto yy246; + if (yych <= '>') goto yy244; goto yy139; yy157: YYDEBUG(157, *YYCURSOR); yych = *++YYCURSOR; + if (yych == '=') goto yy242; + goto yy139; +yy158: + YYDEBUG(158, *YYCURSOR); + yych = *++YYCURSOR; if (yych <= '.') { - if (yych == '*') goto yy238; + if (yych == '*') goto yy234; goto yy139; } else { - if (yych <= '/') goto yy240; - if (yych == '=') goto yy241; + if (yych <= '/') goto yy236; + if (yych == '=') goto yy237; goto yy139; } -yy158: - YYDEBUG(158, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy139; - if (yych <= '9') goto yy234; - if (yych == '=') goto yy236; - goto yy139; yy159: YYDEBUG(159, *YYCURSOR); yych = *++YYCURSOR; @@ -2910,18 +2892,18 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(169, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1459 "Zend/zend_language_scanner.l" +#line 1451 "Zend/zend_language_scanner.l" { yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); return '{'; } -#line 2919 "Zend/zend_language_scanner.c" +#line 2901 "Zend/zend_language_scanner.c" yy170: YYDEBUG(170, *YYCURSOR); ++YYCURSOR; YYDEBUG(171, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1471 "Zend/zend_language_scanner.l" +#line 1463 "Zend/zend_language_scanner.l" { RESET_DOC_COMMENT(); if (!zend_stack_is_empty(&SCNG(state_stack))) { @@ -2929,7 +2911,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) } return '}'; } -#line 2933 "Zend/zend_language_scanner.c" +#line 2915 "Zend/zend_language_scanner.c" yy172: YYDEBUG(172, *YYCURSOR); yyaccept = 2; @@ -2957,18 +2939,18 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy173: YYDEBUG(173, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1522 "Zend/zend_language_scanner.l" +#line 1513 "Zend/zend_language_scanner.l" { if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */ - zendlval->value.lval = strtol(yytext, NULL, 0); + Z_LVAL_P(zendlval) = strtol(yytext, NULL, 0); } else { errno = 0; - zendlval->value.lval = strtol(yytext, NULL, 0); + Z_LVAL_P(zendlval) = strtol(yytext, NULL, 0); if (errno == ERANGE) { /* Overflow */ if (yytext[0] == '0') { /* octal overflow */ - zendlval->value.dval = zend_oct_strtod(yytext, NULL); + Z_DVAL_P(zendlval) = zend_oct_strtod(yytext, NULL); } else { - zendlval->value.dval = zend_strtod(yytext, NULL); + Z_DVAL_P(zendlval) = zend_strtod(yytext, NULL); } zendlval->type = IS_DOUBLE; return T_DNUMBER; @@ -2978,7 +2960,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zendlval->type = IS_LONG; return T_LNUMBER; } -#line 2982 "Zend/zend_language_scanner.c" +#line 2964 "Zend/zend_language_scanner.c" yy174: YYDEBUG(174, *YYCURSOR); yyaccept = 2; @@ -3006,7 +2988,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy177: YYDEBUG(177, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1919 "Zend/zend_language_scanner.l" +#line 1853 "Zend/zend_language_scanner.l" { while (YYCURSOR < YYLIMIT) { switch (*YYCURSOR++) { @@ -3040,14 +3022,14 @@ int lex_scan(zval *zendlval TSRMLS_DC) return T_COMMENT; } -#line 3044 "Zend/zend_language_scanner.c" +#line 3026 "Zend/zend_language_scanner.c" yy178: YYDEBUG(178, *YYCURSOR); ++YYCURSOR; yy179: YYDEBUG(179, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2010 "Zend/zend_language_scanner.l" +#line 1940 "Zend/zend_language_scanner.l" { register char *s, *t; char *end; @@ -3073,13 +3055,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } } - zendlval->value.str.val = estrndup(yytext+bprefix+1, yyleng-bprefix-2); - zendlval->value.str.len = yyleng-bprefix-2; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext+bprefix+1, yyleng-bprefix-2, 1); /* convert escape sequences */ - s = t = zendlval->value.str.val; - end = s+zendlval->value.str.len; + s = t = Z_STRVAL_P(zendlval); + end = s+Z_STRLEN_P(zendlval); while (svalue.str.len--; + Z_STRLEN_P(zendlval)--; break; default: *t++ = '\\'; @@ -3108,21 +3088,21 @@ int lex_scan(zval *zendlval TSRMLS_DC) if (SCNG(output_filter)) { size_t sz = 0; - s = zendlval->value.str.val; - SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)s, (size_t)zendlval->value.str.len TSRMLS_CC); - zendlval->value.str.len = sz; + s = Z_STRVAL_P(zendlval); + SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC); + Z_STRLEN_P(zendlval) = sz; efree(s); } return T_CONSTANT_ENCAPSED_STRING; } -#line 3119 "Zend/zend_language_scanner.c" +#line 3099 "Zend/zend_language_scanner.c" yy180: YYDEBUG(180, *YYCURSOR); ++YYCURSOR; yy181: YYDEBUG(181, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2079 "Zend/zend_language_scanner.l" +#line 2007 "Zend/zend_language_scanner.l" { int bprefix = (yytext[0] != '"') ? 1 : 0; @@ -3163,24 +3143,24 @@ int lex_scan(zval *zendlval TSRMLS_DC) BEGIN(ST_DOUBLE_QUOTES); return '"'; } -#line 3167 "Zend/zend_language_scanner.c" +#line 3147 "Zend/zend_language_scanner.c" yy182: YYDEBUG(182, *YYCURSOR); ++YYCURSOR; YYDEBUG(183, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2169 "Zend/zend_language_scanner.l" +#line 2097 "Zend/zend_language_scanner.l" { BEGIN(ST_BACKQUOTE); return '`'; } -#line 3178 "Zend/zend_language_scanner.c" +#line 3158 "Zend/zend_language_scanner.c" yy184: YYDEBUG(184, *YYCURSOR); ++YYCURSOR; YYDEBUG(185, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2432 "Zend/zend_language_scanner.l" +#line 2360 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -3189,7 +3169,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE); goto restart; } -#line 3193 "Zend/zend_language_scanner.c" +#line 3173 "Zend/zend_language_scanner.c" yy186: YYDEBUG(186, *YYCURSOR); ++YYCURSOR; @@ -3216,13 +3196,12 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy190: YYDEBUG(190, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1587 "Zend/zend_language_scanner.l" +#line 1572 "Zend/zend_language_scanner.l" { - zendlval->value.dval = zend_strtod(yytext, NULL); - zendlval->type = IS_DOUBLE; + ZVAL_DOUBLE(zendlval, zend_strtod(yytext, NULL)); return T_DNUMBER; } -#line 3226 "Zend/zend_language_scanner.c" +#line 3205 "Zend/zend_language_scanner.c" yy191: YYDEBUG(191, *YYCURSOR); yyaccept = 2; @@ -3269,10 +3248,10 @@ int lex_scan(zval *zendlval TSRMLS_DC) if (yyaccept <= 3) { goto yy190; } else { - goto yy239; + goto yy235; } } else { - goto yy255; + goto yy251; } } yy195: @@ -3314,7 +3293,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(202, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1497 "Zend/zend_language_scanner.l" +#line 1489 "Zend/zend_language_scanner.l" { char *bin = yytext + 2; /* Skip "0b" */ int len = yyleng - 2; @@ -3327,19 +3306,18 @@ int lex_scan(zval *zendlval TSRMLS_DC) if (len < SIZEOF_LONG * 8) { if (len == 0) { - zendlval->value.lval = 0; + Z_LVAL_P(zendlval) = 0; } else { - zendlval->value.lval = strtol(bin, NULL, 2); + Z_LVAL_P(zendlval) = strtol(bin, NULL, 2); } zendlval->type = IS_LONG; return T_LNUMBER; } else { - zendlval->value.dval = zend_bin_strtod(bin, NULL); - zendlval->type = IS_DOUBLE; + ZVAL_DOUBLE(zendlval, zend_bin_strtod(bin, NULL)); return T_DNUMBER; } } -#line 3343 "Zend/zend_language_scanner.c" +#line 3321 "Zend/zend_language_scanner.c" yy203: YYDEBUG(203, *YYCURSOR); ++YYCURSOR; @@ -3351,7 +3329,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(205, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1543 "Zend/zend_language_scanner.l" +#line 1534 "Zend/zend_language_scanner.l" { char *hex = yytext + 2; /* Skip "0x" */ int len = yyleng - 2; @@ -3364,19 +3342,18 @@ int lex_scan(zval *zendlval TSRMLS_DC) if (len < SIZEOF_LONG * 2 || (len == SIZEOF_LONG * 2 && *hex <= '7')) { if (len == 0) { - zendlval->value.lval = 0; + Z_LVAL_P(zendlval) = 0; } else { - zendlval->value.lval = strtol(hex, NULL, 16); + Z_LVAL_P(zendlval) = strtol(hex, NULL, 16); } zendlval->type = IS_LONG; return T_LNUMBER; } else { - zendlval->value.dval = zend_hex_strtod(hex, NULL); - zendlval->type = IS_DOUBLE; + ZVAL_DOUBLE(zendlval, zend_hex_strtod(hex, NULL)); return T_DNUMBER; } } -#line 3380 "Zend/zend_language_scanner.c" +#line 3357 "Zend/zend_language_scanner.c" yy206: YYDEBUG(206, *YYCURSOR); ++YYCURSOR; @@ -3385,15 +3362,13 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy207: YYDEBUG(207, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1987 "Zend/zend_language_scanner.l" +#line 1921 "Zend/zend_language_scanner.l" { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(INITIAL); return T_CLOSE_TAG; /* implicit ';' at php-end tag */ } -#line 3397 "Zend/zend_language_scanner.c" +#line 3372 "Zend/zend_language_scanner.c" yy208: YYDEBUG(208, *YYCURSOR); yych = *++YYCURSOR; @@ -3427,13 +3402,13 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy212: YYDEBUG(212, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1889 "Zend/zend_language_scanner.l" +#line 1823 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); zendlval->type = IS_STRING; return T_VARIABLE; } -#line 3437 "Zend/zend_language_scanner.c" +#line 3412 "Zend/zend_language_scanner.c" yy213: YYDEBUG(213, *YYCURSOR); yych = *++YYCURSOR; @@ -3447,11 +3422,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(215, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1442 "Zend/zend_language_scanner.l" +#line 1434 "Zend/zend_language_scanner.l" { return T_LOGICAL_XOR; } -#line 3455 "Zend/zend_language_scanner.c" +#line 3430 "Zend/zend_language_scanner.c" yy216: YYDEBUG(216, *YYCURSOR); ++YYCURSOR; @@ -3460,61 +3435,61 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(217, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1434 "Zend/zend_language_scanner.l" +#line 1426 "Zend/zend_language_scanner.l" { return T_LOGICAL_OR; } -#line 3468 "Zend/zend_language_scanner.c" +#line 3443 "Zend/zend_language_scanner.c" yy218: YYDEBUG(218, *YYCURSOR); ++YYCURSOR; YYDEBUG(219, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1422 "Zend/zend_language_scanner.l" +#line 1414 "Zend/zend_language_scanner.l" { return T_XOR_EQUAL; } -#line 3478 "Zend/zend_language_scanner.c" +#line 3453 "Zend/zend_language_scanner.c" yy220: YYDEBUG(220, *YYCURSOR); ++YYCURSOR; YYDEBUG(221, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1426 "Zend/zend_language_scanner.l" +#line 1418 "Zend/zend_language_scanner.l" { return T_BOOLEAN_OR; } -#line 3488 "Zend/zend_language_scanner.c" +#line 3463 "Zend/zend_language_scanner.c" yy222: YYDEBUG(222, *YYCURSOR); ++YYCURSOR; YYDEBUG(223, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1418 "Zend/zend_language_scanner.l" +#line 1410 "Zend/zend_language_scanner.l" { return T_OR_EQUAL; } -#line 3498 "Zend/zend_language_scanner.c" +#line 3473 "Zend/zend_language_scanner.c" yy224: YYDEBUG(224, *YYCURSOR); ++YYCURSOR; YYDEBUG(225, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1430 "Zend/zend_language_scanner.l" +#line 1422 "Zend/zend_language_scanner.l" { return T_BOOLEAN_AND; } -#line 3508 "Zend/zend_language_scanner.c" +#line 3483 "Zend/zend_language_scanner.c" yy226: YYDEBUG(226, *YYCURSOR); ++YYCURSOR; YYDEBUG(227, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1414 "Zend/zend_language_scanner.l" +#line 1406 "Zend/zend_language_scanner.l" { return T_AND_EQUAL; } -#line 3518 "Zend/zend_language_scanner.c" +#line 3493 "Zend/zend_language_scanner.c" yy228: YYDEBUG(228, *YYCURSOR); ++YYCURSOR; @@ -3523,30 +3498,28 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy229: YYDEBUG(229, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1996 "Zend/zend_language_scanner.l" +#line 1928 "Zend/zend_language_scanner.l" { if (CG(asp_tags)) { BEGIN(INITIAL); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - zendlval->value.str.val = yytext; /* no copying - intentional */ + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ return T_CLOSE_TAG; /* implicit ';' at php-end tag */ } else { yyless(1); return yytext[0]; } } -#line 3540 "Zend/zend_language_scanner.c" +#line 3513 "Zend/zend_language_scanner.c" yy230: YYDEBUG(230, *YYCURSOR); ++YYCURSOR; YYDEBUG(231, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1402 "Zend/zend_language_scanner.l" +#line 1394 "Zend/zend_language_scanner.l" { return T_MOD_EQUAL; } -#line 3550 "Zend/zend_language_scanner.c" +#line 3523 "Zend/zend_language_scanner.c" yy232: YYDEBUG(232, *YYCURSOR); yych = *++YYCURSOR; @@ -3558,39 +3531,13 @@ int lex_scan(zval *zendlval TSRMLS_DC) goto yy229; yy234: YYDEBUG(234, *YYCURSOR); - yyaccept = 3; - YYMARKER = ++YYCURSOR; - YYFILL(3); - yych = *YYCURSOR; - YYDEBUG(235, *YYCURSOR); - if (yych <= 'D') { - if (yych <= '/') goto yy190; - if (yych <= '9') goto yy234; - goto yy190; - } else { - if (yych <= 'E') goto yy193; - if (yych == 'e') goto yy193; - goto yy190; - } -yy236: - YYDEBUG(236, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(237, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 1398 "Zend/zend_language_scanner.l" - { - return T_CONCAT_EQUAL; -} -#line 3585 "Zend/zend_language_scanner.c" -yy238: - YYDEBUG(238, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); - if (yych == '*') goto yy243; -yy239: - YYDEBUG(239, *YYCURSOR); + if (yych == '*') goto yy239; +yy235: + YYDEBUG(235, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1953 "Zend/zend_language_scanner.l" +#line 1887 "Zend/zend_language_scanner.l" { int doc_com; @@ -3624,281 +3571,281 @@ int lex_scan(zval *zendlval TSRMLS_DC) return T_COMMENT; } -#line 3628 "Zend/zend_language_scanner.c" -yy240: - YYDEBUG(240, *YYCURSOR); +#line 3575 "Zend/zend_language_scanner.c" +yy236: + YYDEBUG(236, *YYCURSOR); yych = *++YYCURSOR; goto yy177; -yy241: - YYDEBUG(241, *YYCURSOR); +yy237: + YYDEBUG(237, *YYCURSOR); ++YYCURSOR; - YYDEBUG(242, *YYCURSOR); + YYDEBUG(238, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1394 "Zend/zend_language_scanner.l" +#line 1386 "Zend/zend_language_scanner.l" { return T_DIV_EQUAL; } -#line 3642 "Zend/zend_language_scanner.c" -yy243: - YYDEBUG(243, *YYCURSOR); +#line 3589 "Zend/zend_language_scanner.c" +yy239: + YYDEBUG(239, *YYCURSOR); yych = *++YYCURSOR; if (yybm[0+yych] & 64) { - goto yy244; + goto yy240; } goto yy194; -yy244: - YYDEBUG(244, *YYCURSOR); +yy240: + YYDEBUG(240, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(245, *YYCURSOR); + YYDEBUG(241, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy244; + goto yy240; } - goto yy239; -yy246: - YYDEBUG(246, *YYCURSOR); + goto yy235; +yy242: + YYDEBUG(242, *YYCURSOR); ++YYCURSOR; - YYDEBUG(247, *YYCURSOR); + YYDEBUG(243, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1390 "Zend/zend_language_scanner.l" +#line 1382 "Zend/zend_language_scanner.l" { return T_MUL_EQUAL; } -#line 3669 "Zend/zend_language_scanner.c" -yy248: - YYDEBUG(248, *YYCURSOR); +#line 3616 "Zend/zend_language_scanner.c" +yy244: + YYDEBUG(244, *YYCURSOR); ++YYCURSOR; - if ((yych = *YYCURSOR) == '=') goto yy252; - YYDEBUG(249, *YYCURSOR); + if ((yych = *YYCURSOR) == '=') goto yy248; + YYDEBUG(245, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1450 "Zend/zend_language_scanner.l" +#line 1442 "Zend/zend_language_scanner.l" { return T_SR; } -#line 3680 "Zend/zend_language_scanner.c" -yy250: - YYDEBUG(250, *YYCURSOR); +#line 3627 "Zend/zend_language_scanner.c" +yy246: + YYDEBUG(246, *YYCURSOR); ++YYCURSOR; - YYDEBUG(251, *YYCURSOR); + YYDEBUG(247, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1378 "Zend/zend_language_scanner.l" +#line 1370 "Zend/zend_language_scanner.l" { return T_IS_GREATER_OR_EQUAL; } -#line 3690 "Zend/zend_language_scanner.c" -yy252: - YYDEBUG(252, *YYCURSOR); +#line 3637 "Zend/zend_language_scanner.c" +yy248: + YYDEBUG(248, *YYCURSOR); ++YYCURSOR; - YYDEBUG(253, *YYCURSOR); + YYDEBUG(249, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1410 "Zend/zend_language_scanner.l" +#line 1402 "Zend/zend_language_scanner.l" { return T_SR_EQUAL; } -#line 3700 "Zend/zend_language_scanner.c" -yy254: - YYDEBUG(254, *YYCURSOR); +#line 3647 "Zend/zend_language_scanner.c" +yy250: + YYDEBUG(250, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ';') goto yy255; - if (yych <= '<') goto yy270; - if (yych <= '=') goto yy268; -yy255: - YYDEBUG(255, *YYCURSOR); + if (yych <= ';') goto yy251; + if (yych <= '<') goto yy266; + if (yych <= '=') goto yy264; +yy251: + YYDEBUG(251, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1446 "Zend/zend_language_scanner.l" +#line 1438 "Zend/zend_language_scanner.l" { return T_SL; } -#line 3715 "Zend/zend_language_scanner.c" -yy256: - YYDEBUG(256, *YYCURSOR); +#line 3662 "Zend/zend_language_scanner.c" +yy252: + YYDEBUG(252, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy261; - if (yych == 's') goto yy261; + if (yych == 'S') goto yy257; + if (yych == 's') goto yy257; goto yy194; -yy257: - YYDEBUG(257, *YYCURSOR); +yy253: + YYDEBUG(253, *YYCURSOR); ++YYCURSOR; - YYDEBUG(258, *YYCURSOR); + YYDEBUG(254, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1374 "Zend/zend_language_scanner.l" +#line 1366 "Zend/zend_language_scanner.l" { return T_IS_SMALLER_OR_EQUAL; } -#line 3731 "Zend/zend_language_scanner.c" -yy259: - YYDEBUG(259, *YYCURSOR); +#line 3678 "Zend/zend_language_scanner.c" +yy255: + YYDEBUG(255, *YYCURSOR); ++YYCURSOR; -yy260: - YYDEBUG(260, *YYCURSOR); +yy256: + YYDEBUG(256, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1370 "Zend/zend_language_scanner.l" +#line 1362 "Zend/zend_language_scanner.l" { return T_IS_NOT_EQUAL; } -#line 3742 "Zend/zend_language_scanner.c" -yy261: - YYDEBUG(261, *YYCURSOR); +#line 3689 "Zend/zend_language_scanner.c" +yy257: + YYDEBUG(257, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy262; + if (yych == 'C') goto yy258; if (yych != 'c') goto yy194; -yy262: - YYDEBUG(262, *YYCURSOR); +yy258: + YYDEBUG(258, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy263; + if (yych == 'R') goto yy259; if (yych != 'r') goto yy194; -yy263: - YYDEBUG(263, *YYCURSOR); +yy259: + YYDEBUG(259, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy264; + if (yych == 'I') goto yy260; if (yych != 'i') goto yy194; -yy264: - YYDEBUG(264, *YYCURSOR); +yy260: + YYDEBUG(260, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy265; + if (yych == 'P') goto yy261; if (yych != 'p') goto yy194; -yy265: - YYDEBUG(265, *YYCURSOR); +yy261: + YYDEBUG(261, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy266; + if (yych == 'T') goto yy262; if (yych != 't') goto yy194; -yy266: - YYDEBUG(266, *YYCURSOR); +yy262: + YYDEBUG(262, *YYCURSOR); ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; - YYDEBUG(267, *YYCURSOR); + YYDEBUG(263, *YYCURSOR); if (yych <= '\r') { if (yych <= 0x08) goto yy194; - if (yych <= '\n') goto yy266; + if (yych <= '\n') goto yy262; if (yych <= '\f') goto yy194; - goto yy266; + goto yy262; } else { if (yych <= ' ') { if (yych <= 0x1F) goto yy194; - goto yy266; + goto yy262; } else { if (yych == '>') goto yy206; goto yy194; } } -yy268: - YYDEBUG(268, *YYCURSOR); +yy264: + YYDEBUG(264, *YYCURSOR); ++YYCURSOR; - YYDEBUG(269, *YYCURSOR); + YYDEBUG(265, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1406 "Zend/zend_language_scanner.l" +#line 1398 "Zend/zend_language_scanner.l" { return T_SL_EQUAL; } -#line 3797 "Zend/zend_language_scanner.c" -yy270: - YYDEBUG(270, *YYCURSOR); +#line 3744 "Zend/zend_language_scanner.c" +yy266: + YYDEBUG(266, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; - YYDEBUG(271, *YYCURSOR); + YYDEBUG(267, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy270; + goto yy266; } if (yych <= 'Z') { if (yych <= '&') { - if (yych == '"') goto yy275; + if (yych == '"') goto yy271; goto yy194; } else { - if (yych <= '\'') goto yy274; + if (yych <= '\'') goto yy270; if (yych <= '@') goto yy194; } } else { if (yych <= '`') { if (yych != '_') goto yy194; } else { - if (yych <= 'z') goto yy272; + if (yych <= 'z') goto yy268; if (yych <= '~') goto yy194; } } -yy272: - YYDEBUG(272, *YYCURSOR); +yy268: + YYDEBUG(268, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; - YYDEBUG(273, *YYCURSOR); + YYDEBUG(269, *YYCURSOR); if (yych <= '@') { if (yych <= '\f') { - if (yych == '\n') goto yy279; + if (yych == '\n') goto yy275; goto yy194; } else { - if (yych <= '\r') goto yy281; + if (yych <= '\r') goto yy277; if (yych <= '/') goto yy194; - if (yych <= '9') goto yy272; + if (yych <= '9') goto yy268; goto yy194; } } else { if (yych <= '_') { - if (yych <= 'Z') goto yy272; + if (yych <= 'Z') goto yy268; if (yych <= '^') goto yy194; - goto yy272; + goto yy268; } else { if (yych <= '`') goto yy194; - if (yych <= 'z') goto yy272; + if (yych <= 'z') goto yy268; if (yych <= '~') goto yy194; - goto yy272; + goto yy268; } } -yy274: - YYDEBUG(274, *YYCURSOR); +yy270: + YYDEBUG(270, *YYCURSOR); yych = *++YYCURSOR; if (yych == '\'') goto yy194; - if (yych <= '/') goto yy283; + if (yych <= '/') goto yy279; if (yych <= '9') goto yy194; - goto yy283; -yy275: - YYDEBUG(275, *YYCURSOR); + goto yy279; +yy271: + YYDEBUG(271, *YYCURSOR); yych = *++YYCURSOR; if (yych == '"') goto yy194; - if (yych <= '/') goto yy277; + if (yych <= '/') goto yy273; if (yych <= '9') goto yy194; - goto yy277; -yy276: - YYDEBUG(276, *YYCURSOR); + goto yy273; +yy272: + YYDEBUG(272, *YYCURSOR); ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; -yy277: - YYDEBUG(277, *YYCURSOR); +yy273: + YYDEBUG(273, *YYCURSOR); if (yych <= 'Z') { if (yych <= '/') { if (yych != '"') goto yy194; } else { - if (yych <= '9') goto yy276; + if (yych <= '9') goto yy272; if (yych <= '@') goto yy194; - goto yy276; + goto yy272; } } else { if (yych <= '`') { - if (yych == '_') goto yy276; + if (yych == '_') goto yy272; goto yy194; } else { - if (yych <= 'z') goto yy276; + if (yych <= 'z') goto yy272; if (yych <= '~') goto yy194; - goto yy276; + goto yy272; } } -yy278: - YYDEBUG(278, *YYCURSOR); +yy274: + YYDEBUG(274, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy279; - if (yych == '\r') goto yy281; + if (yych == '\n') goto yy275; + if (yych == '\r') goto yy277; goto yy194; -yy279: - YYDEBUG(279, *YYCURSOR); +yy275: + YYDEBUG(275, *YYCURSOR); ++YYCURSOR; -yy280: - YYDEBUG(280, *YYCURSOR); +yy276: + YYDEBUG(276, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2121 "Zend/zend_language_scanner.l" +#line 2049 "Zend/zend_language_scanner.l" { char *s; int bprefix = (yytext[0] != '<') ? 1 : 0; @@ -3945,255 +3892,255 @@ int lex_scan(zval *zendlval TSRMLS_DC) return T_START_HEREDOC; } -#line 3949 "Zend/zend_language_scanner.c" -yy281: - YYDEBUG(281, *YYCURSOR); +#line 3896 "Zend/zend_language_scanner.c" +yy277: + YYDEBUG(277, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy279; - goto yy280; -yy282: - YYDEBUG(282, *YYCURSOR); + if (yych == '\n') goto yy275; + goto yy276; +yy278: + YYDEBUG(278, *YYCURSOR); ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; -yy283: - YYDEBUG(283, *YYCURSOR); +yy279: + YYDEBUG(279, *YYCURSOR); if (yych <= 'Z') { if (yych <= '/') { - if (yych == '\'') goto yy278; + if (yych == '\'') goto yy274; goto yy194; } else { - if (yych <= '9') goto yy282; + if (yych <= '9') goto yy278; if (yych <= '@') goto yy194; - goto yy282; + goto yy278; } } else { if (yych <= '`') { - if (yych == '_') goto yy282; + if (yych == '_') goto yy278; goto yy194; } else { - if (yych <= 'z') goto yy282; + if (yych <= 'z') goto yy278; if (yych <= '~') goto yy194; - goto yy282; + goto yy278; } } -yy284: - YYDEBUG(284, *YYCURSOR); +yy280: + YYDEBUG(280, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '=') goto yy260; - YYDEBUG(285, *YYCURSOR); + if (yych != '=') goto yy256; + YYDEBUG(281, *YYCURSOR); ++YYCURSOR; - YYDEBUG(286, *YYCURSOR); + YYDEBUG(282, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1362 "Zend/zend_language_scanner.l" +#line 1354 "Zend/zend_language_scanner.l" { return T_IS_NOT_IDENTICAL; } -#line 3993 "Zend/zend_language_scanner.c" -yy287: - YYDEBUG(287, *YYCURSOR); +#line 3940 "Zend/zend_language_scanner.c" +yy283: + YYDEBUG(283, *YYCURSOR); ++YYCURSOR; - YYDEBUG(288, *YYCURSOR); + YYDEBUG(284, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1382 "Zend/zend_language_scanner.l" +#line 1374 "Zend/zend_language_scanner.l" { return T_PLUS_EQUAL; } -#line 4003 "Zend/zend_language_scanner.c" -yy289: - YYDEBUG(289, *YYCURSOR); +#line 3950 "Zend/zend_language_scanner.c" +yy285: + YYDEBUG(285, *YYCURSOR); ++YYCURSOR; - YYDEBUG(290, *YYCURSOR); + YYDEBUG(286, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1350 "Zend/zend_language_scanner.l" +#line 1342 "Zend/zend_language_scanner.l" { return T_INC; } -#line 4013 "Zend/zend_language_scanner.c" -yy291: - YYDEBUG(291, *YYCURSOR); +#line 3960 "Zend/zend_language_scanner.c" +yy287: + YYDEBUG(287, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy292; + if (yych == 'S') goto yy288; if (yych != 's') goto yy187; -yy292: - YYDEBUG(292, *YYCURSOR); +yy288: + YYDEBUG(288, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy293; + if (yych == 'T') goto yy289; if (yych != 't') goto yy187; -yy293: - YYDEBUG(293, *YYCURSOR); +yy289: + YYDEBUG(289, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(294, *YYCURSOR); + YYDEBUG(290, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1338 "Zend/zend_language_scanner.l" +#line 1330 "Zend/zend_language_scanner.l" { return T_LIST; } -#line 4036 "Zend/zend_language_scanner.c" -yy295: - YYDEBUG(295, *YYCURSOR); +#line 3983 "Zend/zend_language_scanner.c" +yy291: + YYDEBUG(291, *YYCURSOR); ++YYCURSOR; - if ((yych = *YYCURSOR) == '=') goto yy299; - YYDEBUG(296, *YYCURSOR); + if ((yych = *YYCURSOR) == '=') goto yy295; + YYDEBUG(292, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1366 "Zend/zend_language_scanner.l" +#line 1358 "Zend/zend_language_scanner.l" { return T_IS_EQUAL; } -#line 4047 "Zend/zend_language_scanner.c" -yy297: - YYDEBUG(297, *YYCURSOR); +#line 3994 "Zend/zend_language_scanner.c" +yy293: + YYDEBUG(293, *YYCURSOR); ++YYCURSOR; - YYDEBUG(298, *YYCURSOR); + YYDEBUG(294, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1334 "Zend/zend_language_scanner.l" +#line 1326 "Zend/zend_language_scanner.l" { return T_DOUBLE_ARROW; } -#line 4057 "Zend/zend_language_scanner.c" -yy299: - YYDEBUG(299, *YYCURSOR); +#line 4004 "Zend/zend_language_scanner.c" +yy295: + YYDEBUG(295, *YYCURSOR); ++YYCURSOR; - YYDEBUG(300, *YYCURSOR); + YYDEBUG(296, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1358 "Zend/zend_language_scanner.l" +#line 1350 "Zend/zend_language_scanner.l" { return T_IS_IDENTICAL; } -#line 4067 "Zend/zend_language_scanner.c" -yy301: - YYDEBUG(301, *YYCURSOR); +#line 4014 "Zend/zend_language_scanner.c" +yy297: + YYDEBUG(297, *YYCURSOR); yych = *++YYCURSOR; YYDEBUG(-1, yych); switch (yych) { case 'C': - case 'c': goto yy303; + case 'c': goto yy299; case 'D': - case 'd': goto yy308; + case 'd': goto yy304; case 'F': - case 'f': goto yy305; + case 'f': goto yy301; case 'H': - case 'h': goto yy302; + case 'h': goto yy298; case 'L': - case 'l': goto yy307; + case 'l': goto yy303; case 'M': - case 'm': goto yy306; + case 'm': goto yy302; case 'N': - case 'n': goto yy309; + case 'n': goto yy305; case 'T': - case 't': goto yy304; + case 't': goto yy300; default: goto yy187; } -yy302: - YYDEBUG(302, *YYCURSOR); +yy298: + YYDEBUG(298, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy370; - if (yych == 'a') goto yy370; + if (yych == 'A') goto yy366; + if (yych == 'a') goto yy366; goto yy187; -yy303: - YYDEBUG(303, *YYCURSOR); +yy299: + YYDEBUG(299, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy363; - if (yych == 'l') goto yy363; + if (yych == 'L') goto yy359; + if (yych == 'l') goto yy359; goto yy187; -yy304: - YYDEBUG(304, *YYCURSOR); +yy300: + YYDEBUG(300, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy356; - if (yych == 'r') goto yy356; + if (yych == 'R') goto yy352; + if (yych == 'r') goto yy352; goto yy187; -yy305: - YYDEBUG(305, *YYCURSOR); +yy301: + YYDEBUG(301, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { - if (yych == 'I') goto yy340; + if (yych == 'I') goto yy336; if (yych <= 'T') goto yy187; - goto yy341; + goto yy337; } else { if (yych <= 'i') { if (yych <= 'h') goto yy187; - goto yy340; + goto yy336; } else { - if (yych == 'u') goto yy341; + if (yych == 'u') goto yy337; goto yy187; } } +yy302: + YYDEBUG(302, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy328; + if (yych == 'e') goto yy328; + goto yy187; +yy303: + YYDEBUG(303, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'I') goto yy322; + if (yych == 'i') goto yy322; + goto yy187; +yy304: + YYDEBUG(304, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'I') goto yy317; + if (yych == 'i') goto yy317; + goto yy187; +yy305: + YYDEBUG(305, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'A') goto yy306; + if (yych != 'a') goto yy187; yy306: YYDEBUG(306, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy332; - if (yych == 'e') goto yy332; - goto yy187; + if (yych == 'M') goto yy307; + if (yych != 'm') goto yy187; yy307: YYDEBUG(307, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy326; - if (yych == 'i') goto yy326; - goto yy187; + if (yych == 'E') goto yy308; + if (yych != 'e') goto yy187; yy308: YYDEBUG(308, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy321; - if (yych == 'i') goto yy321; - goto yy187; + if (yych == 'S') goto yy309; + if (yych != 's') goto yy187; yy309: YYDEBUG(309, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy310; - if (yych != 'a') goto yy187; + if (yych == 'P') goto yy310; + if (yych != 'p') goto yy187; yy310: YYDEBUG(310, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'M') goto yy311; - if (yych != 'm') goto yy187; + if (yych == 'A') goto yy311; + if (yych != 'a') goto yy187; yy311: YYDEBUG(311, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy312; - if (yych != 'e') goto yy187; + if (yych == 'C') goto yy312; + if (yych != 'c') goto yy187; yy312: YYDEBUG(312, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy313; - if (yych != 's') goto yy187; + if (yych == 'E') goto yy313; + if (yych != 'e') goto yy187; yy313: YYDEBUG(313, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy314; - if (yych != 'p') goto yy187; -yy314: - YYDEBUG(314, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy315; - if (yych != 'a') goto yy187; -yy315: - YYDEBUG(315, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy316; - if (yych != 'c') goto yy187; -yy316: - YYDEBUG(316, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy317; - if (yych != 'e') goto yy187; -yy317: - YYDEBUG(317, *YYCURSOR); - yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(318, *YYCURSOR); + YYDEBUG(314, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(319, *YYCURSOR); + YYDEBUG(315, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(320, *YYCURSOR); + YYDEBUG(316, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1722 "Zend/zend_language_scanner.l" +#line 1668 "Zend/zend_language_scanner.l" { if (CG(current_namespace)) { *zendlval = *CG(current_namespace); @@ -4203,27 +4150,27 @@ int lex_scan(zval *zendlval TSRMLS_DC) } return T_NS_C; } -#line 4207 "Zend/zend_language_scanner.c" -yy321: - YYDEBUG(321, *YYCURSOR); +#line 4154 "Zend/zend_language_scanner.c" +yy317: + YYDEBUG(317, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy322; + if (yych == 'R') goto yy318; if (yych != 'r') goto yy187; -yy322: - YYDEBUG(322, *YYCURSOR); +yy318: + YYDEBUG(318, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(323, *YYCURSOR); + YYDEBUG(319, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(324, *YYCURSOR); + YYDEBUG(320, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(325, *YYCURSOR); + YYDEBUG(321, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1695 "Zend/zend_language_scanner.l" +#line 1643 "Zend/zend_language_scanner.l" { char *filename = zend_get_compiled_filename(TSRMLS_C); const size_t filename_len = strlen(filename); @@ -4245,91 +4192,80 @@ int lex_scan(zval *zendlval TSRMLS_DC) #endif } - zendlval->value.str.len = strlen(dirname); - zendlval->value.str.val = dirname; - zendlval->type = IS_STRING; + ZVAL_STRING(zendlval, dirname, 0); return T_DIR; } -#line 4254 "Zend/zend_language_scanner.c" -yy326: - YYDEBUG(326, *YYCURSOR); +#line 4199 "Zend/zend_language_scanner.c" +yy322: + YYDEBUG(322, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy327; + if (yych == 'N') goto yy323; if (yych != 'n') goto yy187; -yy327: - YYDEBUG(327, *YYCURSOR); +yy323: + YYDEBUG(323, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy328; + if (yych == 'E') goto yy324; if (yych != 'e') goto yy187; -yy328: - YYDEBUG(328, *YYCURSOR); +yy324: + YYDEBUG(324, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(329, *YYCURSOR); + YYDEBUG(325, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(330, *YYCURSOR); + YYDEBUG(326, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(331, *YYCURSOR); + YYDEBUG(327, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1677 "Zend/zend_language_scanner.l" +#line 1628 "Zend/zend_language_scanner.l" { - zendlval->value.lval = CG(zend_lineno); - zendlval->type = IS_LONG; + ZVAL_LONG(zendlval, CG(zend_lineno)); return T_LINE; } -#line 4285 "Zend/zend_language_scanner.c" -yy332: - YYDEBUG(332, *YYCURSOR); +#line 4229 "Zend/zend_language_scanner.c" +yy328: + YYDEBUG(328, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy333; + if (yych == 'T') goto yy329; if (yych != 't') goto yy187; -yy333: - YYDEBUG(333, *YYCURSOR); +yy329: + YYDEBUG(329, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy334; + if (yych == 'H') goto yy330; if (yych != 'h') goto yy187; -yy334: - YYDEBUG(334, *YYCURSOR); +yy330: + YYDEBUG(330, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy335; + if (yych == 'O') goto yy331; if (yych != 'o') goto yy187; -yy335: - YYDEBUG(335, *YYCURSOR); +yy331: + YYDEBUG(331, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy336; + if (yych == 'D') goto yy332; if (yych != 'd') goto yy187; -yy336: - YYDEBUG(336, *YYCURSOR); +yy332: + YYDEBUG(332, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(337, *YYCURSOR); + YYDEBUG(333, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(338, *YYCURSOR); + YYDEBUG(334, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(339, *YYCURSOR); + YYDEBUG(335, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1656 "Zend/zend_language_scanner.l" +#line 1615 "Zend/zend_language_scanner.l" { const char *class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL; const char *func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL; - size_t len = 0; - if (class_name) { - len += strlen(class_name) + 2; - } - if (func_name) { - len += strlen(func_name); - } - - zendlval->value.str.len = zend_spprintf(&zendlval->value.str.val, 0, "%s%s%s", + Z_STRLEN_P(zendlval) = zend_spprintf(&Z_STRVAL_P(zendlval), 0, "%s%s%s", class_name ? class_name : "", class_name && func_name ? "::" : "", func_name ? func_name : "" @@ -4337,266 +4273,263 @@ int lex_scan(zval *zendlval TSRMLS_DC) zendlval->type = IS_STRING; return T_METHOD_C; } -#line 4341 "Zend/zend_language_scanner.c" -yy340: - YYDEBUG(340, *YYCURSOR); +#line 4277 "Zend/zend_language_scanner.c" +yy336: + YYDEBUG(336, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy351; - if (yych == 'l') goto yy351; + if (yych == 'L') goto yy347; + if (yych == 'l') goto yy347; goto yy187; -yy341: - YYDEBUG(341, *YYCURSOR); +yy337: + YYDEBUG(337, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy342; + if (yych == 'N') goto yy338; if (yych != 'n') goto yy187; -yy342: - YYDEBUG(342, *YYCURSOR); +yy338: + YYDEBUG(338, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy343; + if (yych == 'C') goto yy339; if (yych != 'c') goto yy187; -yy343: - YYDEBUG(343, *YYCURSOR); +yy339: + YYDEBUG(339, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy344; + if (yych == 'T') goto yy340; if (yych != 't') goto yy187; -yy344: - YYDEBUG(344, *YYCURSOR); +yy340: + YYDEBUG(340, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy345; + if (yych == 'I') goto yy341; if (yych != 'i') goto yy187; -yy345: - YYDEBUG(345, *YYCURSOR); +yy341: + YYDEBUG(341, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy346; + if (yych == 'O') goto yy342; if (yych != 'o') goto yy187; -yy346: - YYDEBUG(346, *YYCURSOR); +yy342: + YYDEBUG(342, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy347; + if (yych == 'N') goto yy343; if (yych != 'n') goto yy187; -yy347: - YYDEBUG(347, *YYCURSOR); +yy343: + YYDEBUG(343, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(348, *YYCURSOR); + YYDEBUG(344, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(349, *YYCURSOR); + YYDEBUG(345, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(350, *YYCURSOR); + YYDEBUG(346, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1640 "Zend/zend_language_scanner.l" +#line 1605 "Zend/zend_language_scanner.l" { - const char *func_name = NULL; - - if (CG(active_op_array)) { - func_name = CG(active_op_array)->function_name; - } - - if (!func_name) { - func_name = ""; + zend_op_array *op_array = CG(active_op_array); + if (op_array && op_array->function_name) { + ZVAL_STRING(zendlval, op_array->function_name, 1); + } else { + ZVAL_EMPTY_STRING(zendlval); } - zendlval->value.str.len = strlen(func_name); - zendlval->value.str.val = estrndup(func_name, zendlval->value.str.len); - zendlval->type = IS_STRING; return T_FUNC_C; } -#line 4408 "Zend/zend_language_scanner.c" -yy351: - YYDEBUG(351, *YYCURSOR); +#line 4338 "Zend/zend_language_scanner.c" +yy347: + YYDEBUG(347, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy352; + if (yych == 'E') goto yy348; if (yych != 'e') goto yy187; -yy352: - YYDEBUG(352, *YYCURSOR); +yy348: + YYDEBUG(348, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(353, *YYCURSOR); + YYDEBUG(349, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(354, *YYCURSOR); + YYDEBUG(350, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(355, *YYCURSOR); + YYDEBUG(351, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1683 "Zend/zend_language_scanner.l" +#line 1633 "Zend/zend_language_scanner.l" { char *filename = zend_get_compiled_filename(TSRMLS_C); if (!filename) { filename = ""; } - zendlval->value.str.len = strlen(filename); - zendlval->value.str.val = estrndup(filename, zendlval->value.str.len); - zendlval->type = IS_STRING; + ZVAL_STRING(zendlval, filename, 1); return T_FILE; } -#line 4440 "Zend/zend_language_scanner.c" -yy356: - YYDEBUG(356, *YYCURSOR); +#line 4368 "Zend/zend_language_scanner.c" +yy352: + YYDEBUG(352, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy357; + if (yych == 'A') goto yy353; if (yych != 'a') goto yy187; -yy357: - YYDEBUG(357, *YYCURSOR); +yy353: + YYDEBUG(353, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy358; + if (yych == 'I') goto yy354; if (yych != 'i') goto yy187; -yy358: - YYDEBUG(358, *YYCURSOR); +yy354: + YYDEBUG(354, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy359; + if (yych == 'T') goto yy355; if (yych != 't') goto yy187; -yy359: - YYDEBUG(359, *YYCURSOR); +yy355: + YYDEBUG(355, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(360, *YYCURSOR); + YYDEBUG(356, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(361, *YYCURSOR); + YYDEBUG(357, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(362, *YYCURSOR); + YYDEBUG(358, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1620 "Zend/zend_language_scanner.l" +#line 1595 "Zend/zend_language_scanner.l" { - const char *trait_name = NULL; - - if (CG(active_class_entry) - && (ZEND_ACC_TRAIT == - (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT))) { - trait_name = CG(active_class_entry)->name; - } - - if (!trait_name) { - trait_name = ""; + zend_class_entry *ce = CG(active_class_entry); + if (ce && ce->name && ZEND_ACC_TRAIT == (ce->ce_flags & ZEND_ACC_TRAIT)) { + ZVAL_STRINGL(zendlval, ce->name, ce->name_length, 1); + } else { + ZVAL_EMPTY_STRING(zendlval); } - - zendlval->value.str.len = strlen(trait_name); - zendlval->value.str.val = estrndup(trait_name, zendlval->value.str.len); - zendlval->type = IS_STRING; - return T_TRAIT_C; } -#line 4490 "Zend/zend_language_scanner.c" -yy363: - YYDEBUG(363, *YYCURSOR); +#line 4408 "Zend/zend_language_scanner.c" +yy359: + YYDEBUG(359, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy364; + if (yych == 'A') goto yy360; if (yych != 'a') goto yy187; -yy364: - YYDEBUG(364, *YYCURSOR); +yy360: + YYDEBUG(360, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy365; + if (yych == 'S') goto yy361; if (yych != 's') goto yy187; -yy365: - YYDEBUG(365, *YYCURSOR); +yy361: + YYDEBUG(361, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy366; + if (yych == 'S') goto yy362; if (yych != 's') goto yy187; -yy366: - YYDEBUG(366, *YYCURSOR); +yy362: + YYDEBUG(362, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(367, *YYCURSOR); + YYDEBUG(363, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(368, *YYCURSOR); + YYDEBUG(364, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(369, *YYCURSOR); + YYDEBUG(365, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1593 "Zend/zend_language_scanner.l" +#line 1577 "Zend/zend_language_scanner.l" { - const char *class_name = NULL; - - if (CG(active_class_entry) - && (ZEND_ACC_TRAIT == - (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT))) { + zend_class_entry *ce = CG(active_class_entry); + if (ce && ZEND_ACC_TRAIT == (ce->ce_flags & ZEND_ACC_TRAIT)) { /* We create a special __CLASS__ constant that is going to be resolved at run-time */ - zendlval->value.str.len = sizeof("__CLASS__")-1; - zendlval->value.str.val = estrndup("__CLASS__", zendlval->value.str.len); + Z_STRLEN_P(zendlval) = sizeof("__CLASS__")-1; + Z_STRVAL_P(zendlval) = estrndup("__CLASS__", Z_STRLEN_P(zendlval)); zendlval->type = IS_CONSTANT; } else { - if (CG(active_class_entry)) { - class_name = CG(active_class_entry)->name; - } - - if (!class_name) { - class_name = ""; + if (ce && ce->name) { + ZVAL_STRINGL(zendlval, ce->name, ce->name_length, 1); + } else { + ZVAL_EMPTY_STRING(zendlval); } - - zendlval->value.str.len = strlen(class_name); - zendlval->value.str.val = estrndup(class_name, zendlval->value.str.len); - zendlval->type = IS_STRING; } return T_CLASS_C; } -#line 4547 "Zend/zend_language_scanner.c" +#line 4456 "Zend/zend_language_scanner.c" +yy366: + YYDEBUG(366, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'L') goto yy367; + if (yych != 'l') goto yy187; +yy367: + YYDEBUG(367, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'T') goto yy368; + if (yych != 't') goto yy187; +yy368: + YYDEBUG(368, *YYCURSOR); + yych = *++YYCURSOR; + if (yych != '_') goto yy187; + YYDEBUG(369, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'C') goto yy370; + if (yych != 'c') goto yy187; yy370: YYDEBUG(370, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy371; - if (yych != 'l') goto yy187; + if (yych == 'O') goto yy371; + if (yych != 'o') goto yy187; yy371: YYDEBUG(371, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy372; - if (yych != 't') goto yy187; + if (yych == 'M') goto yy372; + if (yych != 'm') goto yy187; yy372: YYDEBUG(372, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '_') goto yy187; + if (yych == 'P') goto yy373; + if (yych != 'p') goto yy187; +yy373: YYDEBUG(373, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy374; - if (yych != 'c') goto yy187; + if (yych == 'I') goto yy374; + if (yych != 'i') goto yy187; yy374: YYDEBUG(374, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy375; - if (yych != 'o') goto yy187; + if (yych == 'L') goto yy375; + if (yych != 'l') goto yy187; yy375: YYDEBUG(375, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'M') goto yy376; - if (yych != 'm') goto yy187; + if (yych == 'E') goto yy376; + if (yych != 'e') goto yy187; yy376: YYDEBUG(376, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy377; - if (yych != 'p') goto yy187; + if (yych == 'R') goto yy377; + if (yych != 'r') goto yy187; yy377: YYDEBUG(377, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'I') goto yy378; - if (yych != 'i') goto yy187; -yy378: + ++YYCURSOR; + if (yybm[0+(yych = *YYCURSOR)] & 4) { + goto yy186; + } YYDEBUG(378, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'L') goto yy379; - if (yych != 'l') goto yy187; + yyleng = YYCURSOR - SCNG(yy_text); +#line 1294 "Zend/zend_language_scanner.l" + { + return T_HALT_COMPILER; +} +#line 4522 "Zend/zend_language_scanner.c" yy379: YYDEBUG(379, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy380; - if (yych != 'e') goto yy187; + if (yych == 'S') goto yy383; + if (yych == 's') goto yy383; + goto yy187; yy380: YYDEBUG(380, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy381; - if (yych != 'r') goto yy187; + if (yych == 'E') goto yy381; + if (yych != 'e') goto yy187; yy381: YYDEBUG(381, *YYCURSOR); ++YYCURSOR; @@ -4605,22 +4538,21 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(382, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1302 "Zend/zend_language_scanner.l" +#line 1274 "Zend/zend_language_scanner.l" { - return T_HALT_COMPILER; + return T_USE; } -#line 4613 "Zend/zend_language_scanner.c" +#line 4546 "Zend/zend_language_scanner.c" yy383: YYDEBUG(383, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy387; - if (yych == 's') goto yy387; - goto yy187; + if (yych == 'E') goto yy384; + if (yych != 'e') goto yy187; yy384: YYDEBUG(384, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy385; - if (yych != 'e') goto yy187; + if (yych == 'T') goto yy385; + if (yych != 't') goto yy187; yy385: YYDEBUG(385, *YYCURSOR); ++YYCURSOR; @@ -4629,742 +4561,743 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(386, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1282 "Zend/zend_language_scanner.l" +#line 1322 "Zend/zend_language_scanner.l" { - return T_USE; + return T_UNSET; } -#line 4637 "Zend/zend_language_scanner.c" +#line 4569 "Zend/zend_language_scanner.c" yy387: YYDEBUG(387, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy388; - if (yych != 'e') goto yy187; -yy388: - YYDEBUG(388, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy389; - if (yych != 't') goto yy187; -yy389: - YYDEBUG(389, *YYCURSOR); - ++YYCURSOR; - if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; - } - YYDEBUG(390, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 1330 "Zend/zend_language_scanner.l" - { - return T_UNSET; -} -#line 4660 "Zend/zend_language_scanner.c" -yy391: - YYDEBUG(391, *YYCURSOR); ++YYCURSOR; YYFILL(7); yych = *YYCURSOR; -yy392: - YYDEBUG(392, *YYCURSOR); +yy388: + YYDEBUG(388, *YYCURSOR); if (yych <= 'S') { if (yych <= 'D') { if (yych <= ' ') { - if (yych == '\t') goto yy391; + if (yych == '\t') goto yy387; if (yych <= 0x1F) goto yy194; - goto yy391; + goto yy387; } else { if (yych <= 'A') { if (yych <= '@') goto yy194; - goto yy396; + goto yy392; } else { - if (yych <= 'B') goto yy394; + if (yych <= 'B') goto yy390; if (yych <= 'C') goto yy194; - goto yy399; + goto yy395; } } } else { if (yych <= 'I') { - if (yych == 'F') goto yy400; + if (yych == 'F') goto yy396; if (yych <= 'H') goto yy194; - goto yy401; + goto yy397; } else { if (yych <= 'O') { if (yych <= 'N') goto yy194; - goto yy395; + goto yy391; } else { if (yych <= 'Q') goto yy194; - if (yych <= 'R') goto yy398; - goto yy397; + if (yych <= 'R') goto yy394; + goto yy393; } } } } else { if (yych <= 'f') { if (yych <= 'a') { - if (yych == 'U') goto yy393; + if (yych == 'U') goto yy389; if (yych <= '`') goto yy194; - goto yy396; + goto yy392; } else { if (yych <= 'c') { - if (yych <= 'b') goto yy394; + if (yych <= 'b') goto yy390; goto yy194; } else { - if (yych <= 'd') goto yy399; + if (yych <= 'd') goto yy395; if (yych <= 'e') goto yy194; - goto yy400; + goto yy396; } } } else { if (yych <= 'q') { if (yych <= 'i') { if (yych <= 'h') goto yy194; - goto yy401; + goto yy397; } else { - if (yych == 'o') goto yy395; + if (yych == 'o') goto yy391; goto yy194; } } else { if (yych <= 's') { - if (yych <= 'r') goto yy398; - goto yy397; + if (yych <= 'r') goto yy394; + goto yy393; } else { if (yych != 'u') goto yy194; } } } } -yy393: - YYDEBUG(393, *YYCURSOR); +yy389: + YYDEBUG(389, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy460; - if (yych == 'n') goto yy460; + if (yych == 'N') goto yy456; + if (yych == 'n') goto yy456; goto yy194; -yy394: - YYDEBUG(394, *YYCURSOR); +yy390: + YYDEBUG(390, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { - if (yych == 'I') goto yy447; + if (yych == 'I') goto yy443; if (yych <= 'N') goto yy194; - goto yy448; + goto yy444; } else { if (yych <= 'i') { if (yych <= 'h') goto yy194; - goto yy447; + goto yy443; } else { - if (yych == 'o') goto yy448; + if (yych == 'o') goto yy444; goto yy194; } } +yy391: + YYDEBUG(391, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'B') goto yy435; + if (yych == 'b') goto yy435; + goto yy194; +yy392: + YYDEBUG(392, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'R') goto yy428; + if (yych == 'r') goto yy428; + goto yy194; +yy393: + YYDEBUG(393, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'T') goto yy420; + if (yych == 't') goto yy420; + goto yy194; +yy394: + YYDEBUG(394, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy418; + if (yych == 'e') goto yy418; + goto yy194; yy395: YYDEBUG(395, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'B') goto yy439; - if (yych == 'b') goto yy439; + if (yych == 'O') goto yy414; + if (yych == 'o') goto yy414; goto yy194; yy396: YYDEBUG(396, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy432; - if (yych == 'r') goto yy432; + if (yych == 'L') goto yy407; + if (yych == 'l') goto yy407; goto yy194; yy397: YYDEBUG(397, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy424; - if (yych == 't') goto yy424; - goto yy194; + if (yych == 'N') goto yy398; + if (yych != 'n') goto yy194; yy398: YYDEBUG(398, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy422; - if (yych == 'e') goto yy422; - goto yy194; + if (yych == 'T') goto yy399; + if (yych != 't') goto yy194; yy399: YYDEBUG(399, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy418; - if (yych == 'o') goto yy418; - goto yy194; + if (yych == 'E') goto yy400; + if (yych != 'e') goto yy402; yy400: YYDEBUG(400, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy411; - if (yych == 'l') goto yy411; + if (yych == 'G') goto yy405; + if (yych == 'g') goto yy405; goto yy194; yy401: YYDEBUG(401, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy402; - if (yych != 'n') goto yy194; -yy402: - YYDEBUG(402, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy403; - if (yych != 't') goto yy194; -yy403: - YYDEBUG(403, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy404; - if (yych != 'e') goto yy406; -yy404: - YYDEBUG(404, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'G') goto yy409; - if (yych == 'g') goto yy409; - goto yy194; -yy405: - YYDEBUG(405, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy406: - YYDEBUG(406, *YYCURSOR); +yy402: + YYDEBUG(402, *YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy405; + if (yych == '\t') goto yy401; goto yy194; } else { - if (yych <= ' ') goto yy405; + if (yych <= ' ') goto yy401; if (yych != ')') goto yy194; } - YYDEBUG(407, *YYCURSOR); + YYDEBUG(403, *YYCURSOR); ++YYCURSOR; - YYDEBUG(408, *YYCURSOR); + YYDEBUG(404, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1230 "Zend/zend_language_scanner.l" +#line 1222 "Zend/zend_language_scanner.l" { return T_INT_CAST; } -#line 4836 "Zend/zend_language_scanner.c" -yy409: - YYDEBUG(409, *YYCURSOR); +#line 4745 "Zend/zend_language_scanner.c" +yy405: + YYDEBUG(405, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy410; + if (yych == 'E') goto yy406; if (yych != 'e') goto yy194; -yy410: - YYDEBUG(410, *YYCURSOR); +yy406: + YYDEBUG(406, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy405; - if (yych == 'r') goto yy405; + if (yych == 'R') goto yy401; + if (yych == 'r') goto yy401; goto yy194; -yy411: - YYDEBUG(411, *YYCURSOR); +yy407: + YYDEBUG(407, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy412; + if (yych == 'O') goto yy408; if (yych != 'o') goto yy194; -yy412: - YYDEBUG(412, *YYCURSOR); +yy408: + YYDEBUG(408, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy413; + if (yych == 'A') goto yy409; if (yych != 'a') goto yy194; -yy413: - YYDEBUG(413, *YYCURSOR); +yy409: + YYDEBUG(409, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy414; + if (yych == 'T') goto yy410; if (yych != 't') goto yy194; -yy414: - YYDEBUG(414, *YYCURSOR); +yy410: + YYDEBUG(410, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(415, *YYCURSOR); + YYDEBUG(411, *YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy414; + if (yych == '\t') goto yy410; goto yy194; } else { - if (yych <= ' ') goto yy414; + if (yych <= ' ') goto yy410; if (yych != ')') goto yy194; } - YYDEBUG(416, *YYCURSOR); + YYDEBUG(412, *YYCURSOR); ++YYCURSOR; - YYDEBUG(417, *YYCURSOR); + YYDEBUG(413, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1234 "Zend/zend_language_scanner.l" +#line 1226 "Zend/zend_language_scanner.l" { return T_DOUBLE_CAST; } -#line 4884 "Zend/zend_language_scanner.c" -yy418: - YYDEBUG(418, *YYCURSOR); +#line 4793 "Zend/zend_language_scanner.c" +yy414: + YYDEBUG(414, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'U') goto yy419; + if (yych == 'U') goto yy415; if (yych != 'u') goto yy194; -yy419: - YYDEBUG(419, *YYCURSOR); +yy415: + YYDEBUG(415, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'B') goto yy420; + if (yych == 'B') goto yy416; if (yych != 'b') goto yy194; -yy420: - YYDEBUG(420, *YYCURSOR); +yy416: + YYDEBUG(416, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy421; + if (yych == 'L') goto yy417; if (yych != 'l') goto yy194; -yy421: - YYDEBUG(421, *YYCURSOR); +yy417: + YYDEBUG(417, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy414; - if (yych == 'e') goto yy414; + if (yych == 'E') goto yy410; + if (yych == 'e') goto yy410; goto yy194; -yy422: - YYDEBUG(422, *YYCURSOR); +yy418: + YYDEBUG(418, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy423; + if (yych == 'A') goto yy419; if (yych != 'a') goto yy194; -yy423: - YYDEBUG(423, *YYCURSOR); +yy419: + YYDEBUG(419, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy414; - if (yych == 'l') goto yy414; + if (yych == 'L') goto yy410; + if (yych == 'l') goto yy410; goto yy194; -yy424: - YYDEBUG(424, *YYCURSOR); +yy420: + YYDEBUG(420, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy425; + if (yych == 'R') goto yy421; if (yych != 'r') goto yy194; -yy425: - YYDEBUG(425, *YYCURSOR); +yy421: + YYDEBUG(421, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy426; + if (yych == 'I') goto yy422; if (yych != 'i') goto yy194; -yy426: - YYDEBUG(426, *YYCURSOR); +yy422: + YYDEBUG(422, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy427; + if (yych == 'N') goto yy423; if (yych != 'n') goto yy194; -yy427: - YYDEBUG(427, *YYCURSOR); +yy423: + YYDEBUG(423, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'G') goto yy428; + if (yych == 'G') goto yy424; if (yych != 'g') goto yy194; -yy428: - YYDEBUG(428, *YYCURSOR); +yy424: + YYDEBUG(424, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(429, *YYCURSOR); + YYDEBUG(425, *YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy428; + if (yych == '\t') goto yy424; goto yy194; } else { - if (yych <= ' ') goto yy428; + if (yych <= ' ') goto yy424; if (yych != ')') goto yy194; } - YYDEBUG(430, *YYCURSOR); + YYDEBUG(426, *YYCURSOR); ++YYCURSOR; - YYDEBUG(431, *YYCURSOR); + YYDEBUG(427, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1238 "Zend/zend_language_scanner.l" +#line 1230 "Zend/zend_language_scanner.l" { return T_STRING_CAST; } -#line 4958 "Zend/zend_language_scanner.c" -yy432: - YYDEBUG(432, *YYCURSOR); +#line 4867 "Zend/zend_language_scanner.c" +yy428: + YYDEBUG(428, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy433; + if (yych == 'R') goto yy429; if (yych != 'r') goto yy194; -yy433: - YYDEBUG(433, *YYCURSOR); +yy429: + YYDEBUG(429, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy434; + if (yych == 'A') goto yy430; if (yych != 'a') goto yy194; -yy434: - YYDEBUG(434, *YYCURSOR); +yy430: + YYDEBUG(430, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'Y') goto yy435; + if (yych == 'Y') goto yy431; if (yych != 'y') goto yy194; -yy435: - YYDEBUG(435, *YYCURSOR); +yy431: + YYDEBUG(431, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(436, *YYCURSOR); + YYDEBUG(432, *YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy435; + if (yych == '\t') goto yy431; goto yy194; } else { - if (yych <= ' ') goto yy435; + if (yych <= ' ') goto yy431; if (yych != ')') goto yy194; } - YYDEBUG(437, *YYCURSOR); + YYDEBUG(433, *YYCURSOR); ++YYCURSOR; - YYDEBUG(438, *YYCURSOR); + YYDEBUG(434, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1242 "Zend/zend_language_scanner.l" +#line 1234 "Zend/zend_language_scanner.l" { return T_ARRAY_CAST; } -#line 4995 "Zend/zend_language_scanner.c" -yy439: - YYDEBUG(439, *YYCURSOR); +#line 4904 "Zend/zend_language_scanner.c" +yy435: + YYDEBUG(435, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'J') goto yy440; + if (yych == 'J') goto yy436; if (yych != 'j') goto yy194; -yy440: - YYDEBUG(440, *YYCURSOR); +yy436: + YYDEBUG(436, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy441; + if (yych == 'E') goto yy437; if (yych != 'e') goto yy194; -yy441: - YYDEBUG(441, *YYCURSOR); +yy437: + YYDEBUG(437, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy442; + if (yych == 'C') goto yy438; if (yych != 'c') goto yy194; -yy442: - YYDEBUG(442, *YYCURSOR); +yy438: + YYDEBUG(438, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy443; + if (yych == 'T') goto yy439; if (yych != 't') goto yy194; -yy443: - YYDEBUG(443, *YYCURSOR); +yy439: + YYDEBUG(439, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(444, *YYCURSOR); + YYDEBUG(440, *YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy443; + if (yych == '\t') goto yy439; goto yy194; } else { - if (yych <= ' ') goto yy443; + if (yych <= ' ') goto yy439; if (yych != ')') goto yy194; } - YYDEBUG(445, *YYCURSOR); + YYDEBUG(441, *YYCURSOR); ++YYCURSOR; - YYDEBUG(446, *YYCURSOR); + YYDEBUG(442, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1246 "Zend/zend_language_scanner.l" +#line 1238 "Zend/zend_language_scanner.l" { return T_OBJECT_CAST; } -#line 5037 "Zend/zend_language_scanner.c" -yy447: - YYDEBUG(447, *YYCURSOR); +#line 4946 "Zend/zend_language_scanner.c" +yy443: + YYDEBUG(443, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy457; - if (yych == 'n') goto yy457; + if (yych == 'N') goto yy453; + if (yych == 'n') goto yy453; goto yy194; -yy448: - YYDEBUG(448, *YYCURSOR); +yy444: + YYDEBUG(444, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy449; + if (yych == 'O') goto yy445; if (yych != 'o') goto yy194; -yy449: - YYDEBUG(449, *YYCURSOR); +yy445: + YYDEBUG(445, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy450; + if (yych == 'L') goto yy446; if (yych != 'l') goto yy194; -yy450: - YYDEBUG(450, *YYCURSOR); +yy446: + YYDEBUG(446, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy455; - if (yych == 'e') goto yy455; - goto yy452; -yy451: - YYDEBUG(451, *YYCURSOR); + if (yych == 'E') goto yy451; + if (yych == 'e') goto yy451; + goto yy448; +yy447: + YYDEBUG(447, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy452: - YYDEBUG(452, *YYCURSOR); +yy448: + YYDEBUG(448, *YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy451; + if (yych == '\t') goto yy447; goto yy194; } else { - if (yych <= ' ') goto yy451; + if (yych <= ' ') goto yy447; if (yych != ')') goto yy194; } - YYDEBUG(453, *YYCURSOR); + YYDEBUG(449, *YYCURSOR); ++YYCURSOR; - YYDEBUG(454, *YYCURSOR); + YYDEBUG(450, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1250 "Zend/zend_language_scanner.l" +#line 1242 "Zend/zend_language_scanner.l" { return T_BOOL_CAST; } -#line 5082 "Zend/zend_language_scanner.c" -yy455: - YYDEBUG(455, *YYCURSOR); +#line 4991 "Zend/zend_language_scanner.c" +yy451: + YYDEBUG(451, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy456; + if (yych == 'A') goto yy452; if (yych != 'a') goto yy194; -yy456: - YYDEBUG(456, *YYCURSOR); +yy452: + YYDEBUG(452, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy451; - if (yych == 'n') goto yy451; + if (yych == 'N') goto yy447; + if (yych == 'n') goto yy447; goto yy194; -yy457: - YYDEBUG(457, *YYCURSOR); +yy453: + YYDEBUG(453, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy458; + if (yych == 'A') goto yy454; if (yych != 'a') goto yy194; -yy458: - YYDEBUG(458, *YYCURSOR); +yy454: + YYDEBUG(454, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy459; + if (yych == 'R') goto yy455; if (yych != 'r') goto yy194; -yy459: - YYDEBUG(459, *YYCURSOR); +yy455: + YYDEBUG(455, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'Y') goto yy428; - if (yych == 'y') goto yy428; + if (yych == 'Y') goto yy424; + if (yych == 'y') goto yy424; goto yy194; -yy460: - YYDEBUG(460, *YYCURSOR); +yy456: + YYDEBUG(456, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy461; + if (yych == 'S') goto yy457; if (yych != 's') goto yy194; -yy461: - YYDEBUG(461, *YYCURSOR); +yy457: + YYDEBUG(457, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy462; + if (yych == 'E') goto yy458; if (yych != 'e') goto yy194; -yy462: - YYDEBUG(462, *YYCURSOR); +yy458: + YYDEBUG(458, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy463; + if (yych == 'T') goto yy459; if (yych != 't') goto yy194; -yy463: - YYDEBUG(463, *YYCURSOR); +yy459: + YYDEBUG(459, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(464, *YYCURSOR); + YYDEBUG(460, *YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy463; + if (yych == '\t') goto yy459; goto yy194; } else { - if (yych <= ' ') goto yy463; + if (yych <= ' ') goto yy459; if (yych != ')') goto yy194; } - YYDEBUG(465, *YYCURSOR); + YYDEBUG(461, *YYCURSOR); ++YYCURSOR; - YYDEBUG(466, *YYCURSOR); + YYDEBUG(462, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1254 "Zend/zend_language_scanner.l" +#line 1246 "Zend/zend_language_scanner.l" { return T_UNSET_CAST; } -#line 5146 "Zend/zend_language_scanner.c" -yy467: - YYDEBUG(467, *YYCURSOR); +#line 5055 "Zend/zend_language_scanner.c" +yy463: + YYDEBUG(463, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy468; + if (yych == 'R') goto yy464; if (yych != 'r') goto yy187; -yy468: - YYDEBUG(468, *YYCURSOR); +yy464: + YYDEBUG(464, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(469, *YYCURSOR); + YYDEBUG(465, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1226 "Zend/zend_language_scanner.l" +#line 1218 "Zend/zend_language_scanner.l" { return T_VAR; } -#line 5164 "Zend/zend_language_scanner.c" -yy470: - YYDEBUG(470, *YYCURSOR); +#line 5073 "Zend/zend_language_scanner.c" +yy466: + YYDEBUG(466, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'M') goto yy474; - if (yych == 'm') goto yy474; + if (yych == 'M') goto yy470; + if (yych == 'm') goto yy470; goto yy187; -yy471: - YYDEBUG(471, *YYCURSOR); +yy467: + YYDEBUG(467, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'W') goto yy472; + if (yych == 'W') goto yy468; if (yych != 'w') goto yy187; -yy472: - YYDEBUG(472, *YYCURSOR); +yy468: + YYDEBUG(468, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(473, *YYCURSOR); + YYDEBUG(469, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1218 "Zend/zend_language_scanner.l" +#line 1210 "Zend/zend_language_scanner.l" { return T_NEW; } -#line 5188 "Zend/zend_language_scanner.c" -yy474: - YYDEBUG(474, *YYCURSOR); +#line 5097 "Zend/zend_language_scanner.c" +yy470: + YYDEBUG(470, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy475; + if (yych == 'E') goto yy471; if (yych != 'e') goto yy187; -yy475: - YYDEBUG(475, *YYCURSOR); +yy471: + YYDEBUG(471, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy476; + if (yych == 'S') goto yy472; if (yych != 's') goto yy187; -yy476: - YYDEBUG(476, *YYCURSOR); +yy472: + YYDEBUG(472, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy477; + if (yych == 'P') goto yy473; if (yych != 'p') goto yy187; -yy477: - YYDEBUG(477, *YYCURSOR); +yy473: + YYDEBUG(473, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy478; + if (yych == 'A') goto yy474; if (yych != 'a') goto yy187; -yy478: - YYDEBUG(478, *YYCURSOR); +yy474: + YYDEBUG(474, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy479; + if (yych == 'C') goto yy475; if (yych != 'c') goto yy187; -yy479: - YYDEBUG(479, *YYCURSOR); +yy475: + YYDEBUG(475, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy480; + if (yych == 'E') goto yy476; if (yych != 'e') goto yy187; -yy480: - YYDEBUG(480, *YYCURSOR); +yy476: + YYDEBUG(476, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(481, *YYCURSOR); + YYDEBUG(477, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1278 "Zend/zend_language_scanner.l" +#line 1270 "Zend/zend_language_scanner.l" { return T_NAMESPACE; } -#line 5231 "Zend/zend_language_scanner.c" +#line 5140 "Zend/zend_language_scanner.c" +yy478: + YYDEBUG(478, *YYCURSOR); + yyaccept = 3; + YYMARKER = ++YYCURSOR; + YYFILL(3); + yych = *YYCURSOR; + YYDEBUG(479, *YYCURSOR); + if (yych <= 'D') { + if (yych <= '/') goto yy190; + if (yych <= '9') goto yy478; + goto yy190; + } else { + if (yych <= 'E') goto yy193; + if (yych == 'e') goto yy193; + goto yy190; + } +yy480: + YYDEBUG(480, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(481, *YYCURSOR); + yyleng = YYCURSOR - SCNG(yy_text); +#line 1390 "Zend/zend_language_scanner.l" + { + return T_CONCAT_EQUAL; +} +#line 5166 "Zend/zend_language_scanner.c" yy482: YYDEBUG(482, *YYCURSOR); - ++YYCURSOR; + yych = *++YYCURSOR; + if (yych != '.') goto yy194; YYDEBUG(483, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(484, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1210 "Zend/zend_language_scanner.l" +#line 1206 "Zend/zend_language_scanner.l" + { + return T_ELLIPSIS; +} +#line 5179 "Zend/zend_language_scanner.c" +yy485: + YYDEBUG(485, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(486, *YYCURSOR); + yyleng = YYCURSOR - SCNG(yy_text); +#line 1198 "Zend/zend_language_scanner.l" { return T_PAAMAYIM_NEKUDOTAYIM; } -#line 5241 "Zend/zend_language_scanner.c" -yy484: - YYDEBUG(484, *YYCURSOR); +#line 5189 "Zend/zend_language_scanner.c" +yy487: + YYDEBUG(487, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy485: - YYDEBUG(485, *YYCURSOR); +yy488: + YYDEBUG(488, *YYCURSOR); if (yych <= '\f') { if (yych <= 0x08) goto yy141; - if (yych <= '\n') goto yy484; + if (yych <= '\n') goto yy487; goto yy141; } else { - if (yych <= '\r') goto yy484; - if (yych == ' ') goto yy484; + if (yych <= '\r') goto yy487; + if (yych == ' ') goto yy487; goto yy141; } -yy486: - YYDEBUG(486, *YYCURSOR); +yy489: + YYDEBUG(489, *YYCURSOR); ++YYCURSOR; - YYDEBUG(487, *YYCURSOR); + YYDEBUG(490, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1386 "Zend/zend_language_scanner.l" +#line 1378 "Zend/zend_language_scanner.l" { return T_MINUS_EQUAL; } -#line 5267 "Zend/zend_language_scanner.c" -yy488: - YYDEBUG(488, *YYCURSOR); +#line 5215 "Zend/zend_language_scanner.c" +yy491: + YYDEBUG(491, *YYCURSOR); ++YYCURSOR; - YYDEBUG(489, *YYCURSOR); + YYDEBUG(492, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1354 "Zend/zend_language_scanner.l" +#line 1346 "Zend/zend_language_scanner.l" { return T_DEC; } -#line 5277 "Zend/zend_language_scanner.c" -yy490: - YYDEBUG(490, *YYCURSOR); +#line 5225 "Zend/zend_language_scanner.c" +yy493: + YYDEBUG(493, *YYCURSOR); ++YYCURSOR; - YYDEBUG(491, *YYCURSOR); + YYDEBUG(494, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1180 "Zend/zend_language_scanner.l" +#line 1170 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); return T_OBJECT_OPERATOR; } -#line 5288 "Zend/zend_language_scanner.c" -yy492: - YYDEBUG(492, *YYCURSOR); +#line 5236 "Zend/zend_language_scanner.c" +yy495: + YYDEBUG(495, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { - if (yych == 'I') goto yy499; + if (yych == 'I') goto yy502; if (yych <= 'N') goto yy187; - goto yy500; + goto yy503; } else { if (yych <= 'i') { if (yych <= 'h') goto yy187; - goto yy499; + goto yy502; } else { - if (yych == 'o') goto yy500; + if (yych == 'o') goto yy503; goto yy187; } } -yy493: - YYDEBUG(493, *YYCURSOR); +yy496: + YYDEBUG(496, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'B') goto yy494; + if (yych == 'B') goto yy497; if (yych != 'b') goto yy187; -yy494: - YYDEBUG(494, *YYCURSOR); +yy497: + YYDEBUG(497, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy495; + if (yych == 'L') goto yy498; if (yych != 'l') goto yy187; -yy495: - YYDEBUG(495, *YYCURSOR); +yy498: + YYDEBUG(498, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy496; + if (yych == 'I') goto yy499; if (yych != 'i') goto yy187; -yy496: - YYDEBUG(496, *YYCURSOR); +yy499: + YYDEBUG(499, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy497; + if (yych == 'C') goto yy500; if (yych != 'c') goto yy187; -yy497: - YYDEBUG(497, *YYCURSOR); +yy500: + YYDEBUG(500, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(498, *YYCURSOR); + YYDEBUG(501, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1326 "Zend/zend_language_scanner.l" +#line 1318 "Zend/zend_language_scanner.l" { return T_PUBLIC; } -#line 5337 "Zend/zend_language_scanner.c" -yy499: - YYDEBUG(499, *YYCURSOR); +#line 5285 "Zend/zend_language_scanner.c" +yy502: + YYDEBUG(502, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'V') { - if (yych == 'N') goto yy508; + if (yych == 'N') goto yy511; if (yych <= 'U') goto yy187; - goto yy509; + goto yy512; } else { if (yych <= 'n') { if (yych <= 'm') goto yy187; - goto yy508; + goto yy511; } else { - if (yych == 'v') goto yy509; + if (yych == 'v') goto yy512; goto yy187; } } -yy500: - YYDEBUG(500, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy501; - if (yych != 't') goto yy187; -yy501: - YYDEBUG(501, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy502; - if (yych != 'e') goto yy187; -yy502: - YYDEBUG(502, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy503; - if (yych != 'c') goto yy187; yy503: YYDEBUG(503, *YYCURSOR); yych = *++YYCURSOR; @@ -5378,1112 +5311,1112 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy505: YYDEBUG(505, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy506; - if (yych != 'd') goto yy187; + if (yych == 'C') goto yy506; + if (yych != 'c') goto yy187; yy506: YYDEBUG(506, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'T') goto yy507; + if (yych != 't') goto yy187; +yy507: + YYDEBUG(507, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy508; + if (yych != 'e') goto yy187; +yy508: + YYDEBUG(508, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'D') goto yy509; + if (yych != 'd') goto yy187; +yy509: + YYDEBUG(509, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(507, *YYCURSOR); + YYDEBUG(510, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1322 "Zend/zend_language_scanner.l" +#line 1314 "Zend/zend_language_scanner.l" { return T_PROTECTED; } -#line 5396 "Zend/zend_language_scanner.c" -yy508: - YYDEBUG(508, *YYCURSOR); +#line 5344 "Zend/zend_language_scanner.c" +yy511: + YYDEBUG(511, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy514; - if (yych == 't') goto yy514; + if (yych == 'T') goto yy517; + if (yych == 't') goto yy517; goto yy187; -yy509: - YYDEBUG(509, *YYCURSOR); +yy512: + YYDEBUG(512, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy510; + if (yych == 'A') goto yy513; if (yych != 'a') goto yy187; -yy510: - YYDEBUG(510, *YYCURSOR); +yy513: + YYDEBUG(513, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy511; + if (yych == 'T') goto yy514; if (yych != 't') goto yy187; -yy511: - YYDEBUG(511, *YYCURSOR); +yy514: + YYDEBUG(514, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy512; + if (yych == 'E') goto yy515; if (yych != 'e') goto yy187; -yy512: - YYDEBUG(512, *YYCURSOR); +yy515: + YYDEBUG(515, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(513, *YYCURSOR); + YYDEBUG(516, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1318 "Zend/zend_language_scanner.l" +#line 1310 "Zend/zend_language_scanner.l" { return T_PRIVATE; } -#line 5430 "Zend/zend_language_scanner.c" -yy514: - YYDEBUG(514, *YYCURSOR); +#line 5378 "Zend/zend_language_scanner.c" +yy517: + YYDEBUG(517, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(515, *YYCURSOR); + YYDEBUG(518, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1156 "Zend/zend_language_scanner.l" +#line 1146 "Zend/zend_language_scanner.l" { return T_PRINT; } -#line 5443 "Zend/zend_language_scanner.c" -yy516: - YYDEBUG(516, *YYCURSOR); +#line 5391 "Zend/zend_language_scanner.c" +yy519: + YYDEBUG(519, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy521; - if (yych == 'o') goto yy521; + if (yych == 'O') goto yy524; + if (yych == 'o') goto yy524; goto yy187; -yy517: - YYDEBUG(517, *YYCURSOR); +yy520: + YYDEBUG(520, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy518; + if (yych == 'T') goto yy521; if (yych != 't') goto yy187; -yy518: - YYDEBUG(518, *YYCURSOR); +yy521: + YYDEBUG(521, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy519; + if (yych == 'O') goto yy522; if (yych != 'o') goto yy187; -yy519: - YYDEBUG(519, *YYCURSOR); +yy522: + YYDEBUG(522, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(520, *YYCURSOR); + YYDEBUG(523, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1148 "Zend/zend_language_scanner.l" +#line 1138 "Zend/zend_language_scanner.l" { return T_GOTO; } -#line 5472 "Zend/zend_language_scanner.c" -yy521: - YYDEBUG(521, *YYCURSOR); +#line 5420 "Zend/zend_language_scanner.c" +yy524: + YYDEBUG(524, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'B') goto yy522; + if (yych == 'B') goto yy525; if (yych != 'b') goto yy187; -yy522: - YYDEBUG(522, *YYCURSOR); +yy525: + YYDEBUG(525, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy523; + if (yych == 'A') goto yy526; if (yych != 'a') goto yy187; -yy523: - YYDEBUG(523, *YYCURSOR); +yy526: + YYDEBUG(526, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy524; + if (yych == 'L') goto yy527; if (yych != 'l') goto yy187; -yy524: - YYDEBUG(524, *YYCURSOR); +yy527: + YYDEBUG(527, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(525, *YYCURSOR); + YYDEBUG(528, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1290 "Zend/zend_language_scanner.l" +#line 1282 "Zend/zend_language_scanner.l" { return T_GLOBAL; } -#line 5500 "Zend/zend_language_scanner.c" -yy526: - YYDEBUG(526, *YYCURSOR); +#line 5448 "Zend/zend_language_scanner.c" +yy529: + YYDEBUG(529, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '<') goto yy534; + if (yych == '<') goto yy537; goto yy194; -yy527: - YYDEBUG(527, *YYCURSOR); +yy530: + YYDEBUG(530, *YYCURSOR); yych = *++YYCURSOR; goto yy181; -yy528: - YYDEBUG(528, *YYCURSOR); +yy531: + YYDEBUG(531, *YYCURSOR); yych = *++YYCURSOR; goto yy179; -yy529: - YYDEBUG(529, *YYCURSOR); +yy532: + YYDEBUG(532, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy530; + if (yych == 'E') goto yy533; if (yych != 'e') goto yy187; -yy530: - YYDEBUG(530, *YYCURSOR); +yy533: + YYDEBUG(533, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy531; + if (yych == 'A') goto yy534; if (yych != 'a') goto yy187; -yy531: - YYDEBUG(531, *YYCURSOR); +yy534: + YYDEBUG(534, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'K') goto yy532; + if (yych == 'K') goto yy535; if (yych != 'k') goto yy187; -yy532: - YYDEBUG(532, *YYCURSOR); +yy535: + YYDEBUG(535, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(533, *YYCURSOR); + YYDEBUG(536, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1140 "Zend/zend_language_scanner.l" +#line 1130 "Zend/zend_language_scanner.l" { return T_BREAK; } -#line 5541 "Zend/zend_language_scanner.c" -yy534: - YYDEBUG(534, *YYCURSOR); +#line 5489 "Zend/zend_language_scanner.c" +yy537: + YYDEBUG(537, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '<') goto yy270; + if (yych == '<') goto yy266; goto yy194; -yy535: - YYDEBUG(535, *YYCURSOR); +yy538: + YYDEBUG(538, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy542; - if (yych == 'a') goto yy542; + if (yych == 'A') goto yy545; + if (yych == 'a') goto yy545; goto yy187; -yy536: - YYDEBUG(536, *YYCURSOR); +yy539: + YYDEBUG(539, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy537; + if (yych == 'I') goto yy540; if (yych != 'i') goto yy187; -yy537: - YYDEBUG(537, *YYCURSOR); +yy540: + YYDEBUG(540, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy538; + if (yych == 'T') goto yy541; if (yych != 't') goto yy187; -yy538: - YYDEBUG(538, *YYCURSOR); +yy541: + YYDEBUG(541, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy539; + if (yych == 'C') goto yy542; if (yych != 'c') goto yy187; -yy539: - YYDEBUG(539, *YYCURSOR); +yy542: + YYDEBUG(542, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy540; + if (yych == 'H') goto yy543; if (yych != 'h') goto yy187; -yy540: - YYDEBUG(540, *YYCURSOR); +yy543: + YYDEBUG(543, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(541, *YYCURSOR); + YYDEBUG(544, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1124 "Zend/zend_language_scanner.l" +#line 1114 "Zend/zend_language_scanner.l" { return T_SWITCH; } -#line 5585 "Zend/zend_language_scanner.c" -yy542: - YYDEBUG(542, *YYCURSOR); +#line 5533 "Zend/zend_language_scanner.c" +yy545: + YYDEBUG(545, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy543; + if (yych == 'T') goto yy546; if (yych != 't') goto yy187; -yy543: - YYDEBUG(543, *YYCURSOR); +yy546: + YYDEBUG(546, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy544; + if (yych == 'I') goto yy547; if (yych != 'i') goto yy187; -yy544: - YYDEBUG(544, *YYCURSOR); +yy547: + YYDEBUG(547, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy545; + if (yych == 'C') goto yy548; if (yych != 'c') goto yy187; -yy545: - YYDEBUG(545, *YYCURSOR); +yy548: + YYDEBUG(548, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(546, *YYCURSOR); + YYDEBUG(549, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1306 "Zend/zend_language_scanner.l" +#line 1298 "Zend/zend_language_scanner.l" { return T_STATIC; } -#line 5613 "Zend/zend_language_scanner.c" -yy547: - YYDEBUG(547, *YYCURSOR); +#line 5561 "Zend/zend_language_scanner.c" +yy550: + YYDEBUG(550, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy558; - if (yych == 's') goto yy558; + if (yych == 'S') goto yy561; + if (yych == 's') goto yy561; goto yy187; -yy548: - YYDEBUG(548, *YYCURSOR); +yy551: + YYDEBUG(551, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy556; - if (yych == 'd') goto yy556; + if (yych == 'D') goto yy559; + if (yych == 'd') goto yy559; goto yy187; -yy549: - YYDEBUG(549, *YYCURSOR); +yy552: + YYDEBUG(552, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy552; - if (yych == 'r') goto yy552; + if (yych == 'R') goto yy555; + if (yych == 'r') goto yy555; goto yy187; -yy550: - YYDEBUG(550, *YYCURSOR); +yy553: + YYDEBUG(553, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(551, *YYCURSOR); + YYDEBUG(554, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1120 "Zend/zend_language_scanner.l" +#line 1110 "Zend/zend_language_scanner.l" { return T_AS; } -#line 5644 "Zend/zend_language_scanner.c" -yy552: - YYDEBUG(552, *YYCURSOR); +#line 5592 "Zend/zend_language_scanner.c" +yy555: + YYDEBUG(555, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy553; + if (yych == 'A') goto yy556; if (yych != 'a') goto yy187; -yy553: - YYDEBUG(553, *YYCURSOR); +yy556: + YYDEBUG(556, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'Y') goto yy554; + if (yych == 'Y') goto yy557; if (yych != 'y') goto yy187; -yy554: - YYDEBUG(554, *YYCURSOR); +yy557: + YYDEBUG(557, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(555, *YYCURSOR); + YYDEBUG(558, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1342 "Zend/zend_language_scanner.l" +#line 1334 "Zend/zend_language_scanner.l" { return T_ARRAY; } -#line 5667 "Zend/zend_language_scanner.c" -yy556: - YYDEBUG(556, *YYCURSOR); +#line 5615 "Zend/zend_language_scanner.c" +yy559: + YYDEBUG(559, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(557, *YYCURSOR); + YYDEBUG(560, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1438 "Zend/zend_language_scanner.l" +#line 1430 "Zend/zend_language_scanner.l" { return T_LOGICAL_AND; } -#line 5680 "Zend/zend_language_scanner.c" -yy558: - YYDEBUG(558, *YYCURSOR); +#line 5628 "Zend/zend_language_scanner.c" +yy561: + YYDEBUG(561, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy559; + if (yych == 'T') goto yy562; if (yych != 't') goto yy187; -yy559: - YYDEBUG(559, *YYCURSOR); +yy562: + YYDEBUG(562, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy560; + if (yych == 'R') goto yy563; if (yych != 'r') goto yy187; -yy560: - YYDEBUG(560, *YYCURSOR); +yy563: + YYDEBUG(563, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy561; + if (yych == 'A') goto yy564; if (yych != 'a') goto yy187; -yy561: - YYDEBUG(561, *YYCURSOR); +yy564: + YYDEBUG(564, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy562; + if (yych == 'C') goto yy565; if (yych != 'c') goto yy187; -yy562: - YYDEBUG(562, *YYCURSOR); +yy565: + YYDEBUG(565, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy563; + if (yych == 'T') goto yy566; if (yych != 't') goto yy187; -yy563: - YYDEBUG(563, *YYCURSOR); +yy566: + YYDEBUG(566, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(564, *YYCURSOR); + YYDEBUG(567, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1310 "Zend/zend_language_scanner.l" +#line 1302 "Zend/zend_language_scanner.l" { return T_ABSTRACT; } -#line 5718 "Zend/zend_language_scanner.c" -yy565: - YYDEBUG(565, *YYCURSOR); +#line 5666 "Zend/zend_language_scanner.c" +yy568: + YYDEBUG(568, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy566; + if (yych == 'I') goto yy569; if (yych != 'i') goto yy187; -yy566: - YYDEBUG(566, *YYCURSOR); +yy569: + YYDEBUG(569, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy567; + if (yych == 'L') goto yy570; if (yych != 'l') goto yy187; -yy567: - YYDEBUG(567, *YYCURSOR); +yy570: + YYDEBUG(570, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy568; + if (yych == 'E') goto yy571; if (yych != 'e') goto yy187; -yy568: - YYDEBUG(568, *YYCURSOR); +yy571: + YYDEBUG(571, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(569, *YYCURSOR); + YYDEBUG(572, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1080 "Zend/zend_language_scanner.l" +#line 1070 "Zend/zend_language_scanner.l" { return T_WHILE; } -#line 5746 "Zend/zend_language_scanner.c" -yy570: - YYDEBUG(570, *YYCURSOR); +#line 5694 "Zend/zend_language_scanner.c" +yy573: + YYDEBUG(573, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(571, *YYCURSOR); + YYDEBUG(574, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1064 "Zend/zend_language_scanner.l" +#line 1054 "Zend/zend_language_scanner.l" { return T_IF; } -#line 5759 "Zend/zend_language_scanner.c" -yy572: - YYDEBUG(572, *YYCURSOR); +#line 5707 "Zend/zend_language_scanner.c" +yy575: + YYDEBUG(575, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy614; - if (yych == 'p') goto yy614; + if (yych == 'P') goto yy617; + if (yych == 'p') goto yy617; goto yy187; -yy573: - YYDEBUG(573, *YYCURSOR); +yy576: + YYDEBUG(576, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= 'C') { if (yych <= 'B') goto yy187; - goto yy581; + goto yy584; } else { if (yych <= 'R') goto yy187; - if (yych <= 'S') goto yy579; - goto yy580; + if (yych <= 'S') goto yy582; + goto yy583; } } else { if (yych <= 'r') { - if (yych == 'c') goto yy581; + if (yych == 'c') goto yy584; goto yy187; } else { - if (yych <= 's') goto yy579; - if (yych <= 't') goto yy580; + if (yych <= 's') goto yy582; + if (yych <= 't') goto yy583; goto yy187; } } -yy574: - YYDEBUG(574, *YYCURSOR); +yy577: + YYDEBUG(577, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy575; + if (yych == 'S') goto yy578; if (yych != 's') goto yy187; -yy575: - YYDEBUG(575, *YYCURSOR); +yy578: + YYDEBUG(578, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy576; + if (yych == 'E') goto yy579; if (yych != 'e') goto yy187; -yy576: - YYDEBUG(576, *YYCURSOR); +yy579: + YYDEBUG(579, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy577; + if (yych == 'T') goto yy580; if (yych != 't') goto yy187; -yy577: - YYDEBUG(577, *YYCURSOR); +yy580: + YYDEBUG(580, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(578, *YYCURSOR); + YYDEBUG(581, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1294 "Zend/zend_language_scanner.l" +#line 1286 "Zend/zend_language_scanner.l" { return T_ISSET; } -#line 5815 "Zend/zend_language_scanner.c" -yy579: - YYDEBUG(579, *YYCURSOR); +#line 5763 "Zend/zend_language_scanner.c" +yy582: + YYDEBUG(582, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy600; - if (yych == 't') goto yy600; + if (yych == 'T') goto yy603; + if (yych == 't') goto yy603; goto yy187; -yy580: - YYDEBUG(580, *YYCURSOR); +yy583: + YYDEBUG(583, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy593; - if (yych == 'e') goto yy593; + if (yych == 'E') goto yy596; + if (yych == 'e') goto yy596; goto yy187; -yy581: - YYDEBUG(581, *YYCURSOR); +yy584: + YYDEBUG(584, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy582; + if (yych == 'L') goto yy585; if (yych != 'l') goto yy187; -yy582: - YYDEBUG(582, *YYCURSOR); +yy585: + YYDEBUG(585, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'U') goto yy583; + if (yych == 'U') goto yy586; if (yych != 'u') goto yy187; -yy583: - YYDEBUG(583, *YYCURSOR); +yy586: + YYDEBUG(586, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy584; + if (yych == 'D') goto yy587; if (yych != 'd') goto yy187; -yy584: - YYDEBUG(584, *YYCURSOR); +yy587: + YYDEBUG(587, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy585; + if (yych == 'E') goto yy588; if (yych != 'e') goto yy187; -yy585: - YYDEBUG(585, *YYCURSOR); +yy588: + YYDEBUG(588, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '9') { if (yych >= '0') goto yy186; } else { - if (yych <= '@') goto yy586; + if (yych <= '@') goto yy589; if (yych <= 'Z') goto yy186; } } else { if (yych <= '`') { - if (yych <= '_') goto yy587; + if (yych <= '_') goto yy590; } else { if (yych <= 'z') goto yy186; if (yych >= 0x7F) goto yy186; } } -yy586: - YYDEBUG(586, *YYCURSOR); +yy589: + YYDEBUG(589, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1262 "Zend/zend_language_scanner.l" +#line 1254 "Zend/zend_language_scanner.l" { return T_INCLUDE; } -#line 5873 "Zend/zend_language_scanner.c" -yy587: - YYDEBUG(587, *YYCURSOR); +#line 5821 "Zend/zend_language_scanner.c" +yy590: + YYDEBUG(590, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy588; + if (yych == 'O') goto yy591; if (yych != 'o') goto yy187; -yy588: - YYDEBUG(588, *YYCURSOR); +yy591: + YYDEBUG(591, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy589; + if (yych == 'N') goto yy592; if (yych != 'n') goto yy187; -yy589: - YYDEBUG(589, *YYCURSOR); +yy592: + YYDEBUG(592, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy590; + if (yych == 'C') goto yy593; if (yych != 'c') goto yy187; -yy590: - YYDEBUG(590, *YYCURSOR); +yy593: + YYDEBUG(593, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy591; + if (yych == 'E') goto yy594; if (yych != 'e') goto yy187; -yy591: - YYDEBUG(591, *YYCURSOR); +yy594: + YYDEBUG(594, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(592, *YYCURSOR); + YYDEBUG(595, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1266 "Zend/zend_language_scanner.l" +#line 1258 "Zend/zend_language_scanner.l" { return T_INCLUDE_ONCE; } -#line 5906 "Zend/zend_language_scanner.c" -yy593: - YYDEBUG(593, *YYCURSOR); +#line 5854 "Zend/zend_language_scanner.c" +yy596: + YYDEBUG(596, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy594; + if (yych == 'R') goto yy597; if (yych != 'r') goto yy187; -yy594: - YYDEBUG(594, *YYCURSOR); +yy597: + YYDEBUG(597, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'F') goto yy595; + if (yych == 'F') goto yy598; if (yych != 'f') goto yy187; -yy595: - YYDEBUG(595, *YYCURSOR); +yy598: + YYDEBUG(598, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy596; + if (yych == 'A') goto yy599; if (yych != 'a') goto yy187; -yy596: - YYDEBUG(596, *YYCURSOR); +yy599: + YYDEBUG(599, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy597; + if (yych == 'C') goto yy600; if (yych != 'c') goto yy187; -yy597: - YYDEBUG(597, *YYCURSOR); +yy600: + YYDEBUG(600, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy598; + if (yych == 'E') goto yy601; if (yych != 'e') goto yy187; -yy598: - YYDEBUG(598, *YYCURSOR); +yy601: + YYDEBUG(601, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(599, *YYCURSOR); + YYDEBUG(602, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1164 "Zend/zend_language_scanner.l" +#line 1154 "Zend/zend_language_scanner.l" { return T_INTERFACE; } -#line 5944 "Zend/zend_language_scanner.c" -yy600: - YYDEBUG(600, *YYCURSOR); +#line 5892 "Zend/zend_language_scanner.c" +yy603: + YYDEBUG(603, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { - if (yych == 'A') goto yy601; + if (yych == 'A') goto yy604; if (yych <= 'D') goto yy187; - goto yy602; + goto yy605; } else { if (yych <= 'a') { if (yych <= '`') goto yy187; } else { - if (yych == 'e') goto yy602; + if (yych == 'e') goto yy605; goto yy187; } } -yy601: - YYDEBUG(601, *YYCURSOR); +yy604: + YYDEBUG(604, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy608; - if (yych == 'n') goto yy608; + if (yych == 'N') goto yy611; + if (yych == 'n') goto yy611; goto yy187; -yy602: - YYDEBUG(602, *YYCURSOR); +yy605: + YYDEBUG(605, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy603; + if (yych == 'A') goto yy606; if (yych != 'a') goto yy187; -yy603: - YYDEBUG(603, *YYCURSOR); +yy606: + YYDEBUG(606, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy604; + if (yych == 'D') goto yy607; if (yych != 'd') goto yy187; -yy604: - YYDEBUG(604, *YYCURSOR); +yy607: + YYDEBUG(607, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy605; + if (yych == 'O') goto yy608; if (yych != 'o') goto yy187; -yy605: - YYDEBUG(605, *YYCURSOR); +yy608: + YYDEBUG(608, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'F') goto yy606; + if (yych == 'F') goto yy609; if (yych != 'f') goto yy187; -yy606: - YYDEBUG(606, *YYCURSOR); +yy609: + YYDEBUG(609, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(607, *YYCURSOR); + YYDEBUG(610, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1286 "Zend/zend_language_scanner.l" +#line 1278 "Zend/zend_language_scanner.l" { return T_INSTEADOF; } -#line 5998 "Zend/zend_language_scanner.c" -yy608: - YYDEBUG(608, *YYCURSOR); +#line 5946 "Zend/zend_language_scanner.c" +yy611: + YYDEBUG(611, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy609; + if (yych == 'C') goto yy612; if (yych != 'c') goto yy187; -yy609: - YYDEBUG(609, *YYCURSOR); +yy612: + YYDEBUG(612, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy610; + if (yych == 'E') goto yy613; if (yych != 'e') goto yy187; -yy610: - YYDEBUG(610, *YYCURSOR); +yy613: + YYDEBUG(613, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy611; + if (yych == 'O') goto yy614; if (yych != 'o') goto yy187; -yy611: - YYDEBUG(611, *YYCURSOR); +yy614: + YYDEBUG(614, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'F') goto yy612; + if (yych == 'F') goto yy615; if (yych != 'f') goto yy187; -yy612: - YYDEBUG(612, *YYCURSOR); +yy615: + YYDEBUG(615, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(613, *YYCURSOR); + YYDEBUG(616, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1116 "Zend/zend_language_scanner.l" +#line 1106 "Zend/zend_language_scanner.l" { return T_INSTANCEOF; } -#line 6031 "Zend/zend_language_scanner.c" -yy614: - YYDEBUG(614, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'L') goto yy615; - if (yych != 'l') goto yy187; -yy615: - YYDEBUG(615, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy616; - if (yych != 'e') goto yy187; -yy616: - YYDEBUG(616, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'M') goto yy617; - if (yych != 'm') goto yy187; +#line 5979 "Zend/zend_language_scanner.c" yy617: YYDEBUG(617, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy618; - if (yych != 'e') goto yy187; + if (yych == 'L') goto yy618; + if (yych != 'l') goto yy187; yy618: YYDEBUG(618, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy619; - if (yych != 'n') goto yy187; + if (yych == 'E') goto yy619; + if (yych != 'e') goto yy187; yy619: YYDEBUG(619, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy620; - if (yych != 't') goto yy187; + if (yych == 'M') goto yy620; + if (yych != 'm') goto yy187; yy620: YYDEBUG(620, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy621; - if (yych != 's') goto yy187; + if (yych == 'E') goto yy621; + if (yych != 'e') goto yy187; yy621: YYDEBUG(621, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'N') goto yy622; + if (yych != 'n') goto yy187; +yy622: + YYDEBUG(622, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'T') goto yy623; + if (yych != 't') goto yy187; +yy623: + YYDEBUG(623, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'S') goto yy624; + if (yych != 's') goto yy187; +yy624: + YYDEBUG(624, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(622, *YYCURSOR); + YYDEBUG(625, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1176 "Zend/zend_language_scanner.l" +#line 1166 "Zend/zend_language_scanner.l" { return T_IMPLEMENTS; } -#line 6079 "Zend/zend_language_scanner.c" -yy623: - YYDEBUG(623, *YYCURSOR); +#line 6027 "Zend/zend_language_scanner.c" +yy626: + YYDEBUG(626, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy631; - if (yych == 'r') goto yy631; + if (yych == 'R') goto yy634; + if (yych == 'r') goto yy634; goto yy187; -yy624: - YYDEBUG(624, *YYCURSOR); +yy627: + YYDEBUG(627, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'Y') { - if (yych == 'A') goto yy627; + if (yych == 'A') goto yy630; if (yych <= 'X') goto yy187; } else { if (yych <= 'a') { if (yych <= '`') goto yy187; - goto yy627; + goto yy630; } else { if (yych != 'y') goto yy187; } } - YYDEBUG(625, *YYCURSOR); + YYDEBUG(628, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(626, *YYCURSOR); + YYDEBUG(629, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1048 "Zend/zend_language_scanner.l" +#line 1038 "Zend/zend_language_scanner.l" { return T_TRY; } -#line 6111 "Zend/zend_language_scanner.c" -yy627: - YYDEBUG(627, *YYCURSOR); +#line 6059 "Zend/zend_language_scanner.c" +yy630: + YYDEBUG(630, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy628; + if (yych == 'I') goto yy631; if (yych != 'i') goto yy187; -yy628: - YYDEBUG(628, *YYCURSOR); +yy631: + YYDEBUG(631, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy629; + if (yych == 'T') goto yy632; if (yych != 't') goto yy187; -yy629: - YYDEBUG(629, *YYCURSOR); +yy632: + YYDEBUG(632, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(630, *YYCURSOR); + YYDEBUG(633, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1168 "Zend/zend_language_scanner.l" +#line 1158 "Zend/zend_language_scanner.l" { return T_TRAIT; } -#line 6134 "Zend/zend_language_scanner.c" -yy631: - YYDEBUG(631, *YYCURSOR); +#line 6082 "Zend/zend_language_scanner.c" +yy634: + YYDEBUG(634, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy632; + if (yych == 'O') goto yy635; if (yych != 'o') goto yy187; -yy632: - YYDEBUG(632, *YYCURSOR); +yy635: + YYDEBUG(635, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'W') goto yy633; + if (yych == 'W') goto yy636; if (yych != 'w') goto yy187; -yy633: - YYDEBUG(633, *YYCURSOR); +yy636: + YYDEBUG(636, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(634, *YYCURSOR); + YYDEBUG(637, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1060 "Zend/zend_language_scanner.l" +#line 1050 "Zend/zend_language_scanner.l" { return T_THROW; } -#line 6157 "Zend/zend_language_scanner.c" -yy635: - YYDEBUG(635, *YYCURSOR); +#line 6105 "Zend/zend_language_scanner.c" +yy638: + YYDEBUG(638, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy636; + if (yych == 'E') goto yy639; if (yych != 'e') goto yy187; -yy636: - YYDEBUG(636, *YYCURSOR); +yy639: + YYDEBUG(639, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy637; + if (yych == 'L') goto yy640; if (yych != 'l') goto yy187; -yy637: - YYDEBUG(637, *YYCURSOR); +yy640: + YYDEBUG(640, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy638; + if (yych == 'D') goto yy641; if (yych != 'd') goto yy187; -yy638: - YYDEBUG(638, *YYCURSOR); +yy641: + YYDEBUG(641, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(639, *YYCURSOR); + YYDEBUG(642, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1044 "Zend/zend_language_scanner.l" +#line 1034 "Zend/zend_language_scanner.l" { return T_YIELD; } -#line 6185 "Zend/zend_language_scanner.c" -yy640: - YYDEBUG(640, *YYCURSOR); +#line 6133 "Zend/zend_language_scanner.c" +yy643: + YYDEBUG(643, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { - if (yych == 'Q') goto yy642; + if (yych == 'Q') goto yy645; if (yych <= 'S') goto yy187; } else { if (yych <= 'q') { if (yych <= 'p') goto yy187; - goto yy642; + goto yy645; } else { if (yych != 't') goto yy187; } } - YYDEBUG(641, *YYCURSOR); + YYDEBUG(644, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'U') goto yy654; - if (yych == 'u') goto yy654; + if (yych == 'U') goto yy657; + if (yych == 'u') goto yy657; goto yy187; -yy642: - YYDEBUG(642, *YYCURSOR); +yy645: + YYDEBUG(645, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'U') goto yy643; + if (yych == 'U') goto yy646; if (yych != 'u') goto yy187; -yy643: - YYDEBUG(643, *YYCURSOR); +yy646: + YYDEBUG(646, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy644; + if (yych == 'I') goto yy647; if (yych != 'i') goto yy187; -yy644: - YYDEBUG(644, *YYCURSOR); +yy647: + YYDEBUG(647, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy645; + if (yych == 'R') goto yy648; if (yych != 'r') goto yy187; -yy645: - YYDEBUG(645, *YYCURSOR); +yy648: + YYDEBUG(648, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy646; + if (yych == 'E') goto yy649; if (yych != 'e') goto yy187; -yy646: - YYDEBUG(646, *YYCURSOR); +yy649: + YYDEBUG(649, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '9') { if (yych >= '0') goto yy186; } else { - if (yych <= '@') goto yy647; + if (yych <= '@') goto yy650; if (yych <= 'Z') goto yy186; } } else { if (yych <= '`') { - if (yych <= '_') goto yy648; + if (yych <= '_') goto yy651; } else { if (yych <= 'z') goto yy186; if (yych >= 0x7F) goto yy186; } } -yy647: - YYDEBUG(647, *YYCURSOR); +yy650: + YYDEBUG(650, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1270 "Zend/zend_language_scanner.l" +#line 1262 "Zend/zend_language_scanner.l" { return T_REQUIRE; } -#line 6250 "Zend/zend_language_scanner.c" -yy648: - YYDEBUG(648, *YYCURSOR); +#line 6198 "Zend/zend_language_scanner.c" +yy651: + YYDEBUG(651, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy649; + if (yych == 'O') goto yy652; if (yych != 'o') goto yy187; -yy649: - YYDEBUG(649, *YYCURSOR); +yy652: + YYDEBUG(652, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy650; + if (yych == 'N') goto yy653; if (yych != 'n') goto yy187; -yy650: - YYDEBUG(650, *YYCURSOR); +yy653: + YYDEBUG(653, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy651; + if (yych == 'C') goto yy654; if (yych != 'c') goto yy187; -yy651: - YYDEBUG(651, *YYCURSOR); +yy654: + YYDEBUG(654, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy652; + if (yych == 'E') goto yy655; if (yych != 'e') goto yy187; -yy652: - YYDEBUG(652, *YYCURSOR); +yy655: + YYDEBUG(655, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(653, *YYCURSOR); + YYDEBUG(656, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1274 "Zend/zend_language_scanner.l" +#line 1266 "Zend/zend_language_scanner.l" { return T_REQUIRE_ONCE; } -#line 6283 "Zend/zend_language_scanner.c" -yy654: - YYDEBUG(654, *YYCURSOR); +#line 6231 "Zend/zend_language_scanner.c" +yy657: + YYDEBUG(657, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy655; + if (yych == 'R') goto yy658; if (yych != 'r') goto yy187; -yy655: - YYDEBUG(655, *YYCURSOR); +yy658: + YYDEBUG(658, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy656; + if (yych == 'N') goto yy659; if (yych != 'n') goto yy187; -yy656: - YYDEBUG(656, *YYCURSOR); +yy659: + YYDEBUG(659, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(657, *YYCURSOR); + YYDEBUG(660, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1040 "Zend/zend_language_scanner.l" +#line 1030 "Zend/zend_language_scanner.l" { return T_RETURN; } -#line 6306 "Zend/zend_language_scanner.c" -yy658: - YYDEBUG(658, *YYCURSOR); +#line 6254 "Zend/zend_language_scanner.c" +yy661: + YYDEBUG(661, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= 'L') { if (yych <= 'K') goto yy187; - goto yy681; + goto yy684; } else { if (yych <= 'R') goto yy187; - if (yych <= 'S') goto yy680; - goto yy679; + if (yych <= 'S') goto yy683; + goto yy682; } } else { if (yych <= 'r') { - if (yych == 'l') goto yy681; + if (yych == 'l') goto yy684; goto yy187; } else { - if (yych <= 's') goto yy680; - if (yych <= 't') goto yy679; + if (yych <= 's') goto yy683; + if (yych <= 't') goto yy682; goto yy187; } } -yy659: - YYDEBUG(659, *YYCURSOR); +yy662: + YYDEBUG(662, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { - if (yych == 'A') goto yy671; + if (yych == 'A') goto yy674; if (yych <= 'N') goto yy187; - goto yy672; + goto yy675; } else { if (yych <= 'a') { if (yych <= '`') goto yy187; - goto yy671; + goto yy674; } else { - if (yych == 'o') goto yy672; + if (yych == 'o') goto yy675; goto yy187; } } -yy660: - YYDEBUG(660, *YYCURSOR); +yy663: + YYDEBUG(663, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy661; + if (yych == 'N') goto yy664; if (yych != 'n') goto yy187; -yy661: - YYDEBUG(661, *YYCURSOR); +yy664: + YYDEBUG(664, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= 'R') goto yy187; - if (yych >= 'T') goto yy663; + if (yych >= 'T') goto yy666; } else { if (yych <= 'r') goto yy187; - if (yych <= 's') goto yy662; - if (yych <= 't') goto yy663; + if (yych <= 's') goto yy665; + if (yych <= 't') goto yy666; goto yy187; } -yy662: - YYDEBUG(662, *YYCURSOR); +yy665: + YYDEBUG(665, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy669; - if (yych == 't') goto yy669; + if (yych == 'T') goto yy672; + if (yych == 't') goto yy672; goto yy187; -yy663: - YYDEBUG(663, *YYCURSOR); +yy666: + YYDEBUG(666, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy664; + if (yych == 'I') goto yy667; if (yych != 'i') goto yy187; -yy664: - YYDEBUG(664, *YYCURSOR); +yy667: + YYDEBUG(667, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy665; + if (yych == 'N') goto yy668; if (yych != 'n') goto yy187; -yy665: - YYDEBUG(665, *YYCURSOR); +yy668: + YYDEBUG(668, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'U') goto yy666; + if (yych == 'U') goto yy669; if (yych != 'u') goto yy187; -yy666: - YYDEBUG(666, *YYCURSOR); +yy669: + YYDEBUG(669, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy667; + if (yych == 'E') goto yy670; if (yych != 'e') goto yy187; -yy667: - YYDEBUG(667, *YYCURSOR); +yy670: + YYDEBUG(670, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(668, *YYCURSOR); + YYDEBUG(671, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1144 "Zend/zend_language_scanner.l" +#line 1134 "Zend/zend_language_scanner.l" { return T_CONTINUE; } -#line 6400 "Zend/zend_language_scanner.c" -yy669: - YYDEBUG(669, *YYCURSOR); +#line 6348 "Zend/zend_language_scanner.c" +yy672: + YYDEBUG(672, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(670, *YYCURSOR); + YYDEBUG(673, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1036 "Zend/zend_language_scanner.l" +#line 1026 "Zend/zend_language_scanner.l" { return T_CONST; } -#line 6413 "Zend/zend_language_scanner.c" -yy671: - YYDEBUG(671, *YYCURSOR); +#line 6361 "Zend/zend_language_scanner.c" +yy674: + YYDEBUG(674, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy676; - if (yych == 's') goto yy676; + if (yych == 'S') goto yy679; + if (yych == 's') goto yy679; goto yy187; -yy672: - YYDEBUG(672, *YYCURSOR); +yy675: + YYDEBUG(675, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy673; + if (yych == 'N') goto yy676; if (yych != 'n') goto yy187; -yy673: - YYDEBUG(673, *YYCURSOR); +yy676: + YYDEBUG(676, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy674; + if (yych == 'E') goto yy677; if (yych != 'e') goto yy187; -yy674: - YYDEBUG(674, *YYCURSOR); +yy677: + YYDEBUG(677, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(675, *YYCURSOR); + YYDEBUG(678, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1222 "Zend/zend_language_scanner.l" +#line 1214 "Zend/zend_language_scanner.l" { return T_CLONE; } -#line 6442 "Zend/zend_language_scanner.c" -yy676: - YYDEBUG(676, *YYCURSOR); +#line 6390 "Zend/zend_language_scanner.c" +yy679: + YYDEBUG(679, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy677; + if (yych == 'S') goto yy680; if (yych != 's') goto yy187; -yy677: - YYDEBUG(677, *YYCURSOR); +yy680: + YYDEBUG(680, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(678, *YYCURSOR); + YYDEBUG(681, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1160 "Zend/zend_language_scanner.l" +#line 1150 "Zend/zend_language_scanner.l" { return T_CLASS; } -#line 6460 "Zend/zend_language_scanner.c" -yy679: - YYDEBUG(679, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy690; - if (yych == 'c') goto yy690; - goto yy187; -yy680: - YYDEBUG(680, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy688; - if (yych == 'e') goto yy688; - goto yy187; -yy681: - YYDEBUG(681, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'L') goto yy682; - if (yych != 'l') goto yy187; +#line 6408 "Zend/zend_language_scanner.c" yy682: YYDEBUG(682, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy683; - if (yych != 'a') goto yy187; + if (yych == 'C') goto yy693; + if (yych == 'c') goto yy693; + goto yy187; yy683: YYDEBUG(683, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'B') goto yy684; - if (yych != 'b') goto yy187; + if (yych == 'E') goto yy691; + if (yych == 'e') goto yy691; + goto yy187; yy684: YYDEBUG(684, *YYCURSOR); yych = *++YYCURSOR; @@ -6492,39 +6425,36 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy685: YYDEBUG(685, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy686; - if (yych != 'e') goto yy187; + if (yych == 'A') goto yy686; + if (yych != 'a') goto yy187; yy686: YYDEBUG(686, *YYCURSOR); - ++YYCURSOR; - if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; - } + yych = *++YYCURSOR; + if (yych == 'B') goto yy687; + if (yych != 'b') goto yy187; +yy687: YYDEBUG(687, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 1346 "Zend/zend_language_scanner.l" - { - return T_CALLABLE; -} -#line 6510 "Zend/zend_language_scanner.c" + yych = *++YYCURSOR; + if (yych == 'L') goto yy688; + if (yych != 'l') goto yy187; yy688: YYDEBUG(688, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy689; + if (yych != 'e') goto yy187; +yy689: + YYDEBUG(689, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(689, *YYCURSOR); + YYDEBUG(690, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1132 "Zend/zend_language_scanner.l" +#line 1338 "Zend/zend_language_scanner.l" { - return T_CASE; + return T_CALLABLE; } -#line 6523 "Zend/zend_language_scanner.c" -yy690: - YYDEBUG(690, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'H') goto yy691; - if (yych != 'h') goto yy187; +#line 6458 "Zend/zend_language_scanner.c" yy691: YYDEBUG(691, *YYCURSOR); ++YYCURSOR; @@ -6533,719 +6463,737 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(692, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1052 "Zend/zend_language_scanner.l" +#line 1122 "Zend/zend_language_scanner.l" { - return T_CATCH; + return T_CASE; } -#line 6541 "Zend/zend_language_scanner.c" +#line 6471 "Zend/zend_language_scanner.c" yy693: YYDEBUG(693, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy710; - if (yych == 'n') goto yy710; - goto yy187; + if (yych == 'H') goto yy694; + if (yych != 'h') goto yy187; yy694: YYDEBUG(694, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy703; - if (yych == 'r') goto yy703; - goto yy187; -yy695: + ++YYCURSOR; + if (yybm[0+(yych = *YYCURSOR)] & 4) { + goto yy186; + } YYDEBUG(695, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy696; - if (yych != 'n') goto yy187; + yyleng = YYCURSOR - SCNG(yy_text); +#line 1042 "Zend/zend_language_scanner.l" + { + return T_CATCH; +} +#line 6489 "Zend/zend_language_scanner.c" yy696: YYDEBUG(696, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy697; - if (yych != 'c') goto yy187; + if (yych == 'N') goto yy713; + if (yych == 'n') goto yy713; + goto yy187; yy697: YYDEBUG(697, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy698; - if (yych != 't') goto yy187; + if (yych == 'R') goto yy706; + if (yych == 'r') goto yy706; + goto yy187; yy698: YYDEBUG(698, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy699; - if (yych != 'i') goto yy187; + if (yych == 'N') goto yy699; + if (yych != 'n') goto yy187; yy699: YYDEBUG(699, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy700; - if (yych != 'o') goto yy187; + if (yych == 'C') goto yy700; + if (yych != 'c') goto yy187; yy700: YYDEBUG(700, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy701; + if (yych == 'T') goto yy701; + if (yych != 't') goto yy187; +yy701: + YYDEBUG(701, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'I') goto yy702; + if (yych != 'i') goto yy187; +yy702: + YYDEBUG(702, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'O') goto yy703; + if (yych != 'o') goto yy187; +yy703: + YYDEBUG(703, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'N') goto yy704; if (yych != 'n') goto yy187; -yy701: - YYDEBUG(701, *YYCURSOR); +yy704: + YYDEBUG(704, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(702, *YYCURSOR); + YYDEBUG(705, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1032 "Zend/zend_language_scanner.l" +#line 1022 "Zend/zend_language_scanner.l" { return T_FUNCTION; } -#line 6596 "Zend/zend_language_scanner.c" -yy703: - YYDEBUG(703, *YYCURSOR); +#line 6544 "Zend/zend_language_scanner.c" +yy706: + YYDEBUG(706, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '@') { - if (yych <= '/') goto yy704; + if (yych <= '/') goto yy707; if (yych <= '9') goto yy186; } else { - if (yych == 'E') goto yy705; + if (yych == 'E') goto yy708; if (yych <= 'Z') goto yy186; } } else { if (yych <= 'd') { if (yych != '`') goto yy186; } else { - if (yych <= 'e') goto yy705; + if (yych <= 'e') goto yy708; if (yych <= 'z') goto yy186; if (yych >= 0x7F) goto yy186; } } -yy704: - YYDEBUG(704, *YYCURSOR); +yy707: + YYDEBUG(707, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1092 "Zend/zend_language_scanner.l" +#line 1082 "Zend/zend_language_scanner.l" { return T_FOR; } -#line 6624 "Zend/zend_language_scanner.c" -yy705: - YYDEBUG(705, *YYCURSOR); +#line 6572 "Zend/zend_language_scanner.c" +yy708: + YYDEBUG(708, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy706; + if (yych == 'A') goto yy709; if (yych != 'a') goto yy187; -yy706: - YYDEBUG(706, *YYCURSOR); +yy709: + YYDEBUG(709, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy707; + if (yych == 'C') goto yy710; if (yych != 'c') goto yy187; -yy707: - YYDEBUG(707, *YYCURSOR); +yy710: + YYDEBUG(710, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy708; + if (yych == 'H') goto yy711; if (yych != 'h') goto yy187; -yy708: - YYDEBUG(708, *YYCURSOR); +yy711: + YYDEBUG(711, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(709, *YYCURSOR); + YYDEBUG(712, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1100 "Zend/zend_language_scanner.l" +#line 1090 "Zend/zend_language_scanner.l" { return T_FOREACH; } -#line 6652 "Zend/zend_language_scanner.c" -yy710: - YYDEBUG(710, *YYCURSOR); +#line 6600 "Zend/zend_language_scanner.c" +yy713: + YYDEBUG(713, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy711; + if (yych == 'A') goto yy714; if (yych != 'a') goto yy187; -yy711: - YYDEBUG(711, *YYCURSOR); +yy714: + YYDEBUG(714, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy712; + if (yych == 'L') goto yy715; if (yych != 'l') goto yy187; -yy712: - YYDEBUG(712, *YYCURSOR); +yy715: + YYDEBUG(715, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '@') { - if (yych <= '/') goto yy713; + if (yych <= '/') goto yy716; if (yych <= '9') goto yy186; } else { - if (yych == 'L') goto yy714; + if (yych == 'L') goto yy717; if (yych <= 'Z') goto yy186; } } else { if (yych <= 'k') { if (yych != '`') goto yy186; } else { - if (yych <= 'l') goto yy714; + if (yych <= 'l') goto yy717; if (yych <= 'z') goto yy186; if (yych >= 0x7F) goto yy186; } } -yy713: - YYDEBUG(713, *YYCURSOR); +yy716: + YYDEBUG(716, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1314 "Zend/zend_language_scanner.l" +#line 1306 "Zend/zend_language_scanner.l" { return T_FINAL; } -#line 6690 "Zend/zend_language_scanner.c" -yy714: - YYDEBUG(714, *YYCURSOR); +#line 6638 "Zend/zend_language_scanner.c" +yy717: + YYDEBUG(717, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'Y') goto yy715; + if (yych == 'Y') goto yy718; if (yych != 'y') goto yy187; -yy715: - YYDEBUG(715, *YYCURSOR); +yy718: + YYDEBUG(718, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(716, *YYCURSOR); + YYDEBUG(719, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1056 "Zend/zend_language_scanner.l" +#line 1046 "Zend/zend_language_scanner.l" { return T_FINALLY; } -#line 6708 "Zend/zend_language_scanner.c" -yy717: - YYDEBUG(717, *YYCURSOR); +#line 6656 "Zend/zend_language_scanner.c" +yy720: + YYDEBUG(720, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'F') { - if (yych == 'C') goto yy723; + if (yych == 'C') goto yy726; if (yych <= 'E') goto yy187; - goto yy724; + goto yy727; } else { if (yych <= 'c') { if (yych <= 'b') goto yy187; - goto yy723; + goto yy726; } else { - if (yych == 'f') goto yy724; + if (yych == 'f') goto yy727; goto yy187; } } -yy718: - YYDEBUG(718, *YYCURSOR); +yy721: + YYDEBUG(721, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy721; - if (yych == 'e') goto yy721; + if (yych == 'E') goto yy724; + if (yych == 'e') goto yy724; goto yy187; -yy719: - YYDEBUG(719, *YYCURSOR); +yy722: + YYDEBUG(722, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(720, *YYCURSOR); + YYDEBUG(723, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1088 "Zend/zend_language_scanner.l" +#line 1078 "Zend/zend_language_scanner.l" { return T_DO; } -#line 6743 "Zend/zend_language_scanner.c" -yy721: - YYDEBUG(721, *YYCURSOR); +#line 6691 "Zend/zend_language_scanner.c" +yy724: + YYDEBUG(724, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(722, *YYCURSOR); + YYDEBUG(725, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1028 "Zend/zend_language_scanner.l" +#line 1018 "Zend/zend_language_scanner.l" { return T_EXIT; } -#line 6756 "Zend/zend_language_scanner.c" -yy723: - YYDEBUG(723, *YYCURSOR); +#line 6704 "Zend/zend_language_scanner.c" +yy726: + YYDEBUG(726, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy730; - if (yych == 'l') goto yy730; + if (yych == 'L') goto yy733; + if (yych == 'l') goto yy733; goto yy187; -yy724: - YYDEBUG(724, *YYCURSOR); +yy727: + YYDEBUG(727, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy725; + if (yych == 'A') goto yy728; if (yych != 'a') goto yy187; -yy725: - YYDEBUG(725, *YYCURSOR); +yy728: + YYDEBUG(728, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'U') goto yy726; + if (yych == 'U') goto yy729; if (yych != 'u') goto yy187; -yy726: - YYDEBUG(726, *YYCURSOR); +yy729: + YYDEBUG(729, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy727; + if (yych == 'L') goto yy730; if (yych != 'l') goto yy187; -yy727: - YYDEBUG(727, *YYCURSOR); +yy730: + YYDEBUG(730, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy728; + if (yych == 'T') goto yy731; if (yych != 't') goto yy187; -yy728: - YYDEBUG(728, *YYCURSOR); +yy731: + YYDEBUG(731, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(729, *YYCURSOR); + YYDEBUG(732, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1136 "Zend/zend_language_scanner.l" +#line 1126 "Zend/zend_language_scanner.l" { return T_DEFAULT; } -#line 6795 "Zend/zend_language_scanner.c" -yy730: - YYDEBUG(730, *YYCURSOR); +#line 6743 "Zend/zend_language_scanner.c" +yy733: + YYDEBUG(733, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy731; + if (yych == 'A') goto yy734; if (yych != 'a') goto yy187; -yy731: - YYDEBUG(731, *YYCURSOR); +yy734: + YYDEBUG(734, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy732; + if (yych == 'R') goto yy735; if (yych != 'r') goto yy187; -yy732: - YYDEBUG(732, *YYCURSOR); +yy735: + YYDEBUG(735, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy733; + if (yych == 'E') goto yy736; if (yych != 'e') goto yy187; -yy733: - YYDEBUG(733, *YYCURSOR); +yy736: + YYDEBUG(736, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(734, *YYCURSOR); + YYDEBUG(737, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1108 "Zend/zend_language_scanner.l" +#line 1098 "Zend/zend_language_scanner.l" { return T_DECLARE; } -#line 6823 "Zend/zend_language_scanner.c" -yy735: - YYDEBUG(735, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'H') goto yy797; - if (yych == 'h') goto yy797; - goto yy187; -yy736: - YYDEBUG(736, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy791; - if (yych == 's') goto yy791; - goto yy187; -yy737: - YYDEBUG(737, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'P') goto yy787; - if (yych == 'p') goto yy787; - goto yy187; +#line 6771 "Zend/zend_language_scanner.c" yy738: YYDEBUG(738, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy753; - if (yych == 'd') goto yy753; + if (yych == 'H') goto yy800; + if (yych == 'h') goto yy800; goto yy187; yy739: YYDEBUG(739, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy750; - if (yych == 'a') goto yy750; + if (yych == 'S') goto yy794; + if (yych == 's') goto yy794; goto yy187; yy740: YYDEBUG(740, *YYCURSOR); yych = *++YYCURSOR; + if (yych == 'P') goto yy790; + if (yych == 'p') goto yy790; + goto yy187; +yy741: + YYDEBUG(741, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'D') goto yy756; + if (yych == 'd') goto yy756; + goto yy187; +yy742: + YYDEBUG(742, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'A') goto yy753; + if (yych == 'a') goto yy753; + goto yy187; +yy743: + YYDEBUG(743, *YYCURSOR); + yych = *++YYCURSOR; if (yych <= 'T') { - if (yych == 'I') goto yy741; + if (yych == 'I') goto yy744; if (yych <= 'S') goto yy187; - goto yy742; + goto yy745; } else { if (yych <= 'i') { if (yych <= 'h') goto yy187; } else { - if (yych == 't') goto yy742; + if (yych == 't') goto yy745; goto yy187; } } -yy741: - YYDEBUG(741, *YYCURSOR); +yy744: + YYDEBUG(744, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy748; - if (yych == 't') goto yy748; + if (yych == 'T') goto yy751; + if (yych == 't') goto yy751; goto yy187; -yy742: - YYDEBUG(742, *YYCURSOR); +yy745: + YYDEBUG(745, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy743; + if (yych == 'E') goto yy746; if (yych != 'e') goto yy187; -yy743: - YYDEBUG(743, *YYCURSOR); +yy746: + YYDEBUG(746, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy744; + if (yych == 'N') goto yy747; if (yych != 'n') goto yy187; -yy744: - YYDEBUG(744, *YYCURSOR); +yy747: + YYDEBUG(747, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy745; + if (yych == 'D') goto yy748; if (yych != 'd') goto yy187; -yy745: - YYDEBUG(745, *YYCURSOR); +yy748: + YYDEBUG(748, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy746; + if (yych == 'S') goto yy749; if (yych != 's') goto yy187; -yy746: - YYDEBUG(746, *YYCURSOR); +yy749: + YYDEBUG(749, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(747, *YYCURSOR); + YYDEBUG(750, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1172 "Zend/zend_language_scanner.l" +#line 1162 "Zend/zend_language_scanner.l" { return T_EXTENDS; } -#line 6907 "Zend/zend_language_scanner.c" -yy748: - YYDEBUG(748, *YYCURSOR); +#line 6855 "Zend/zend_language_scanner.c" +yy751: + YYDEBUG(751, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(749, *YYCURSOR); + YYDEBUG(752, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1024 "Zend/zend_language_scanner.l" +#line 1014 "Zend/zend_language_scanner.l" { return T_EXIT; } -#line 6920 "Zend/zend_language_scanner.c" -yy750: - YYDEBUG(750, *YYCURSOR); +#line 6868 "Zend/zend_language_scanner.c" +yy753: + YYDEBUG(753, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy751; + if (yych == 'L') goto yy754; if (yych != 'l') goto yy187; -yy751: - YYDEBUG(751, *YYCURSOR); +yy754: + YYDEBUG(754, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(752, *YYCURSOR); + YYDEBUG(755, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1258 "Zend/zend_language_scanner.l" +#line 1250 "Zend/zend_language_scanner.l" { return T_EVAL; } -#line 6938 "Zend/zend_language_scanner.c" -yy753: - YYDEBUG(753, *YYCURSOR); +#line 6886 "Zend/zend_language_scanner.c" +yy756: + YYDEBUG(756, *YYCURSOR); yych = *++YYCURSOR; YYDEBUG(-1, yych); switch (yych) { case 'D': - case 'd': goto yy754; + case 'd': goto yy757; case 'F': - case 'f': goto yy755; + case 'f': goto yy758; case 'I': - case 'i': goto yy756; + case 'i': goto yy759; case 'S': - case 's': goto yy757; + case 's': goto yy760; case 'W': - case 'w': goto yy758; + case 'w': goto yy761; default: goto yy187; } -yy754: - YYDEBUG(754, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy780; - if (yych == 'e') goto yy780; - goto yy187; -yy755: - YYDEBUG(755, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'O') goto yy772; - if (yych == 'o') goto yy772; - goto yy187; -yy756: - YYDEBUG(756, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'F') goto yy770; - if (yych == 'f') goto yy770; - goto yy187; yy757: YYDEBUG(757, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'W') goto yy764; - if (yych == 'w') goto yy764; + if (yych == 'E') goto yy783; + if (yych == 'e') goto yy783; goto yy187; yy758: YYDEBUG(758, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy759; - if (yych != 'h') goto yy187; + if (yych == 'O') goto yy775; + if (yych == 'o') goto yy775; + goto yy187; yy759: YYDEBUG(759, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy760; - if (yych != 'i') goto yy187; + if (yych == 'F') goto yy773; + if (yych == 'f') goto yy773; + goto yy187; yy760: YYDEBUG(760, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy761; - if (yych != 'l') goto yy187; + if (yych == 'W') goto yy767; + if (yych == 'w') goto yy767; + goto yy187; yy761: YYDEBUG(761, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy762; - if (yych != 'e') goto yy187; + if (yych == 'H') goto yy762; + if (yych != 'h') goto yy187; yy762: YYDEBUG(762, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'I') goto yy763; + if (yych != 'i') goto yy187; +yy763: + YYDEBUG(763, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'L') goto yy764; + if (yych != 'l') goto yy187; +yy764: + YYDEBUG(764, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy765; + if (yych != 'e') goto yy187; +yy765: + YYDEBUG(765, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(763, *YYCURSOR); + YYDEBUG(766, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1084 "Zend/zend_language_scanner.l" +#line 1074 "Zend/zend_language_scanner.l" { return T_ENDWHILE; } -#line 7012 "Zend/zend_language_scanner.c" -yy764: - YYDEBUG(764, *YYCURSOR); +#line 6960 "Zend/zend_language_scanner.c" +yy767: + YYDEBUG(767, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy765; + if (yych == 'I') goto yy768; if (yych != 'i') goto yy187; -yy765: - YYDEBUG(765, *YYCURSOR); +yy768: + YYDEBUG(768, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy766; + if (yych == 'T') goto yy769; if (yych != 't') goto yy187; -yy766: - YYDEBUG(766, *YYCURSOR); +yy769: + YYDEBUG(769, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy767; + if (yych == 'C') goto yy770; if (yych != 'c') goto yy187; -yy767: - YYDEBUG(767, *YYCURSOR); +yy770: + YYDEBUG(770, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy768; + if (yych == 'H') goto yy771; if (yych != 'h') goto yy187; -yy768: - YYDEBUG(768, *YYCURSOR); +yy771: + YYDEBUG(771, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(769, *YYCURSOR); + YYDEBUG(772, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1128 "Zend/zend_language_scanner.l" +#line 1118 "Zend/zend_language_scanner.l" { return T_ENDSWITCH; } -#line 7045 "Zend/zend_language_scanner.c" -yy770: - YYDEBUG(770, *YYCURSOR); +#line 6993 "Zend/zend_language_scanner.c" +yy773: + YYDEBUG(773, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(771, *YYCURSOR); + YYDEBUG(774, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1072 "Zend/zend_language_scanner.l" +#line 1062 "Zend/zend_language_scanner.l" { return T_ENDIF; } -#line 7058 "Zend/zend_language_scanner.c" -yy772: - YYDEBUG(772, *YYCURSOR); +#line 7006 "Zend/zend_language_scanner.c" +yy775: + YYDEBUG(775, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy773; + if (yych == 'R') goto yy776; if (yych != 'r') goto yy187; -yy773: - YYDEBUG(773, *YYCURSOR); +yy776: + YYDEBUG(776, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '@') { - if (yych <= '/') goto yy774; + if (yych <= '/') goto yy777; if (yych <= '9') goto yy186; } else { - if (yych == 'E') goto yy775; + if (yych == 'E') goto yy778; if (yych <= 'Z') goto yy186; } } else { if (yych <= 'd') { if (yych != '`') goto yy186; } else { - if (yych <= 'e') goto yy775; + if (yych <= 'e') goto yy778; if (yych <= 'z') goto yy186; if (yych >= 0x7F) goto yy186; } } -yy774: - YYDEBUG(774, *YYCURSOR); +yy777: + YYDEBUG(777, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1096 "Zend/zend_language_scanner.l" +#line 1086 "Zend/zend_language_scanner.l" { return T_ENDFOR; } -#line 7091 "Zend/zend_language_scanner.c" -yy775: - YYDEBUG(775, *YYCURSOR); +#line 7039 "Zend/zend_language_scanner.c" +yy778: + YYDEBUG(778, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy776; + if (yych == 'A') goto yy779; if (yych != 'a') goto yy187; -yy776: - YYDEBUG(776, *YYCURSOR); +yy779: + YYDEBUG(779, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy777; + if (yych == 'C') goto yy780; if (yych != 'c') goto yy187; -yy777: - YYDEBUG(777, *YYCURSOR); +yy780: + YYDEBUG(780, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy778; + if (yych == 'H') goto yy781; if (yych != 'h') goto yy187; -yy778: - YYDEBUG(778, *YYCURSOR); +yy781: + YYDEBUG(781, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(779, *YYCURSOR); + YYDEBUG(782, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1104 "Zend/zend_language_scanner.l" +#line 1094 "Zend/zend_language_scanner.l" { return T_ENDFOREACH; } -#line 7119 "Zend/zend_language_scanner.c" -yy780: - YYDEBUG(780, *YYCURSOR); +#line 7067 "Zend/zend_language_scanner.c" +yy783: + YYDEBUG(783, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy781; + if (yych == 'C') goto yy784; if (yych != 'c') goto yy187; -yy781: - YYDEBUG(781, *YYCURSOR); +yy784: + YYDEBUG(784, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy782; + if (yych == 'L') goto yy785; if (yych != 'l') goto yy187; -yy782: - YYDEBUG(782, *YYCURSOR); +yy785: + YYDEBUG(785, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy783; + if (yych == 'A') goto yy786; if (yych != 'a') goto yy187; -yy783: - YYDEBUG(783, *YYCURSOR); +yy786: + YYDEBUG(786, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy784; + if (yych == 'R') goto yy787; if (yych != 'r') goto yy187; -yy784: - YYDEBUG(784, *YYCURSOR); +yy787: + YYDEBUG(787, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy785; + if (yych == 'E') goto yy788; if (yych != 'e') goto yy187; -yy785: - YYDEBUG(785, *YYCURSOR); +yy788: + YYDEBUG(788, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(786, *YYCURSOR); + YYDEBUG(789, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1112 "Zend/zend_language_scanner.l" +#line 1102 "Zend/zend_language_scanner.l" { return T_ENDDECLARE; } -#line 7157 "Zend/zend_language_scanner.c" -yy787: - YYDEBUG(787, *YYCURSOR); +#line 7105 "Zend/zend_language_scanner.c" +yy790: + YYDEBUG(790, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy788; + if (yych == 'T') goto yy791; if (yych != 't') goto yy187; -yy788: - YYDEBUG(788, *YYCURSOR); +yy791: + YYDEBUG(791, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'Y') goto yy789; + if (yych == 'Y') goto yy792; if (yych != 'y') goto yy187; -yy789: - YYDEBUG(789, *YYCURSOR); +yy792: + YYDEBUG(792, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(790, *YYCURSOR); + YYDEBUG(793, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1298 "Zend/zend_language_scanner.l" +#line 1290 "Zend/zend_language_scanner.l" { return T_EMPTY; } -#line 7180 "Zend/zend_language_scanner.c" -yy791: - YYDEBUG(791, *YYCURSOR); +#line 7128 "Zend/zend_language_scanner.c" +yy794: + YYDEBUG(794, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy792; + if (yych == 'E') goto yy795; if (yych != 'e') goto yy187; -yy792: - YYDEBUG(792, *YYCURSOR); +yy795: + YYDEBUG(795, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '@') { - if (yych <= '/') goto yy793; + if (yych <= '/') goto yy796; if (yych <= '9') goto yy186; } else { - if (yych == 'I') goto yy794; + if (yych == 'I') goto yy797; if (yych <= 'Z') goto yy186; } } else { if (yych <= 'h') { if (yych != '`') goto yy186; } else { - if (yych <= 'i') goto yy794; + if (yych <= 'i') goto yy797; if (yych <= 'z') goto yy186; if (yych >= 0x7F) goto yy186; } } -yy793: - YYDEBUG(793, *YYCURSOR); +yy796: + YYDEBUG(796, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1076 "Zend/zend_language_scanner.l" +#line 1066 "Zend/zend_language_scanner.l" { return T_ELSE; } -#line 7213 "Zend/zend_language_scanner.c" -yy794: - YYDEBUG(794, *YYCURSOR); +#line 7161 "Zend/zend_language_scanner.c" +yy797: + YYDEBUG(797, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'F') goto yy795; + if (yych == 'F') goto yy798; if (yych != 'f') goto yy187; -yy795: - YYDEBUG(795, *YYCURSOR); +yy798: + YYDEBUG(798, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(796, *YYCURSOR); + YYDEBUG(799, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1068 "Zend/zend_language_scanner.l" +#line 1058 "Zend/zend_language_scanner.l" { return T_ELSEIF; } -#line 7231 "Zend/zend_language_scanner.c" -yy797: - YYDEBUG(797, *YYCURSOR); +#line 7179 "Zend/zend_language_scanner.c" +yy800: + YYDEBUG(800, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy798; + if (yych == 'O') goto yy801; if (yych != 'o') goto yy187; -yy798: - YYDEBUG(798, *YYCURSOR); +yy801: + YYDEBUG(801, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(799, *YYCURSOR); + YYDEBUG(802, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1152 "Zend/zend_language_scanner.l" +#line 1142 "Zend/zend_language_scanner.l" { return T_ECHO; } -#line 7249 "Zend/zend_language_scanner.c" +#line 7197 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_LOOKING_FOR_PROPERTY: @@ -7284,115 +7232,113 @@ int lex_scan(zval *zendlval TSRMLS_DC) 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, }; - YYDEBUG(800, *YYCURSOR); + YYDEBUG(803, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; if (yych <= '-') { if (yych <= '\r') { - if (yych <= 0x08) goto yy808; - if (yych <= '\n') goto yy802; - if (yych <= '\f') goto yy808; + if (yych <= 0x08) goto yy811; + if (yych <= '\n') goto yy805; + if (yych <= '\f') goto yy811; } else { - if (yych == ' ') goto yy802; - if (yych <= ',') goto yy808; - goto yy804; + if (yych == ' ') goto yy805; + if (yych <= ',') goto yy811; + goto yy807; } } else { if (yych <= '_') { - if (yych <= '@') goto yy808; - if (yych <= 'Z') goto yy806; - if (yych <= '^') goto yy808; - goto yy806; + if (yych <= '@') goto yy811; + if (yych <= 'Z') goto yy809; + if (yych <= '^') goto yy811; + goto yy809; } else { - if (yych <= '`') goto yy808; - if (yych <= 'z') goto yy806; - if (yych <= '~') goto yy808; - goto yy806; + if (yych <= '`') goto yy811; + if (yych <= 'z') goto yy809; + if (yych <= '~') goto yy811; + goto yy809; } } -yy802: - YYDEBUG(802, *YYCURSOR); +yy805: + YYDEBUG(805, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy814; -yy803: - YYDEBUG(803, *YYCURSOR); + goto yy817; +yy806: + YYDEBUG(806, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1185 "Zend/zend_language_scanner.l" +#line 1175 "Zend/zend_language_scanner.l" { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ HANDLE_NEWLINES(yytext, yyleng); return T_WHITESPACE; } -#line 7330 "Zend/zend_language_scanner.c" -yy804: - YYDEBUG(804, *YYCURSOR); +#line 7276 "Zend/zend_language_scanner.c" +yy807: + YYDEBUG(807, *YYCURSOR); ++YYCURSOR; - if ((yych = *YYCURSOR) == '>') goto yy811; -yy805: - YYDEBUG(805, *YYCURSOR); + if ((yych = *YYCURSOR) == '>') goto yy814; +yy808: + YYDEBUG(808, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1204 "Zend/zend_language_scanner.l" +#line 1192 "Zend/zend_language_scanner.l" { yyless(0); yy_pop_state(TSRMLS_C); goto restart; } -#line 7344 "Zend/zend_language_scanner.c" -yy806: - YYDEBUG(806, *YYCURSOR); +#line 7290 "Zend/zend_language_scanner.c" +yy809: + YYDEBUG(809, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy810; -yy807: - YYDEBUG(807, *YYCURSOR); + goto yy813; +yy810: + YYDEBUG(810, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1197 "Zend/zend_language_scanner.l" +#line 1185 "Zend/zend_language_scanner.l" { yy_pop_state(TSRMLS_C); zend_copy_value(zendlval, yytext, yyleng); zendlval->type = IS_STRING; return T_STRING; } -#line 7360 "Zend/zend_language_scanner.c" -yy808: - YYDEBUG(808, *YYCURSOR); +#line 7306 "Zend/zend_language_scanner.c" +yy811: + YYDEBUG(811, *YYCURSOR); yych = *++YYCURSOR; - goto yy805; -yy809: - YYDEBUG(809, *YYCURSOR); + goto yy808; +yy812: + YYDEBUG(812, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy810: - YYDEBUG(810, *YYCURSOR); +yy813: + YYDEBUG(813, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy809; + goto yy812; } - goto yy807; -yy811: - YYDEBUG(811, *YYCURSOR); + goto yy810; +yy814: + YYDEBUG(814, *YYCURSOR); ++YYCURSOR; - YYDEBUG(812, *YYCURSOR); + YYDEBUG(815, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1193 "Zend/zend_language_scanner.l" +#line 1181 "Zend/zend_language_scanner.l" { return T_OBJECT_OPERATOR; } -#line 7385 "Zend/zend_language_scanner.c" -yy813: - YYDEBUG(813, *YYCURSOR); +#line 7331 "Zend/zend_language_scanner.c" +yy816: + YYDEBUG(816, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy814: - YYDEBUG(814, *YYCURSOR); +yy817: + YYDEBUG(817, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy813; + goto yy816; } - goto yy803; + goto yy806; } /* *********************************** */ yyc_ST_LOOKING_FOR_VARNAME: @@ -7431,74 +7377,74 @@ int lex_scan(zval *zendlval TSRMLS_DC) 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, }; - YYDEBUG(815, *YYCURSOR); + YYDEBUG(818, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; if (yych <= '_') { - if (yych <= '@') goto yy819; - if (yych <= 'Z') goto yy817; - if (yych <= '^') goto yy819; + if (yych <= '@') goto yy822; + if (yych <= 'Z') goto yy820; + if (yych <= '^') goto yy822; } else { - if (yych <= '`') goto yy819; - if (yych <= 'z') goto yy817; - if (yych <= '~') goto yy819; + if (yych <= '`') goto yy822; + if (yych <= 'z') goto yy820; + if (yych <= '~') goto yy822; } -yy817: - YYDEBUG(817, *YYCURSOR); +yy820: + YYDEBUG(820, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '_') { if (yych <= '@') { - if (yych <= '/') goto yy818; - if (yych <= '9') goto yy821; + if (yych <= '/') goto yy821; + if (yych <= '9') goto yy824; } else { - if (yych <= '[') goto yy821; - if (yych >= '_') goto yy821; + if (yych <= '[') goto yy824; + if (yych >= '_') goto yy824; } } else { if (yych <= '|') { - if (yych <= '`') goto yy818; - if (yych <= 'z') goto yy821; + if (yych <= '`') goto yy821; + if (yych <= 'z') goto yy824; } else { - if (yych != '~') goto yy821; + if (yych != '~') goto yy824; } } -yy818: - YYDEBUG(818, *YYCURSOR); +yy821: + YYDEBUG(821, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1490 "Zend/zend_language_scanner.l" +#line 1482 "Zend/zend_language_scanner.l" { yyless(0); yy_pop_state(TSRMLS_C); yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); goto restart; } -#line 7477 "Zend/zend_language_scanner.c" -yy819: - YYDEBUG(819, *YYCURSOR); +#line 7423 "Zend/zend_language_scanner.c" +yy822: + YYDEBUG(822, *YYCURSOR); yych = *++YYCURSOR; - goto yy818; -yy820: - YYDEBUG(820, *YYCURSOR); + goto yy821; +yy823: + YYDEBUG(823, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy821: - YYDEBUG(821, *YYCURSOR); +yy824: + YYDEBUG(824, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy820; + goto yy823; } - if (yych == '[') goto yy823; - if (yych == '}') goto yy823; - YYDEBUG(822, *YYCURSOR); + if (yych == '[') goto yy826; + if (yych == '}') goto yy826; + YYDEBUG(825, *YYCURSOR); YYCURSOR = YYMARKER; - goto yy818; -yy823: - YYDEBUG(823, *YYCURSOR); + goto yy821; +yy826: + YYDEBUG(826, *YYCURSOR); ++YYCURSOR; - YYDEBUG(824, *YYCURSOR); + YYDEBUG(827, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1480 "Zend/zend_language_scanner.l" +#line 1472 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); zend_copy_value(zendlval, yytext, yyleng); @@ -7507,18 +7453,18 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); return T_STRING_VARNAME; } -#line 7511 "Zend/zend_language_scanner.c" +#line 7457 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_NOWDOC: - YYDEBUG(825, *YYCURSOR); + YYDEBUG(828, *YYCURSOR); YYFILL(1); yych = *YYCURSOR; - YYDEBUG(827, *YYCURSOR); + YYDEBUG(830, *YYCURSOR); ++YYCURSOR; - YYDEBUG(828, *YYCURSOR); + YYDEBUG(831, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2374 "Zend/zend_language_scanner.l" +#line 2302 "Zend/zend_language_scanner.l" { int newline = 0; @@ -7575,7 +7521,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) HANDLE_NEWLINES(yytext, yyleng - newline); return T_ENCAPSED_AND_WHITESPACE; } -#line 7579 "Zend/zend_language_scanner.c" +#line 7525 "Zend/zend_language_scanner.c" /* *********************************** */ yyc_ST_VAR_OFFSET: { @@ -7613,162 +7559,159 @@ int lex_scan(zval *zendlval TSRMLS_DC) 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, }; - YYDEBUG(829, *YYCURSOR); + YYDEBUG(832, *YYCURSOR); YYFILL(3); yych = *YYCURSOR; if (yych <= '/') { if (yych <= ' ') { if (yych <= '\f') { - if (yych <= 0x08) goto yy843; - if (yych <= '\n') goto yy839; - goto yy843; + if (yych <= 0x08) goto yy846; + if (yych <= '\n') goto yy842; + goto yy846; } else { - if (yych <= '\r') goto yy839; - if (yych <= 0x1F) goto yy843; - goto yy839; + if (yych <= '\r') goto yy842; + if (yych <= 0x1F) goto yy846; + goto yy842; } } else { if (yych <= '$') { - if (yych <= '"') goto yy838; - if (yych <= '#') goto yy839; - goto yy834; + if (yych <= '"') goto yy841; + if (yych <= '#') goto yy842; + goto yy837; } else { - if (yych == '\'') goto yy839; - goto yy838; + if (yych == '\'') goto yy842; + goto yy841; } } } else { if (yych <= '\\') { if (yych <= '@') { - if (yych <= '0') goto yy831; - if (yych <= '9') goto yy833; - goto yy838; + if (yych <= '0') goto yy834; + if (yych <= '9') goto yy836; + goto yy841; } else { - if (yych <= 'Z') goto yy841; - if (yych <= '[') goto yy838; - goto yy839; + if (yych <= 'Z') goto yy844; + if (yych <= '[') goto yy841; + goto yy842; } } else { if (yych <= '_') { - if (yych <= ']') goto yy836; - if (yych <= '^') goto yy838; - goto yy841; + if (yych <= ']') goto yy839; + if (yych <= '^') goto yy841; + goto yy844; } else { - if (yych <= '`') goto yy838; - if (yych <= 'z') goto yy841; - if (yych <= '~') goto yy838; - goto yy841; + if (yych <= '`') goto yy841; + if (yych <= 'z') goto yy844; + if (yych <= '~') goto yy841; + goto yy844; } } } -yy831: - YYDEBUG(831, *YYCURSOR); +yy834: + YYDEBUG(834, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'W') { if (yych <= '9') { - if (yych >= '0') goto yy855; + if (yych >= '0') goto yy858; } else { - if (yych == 'B') goto yy852; + if (yych == 'B') goto yy855; } } else { if (yych <= 'b') { - if (yych <= 'X') goto yy854; - if (yych >= 'b') goto yy852; + if (yych <= 'X') goto yy857; + if (yych >= 'b') goto yy855; } else { - if (yych == 'x') goto yy854; + if (yych == 'x') goto yy857; } } -yy832: - YYDEBUG(832, *YYCURSOR); +yy835: + YYDEBUG(835, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1568 "Zend/zend_language_scanner.l" +#line 1558 "Zend/zend_language_scanner.l" { /* Offset could be treated as a long */ if (yyleng < MAX_LENGTH_OF_LONG - 1 || (yyleng == MAX_LENGTH_OF_LONG - 1 && strcmp(yytext, long_min_digits) < 0)) { - zendlval->value.lval = strtol(yytext, NULL, 10); - zendlval->type = IS_LONG; + ZVAL_LONG(zendlval, strtol(yytext, NULL, 10)); } else { - zendlval->value.str.val = (char *)estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 1); } return T_NUM_STRING; } -#line 7698 "Zend/zend_language_scanner.c" -yy833: - YYDEBUG(833, *YYCURSOR); +#line 7641 "Zend/zend_language_scanner.c" +yy836: + YYDEBUG(836, *YYCURSOR); yych = *++YYCURSOR; - goto yy851; -yy834: - YYDEBUG(834, *YYCURSOR); + goto yy854; +yy837: + YYDEBUG(837, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '_') { - if (yych <= '@') goto yy835; - if (yych <= 'Z') goto yy847; - if (yych >= '_') goto yy847; + if (yych <= '@') goto yy838; + if (yych <= 'Z') goto yy850; + if (yych >= '_') goto yy850; } else { - if (yych <= '`') goto yy835; - if (yych <= 'z') goto yy847; - if (yych >= 0x7F) goto yy847; + if (yych <= '`') goto yy838; + if (yych <= 'z') goto yy850; + if (yych >= 0x7F) goto yy850; } -yy835: - YYDEBUG(835, *YYCURSOR); +yy838: + YYDEBUG(838, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1900 "Zend/zend_language_scanner.l" +#line 1834 "Zend/zend_language_scanner.l" { /* Only '[' can be valid, but returning other tokens will allow a more explicit parse error */ return yytext[0]; } -#line 7723 "Zend/zend_language_scanner.c" -yy836: - YYDEBUG(836, *YYCURSOR); +#line 7666 "Zend/zend_language_scanner.c" +yy839: + YYDEBUG(839, *YYCURSOR); ++YYCURSOR; - YYDEBUG(837, *YYCURSOR); + YYDEBUG(840, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1895 "Zend/zend_language_scanner.l" +#line 1829 "Zend/zend_language_scanner.l" { yy_pop_state(TSRMLS_C); return ']'; } -#line 7734 "Zend/zend_language_scanner.c" -yy838: - YYDEBUG(838, *YYCURSOR); +#line 7677 "Zend/zend_language_scanner.c" +yy841: + YYDEBUG(841, *YYCURSOR); yych = *++YYCURSOR; - goto yy835; -yy839: - YYDEBUG(839, *YYCURSOR); + goto yy838; +yy842: + YYDEBUG(842, *YYCURSOR); ++YYCURSOR; - YYDEBUG(840, *YYCURSOR); + YYDEBUG(843, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1905 "Zend/zend_language_scanner.l" +#line 1839 "Zend/zend_language_scanner.l" { /* Invalid rule to return a more explicit parse error with proper line number */ yyless(0); yy_pop_state(TSRMLS_C); return T_ENCAPSED_AND_WHITESPACE; } -#line 7751 "Zend/zend_language_scanner.c" -yy841: - YYDEBUG(841, *YYCURSOR); +#line 7694 "Zend/zend_language_scanner.c" +yy844: + YYDEBUG(844, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy846; -yy842: - YYDEBUG(842, *YYCURSOR); + goto yy849; +yy845: + YYDEBUG(845, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1912 "Zend/zend_language_scanner.l" +#line 1846 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, yytext, yyleng); zendlval->type = IS_STRING; return T_STRING; } -#line 7766 "Zend/zend_language_scanner.c" -yy843: - YYDEBUG(843, *YYCURSOR); +#line 7709 "Zend/zend_language_scanner.c" +yy846: + YYDEBUG(846, *YYCURSOR); ++YYCURSOR; - YYDEBUG(844, *YYCURSOR); + YYDEBUG(847, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2432 "Zend/zend_language_scanner.l" +#line 2360 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -7777,118 +7720,116 @@ int lex_scan(zval *zendlval TSRMLS_DC) zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE); goto restart; } -#line 7781 "Zend/zend_language_scanner.c" -yy845: - YYDEBUG(845, *YYCURSOR); +#line 7724 "Zend/zend_language_scanner.c" +yy848: + YYDEBUG(848, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy846: - YYDEBUG(846, *YYCURSOR); +yy849: + YYDEBUG(849, *YYCURSOR); if (yybm[0+yych] & 16) { - goto yy845; + goto yy848; } - goto yy842; -yy847: - YYDEBUG(847, *YYCURSOR); + goto yy845; +yy850: + YYDEBUG(850, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(848, *YYCURSOR); + YYDEBUG(851, *YYCURSOR); if (yych <= '^') { if (yych <= '9') { - if (yych >= '0') goto yy847; + if (yych >= '0') goto yy850; } else { - if (yych <= '@') goto yy849; - if (yych <= 'Z') goto yy847; + if (yych <= '@') goto yy852; + if (yych <= 'Z') goto yy850; } } else { if (yych <= '`') { - if (yych <= '_') goto yy847; + if (yych <= '_') goto yy850; } else { - if (yych <= 'z') goto yy847; - if (yych >= 0x7F) goto yy847; + if (yych <= 'z') goto yy850; + if (yych >= 0x7F) goto yy850; } } -yy849: - YYDEBUG(849, *YYCURSOR); +yy852: + YYDEBUG(852, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1889 "Zend/zend_language_scanner.l" +#line 1823 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); zendlval->type = IS_STRING; return T_VARIABLE; } -#line 7823 "Zend/zend_language_scanner.c" -yy850: - YYDEBUG(850, *YYCURSOR); +#line 7766 "Zend/zend_language_scanner.c" +yy853: + YYDEBUG(853, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy851: - YYDEBUG(851, *YYCURSOR); +yy854: + YYDEBUG(854, *YYCURSOR); if (yybm[0+yych] & 32) { - goto yy850; + goto yy853; } - goto yy832; -yy852: - YYDEBUG(852, *YYCURSOR); + goto yy835; +yy855: + YYDEBUG(855, *YYCURSOR); yych = *++YYCURSOR; if (yybm[0+yych] & 128) { - goto yy860; + goto yy863; } -yy853: - YYDEBUG(853, *YYCURSOR); +yy856: + YYDEBUG(856, *YYCURSOR); YYCURSOR = YYMARKER; - goto yy832; -yy854: - YYDEBUG(854, *YYCURSOR); + goto yy835; +yy857: + YYDEBUG(857, *YYCURSOR); yych = *++YYCURSOR; if (yybm[0+yych] & 64) { - goto yy858; + goto yy861; } - goto yy853; -yy855: - YYDEBUG(855, *YYCURSOR); + goto yy856; +yy858: + YYDEBUG(858, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(856, *YYCURSOR); - if (yych <= '/') goto yy857; - if (yych <= '9') goto yy855; -yy857: - YYDEBUG(857, *YYCURSOR); + YYDEBUG(859, *YYCURSOR); + if (yych <= '/') goto yy860; + if (yych <= '9') goto yy858; +yy860: + YYDEBUG(860, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1580 "Zend/zend_language_scanner.l" +#line 1567 "Zend/zend_language_scanner.l" { /* Offset must be treated as a string */ - zendlval->value.str.val = (char *)estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 1); return T_NUM_STRING; } -#line 7870 "Zend/zend_language_scanner.c" -yy858: - YYDEBUG(858, *YYCURSOR); +#line 7811 "Zend/zend_language_scanner.c" +yy861: + YYDEBUG(861, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(859, *YYCURSOR); + YYDEBUG(862, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy858; + goto yy861; } - goto yy857; -yy860: - YYDEBUG(860, *YYCURSOR); + goto yy860; +yy863: + YYDEBUG(863, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(861, *YYCURSOR); + YYDEBUG(864, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy860; + goto yy863; } - goto yy857; + goto yy860; } } -#line 2441 "Zend/zend_language_scanner.l" +#line 2369 "Zend/zend_language_scanner.l" } diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index d2e7243bb2da1..f620cb8b4695b 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -562,10 +562,8 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR zend_bool original_in_compilation = CG(in_compilation); retval_znode.op_type = IS_CONST; - retval_znode.u.constant.type = IS_LONG; - retval_znode.u.constant.value.lval = 1; - Z_UNSET_ISREF(retval_znode.u.constant); - Z_SET_REFCOUNT(retval_znode.u.constant, 1); + INIT_PZVAL(&retval_znode.u.constant); + ZVAL_LONG(&retval_znode.u.constant, 1); zend_save_lexical_state(&original_lex_state TSRMLS_CC); @@ -622,7 +620,7 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC) convert_to_string(&tmp); filename = &tmp; } - file_handle.filename = filename->value.str.val; + file_handle.filename = Z_STRVAL_P(filename); file_handle.free_filename = 0; file_handle.type = ZEND_HANDLE_FILENAME; file_handle.opened_path = NULL; @@ -633,7 +631,7 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC) int dummy = 1; if (!file_handle.opened_path) { - file_handle.opened_path = opened_path = estrndup(filename->value.str.val, filename->value.str.len); + file_handle.opened_path = opened_path = estrndup(Z_STRVAL_P(filename), Z_STRLEN_P(filename)); } zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL); @@ -655,22 +653,15 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D char *buf; size_t size; - /* enforce two trailing NULLs for flex... */ - if (IS_INTERNED(str->value.str.val)) { - char *tmp = safe_emalloc(1, str->value.str.len, ZEND_MMAP_AHEAD); - memcpy(tmp, str->value.str.val, str->value.str.len + ZEND_MMAP_AHEAD); - str->value.str.val = tmp; - } else { - str->value.str.val = safe_erealloc(str->value.str.val, 1, str->value.str.len, ZEND_MMAP_AHEAD); - } - - memset(str->value.str.val + str->value.str.len, 0, ZEND_MMAP_AHEAD); + /* enforce ZEND_MMAP_AHEAD trailing NULLs for flex... */ + Z_STRVAL_P(str) = str_erealloc(Z_STRVAL_P(str), Z_STRLEN_P(str) + ZEND_MMAP_AHEAD); + memset(Z_STRVAL_P(str) + Z_STRLEN_P(str), 0, ZEND_MMAP_AHEAD); SCNG(yy_in) = NULL; SCNG(yy_start) = NULL; - buf = str->value.str.val; - size = str->value.str.len; + buf = Z_STRVAL_P(str); + size = Z_STRLEN_P(str); if (CG(multibyte)) { SCNG(script_org) = (unsigned char*)buf; @@ -731,7 +722,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC) int compiler_result; zend_bool original_in_compilation = CG(in_compilation); - if (source_string->value.str.len==0) { + if (Z_STRLEN_P(source_string)==0) { efree(op_array); return NULL; } @@ -869,11 +860,11 @@ ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter # define zend_copy_value(zendlval, yytext, yyleng) \ if (SCNG(output_filter)) { \ size_t sz = 0; \ - SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); \ - zendlval->value.str.len = sz; \ + SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); \ + Z_STRLEN_P(zendlval) = sz; \ } else { \ - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); \ - zendlval->value.str.len = yyleng; \ + Z_STRVAL_P(zendlval) = (char *) estrndup(yytext, yyleng); \ + Z_STRLEN_P(zendlval) = yyleng; \ } static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quote_type TSRMLS_DC) @@ -884,8 +875,8 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo ZVAL_STRINGL(zendlval, str, len, 1); /* convert escape sequences */ - s = t = zendlval->value.str.val; - end = s+zendlval->value.str.len; + s = t = Z_STRVAL_P(zendlval); + end = s+Z_STRLEN_P(zendlval); while (svalue.str.len--; + Z_STRLEN_P(zendlval)--; break; case 'r': *t++ = '\r'; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 't': *t++ = '\t'; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 'f': *t++ = '\f'; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 'v': *t++ = '\v'; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 'e': #ifdef PHP_WIN32 @@ -921,7 +912,7 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo #else *t++ = '\e'; #endif - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case '"': case '`': @@ -933,20 +924,20 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo case '\\': case '$': *t++ = *s; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 'x': case 'X': if (ZEND_IS_HEX(*(s+1))) { char hex_buf[3] = { 0, 0, 0 }; - zendlval->value.str.len--; /* for the 'x' */ + Z_STRLEN_P(zendlval)--; /* for the 'x' */ hex_buf[0] = *(++s); - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; if (ZEND_IS_HEX(*(s+1))) { hex_buf[1] = *(++s); - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; } *t++ = (char) strtol(hex_buf, NULL, 16); } else { @@ -960,13 +951,13 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo char octal_buf[4] = { 0, 0, 0, 0 }; octal_buf[0] = *s; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; if (ZEND_IS_OCT(*(s+1))) { octal_buf[1] = *(++s); - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; if (ZEND_IS_OCT(*(s+1))) { octal_buf[2] = *(++s); - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; } } *t++ = (char) strtol(octal_buf, NULL, 8); @@ -988,9 +979,9 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo *t = 0; if (SCNG(output_filter)) { size_t sz = 0; - s = zendlval->value.str.val; - SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)s, (size_t)zendlval->value.str.len TSRMLS_CC); - zendlval->value.str.len = sz; + s = Z_STRVAL_P(zendlval); + SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC); + Z_STRLEN_P(zendlval) = sz; efree(s); } } @@ -1020,7 +1011,6 @@ NEWLINE ("\r"|"\n"|"\r\n") /* compute yyleng before each rule */ := yyleng = YYCURSOR - SCNG(yy_text); - "exit" { return T_EXIT; } @@ -1183,9 +1173,7 @@ NEWLINE ("\r"|"\n"|"\r\n") } {WHITESPACE}+ { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ HANDLE_NEWLINES(yytext, yyleng); return T_WHITESPACE; } @@ -1215,6 +1203,10 @@ NEWLINE ("\r"|"\n"|"\r\n") return T_NS_SEPARATOR; } +"..." { + return T_ELLIPSIS; +} + "new" { return T_NEW; } @@ -1506,30 +1498,29 @@ NEWLINE ("\r"|"\n"|"\r\n") if (len < SIZEOF_LONG * 8) { if (len == 0) { - zendlval->value.lval = 0; + Z_LVAL_P(zendlval) = 0; } else { - zendlval->value.lval = strtol(bin, NULL, 2); + Z_LVAL_P(zendlval) = strtol(bin, NULL, 2); } zendlval->type = IS_LONG; return T_LNUMBER; } else { - zendlval->value.dval = zend_bin_strtod(bin, NULL); - zendlval->type = IS_DOUBLE; + ZVAL_DOUBLE(zendlval, zend_bin_strtod(bin, NULL)); return T_DNUMBER; } } {LNUM} { if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */ - zendlval->value.lval = strtol(yytext, NULL, 0); + Z_LVAL_P(zendlval) = strtol(yytext, NULL, 0); } else { errno = 0; - zendlval->value.lval = strtol(yytext, NULL, 0); + Z_LVAL_P(zendlval) = strtol(yytext, NULL, 0); if (errno == ERANGE) { /* Overflow */ if (yytext[0] == '0') { /* octal overflow */ - zendlval->value.dval = zend_oct_strtod(yytext, NULL); + Z_DVAL_P(zendlval) = zend_oct_strtod(yytext, NULL); } else { - zendlval->value.dval = zend_strtod(yytext, NULL); + Z_DVAL_P(zendlval) = zend_strtod(yytext, NULL); } zendlval->type = IS_DOUBLE; return T_DNUMBER; @@ -1552,120 +1543,80 @@ NEWLINE ("\r"|"\n"|"\r\n") if (len < SIZEOF_LONG * 2 || (len == SIZEOF_LONG * 2 && *hex <= '7')) { if (len == 0) { - zendlval->value.lval = 0; + Z_LVAL_P(zendlval) = 0; } else { - zendlval->value.lval = strtol(hex, NULL, 16); + Z_LVAL_P(zendlval) = strtol(hex, NULL, 16); } zendlval->type = IS_LONG; return T_LNUMBER; } else { - zendlval->value.dval = zend_hex_strtod(hex, NULL); - zendlval->type = IS_DOUBLE; + ZVAL_DOUBLE(zendlval, zend_hex_strtod(hex, NULL)); return T_DNUMBER; } } [0]|([1-9][0-9]*) { /* Offset could be treated as a long */ if (yyleng < MAX_LENGTH_OF_LONG - 1 || (yyleng == MAX_LENGTH_OF_LONG - 1 && strcmp(yytext, long_min_digits) < 0)) { - zendlval->value.lval = strtol(yytext, NULL, 10); - zendlval->type = IS_LONG; + ZVAL_LONG(zendlval, strtol(yytext, NULL, 10)); } else { - zendlval->value.str.val = (char *)estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 1); } return T_NUM_STRING; } {LNUM}|{HNUM}|{BNUM} { /* Offset must be treated as a string */ - zendlval->value.str.val = (char *)estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 1); return T_NUM_STRING; } {DNUM}|{EXPONENT_DNUM} { - zendlval->value.dval = zend_strtod(yytext, NULL); - zendlval->type = IS_DOUBLE; + ZVAL_DOUBLE(zendlval, zend_strtod(yytext, NULL)); return T_DNUMBER; } "__CLASS__" { - const char *class_name = NULL; - - if (CG(active_class_entry) - && (ZEND_ACC_TRAIT == - (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT))) { + zend_class_entry *ce = CG(active_class_entry); + if (ce && ZEND_ACC_TRAIT == (ce->ce_flags & ZEND_ACC_TRAIT)) { /* We create a special __CLASS__ constant that is going to be resolved at run-time */ - zendlval->value.str.len = sizeof("__CLASS__")-1; - zendlval->value.str.val = estrndup("__CLASS__", zendlval->value.str.len); + Z_STRLEN_P(zendlval) = sizeof("__CLASS__")-1; + Z_STRVAL_P(zendlval) = estrndup("__CLASS__", Z_STRLEN_P(zendlval)); zendlval->type = IS_CONSTANT; } else { - if (CG(active_class_entry)) { - class_name = CG(active_class_entry)->name; - } - - if (!class_name) { - class_name = ""; + if (ce && ce->name) { + ZVAL_STRINGL(zendlval, ce->name, ce->name_length, 1); + } else { + ZVAL_EMPTY_STRING(zendlval); } - - zendlval->value.str.len = strlen(class_name); - zendlval->value.str.val = estrndup(class_name, zendlval->value.str.len); - zendlval->type = IS_STRING; } return T_CLASS_C; } "__TRAIT__" { - const char *trait_name = NULL; - - if (CG(active_class_entry) - && (ZEND_ACC_TRAIT == - (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT))) { - trait_name = CG(active_class_entry)->name; - } - - if (!trait_name) { - trait_name = ""; - } - - zendlval->value.str.len = strlen(trait_name); - zendlval->value.str.val = estrndup(trait_name, zendlval->value.str.len); - zendlval->type = IS_STRING; - + zend_class_entry *ce = CG(active_class_entry); + if (ce && ce->name && ZEND_ACC_TRAIT == (ce->ce_flags & ZEND_ACC_TRAIT)) { + ZVAL_STRINGL(zendlval, ce->name, ce->name_length, 1); + } else { + ZVAL_EMPTY_STRING(zendlval); + } return T_TRAIT_C; } "__FUNCTION__" { - const char *func_name = NULL; - - if (CG(active_op_array)) { - func_name = CG(active_op_array)->function_name; - } - - if (!func_name) { - func_name = ""; + zend_op_array *op_array = CG(active_op_array); + if (op_array && op_array->function_name) { + ZVAL_STRING(zendlval, op_array->function_name, 1); + } else { + ZVAL_EMPTY_STRING(zendlval); } - zendlval->value.str.len = strlen(func_name); - zendlval->value.str.val = estrndup(func_name, zendlval->value.str.len); - zendlval->type = IS_STRING; return T_FUNC_C; } "__METHOD__" { const char *class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL; const char *func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL; - size_t len = 0; - - if (class_name) { - len += strlen(class_name) + 2; - } - if (func_name) { - len += strlen(func_name); - } - zendlval->value.str.len = zend_spprintf(&zendlval->value.str.val, 0, "%s%s%s", + Z_STRLEN_P(zendlval) = zend_spprintf(&Z_STRVAL_P(zendlval), 0, "%s%s%s", class_name ? class_name : "", class_name && func_name ? "::" : "", func_name ? func_name : "" @@ -1675,8 +1626,7 @@ NEWLINE ("\r"|"\n"|"\r\n") } "__LINE__" { - zendlval->value.lval = CG(zend_lineno); - zendlval->type = IS_LONG; + ZVAL_LONG(zendlval, CG(zend_lineno)); return T_LINE; } @@ -1686,9 +1636,7 @@ NEWLINE ("\r"|"\n"|"\r\n") if (!filename) { filename = ""; } - zendlval->value.str.len = strlen(filename); - zendlval->value.str.val = estrndup(filename, zendlval->value.str.len); - zendlval->type = IS_STRING; + ZVAL_STRING(zendlval, filename, 1); return T_FILE; } @@ -1713,9 +1661,7 @@ NEWLINE ("\r"|"\n"|"\r\n") #endif } - zendlval->value.str.len = strlen(dirname); - zendlval->value.str.val = dirname; - zendlval->type = IS_STRING; + ZVAL_STRING(zendlval, dirname, 0); return T_DIR; } @@ -1739,9 +1685,7 @@ NEWLINE ("\r"|"\n"|"\r\n") } HANDLE_NEWLINES(yytext, yyleng); - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } @@ -1749,9 +1693,7 @@ NEWLINE ("\r"|"\n"|"\r\n") "<%=" { if (CG(asp_tags)) { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG_WITH_ECHO; } else { @@ -1761,9 +1703,7 @@ NEWLINE ("\r"|"\n"|"\r\n") "value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG_WITH_ECHO; } @@ -1771,9 +1711,7 @@ NEWLINE ("\r"|"\n"|"\r\n") "<%" { if (CG(asp_tags)) { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } else { @@ -1783,9 +1721,7 @@ NEWLINE ("\r"|"\n"|"\r\n") "value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ HANDLE_NEWLINE(yytext[yyleng-1]); BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; @@ -1794,9 +1730,7 @@ NEWLINE ("\r"|"\n"|"\r\n") "value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } else { @@ -1850,14 +1784,14 @@ inline_html: if (SCNG(output_filter)) { int readsize; size_t sz = 0; - readsize = SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); - zendlval->value.str.len = sz; + readsize = SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); + Z_STRLEN_P(zendlval) = sz; if (readsize < yyleng) { yyless(readsize); } } else { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; + Z_STRVAL_P(zendlval) = (char *) estrndup(yytext, yyleng); + Z_STRLEN_P(zendlval) = yyleng; } zendlval->type = IS_STRING; HANDLE_NEWLINES(yytext, yyleng); @@ -1985,9 +1919,7 @@ inline_html: } ("?>"|""){NEWLINE}? { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(INITIAL); return T_CLOSE_TAG; /* implicit ';' at php-end tag */ } @@ -1996,9 +1928,7 @@ inline_html: "%>"{NEWLINE}? { if (CG(asp_tags)) { BEGIN(INITIAL); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - zendlval->value.str.val = yytext; /* no copying - intentional */ + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ return T_CLOSE_TAG; /* implicit ';' at php-end tag */ } else { yyless(1); @@ -2032,13 +1962,11 @@ inline_html: } } - zendlval->value.str.val = estrndup(yytext+bprefix+1, yyleng-bprefix-2); - zendlval->value.str.len = yyleng-bprefix-2; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext+bprefix+1, yyleng-bprefix-2, 1); /* convert escape sequences */ - s = t = zendlval->value.str.val; - end = s+zendlval->value.str.len; + s = t = Z_STRVAL_P(zendlval); + end = s+Z_STRLEN_P(zendlval); while (svalue.str.len--; + Z_STRLEN_P(zendlval)--; break; default: *t++ = '\\'; @@ -2067,9 +1995,9 @@ inline_html: if (SCNG(output_filter)) { size_t sz = 0; - s = zendlval->value.str.val; - SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)s, (size_t)zendlval->value.str.len TSRMLS_CC); - zendlval->value.str.len = sz; + s = Z_STRVAL_P(zendlval); + SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC); + Z_STRLEN_P(zendlval) = sz; efree(s); } return T_CONSTANT_ENCAPSED_STRING; @@ -2187,7 +2115,7 @@ inline_html: "{$" { - zendlval->value.lval = (long) '{'; + Z_LVAL_P(zendlval) = (long) '{'; yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); yyless(1); return T_CURLY_OPEN; diff --git a/Zend/zend_multibyte.c b/Zend/zend_multibyte.c index dafcf18393578..a75d074936ec8 100644 --- a/Zend/zend_multibyte.c +++ b/Zend/zend_multibyte.c @@ -53,7 +53,7 @@ static size_t dummy_encoding_converter(unsigned char **to, size_t *to_length, co static int dummy_encoding_list_parser(const char *encoding_list, size_t encoding_list_len, const zend_encoding ***return_list, size_t *return_size, int persistent TSRMLS_DC) { *return_list = pemalloc(0, persistent); - return_size = 0; + *return_size = 0; return SUCCESS; } diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 921e0d798a069..8beacdfd352b4 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -896,11 +896,8 @@ ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */ zend_call_method_with_2_params(&this_ptr, ce, &ce->__call, ZEND_CALL_FUNC_NAME, &method_result_ptr, method_name_ptr, method_args_ptr); if (method_result_ptr) { - if (Z_ISREF_P(method_result_ptr) || Z_REFCOUNT_P(method_result_ptr) > 1) { - RETVAL_ZVAL(method_result_ptr, 1, 1); - } else { - RETVAL_ZVAL(method_result_ptr, 0, 1); - } + RETVAL_ZVAL_FAST(method_result_ptr); + zval_ptr_dtor(&method_result_ptr); } /* now destruct all auxiliaries */ @@ -1113,11 +1110,8 @@ ZEND_API void zend_std_callstatic_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ zend_call_method_with_2_params(NULL, ce, &ce->__callstatic, ZEND_CALLSTATIC_FUNC_NAME, &method_result_ptr, method_name_ptr, method_args_ptr); if (method_result_ptr) { - if (Z_ISREF_P(method_result_ptr) || Z_REFCOUNT_P(method_result_ptr) > 1) { - RETVAL_ZVAL(method_result_ptr, 1, 1); - } else { - RETVAL_ZVAL(method_result_ptr, 0, 1); - } + RETVAL_ZVAL_FAST(method_result_ptr); + zval_ptr_dtor(&method_result_ptr); } /* now destruct all auxiliaries */ diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c index 1fe5d0c1994cd..b5dd48f798455 100644 --- a/Zend/zend_objects_API.c +++ b/Zend/zend_objects_API.c @@ -57,6 +57,11 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TS obj->dtor(obj->object, i TSRMLS_CC); obj = &objects->object_buckets[i].bucket.obj; obj->refcount--; + + if (obj->refcount == 0) { + /* in case gc_collect_cycle is triggered before free_storage */ + GC_REMOVE_ZOBJ_FROM_BUFFER(obj); + } } } } diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 41b4bd25710fd..ad0879888426c 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -499,7 +499,7 @@ static void zend_check_finally_breakout(zend_op_array *op_array, zend_uint op_nu CG(in_compilation) = 1; CG(active_op_array) = op_array; CG(zend_lineno) = op_array->opcodes[op_num].lineno; - zend_error(E_COMPILE_ERROR, "jump out of a finally block is disallowed"); + zend_error_noreturn(E_COMPILE_ERROR, "jump out of a finally block is disallowed"); } } } @@ -710,7 +710,7 @@ ZEND_API int pass_two(zend_op_array *op_array TSRMLS_DC) if (op_array->fn_flags & ZEND_ACC_GENERATOR) { if (opline->op1_type != IS_CONST || Z_TYPE_P(opline->op1.zv) != IS_NULL) { CG(zend_lineno) = opline->lineno; - zend_error(E_COMPILE_ERROR, "Generators cannot return values using \"return\""); + zend_error_noreturn(E_COMPILE_ERROR, "Generators cannot return values using \"return\""); } opline->opcode = ZEND_GENERATOR_RETURN; diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 34237387b6b33..e8629291e545a 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -192,7 +192,7 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC) /* {{{ */ if ((Z_TYPE_P(op)=is_numeric_string(strval, Z_STRLEN_P(op), &Z_LVAL_P(op), &Z_DVAL_P(op), 1)) == 0) { ZVAL_LONG(op, 0); } - STR_FREE(strval); + str_efree(strval); break; } case IS_BOOL: @@ -391,7 +391,7 @@ ZEND_API void convert_to_long_base(zval *op, int base) /* {{{ */ char *strval = Z_STRVAL_P(op); Z_LVAL_P(op) = strtol(strval, NULL, base); - STR_FREE(strval); + str_efree(strval); } break; case IS_ARRAY: @@ -451,7 +451,7 @@ ZEND_API void convert_to_double(zval *op) /* {{{ */ char *strval = Z_STRVAL_P(op); Z_DVAL_P(op) = zend_strtod(strval, NULL); - STR_FREE(strval); + str_efree(strval); } break; case IS_ARRAY: @@ -540,7 +540,7 @@ ZEND_API void convert_to_boolean(zval *op) /* {{{ */ } else { Z_LVAL_P(op) = 1; } - STR_FREE(strval); + str_efree(strval); } break; case IS_ARRAY: @@ -1153,7 +1153,7 @@ ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) / result_str[i] |= Z_STRVAL_P(shorter)[i]; } if (result==op1) { - STR_FREE(Z_STRVAL_P(result)); + str_efree(Z_STRVAL_P(result)); } Z_STRVAL_P(result) = result_str; Z_STRLEN_P(result) = result_len; @@ -1200,7 +1200,7 @@ ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) result_str[i] &= Z_STRVAL_P(longer)[i]; } if (result==op1) { - STR_FREE(Z_STRVAL_P(result)); + str_efree(Z_STRVAL_P(result)); } Z_STRVAL_P(result) = result_str; Z_STRLEN_P(result) = result_len; @@ -1247,7 +1247,7 @@ ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) result_str[i] ^= Z_STRVAL_P(longer)[i]; } if (result==op1) { - STR_FREE(Z_STRVAL_P(result)); + str_efree(Z_STRVAL_P(result)); } Z_STRVAL_P(result) = result_str; Z_STRLEN_P(result) = result_len; @@ -1313,14 +1313,8 @@ ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) ZEND_API int add_char_to_string(zval *result, const zval *op1, const zval *op2) /* {{{ */ { int length = Z_STRLEN_P(op1) + 1; - char *buf; + char *buf = str_erealloc(Z_STRVAL_P(op1), length + 1); - if (IS_INTERNED(Z_STRVAL_P(op1))) { - buf = (char *) emalloc(length + 1); - memcpy(buf, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); - } else { - buf = (char *) erealloc(Z_STRVAL_P(op1), length + 1); - } buf[length - 1] = (char) Z_LVAL_P(op2); buf[length] = 0; ZVAL_STRINGL(result, buf, length, 0); @@ -1332,14 +1326,8 @@ ZEND_API int add_char_to_string(zval *result, const zval *op1, const zval *op2) ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2) /* {{{ */ { int length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2); - char *buf; + char *buf = str_erealloc(Z_STRVAL_P(op1), length + 1); - if (IS_INTERNED(Z_STRVAL_P(op1))) { - buf = (char *) emalloc(length+1); - memcpy(buf, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); - } else { - buf = (char *) erealloc(Z_STRVAL_P(op1), length+1); - } memcpy(buf + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); buf[length] = 0; ZVAL_STRINGL(result, buf, length, 0); @@ -1842,16 +1830,14 @@ static void increment_string(zval *str) /* {{{ */ int ch; if (Z_STRLEN_P(str) == 0) { - STR_FREE(Z_STRVAL_P(str)); + str_efree(Z_STRVAL_P(str)); Z_STRVAL_P(str) = estrndup("1", sizeof("1")-1); Z_STRLEN_P(str) = 1; return; } if (IS_INTERNED(s)) { - s = (char*) emalloc(Z_STRLEN_P(str) + 1); - memcpy(s, Z_STRVAL_P(str), Z_STRLEN_P(str) + 1); - Z_STRVAL_P(str) = s; + Z_STRVAL_P(str) = s = estrndup(s, Z_STRLEN_P(str)); } while (pos >= 0) { @@ -1909,7 +1895,7 @@ static void increment_string(zval *str) /* {{{ */ t[0] = 'a'; break; } - STR_FREE(Z_STRVAL_P(str)); + str_efree(Z_STRVAL_P(str)); Z_STRVAL_P(str) = t; } } @@ -1999,13 +1985,13 @@ ZEND_API int decrement_function(zval *op1) /* {{{ */ break; case IS_STRING: /* Like perl we only support string increment */ if (Z_STRLEN_P(op1) == 0) { /* consider as 0 */ - STR_FREE(Z_STRVAL_P(op1)); + str_efree(Z_STRVAL_P(op1)); ZVAL_LONG(op1, -1); break; } switch (is_numeric_string(Z_STRVAL_P(op1), Z_STRLEN_P(op1), &lval, &dval, 0)) { case IS_LONG: - STR_FREE(Z_STRVAL_P(op1)); + str_efree(Z_STRVAL_P(op1)); if (lval == LONG_MIN) { double d = (double)lval; ZVAL_DOUBLE(op1, d-1); @@ -2014,7 +2000,7 @@ ZEND_API int decrement_function(zval *op1) /* {{{ */ } break; case IS_DOUBLE: - STR_FREE(Z_STRVAL_P(op1)); + str_efree(Z_STRVAL_P(op1)); ZVAL_DOUBLE(op1, dval - 1); break; } diff --git a/Zend/zend_string.h b/Zend/zend_string.h index ebf8c816c11ff..27ba50be3d642 100644 --- a/Zend/zend_string.h +++ b/Zend/zend_string.h @@ -56,12 +56,39 @@ END_EXTERN_C() } \ } while (0) +#define str_efree_rel(s) do { \ + if (!IS_INTERNED(s)) { \ + efree_rel((char *)s); \ + } \ + } while (0) + #define str_free(s) do { \ if (!IS_INTERNED(s)) { \ free((char*)s); \ } \ } while (0) +#define str_erealloc(str, new_len) \ + (IS_INTERNED(str) \ + ? _str_erealloc(str, new_len, INTERNED_LEN(str)) \ + : erealloc(str, new_len)) + +static inline char *_str_erealloc(char *str, size_t new_len, size_t old_len) { + char *buf = (char *) emalloc(new_len); + memcpy(buf, str, old_len); + return buf; +} + +#define str_estrndup(str, len) \ + (IS_INTERNED(str) ? (str) : estrndup((str), (len))) + +#define str_strndup(str, len) \ + (IS_INTERNED(str) ? (str) : zend_strndup((str), (len))); + +#define str_hash(str, len) \ + (IS_INTERNED(str) ? INTERNED_HASH(str) : zend_hash_func((str), (len)+1)) + + #endif /* ZEND_STRING_H */ /* diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c index c0e1849eefa13..d82e1642e78b0 100644 --- a/Zend/zend_variables.c +++ b/Zend/zend_variables.c @@ -33,7 +33,7 @@ ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC) case IS_STRING: case IS_CONSTANT: CHECK_ZVAL_STRING_REL(zvalue); - STR_FREE_REL(zvalue->value.str.val); + str_efree_rel(zvalue->value.str.val); break; case IS_ARRAY: case IS_CONSTANT_ARRAY: { diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 7e4f7a897d2db..09f567c36f98b 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -1052,10 +1052,8 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, UNUSED|CONST| */ if (OP1_TYPE == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -1390,11 +1388,6 @@ ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|CV, CONST|TMP|VAR|CV) SAVE_OPLINE(); property = GET_OP2_ZVAL_PTR(BP_VAR_R); - if (OP1_TYPE == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); - EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr; - } - if (IS_OP2_TMP_FREE()) { MAKE_REAL_ZVAL_PTR(property); } @@ -1835,7 +1828,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY) EG(current_execute_data) = EX(prev_execute_data); EG(opline_ptr) = NULL; if (!EG(active_symbol_table)) { - i_free_compiled_variables(execute_data); + i_free_compiled_variables(execute_data TSRMLS_CC); } zend_vm_stack_free((char*)execute_data - (ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T) TSRMLS_CC); @@ -1990,7 +1983,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) if (!zend_execute_internal) { /* saves one function call if zend_execute_internal is not used */ - fbc->internal_function.handler(opline->extended_value, ret->var.ptr, (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? &ret->var.ptr : NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC); + fbc->internal_function.handler(opline->extended_value, ret->var.ptr, &ret->var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC); } else { zend_execute_internal(execute_data, NULL, RETURN_VALUE_USED(opline) TSRMLS_CC); } @@ -2609,7 +2602,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -3281,6 +3274,37 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST) ZEND_VM_NEXT_OPCODE(); } +ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, ANY, ANY) +{ + USE_OPLINE + zend_uint arg_num = opline->op1.num; + zend_uint arg_count = zend_vm_stack_get_args_count(TSRMLS_C); + zval **var_ptr, *params; + + SAVE_OPLINE(); + + var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC); + Z_DELREF_PP(var_ptr); + MAKE_STD_ZVAL(params); + *var_ptr = params; + + if (arg_num <= arg_count) { + array_init_size(params, arg_count - arg_num + 1); + } else { + array_init(params); + } + + for (; arg_num <= arg_count; ++arg_num) { + zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC); + zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC); + zend_hash_next_index_insert(Z_ARRVAL_P(params), param, sizeof(zval *), NULL); + Z_ADDREF_PP(param); + } + + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); +} + ZEND_VM_HANDLER(52, ZEND_BOOL, CONST|TMP|VAR|CV, ANY) { USE_OPLINE @@ -3640,11 +3664,7 @@ ZEND_VM_C_LABEL(num_index): hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, ZEND_VM_C_GOTO(num_index)); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -3992,11 +4012,7 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV) hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, ZEND_VM_C_GOTO(num_index_dim)); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -4513,11 +4529,7 @@ ZEND_VM_C_LABEL(num_index_prop): if (!prop_dim) { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, ZEND_VM_C_GOTO(num_index_prop)); } - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -5194,7 +5206,7 @@ ZEND_VM_HANDLER(143, ZEND_DECLARE_CONST, CONST, CONST) zval_copy_ctor(&c.value); } c.flags = CONST_CS; /* non persistent, case sensetive */ - c.name = IS_INTERNED(Z_STRVAL_P(name)) ? Z_STRVAL_P(name) : zend_strndup(Z_STRVAL_P(name), Z_STRLEN_P(name)); + c.name = str_strndup(Z_STRVAL_P(name), Z_STRLEN_P(name)); c.name_len = Z_STRLEN_P(name)+1; c.module_number = PHP_USER_CONSTANT; diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 5f2c8055a02de..a5b4e72da0b19 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -396,7 +396,7 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) EG(current_execute_data) = EX(prev_execute_data); EG(opline_ptr) = NULL; if (!EG(active_symbol_table)) { - i_free_compiled_variables(execute_data); + i_free_compiled_variables(execute_data TSRMLS_CC); } zend_vm_stack_free((char*)execute_data - (ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T) TSRMLS_CC); @@ -551,7 +551,7 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR if (!zend_execute_internal) { /* saves one function call if zend_execute_internal is not used */ - fbc->internal_function.handler(opline->extended_value, ret->var.ptr, (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? &ret->var.ptr : NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC); + fbc->internal_function.handler(opline->extended_value, ret->var.ptr, &ret->var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC); } else { zend_execute_internal(execute_data, NULL, RETURN_VALUE_USED(opline) TSRMLS_CC); } @@ -742,6 +742,37 @@ static int ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) ZEND_VM_NEXT_OPCODE(); } +static int ZEND_FASTCALL ZEND_RECV_VARIADIC_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_uint arg_num = opline->op1.num; + zend_uint arg_count = zend_vm_stack_get_args_count(TSRMLS_C); + zval **var_ptr, *params; + + SAVE_OPLINE(); + + var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC); + Z_DELREF_PP(var_ptr); + MAKE_STD_ZVAL(params); + *var_ptr = params; + + if (arg_num <= arg_count) { + array_init_size(params, arg_count - arg_num + 1); + } else { + array_init(params); + } + + for (; arg_num <= arg_count; ++arg_num) { + zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC); + zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC); + zend_hash_next_index_insert(Z_ARRVAL_P(params), param, sizeof(zval *), NULL); + Z_ADDREF_PP(param); + } + + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); +} + static int ZEND_FASTCALL ZEND_NEW_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -3397,10 +3428,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_CONST(int type */ if (IS_CONST == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -3661,7 +3690,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER( /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -3847,11 +3876,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_O hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -4080,7 +4105,7 @@ static int ZEND_FASTCALL ZEND_DECLARE_CONST_SPEC_CONST_CONST_HANDLER(ZEND_OPCOD zval_copy_ctor(&c.value); } c.flags = CONST_CS; /* non persistent, case sensetive */ - c.name = IS_INTERNED(Z_STRVAL_P(name)) ? Z_STRVAL_P(name) : zend_strndup(Z_STRVAL_P(name), Z_STRLEN_P(name)); + c.name = str_strndup(Z_STRVAL_P(name), Z_STRLEN_P(name)); c.name_len = Z_STRLEN_P(name)+1; c.module_number = PHP_USER_CONSTANT; @@ -4654,7 +4679,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -4744,11 +4769,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPC hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -5272,10 +5293,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_VAR(int type, */ if (IS_CONST == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -5512,7 +5531,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -5602,11 +5621,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPC hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -6018,10 +6033,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_UNUSED(int typ */ if (IS_CONST == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -6232,7 +6245,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -6307,11 +6320,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_ hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -7092,7 +7101,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -7241,11 +7250,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCO hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -8778,10 +8783,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_CONST(int type, */ if (IS_TMP_VAR == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -9133,11 +9136,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPC hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -9992,11 +9991,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCOD hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -10520,10 +10515,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_VAR(int type, ZE */ if (IS_TMP_VAR == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -10852,11 +10845,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -11268,10 +11257,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_UNUSED(int type, */ if (IS_TMP_VAR == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -11434,11 +11421,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OP hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -12290,11 +12273,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -14682,10 +14661,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type, */ if (IS_VAR == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -15019,11 +14996,6 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA SAVE_OPLINE(); property = opline->op2.zv; - if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); - EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr; - } - if (0) { MAKE_REAL_ZVAL_PTR(property); } @@ -15561,7 +15533,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -15747,11 +15719,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPC hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -15906,11 +15874,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -16134,11 +16098,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST( if (!prop_dim) { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); } - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -17370,11 +17330,6 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); - if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); - EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr; - } - if (1) { MAKE_REAL_ZVAL_PTR(property); } @@ -17914,7 +17869,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -18004,11 +17959,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCOD hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -18085,11 +18036,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -18228,11 +18175,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(in if (!prop_dim) { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); } - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -19291,10 +19234,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE */ if (IS_VAR == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -19628,11 +19569,6 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); - if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); - EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr; - } - if (0) { MAKE_REAL_ZVAL_PTR(property); } @@ -20227,7 +20163,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -20317,11 +20253,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -20476,11 +20408,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -20704,11 +20632,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(in if (!prop_dim) { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); } - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -21285,10 +21209,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type, */ if (IS_VAR == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -21667,7 +21589,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -21742,11 +21664,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OP hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -23090,11 +23008,6 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); - if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); - EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr; - } - if (0) { MAKE_REAL_ZVAL_PTR(property); } @@ -23685,7 +23598,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_ /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -23774,11 +23687,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -23855,11 +23764,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -23998,11 +23903,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(int if (!prop_dim) { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); } - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -24873,11 +24774,6 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE SAVE_OPLINE(); property = opline->op2.zv; - if (IS_UNUSED == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); - EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr; - } - if (0) { MAKE_REAL_ZVAL_PTR(property); } @@ -25367,11 +25263,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -25508,11 +25400,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CON if (!prop_dim) { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); } - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -26293,11 +26181,6 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_H SAVE_OPLINE(); property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); - if (IS_UNUSED == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); - EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr; - } - if (1) { MAKE_REAL_ZVAL_PTR(property); } @@ -26690,11 +26573,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -26831,11 +26710,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP if (!prop_dim) { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); } - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -27616,11 +27491,6 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_H SAVE_OPLINE(); property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); - if (IS_UNUSED == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); - EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr; - } - if (0) { MAKE_REAL_ZVAL_PTR(property); } @@ -28013,11 +27883,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -28154,11 +28020,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR if (!prop_dim) { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); } - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -29363,11 +29225,6 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HA SAVE_OPLINE(); property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); - if (IS_UNUSED == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); - EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr; - } - if (0) { MAKE_REAL_ZVAL_PTR(property); } @@ -29758,11 +29615,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -29899,11 +29752,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV( if (!prop_dim) { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); } - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -32193,10 +32042,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_CONST(int type, Z */ if (IS_CV == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -32528,11 +32375,6 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN SAVE_OPLINE(); property = opline->op2.zv; - if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); - EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr; - } - if (0) { MAKE_REAL_ZVAL_PTR(property); } @@ -33030,11 +32872,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCO hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -33189,11 +33027,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -33415,11 +33249,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(i if (!prop_dim) { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); } - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -34645,11 +34475,6 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); - if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); - EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr; - } - if (1) { MAKE_REAL_ZVAL_PTR(property); } @@ -35150,11 +34975,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -35231,11 +35052,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -35372,11 +35189,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(int if (!prop_dim) { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); } - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -36431,10 +36244,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type, ZEN */ if (IS_CV == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -36766,11 +36577,6 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); - if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); - EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr; - } - if (0) { MAKE_REAL_ZVAL_PTR(property); } @@ -37325,11 +37131,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -37484,11 +37286,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -37710,11 +37508,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(int if (!prop_dim) { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); } - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -38287,10 +38081,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_UNUSED(int type, */ if (IS_CV == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -38620,11 +38412,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPC hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -39943,11 +39731,6 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE SAVE_OPLINE(); property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); - if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); - EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr; - } - if (0) { MAKE_REAL_ZVAL_PTR(property); } @@ -40497,11 +40280,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_ hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -40578,11 +40357,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -40719,11 +40494,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(int if (!prop_dim) { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); } - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -45095,6 +44866,31 @@ void zend_init_opcodes_handlers(void) ZEND_FAST_RET_SPEC_HANDLER, ZEND_FAST_RET_SPEC_HANDLER, ZEND_FAST_RET_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, ZEND_NULL_HANDLER }; zend_opcode_handlers = (opcode_handler_t*)labels; diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h index 859258a440bef..7624ec192d7e6 100644 --- a/Zend/zend_vm_opcodes.h +++ b/Zend/zend_vm_opcodes.h @@ -164,3 +164,4 @@ #define ZEND_GENERATOR_RETURN 161 #define ZEND_FAST_CALL 162 #define ZEND_FAST_RET 163 +#define ZEND_RECV_VARIADIC 164 diff --git a/build/shtool b/build/shtool index 684a01f5df968..fc6ae1e6efbbb 100755 --- a/build/shtool +++ b/build/shtool @@ -1003,7 +1003,14 @@ mkdir ) if [ ".$opt_t" = .yes ]; then echo "mkdir $pathcomp" 1>&2 fi - mkdir $pathcomp || errstatus=$? + # See https://bugs.php.net/51076 + # The fix is from Debian who have sent it + # upstream, too; but upstream seems dead. + mkdir $pathcomp || { + _errstatus=$? + [ -d "$pathcomp" ] || errstatus=${_errstatus} + unset _errstatus + } if [ ".$opt_o" != . ]; then if [ ".$opt_t" = .yes ]; then echo "chown $opt_o $pathcomp" 1>&2 diff --git a/ext/bcmath/libbcmath/src/recmul.c b/ext/bcmath/libbcmath/src/recmul.c index c31d09dc72db5..64014f3a6e8a0 100644 --- a/ext/bcmath/libbcmath/src/recmul.c +++ b/ext/bcmath/libbcmath/src/recmul.c @@ -183,7 +183,6 @@ _bc_rec_mul (bc_num u, int ulen, bc_num v, int vlen, bc_num *prod, int full_scale TSRMLS_DC) { bc_num u0, u1, v0, v1; - int u0len, v0len; bc_num m1, m2, m3, d1, d2; int n, prodlen, m1zero; int d1len, d2len; @@ -216,10 +215,8 @@ _bc_rec_mul (bc_num u, int ulen, bc_num v, int vlen, bc_num *prod, } _bc_rm_leading_zeros (u1); _bc_rm_leading_zeros (u0); - u0len = u0->n_len; _bc_rm_leading_zeros (v1); _bc_rm_leading_zeros (v0); - v0len = v0->n_len; m1zero = bc_is_zero(u1 TSRMLS_CC) || bc_is_zero(v1 TSRMLS_CC); diff --git a/ext/bz2/bz2_filter.c b/ext/bz2/bz2_filter.c index 335600232b301..1e7837b098dae 100644 --- a/ext/bz2/bz2_filter.c +++ b/ext/bz2/bz2_filter.c @@ -97,6 +97,7 @@ static php_stream_filter_status_t php_bz2_decompress_filter( status = BZ2_bzDecompressInit(streamp, 0, data->small_footprint); if (BZ_OK != status) { + php_stream_bucket_delref(bucket TSRMLS_CC); return PSFS_ERR_FATAL; } diff --git a/ext/curl/interface.c b/ext/curl/interface.c index ac872dfbc2ca9..591315973ce20 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -2504,6 +2504,7 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu case CURLOPT_FOLLOWLOCATION: convert_to_long_ex(zvalue); +#if LIBCURL_VERSION_NUM < 0x071304 if (PG(open_basedir) && *PG(open_basedir)) { if (Z_LVAL_PP(zvalue) != 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set"); @@ -2511,6 +2512,7 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu return 1; } } +#endif error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue)); break; diff --git a/ext/curl/tests/bug65646.phpt b/ext/curl/tests/bug65646.phpt new file mode 100644 index 0000000000000..f244f7238fc7d --- /dev/null +++ b/ext/curl/tests/bug65646.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir or safe_mode): open_basedir disabled +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(true) diff --git a/ext/curl/tests/bug65646_open_basedir_new.phpt b/ext/curl/tests/bug65646_open_basedir_new.phpt new file mode 100644 index 0000000000000..991c4a2b8a562 --- /dev/null +++ b/ext/curl/tests/bug65646_open_basedir_new.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir or safe_mode): open_basedir enabled; curl >= 7.19.4 +--INI-- +open_basedir=. +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +bool(true) + +Warning: curl_setopt(): CURLPROTO_FILE cannot be activated when an open_basedir is set in %s on line %d +bool(false) + +Warning: curl_setopt(): CURLPROTO_FILE cannot be activated when an open_basedir is set in %s on line %d +bool(false) diff --git a/ext/curl/tests/bug65646_open_basedir_old.phpt b/ext/curl/tests/bug65646_open_basedir_old.phpt new file mode 100644 index 0000000000000..cf11d21a200a2 --- /dev/null +++ b/ext/curl/tests/bug65646_open_basedir_old.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir or safe_mode): open_basedir enabled; curl < 7.19.4 +--INI-- +open_basedir=. +--SKIPIF-- +=')) exit("skip curl version is too new"); +?> +--FILE-- + +--EXPECTF-- +Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set in %s on line %d +bool(false) diff --git a/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt b/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt deleted file mode 100644 index 7a778f36924db..0000000000000 --- a/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -CURLOPT_FOLLOWLOCATION case check open_basedir ---CREDITS-- -WHITE new media architects - Dennis ---INI-- -open_basedir = DIRECTORY_SEPARATOR."tmp"; ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set in %s.php on line %d -bool(false) - diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c index 9428ce380415a..0e99e231d6210 100644 --- a/ext/date/lib/parse_date.c +++ b/ext/date/lib/parse_date.c @@ -25002,7 +25002,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim TIMELIB_CHECK_NUMBER; sec = timelib_get_nr_ex((char **) &ptr, 2, &length); if (sec == TIMELIB_UNSET || length != 2) { - add_pbf_error(s, "A two second minute could not be found", string, begin); + add_pbf_error(s, "A two digit second could not be found", string, begin); } else { s->time->s = sec; } diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re index 7efeb430c3be1..6d91d9ada9e41 100644 --- a/ext/date/lib/parse_date.re +++ b/ext/date/lib/parse_date.re @@ -2009,7 +2009,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim TIMELIB_CHECK_NUMBER; sec = timelib_get_nr_ex((char **) &ptr, 2, &length); if (sec == TIMELIB_UNSET || length != 2) { - add_pbf_error(s, "A two second minute could not be found", string, begin); + add_pbf_error(s, "A two digit second could not be found", string, begin); } else { s->time->s = sec; } diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h index 1e5706cdccd3c..8142aab565eb0 100644 --- a/ext/date/lib/timezonedb.h +++ b/ext/date/lib/timezonedb.h @@ -58,529 +58,529 @@ const timelib_tzdb_index_entry timezonedb_idx_builtin[579] = { { "America/Anguilla" , 0x002952 }, { "America/Antigua" , 0x0029A7 }, { "America/Araguaina" , 0x002A0D }, - { "America/Argentina/Buenos_Aires" , 0x002C67 }, - { "America/Argentina/Catamarca" , 0x002E15 }, - { "America/Argentina/ComodRivadavia" , 0x002FD6 }, - { "America/Argentina/Cordoba" , 0x00317C }, - { "America/Argentina/Jujuy" , 0x003351 }, - { "America/Argentina/La_Rioja" , 0x003505 }, - { "America/Argentina/Mendoza" , 0x0036BD }, - { "America/Argentina/Rio_Gallegos" , 0x00387D }, - { "America/Argentina/Salta" , 0x003A32 }, - { "America/Argentina/San_Juan" , 0x003BDE }, - { "America/Argentina/San_Luis" , 0x003D96 }, - { "America/Argentina/Tucuman" , 0x003F5C }, - { "America/Argentina/Ushuaia" , 0x004118 }, - { "America/Aruba" , 0x0042D3 }, - { "America/Asuncion" , 0x004339 }, - { "America/Atikokan" , 0x00461E }, - { "America/Atka" , 0x0046F4 }, - { "America/Bahia" , 0x004A5A }, - { "America/Bahia_Banderas" , 0x004BED }, - { "America/Barbados" , 0x004E66 }, - { "America/Belem" , 0x004F00 }, - { "America/Belize" , 0x004FFB }, - { "America/Blanc-Sablon" , 0x005177 }, - { "America/Boa_Vista" , 0x00522B }, - { "America/Bogota" , 0x005334 }, - { "America/Boise" , 0x0053A0 }, - { "America/Buenos_Aires" , 0x005737 }, - { "America/Cambridge_Bay" , 0x0058D0 }, - { "America/Campo_Grande" , 0x005BF8 }, - { "America/Cancun" , 0x005EE7 }, - { "America/Caracas" , 0x006129 }, - { "America/Catamarca" , 0x006190 }, - { "America/Cayenne" , 0x006336 }, - { "America/Cayman" , 0x006398 }, - { "America/Chicago" , 0x0063ED }, - { "America/Chihuahua" , 0x006904 }, - { "America/Coral_Harbour" , 0x006B6F }, - { "America/Cordoba" , 0x006C01 }, - { "America/Costa_Rica" , 0x006DA7 }, - { "America/Creston" , 0x006E31 }, - { "America/Cuiaba" , 0x006EBD }, - { "America/Curacao" , 0x00719B }, - { "America/Danmarkshavn" , 0x007201 }, - { "America/Dawson" , 0x007345 }, - { "America/Dawson_Creek" , 0x007662 }, - { "America/Denver" , 0x00783C }, - { "America/Detroit" , 0x007BC2 }, - { "America/Dominica" , 0x007F21 }, - { "America/Edmonton" , 0x007F76 }, - { "America/Eirunepe" , 0x00832E }, - { "America/El_Salvador" , 0x008441 }, - { "America/Ensenada" , 0x0084B6 }, - { "America/Fort_Wayne" , 0x00895D }, - { "America/Fortaleza" , 0x00881F }, - { "America/Glace_Bay" , 0x008BC7 }, - { "America/Godthab" , 0x008F3E }, - { "America/Goose_Bay" , 0x009202 }, - { "America/Grand_Turk" , 0x0096BF }, - { "America/Grenada" , 0x00996E }, - { "America/Guadeloupe" , 0x0099C3 }, - { "America/Guatemala" , 0x009A18 }, - { "America/Guayaquil" , 0x009AA1 }, - { "America/Guyana" , 0x009AFE }, - { "America/Halifax" , 0x009B7F }, - { "America/Havana" , 0x00A095 }, - { "America/Hermosillo" , 0x00A408 }, - { "America/Indiana/Indianapolis" , 0x00A4E6 }, - { "America/Indiana/Knox" , 0x00A777 }, - { "America/Indiana/Marengo" , 0x00AB0E }, - { "America/Indiana/Petersburg" , 0x00ADB4 }, - { "America/Indiana/Tell_City" , 0x00B301 }, - { "America/Indiana/Vevay" , 0x00B59A }, - { "America/Indiana/Vincennes" , 0x00B7D5 }, - { "America/Indiana/Winamac" , 0x00BA89 }, - { "America/Indianapolis" , 0x00B097 }, - { "America/Inuvik" , 0x00BD42 }, - { "America/Iqaluit" , 0x00C039 }, - { "America/Jamaica" , 0x00C35B }, - { "America/Jujuy" , 0x00C420 }, - { "America/Juneau" , 0x00C5CA }, - { "America/Kentucky/Louisville" , 0x00C948 }, - { "America/Kentucky/Monticello" , 0x00CD66 }, - { "America/Knox_IN" , 0x00D0EB }, - { "America/Kralendijk" , 0x00D45C }, - { "America/La_Paz" , 0x00D4C2 }, - { "America/Lima" , 0x00D529 }, - { "America/Los_Angeles" , 0x00D5D1 }, - { "America/Louisville" , 0x00D9E2 }, - { "America/Lower_Princes" , 0x00DDD7 }, - { "America/Maceio" , 0x00DE3D }, - { "America/Managua" , 0x00DF77 }, - { "America/Manaus" , 0x00E02A }, - { "America/Marigot" , 0x00E12C }, - { "America/Martinique" , 0x00E181 }, - { "America/Matamoros" , 0x00E1ED }, - { "America/Mazatlan" , 0x00E446 }, - { "America/Mendoza" , 0x00E6B3 }, - { "America/Menominee" , 0x00E867 }, - { "America/Merida" , 0x00EBE8 }, - { "America/Metlakatla" , 0x00EE23 }, - { "America/Mexico_City" , 0x00EF5D }, - { "America/Miquelon" , 0x00F1D8 }, - { "America/Moncton" , 0x00F44A }, - { "America/Monterrey" , 0x00F8E1 }, - { "America/Montevideo" , 0x00FB44 }, - { "America/Montreal" , 0x00FE56 }, - { "America/Montserrat" , 0x01036C }, - { "America/Nassau" , 0x0103C1 }, - { "America/New_York" , 0x010706 }, - { "America/Nipigon" , 0x010C11 }, - { "America/Nome" , 0x010F62 }, - { "America/Noronha" , 0x0112E0 }, - { "America/North_Dakota/Beulah" , 0x011410 }, - { "America/North_Dakota/Center" , 0x0117A4 }, - { "America/North_Dakota/New_Salem" , 0x011B38 }, - { "America/Ojinaga" , 0x011EE1 }, - { "America/Panama" , 0x012142 }, - { "America/Pangnirtung" , 0x012197 }, - { "America/Paramaribo" , 0x0124CD }, - { "America/Phoenix" , 0x01255F }, - { "America/Port-au-Prince" , 0x01260D }, - { "America/Port_of_Spain" , 0x01292C }, - { "America/Porto_Acre" , 0x01282D }, - { "America/Porto_Velho" , 0x012981 }, - { "America/Puerto_Rico" , 0x012A77 }, - { "America/Rainy_River" , 0x012AE2 }, - { "America/Rankin_Inlet" , 0x012E1A }, - { "America/Recife" , 0x013100 }, - { "America/Regina" , 0x01322A }, - { "America/Resolute" , 0x0133E8 }, - { "America/Rio_Branco" , 0x0136D9 }, - { "America/Rosario" , 0x0137DC }, - { "America/Santa_Isabel" , 0x013982 }, - { "America/Santarem" , 0x013D25 }, - { "America/Santiago" , 0x013E2A }, - { "America/Santo_Domingo" , 0x0141D3 }, - { "America/Sao_Paulo" , 0x014299 }, - { "America/Scoresbysund" , 0x0145A8 }, - { "America/Shiprock" , 0x014896 }, - { "America/Sitka" , 0x014C25 }, - { "America/St_Barthelemy" , 0x014FAD }, - { "America/St_Johns" , 0x015002 }, - { "America/St_Kitts" , 0x015555 }, - { "America/St_Lucia" , 0x0155AA }, - { "America/St_Thomas" , 0x0155FF }, - { "America/St_Vincent" , 0x015654 }, - { "America/Swift_Current" , 0x0156A9 }, - { "America/Tegucigalpa" , 0x0157CA }, - { "America/Thule" , 0x015849 }, - { "America/Thunder_Bay" , 0x015A90 }, - { "America/Tijuana" , 0x015DD9 }, - { "America/Toronto" , 0x016172 }, - { "America/Tortola" , 0x016689 }, - { "America/Vancouver" , 0x0166DE }, - { "America/Virgin" , 0x016B1B }, - { "America/Whitehorse" , 0x016B70 }, - { "America/Winnipeg" , 0x016E8D }, - { "America/Yakutat" , 0x0172CD }, - { "America/Yellowknife" , 0x017638 }, - { "Antarctica/Casey" , 0x017948 }, - { "Antarctica/Davis" , 0x0179E5 }, - { "Antarctica/DumontDUrville" , 0x017A86 }, - { "Antarctica/Macquarie" , 0x017B18 }, - { "Antarctica/Mawson" , 0x017D5F }, - { "Antarctica/McMurdo" , 0x017DDB }, - { "Antarctica/Palmer" , 0x0180DD }, - { "Antarctica/Rothera" , 0x0183F9 }, - { "Antarctica/South_Pole" , 0x01846F }, - { "Antarctica/Syowa" , 0x018777 }, - { "Antarctica/Vostok" , 0x0187E5 }, - { "Arctic/Longyearbyen" , 0x018856 }, - { "Asia/Aden" , 0x018B88 }, - { "Asia/Almaty" , 0x018BDD }, - { "Asia/Amman" , 0x018D5C }, - { "Asia/Anadyr" , 0x019012 }, - { "Asia/Aqtau" , 0x0191F7 }, - { "Asia/Aqtobe" , 0x0193F6 }, - { "Asia/Ashgabat" , 0x0195AE }, - { "Asia/Ashkhabad" , 0x0196CB }, - { "Asia/Baghdad" , 0x0197E8 }, - { "Asia/Bahrain" , 0x01995D }, - { "Asia/Baku" , 0x0199C3 }, - { "Asia/Bangkok" , 0x019CAB }, - { "Asia/Beirut" , 0x019D00 }, - { "Asia/Bishkek" , 0x01A00D }, - { "Asia/Brunei" , 0x01A1B9 }, - { "Asia/Calcutta" , 0x01A21B }, - { "Asia/Choibalsan" , 0x01A294 }, - { "Asia/Chongqing" , 0x01A40D }, - { "Asia/Chungking" , 0x01A4FC }, - { "Asia/Colombo" , 0x01A5AB }, - { "Asia/Dacca" , 0x01A647 }, - { "Asia/Damascus" , 0x01A6ED }, - { "Asia/Dhaka" , 0x01AA3D }, - { "Asia/Dili" , 0x01AAE3 }, - { "Asia/Dubai" , 0x01AB6C }, - { "Asia/Dushanbe" , 0x01ABC1 }, - { "Asia/Gaza" , 0x01ACC4 }, - { "Asia/Harbin" , 0x01B017 }, - { "Asia/Hebron" , 0x01B0FE }, - { "Asia/Ho_Chi_Minh" , 0x01B45A }, - { "Asia/Hong_Kong" , 0x01B4D2 }, - { "Asia/Hovd" , 0x01B694 }, - { "Asia/Irkutsk" , 0x01B80C }, - { "Asia/Istanbul" , 0x01B9F2 }, - { "Asia/Jakarta" , 0x01BDDF }, - { "Asia/Jayapura" , 0x01BE89 }, - { "Asia/Jerusalem" , 0x01BF25 }, - { "Asia/Kabul" , 0x01C254 }, - { "Asia/Kamchatka" , 0x01C2A5 }, - { "Asia/Karachi" , 0x01C481 }, - { "Asia/Kashgar" , 0x01C536 }, - { "Asia/Kathmandu" , 0x01C607 }, - { "Asia/Katmandu" , 0x01C66D }, - { "Asia/Khandyga" , 0x01C6D3 }, - { "Asia/Kolkata" , 0x01C8F8 }, - { "Asia/Krasnoyarsk" , 0x01C971 }, - { "Asia/Kuala_Lumpur" , 0x01CB59 }, - { "Asia/Kuching" , 0x01CC16 }, - { "Asia/Kuwait" , 0x01CD04 }, - { "Asia/Macao" , 0x01CD59 }, - { "Asia/Macau" , 0x01CE94 }, - { "Asia/Magadan" , 0x01CFCF }, - { "Asia/Makassar" , 0x01D1B1 }, - { "Asia/Manila" , 0x01D275 }, - { "Asia/Muscat" , 0x01D2FA }, - { "Asia/Nicosia" , 0x01D34F }, - { "Asia/Novokuznetsk" , 0x01D637 }, - { "Asia/Novosibirsk" , 0x01D839 }, - { "Asia/Omsk" , 0x01DA24 }, - { "Asia/Oral" , 0x01DC0B }, - { "Asia/Phnom_Penh" , 0x01DDDB }, - { "Asia/Pontianak" , 0x01DE53 }, - { "Asia/Pyongyang" , 0x01DF14 }, - { "Asia/Qatar" , 0x01DF81 }, - { "Asia/Qyzylorda" , 0x01DFE7 }, - { "Asia/Rangoon" , 0x01E1BD }, - { "Asia/Riyadh" , 0x01E235 }, - { "Asia/Saigon" , 0x01E28A }, - { "Asia/Sakhalin" , 0x01E302 }, - { "Asia/Samarkand" , 0x01E4F9 }, - { "Asia/Seoul" , 0x01E62F }, - { "Asia/Shanghai" , 0x01E6D3 }, - { "Asia/Singapore" , 0x01E7B3 }, - { "Asia/Taipei" , 0x01E86A }, - { "Asia/Tashkent" , 0x01E982 }, - { "Asia/Tbilisi" , 0x01EAB3 }, - { "Asia/Tehran" , 0x01EC6D }, - { "Asia/Tel_Aviv" , 0x01EEDB }, - { "Asia/Thimbu" , 0x01F20A }, - { "Asia/Thimphu" , 0x01F270 }, - { "Asia/Tokyo" , 0x01F2D6 }, - { "Asia/Ujung_Pandang" , 0x01F35F }, - { "Asia/Ulaanbaatar" , 0x01F3DB }, - { "Asia/Ulan_Bator" , 0x01F536 }, - { "Asia/Urumqi" , 0x01F683 }, - { "Asia/Ust-Nera" , 0x01F74A }, - { "Asia/Vientiane" , 0x01F94F }, - { "Asia/Vladivostok" , 0x01F9C7 }, - { "Asia/Yakutsk" , 0x01FBB3 }, - { "Asia/Yekaterinburg" , 0x01FD98 }, - { "Asia/Yerevan" , 0x01FFA3 }, - { "Atlantic/Azores" , 0x0201A3 }, - { "Atlantic/Bermuda" , 0x0206A6 }, - { "Atlantic/Canary" , 0x020987 }, - { "Atlantic/Cape_Verde" , 0x020C5D }, - { "Atlantic/Faeroe" , 0x020CD6 }, - { "Atlantic/Faroe" , 0x020F7A }, - { "Atlantic/Jan_Mayen" , 0x02121E }, - { "Atlantic/Madeira" , 0x021550 }, - { "Atlantic/Reykjavik" , 0x021A59 }, - { "Atlantic/South_Georgia" , 0x021C12 }, - { "Atlantic/St_Helena" , 0x021E24 }, - { "Atlantic/Stanley" , 0x021C56 }, - { "Australia/ACT" , 0x021E79 }, - { "Australia/Adelaide" , 0x022196 }, - { "Australia/Brisbane" , 0x0224C2 }, - { "Australia/Broken_Hill" , 0x022589 }, - { "Australia/Canberra" , 0x0228C7 }, - { "Australia/Currie" , 0x022BE4 }, - { "Australia/Darwin" , 0x022F17 }, - { "Australia/Eucla" , 0x022F9D }, - { "Australia/Hobart" , 0x023072 }, - { "Australia/LHI" , 0x0233D0 }, - { "Australia/Lindeman" , 0x02366B }, - { "Australia/Lord_Howe" , 0x02374C }, - { "Australia/Melbourne" , 0x0239F7 }, - { "Australia/North" , 0x023D1C }, - { "Australia/NSW" , 0x023D90 }, - { "Australia/Perth" , 0x0240AD }, - { "Australia/Queensland" , 0x024185 }, - { "Australia/South" , 0x024231 }, - { "Australia/Sydney" , 0x02454E }, - { "Australia/Tasmania" , 0x02488B }, - { "Australia/Victoria" , 0x024BD0 }, - { "Australia/West" , 0x024EED }, - { "Australia/Yancowinna" , 0x024FA3 }, - { "Brazil/Acre" , 0x0252C5 }, - { "Brazil/DeNoronha" , 0x0253C4 }, - { "Brazil/East" , 0x0254E4 }, - { "Brazil/West" , 0x0257C1 }, - { "Canada/Atlantic" , 0x0258B9 }, - { "Canada/Central" , 0x025DA1 }, - { "Canada/East-Saskatchewan" , 0x0266AB }, - { "Canada/Eastern" , 0x0261BB }, - { "Canada/Mountain" , 0x026834 }, - { "Canada/Newfoundland" , 0x026BAA }, - { "Canada/Pacific" , 0x0270D5 }, - { "Canada/Saskatchewan" , 0x0274EE }, - { "Canada/Yukon" , 0x027677 }, - { "CET" , 0x02797A }, - { "Chile/Continental" , 0x027C83 }, - { "Chile/EasterIsland" , 0x02801E }, - { "CST6CDT" , 0x028360 }, - { "Cuba" , 0x0286B1 }, - { "EET" , 0x028A24 }, - { "Egypt" , 0x028CD7 }, - { "Eire" , 0x028F9A }, - { "EST" , 0x0294AB }, - { "EST5EDT" , 0x0294EF }, - { "Etc/GMT" , 0x029840 }, - { "Etc/GMT+0" , 0x02990C }, - { "Etc/GMT+1" , 0x029996 }, - { "Etc/GMT+10" , 0x029A23 }, - { "Etc/GMT+11" , 0x029AB1 }, - { "Etc/GMT+12" , 0x029B3F }, - { "Etc/GMT+2" , 0x029C5A }, - { "Etc/GMT+3" , 0x029CE6 }, - { "Etc/GMT+4" , 0x029D72 }, - { "Etc/GMT+5" , 0x029DFE }, - { "Etc/GMT+6" , 0x029E8A }, - { "Etc/GMT+7" , 0x029F16 }, - { "Etc/GMT+8" , 0x029FA2 }, - { "Etc/GMT+9" , 0x02A02E }, - { "Etc/GMT-0" , 0x0298C8 }, - { "Etc/GMT-1" , 0x029950 }, - { "Etc/GMT-10" , 0x0299DC }, - { "Etc/GMT-11" , 0x029A6A }, - { "Etc/GMT-12" , 0x029AF8 }, - { "Etc/GMT-13" , 0x029B86 }, - { "Etc/GMT-14" , 0x029BCD }, - { "Etc/GMT-2" , 0x029C14 }, - { "Etc/GMT-3" , 0x029CA0 }, - { "Etc/GMT-4" , 0x029D2C }, - { "Etc/GMT-5" , 0x029DB8 }, - { "Etc/GMT-6" , 0x029E44 }, - { "Etc/GMT-7" , 0x029ED0 }, - { "Etc/GMT-8" , 0x029F5C }, - { "Etc/GMT-9" , 0x029FE8 }, - { "Etc/GMT0" , 0x029884 }, - { "Etc/Greenwich" , 0x02A074 }, - { "Etc/UCT" , 0x02A0B8 }, - { "Etc/Universal" , 0x02A0FC }, - { "Etc/UTC" , 0x02A140 }, - { "Etc/Zulu" , 0x02A184 }, - { "Europe/Amsterdam" , 0x02A1C8 }, - { "Europe/Andorra" , 0x02A606 }, - { "Europe/Athens" , 0x02A882 }, - { "Europe/Belfast" , 0x02ABC5 }, - { "Europe/Belgrade" , 0x02B0FC }, - { "Europe/Berlin" , 0x02B3C5 }, - { "Europe/Bratislava" , 0x02B729 }, - { "Europe/Brussels" , 0x02BA5B }, - { "Europe/Bucharest" , 0x02BE92 }, - { "Europe/Budapest" , 0x02C1BC }, - { "Europe/Busingen" , 0x02C52F }, - { "Europe/Chisinau" , 0x02C7E6 }, - { "Europe/Copenhagen" , 0x02CB74 }, - { "Europe/Dublin" , 0x02CE7E }, - { "Europe/Gibraltar" , 0x02D38F }, - { "Europe/Guernsey" , 0x02D7E6 }, - { "Europe/Helsinki" , 0x02DD1D }, - { "Europe/Isle_of_Man" , 0x02DFD3 }, - { "Europe/Istanbul" , 0x02E50A }, - { "Europe/Jersey" , 0x02E8F7 }, - { "Europe/Kaliningrad" , 0x02EE2E }, - { "Europe/Kiev" , 0x02F094 }, - { "Europe/Lisbon" , 0x02F3AB }, - { "Europe/Ljubljana" , 0x02F8AF }, - { "Europe/London" , 0x02FB78 }, - { "Europe/Luxembourg" , 0x0300AF }, - { "Europe/Madrid" , 0x030505 }, - { "Europe/Malta" , 0x0308CB }, - { "Europe/Mariehamn" , 0x030C84 }, - { "Europe/Minsk" , 0x030F3A }, - { "Europe/Monaco" , 0x031148 }, - { "Europe/Moscow" , 0x031583 }, - { "Europe/Nicosia" , 0x0317D4 }, - { "Europe/Oslo" , 0x031ABC }, - { "Europe/Paris" , 0x031DEE }, - { "Europe/Podgorica" , 0x032234 }, - { "Europe/Prague" , 0x0324FD }, - { "Europe/Riga" , 0x03282F }, - { "Europe/Rome" , 0x032B74 }, - { "Europe/Samara" , 0x032F37 }, - { "Europe/San_Marino" , 0x03316A }, - { "Europe/Sarajevo" , 0x03352D }, - { "Europe/Simferopol" , 0x0337F6 }, - { "Europe/Skopje" , 0x033B21 }, - { "Europe/Sofia" , 0x033DEA }, - { "Europe/Stockholm" , 0x0340F2 }, - { "Europe/Tallinn" , 0x0343A1 }, - { "Europe/Tirane" , 0x0346DB }, - { "Europe/Tiraspol" , 0x0349E1 }, - { "Europe/Uzhgorod" , 0x034D6F }, - { "Europe/Vaduz" , 0x035086 }, - { "Europe/Vatican" , 0x035319 }, - { "Europe/Vienna" , 0x0356DC }, - { "Europe/Vilnius" , 0x035A09 }, - { "Europe/Volgograd" , 0x035D48 }, - { "Europe/Warsaw" , 0x035F48 }, - { "Europe/Zagreb" , 0x036329 }, - { "Europe/Zaporozhye" , 0x0365F2 }, - { "Europe/Zurich" , 0x036933 }, - { "Factory" , 0x036BE2 }, - { "GB" , 0x036C53 }, - { "GB-Eire" , 0x03718A }, - { "GMT" , 0x0376C1 }, - { "GMT+0" , 0x03778D }, - { "GMT-0" , 0x037749 }, - { "GMT0" , 0x037705 }, - { "Greenwich" , 0x0377D1 }, - { "Hongkong" , 0x037815 }, - { "HST" , 0x0379D7 }, - { "Iceland" , 0x037A1B }, - { "Indian/Antananarivo" , 0x037BD4 }, - { "Indian/Chagos" , 0x037C48 }, - { "Indian/Christmas" , 0x037CAA }, - { "Indian/Cocos" , 0x037CEE }, - { "Indian/Comoro" , 0x037D32 }, - { "Indian/Kerguelen" , 0x037D87 }, - { "Indian/Mahe" , 0x037DDC }, - { "Indian/Maldives" , 0x037E31 }, - { "Indian/Mauritius" , 0x037E86 }, - { "Indian/Mayotte" , 0x037EFC }, - { "Indian/Reunion" , 0x037F51 }, - { "Iran" , 0x037FA6 }, - { "Israel" , 0x038214 }, - { "Jamaica" , 0x038543 }, - { "Japan" , 0x038608 }, - { "Kwajalein" , 0x038691 }, - { "Libya" , 0x0386F4 }, - { "MET" , 0x0388ED }, - { "Mexico/BajaNorte" , 0x038BF6 }, - { "Mexico/BajaSur" , 0x038F5F }, - { "Mexico/General" , 0x0391A4 }, - { "MST" , 0x039402 }, - { "MST7MDT" , 0x039446 }, - { "Navajo" , 0x039797 }, - { "NZ" , 0x039B10 }, - { "NZ-CHAT" , 0x039E8E }, - { "Pacific/Apia" , 0x03A176 }, - { "Pacific/Auckland" , 0x03A312 }, - { "Pacific/Chatham" , 0x03A69E }, - { "Pacific/Chuuk" , 0x03A995 }, - { "Pacific/Easter" , 0x03A9EE }, - { "Pacific/Efate" , 0x03AD4C }, - { "Pacific/Enderbury" , 0x03AE12 }, - { "Pacific/Fakaofo" , 0x03AE80 }, - { "Pacific/Fiji" , 0x03AED1 }, - { "Pacific/Funafuti" , 0x03B064 }, - { "Pacific/Galapagos" , 0x03B0A8 }, - { "Pacific/Gambier" , 0x03B120 }, - { "Pacific/Guadalcanal" , 0x03B185 }, - { "Pacific/Guam" , 0x03B1DA }, - { "Pacific/Honolulu" , 0x03B230 }, - { "Pacific/Johnston" , 0x03B2A7 }, - { "Pacific/Kiritimati" , 0x03B2F9 }, - { "Pacific/Kosrae" , 0x03B364 }, - { "Pacific/Kwajalein" , 0x03B3C1 }, - { "Pacific/Majuro" , 0x03B42D }, - { "Pacific/Marquesas" , 0x03B48C }, - { "Pacific/Midway" , 0x03B4F3 }, - { "Pacific/Nauru" , 0x03B57D }, - { "Pacific/Niue" , 0x03B5F5 }, - { "Pacific/Norfolk" , 0x03B653 }, - { "Pacific/Noumea" , 0x03B6A8 }, - { "Pacific/Pago_Pago" , 0x03B738 }, - { "Pacific/Palau" , 0x03B7C1 }, - { "Pacific/Pitcairn" , 0x03B805 }, - { "Pacific/Pohnpei" , 0x03B85A }, - { "Pacific/Ponape" , 0x03B8AF }, - { "Pacific/Port_Moresby" , 0x03B8F4 }, - { "Pacific/Rarotonga" , 0x03B938 }, - { "Pacific/Saipan" , 0x03BA14 }, - { "Pacific/Samoa" , 0x03BA77 }, - { "Pacific/Tahiti" , 0x03BB00 }, - { "Pacific/Tarawa" , 0x03BB65 }, - { "Pacific/Tongatapu" , 0x03BBB9 }, - { "Pacific/Truk" , 0x03BC45 }, - { "Pacific/Wake" , 0x03BC8A }, - { "Pacific/Wallis" , 0x03BCDA }, - { "Pacific/Yap" , 0x03BD1E }, - { "Poland" , 0x03BD63 }, - { "Portugal" , 0x03C144 }, - { "PRC" , 0x03C640 }, - { "PST8PDT" , 0x03C6F1 }, - { "ROC" , 0x03CA42 }, - { "ROK" , 0x03CB5A }, - { "Singapore" , 0x03CBFE }, - { "Turkey" , 0x03CCB5 }, - { "UCT" , 0x03D0A2 }, - { "Universal" , 0x03D0E6 }, - { "US/Alaska" , 0x03D12A }, - { "US/Aleutian" , 0x03D493 }, - { "US/Arizona" , 0x03D7F9 }, - { "US/Central" , 0x03D887 }, - { "US/East-Indiana" , 0x03E291 }, - { "US/Eastern" , 0x03DD92 }, - { "US/Hawaii" , 0x03E4FB }, - { "US/Indiana-Starke" , 0x03E56C }, - { "US/Michigan" , 0x03E8DD }, - { "US/Mountain" , 0x03EC14 }, - { "US/Pacific" , 0x03EF8D }, - { "US/Pacific-New" , 0x03F392 }, - { "US/Samoa" , 0x03F797 }, - { "UTC" , 0x03F820 }, - { "W-SU" , 0x03FB17 }, - { "WET" , 0x03F864 }, - { "Zulu" , 0x03FD51 }, + { "America/Argentina/Buenos_Aires" , 0x002B72 }, + { "America/Argentina/Catamarca" , 0x002D20 }, + { "America/Argentina/ComodRivadavia" , 0x002EE1 }, + { "America/Argentina/Cordoba" , 0x003087 }, + { "America/Argentina/Jujuy" , 0x00325C }, + { "America/Argentina/La_Rioja" , 0x003410 }, + { "America/Argentina/Mendoza" , 0x0035C8 }, + { "America/Argentina/Rio_Gallegos" , 0x003788 }, + { "America/Argentina/Salta" , 0x00393D }, + { "America/Argentina/San_Juan" , 0x003AE9 }, + { "America/Argentina/San_Luis" , 0x003CA1 }, + { "America/Argentina/Tucuman" , 0x003E67 }, + { "America/Argentina/Ushuaia" , 0x004023 }, + { "America/Aruba" , 0x0041DE }, + { "America/Asuncion" , 0x004244 }, + { "America/Atikokan" , 0x004529 }, + { "America/Atka" , 0x0045FF }, + { "America/Bahia" , 0x004965 }, + { "America/Bahia_Banderas" , 0x004AF8 }, + { "America/Barbados" , 0x004D71 }, + { "America/Belem" , 0x004E0B }, + { "America/Belize" , 0x004F06 }, + { "America/Blanc-Sablon" , 0x005082 }, + { "America/Boa_Vista" , 0x005136 }, + { "America/Bogota" , 0x00523F }, + { "America/Boise" , 0x0052AB }, + { "America/Buenos_Aires" , 0x005642 }, + { "America/Cambridge_Bay" , 0x0057DB }, + { "America/Campo_Grande" , 0x005B03 }, + { "America/Cancun" , 0x005DF2 }, + { "America/Caracas" , 0x006034 }, + { "America/Catamarca" , 0x00609B }, + { "America/Cayenne" , 0x006241 }, + { "America/Cayman" , 0x0062A3 }, + { "America/Chicago" , 0x0062F8 }, + { "America/Chihuahua" , 0x00680F }, + { "America/Coral_Harbour" , 0x006A7A }, + { "America/Cordoba" , 0x006B0C }, + { "America/Costa_Rica" , 0x006CB2 }, + { "America/Creston" , 0x006D3C }, + { "America/Cuiaba" , 0x006DC8 }, + { "America/Curacao" , 0x0070A6 }, + { "America/Danmarkshavn" , 0x00710C }, + { "America/Dawson" , 0x007250 }, + { "America/Dawson_Creek" , 0x00756D }, + { "America/Denver" , 0x007747 }, + { "America/Detroit" , 0x007ACD }, + { "America/Dominica" , 0x007E2C }, + { "America/Edmonton" , 0x007E81 }, + { "America/Eirunepe" , 0x008239 }, + { "America/El_Salvador" , 0x00834C }, + { "America/Ensenada" , 0x0083C1 }, + { "America/Fort_Wayne" , 0x008868 }, + { "America/Fortaleza" , 0x00872A }, + { "America/Glace_Bay" , 0x008AD2 }, + { "America/Godthab" , 0x008E49 }, + { "America/Goose_Bay" , 0x00910D }, + { "America/Grand_Turk" , 0x0095CA }, + { "America/Grenada" , 0x009879 }, + { "America/Guadeloupe" , 0x0098CE }, + { "America/Guatemala" , 0x009923 }, + { "America/Guayaquil" , 0x0099AC }, + { "America/Guyana" , 0x009A09 }, + { "America/Halifax" , 0x009A8A }, + { "America/Havana" , 0x009FA0 }, + { "America/Hermosillo" , 0x00A313 }, + { "America/Indiana/Indianapolis" , 0x00A3F1 }, + { "America/Indiana/Knox" , 0x00A682 }, + { "America/Indiana/Marengo" , 0x00AA19 }, + { "America/Indiana/Petersburg" , 0x00ACBF }, + { "America/Indiana/Tell_City" , 0x00B20C }, + { "America/Indiana/Vevay" , 0x00B4A5 }, + { "America/Indiana/Vincennes" , 0x00B6E0 }, + { "America/Indiana/Winamac" , 0x00B994 }, + { "America/Indianapolis" , 0x00AFA2 }, + { "America/Inuvik" , 0x00BC4D }, + { "America/Iqaluit" , 0x00BF44 }, + { "America/Jamaica" , 0x00C266 }, + { "America/Jujuy" , 0x00C32B }, + { "America/Juneau" , 0x00C4D5 }, + { "America/Kentucky/Louisville" , 0x00C853 }, + { "America/Kentucky/Monticello" , 0x00CC71 }, + { "America/Knox_IN" , 0x00CFF6 }, + { "America/Kralendijk" , 0x00D367 }, + { "America/La_Paz" , 0x00D3CD }, + { "America/Lima" , 0x00D434 }, + { "America/Los_Angeles" , 0x00D4DC }, + { "America/Louisville" , 0x00D8ED }, + { "America/Lower_Princes" , 0x00DCE2 }, + { "America/Maceio" , 0x00DD48 }, + { "America/Managua" , 0x00DE82 }, + { "America/Manaus" , 0x00DF35 }, + { "America/Marigot" , 0x00E037 }, + { "America/Martinique" , 0x00E08C }, + { "America/Matamoros" , 0x00E0F8 }, + { "America/Mazatlan" , 0x00E351 }, + { "America/Mendoza" , 0x00E5BE }, + { "America/Menominee" , 0x00E772 }, + { "America/Merida" , 0x00EAF3 }, + { "America/Metlakatla" , 0x00ED2E }, + { "America/Mexico_City" , 0x00EE68 }, + { "America/Miquelon" , 0x00F0E3 }, + { "America/Moncton" , 0x00F355 }, + { "America/Monterrey" , 0x00F7EC }, + { "America/Montevideo" , 0x00FA4F }, + { "America/Montreal" , 0x00FD61 }, + { "America/Montserrat" , 0x010251 }, + { "America/Nassau" , 0x0102A6 }, + { "America/New_York" , 0x0105EB }, + { "America/Nipigon" , 0x010AF6 }, + { "America/Nome" , 0x010E47 }, + { "America/Noronha" , 0x0111C5 }, + { "America/North_Dakota/Beulah" , 0x0112F5 }, + { "America/North_Dakota/Center" , 0x011689 }, + { "America/North_Dakota/New_Salem" , 0x011A1D }, + { "America/Ojinaga" , 0x011DC6 }, + { "America/Panama" , 0x012027 }, + { "America/Pangnirtung" , 0x01207C }, + { "America/Paramaribo" , 0x0123B2 }, + { "America/Phoenix" , 0x012444 }, + { "America/Port-au-Prince" , 0x012502 }, + { "America/Port_of_Spain" , 0x012821 }, + { "America/Porto_Acre" , 0x012722 }, + { "America/Porto_Velho" , 0x012876 }, + { "America/Puerto_Rico" , 0x01296C }, + { "America/Rainy_River" , 0x0129D7 }, + { "America/Rankin_Inlet" , 0x012D0F }, + { "America/Recife" , 0x012FF5 }, + { "America/Regina" , 0x01311F }, + { "America/Resolute" , 0x0132DD }, + { "America/Rio_Branco" , 0x0135CE }, + { "America/Rosario" , 0x0136D1 }, + { "America/Santa_Isabel" , 0x013877 }, + { "America/Santarem" , 0x013C1A }, + { "America/Santiago" , 0x013D1F }, + { "America/Santo_Domingo" , 0x0140C8 }, + { "America/Sao_Paulo" , 0x01418E }, + { "America/Scoresbysund" , 0x01449D }, + { "America/Shiprock" , 0x01478B }, + { "America/Sitka" , 0x014B04 }, + { "America/St_Barthelemy" , 0x014E8C }, + { "America/St_Johns" , 0x014EE1 }, + { "America/St_Kitts" , 0x015434 }, + { "America/St_Lucia" , 0x015489 }, + { "America/St_Thomas" , 0x0154DE }, + { "America/St_Vincent" , 0x015533 }, + { "America/Swift_Current" , 0x015588 }, + { "America/Tegucigalpa" , 0x0156A9 }, + { "America/Thule" , 0x015728 }, + { "America/Thunder_Bay" , 0x01596F }, + { "America/Tijuana" , 0x015CB8 }, + { "America/Toronto" , 0x016051 }, + { "America/Tortola" , 0x016571 }, + { "America/Vancouver" , 0x0165C6 }, + { "America/Virgin" , 0x016A03 }, + { "America/Whitehorse" , 0x016A58 }, + { "America/Winnipeg" , 0x016D75 }, + { "America/Yakutat" , 0x0171B5 }, + { "America/Yellowknife" , 0x017520 }, + { "Antarctica/Casey" , 0x017830 }, + { "Antarctica/Davis" , 0x0178CD }, + { "Antarctica/DumontDUrville" , 0x01796E }, + { "Antarctica/Macquarie" , 0x017A00 }, + { "Antarctica/Mawson" , 0x017C47 }, + { "Antarctica/McMurdo" , 0x017CC3 }, + { "Antarctica/Palmer" , 0x01806E }, + { "Antarctica/Rothera" , 0x01838A }, + { "Antarctica/South_Pole" , 0x018400 }, + { "Antarctica/Syowa" , 0x01877E }, + { "Antarctica/Vostok" , 0x0187EC }, + { "Arctic/Longyearbyen" , 0x01885D }, + { "Asia/Aden" , 0x018B8F }, + { "Asia/Almaty" , 0x018BE4 }, + { "Asia/Amman" , 0x018D63 }, + { "Asia/Anadyr" , 0x018F35 }, + { "Asia/Aqtau" , 0x01911A }, + { "Asia/Aqtobe" , 0x019319 }, + { "Asia/Ashgabat" , 0x0194D1 }, + { "Asia/Ashkhabad" , 0x0195EE }, + { "Asia/Baghdad" , 0x01970B }, + { "Asia/Bahrain" , 0x019880 }, + { "Asia/Baku" , 0x0198E6 }, + { "Asia/Bangkok" , 0x019BCE }, + { "Asia/Beirut" , 0x019C23 }, + { "Asia/Bishkek" , 0x019F30 }, + { "Asia/Brunei" , 0x01A0DC }, + { "Asia/Calcutta" , 0x01A13E }, + { "Asia/Choibalsan" , 0x01A1B7 }, + { "Asia/Chongqing" , 0x01A330 }, + { "Asia/Chungking" , 0x01A41F }, + { "Asia/Colombo" , 0x01A4CE }, + { "Asia/Dacca" , 0x01A56A }, + { "Asia/Damascus" , 0x01A610 }, + { "Asia/Dhaka" , 0x01A960 }, + { "Asia/Dili" , 0x01AA06 }, + { "Asia/Dubai" , 0x01AA90 }, + { "Asia/Dushanbe" , 0x01AAE5 }, + { "Asia/Gaza" , 0x01ABE8 }, + { "Asia/Harbin" , 0x01AF3B }, + { "Asia/Hebron" , 0x01B022 }, + { "Asia/Ho_Chi_Minh" , 0x01B37E }, + { "Asia/Hong_Kong" , 0x01B3F6 }, + { "Asia/Hovd" , 0x01B5B8 }, + { "Asia/Irkutsk" , 0x01B730 }, + { "Asia/Istanbul" , 0x01B916 }, + { "Asia/Jakarta" , 0x01BD03 }, + { "Asia/Jayapura" , 0x01BDAD }, + { "Asia/Jerusalem" , 0x01BE49 }, + { "Asia/Kabul" , 0x01C178 }, + { "Asia/Kamchatka" , 0x01C1C9 }, + { "Asia/Karachi" , 0x01C3A5 }, + { "Asia/Kashgar" , 0x01C45A }, + { "Asia/Kathmandu" , 0x01C52B }, + { "Asia/Katmandu" , 0x01C591 }, + { "Asia/Khandyga" , 0x01C5F7 }, + { "Asia/Kolkata" , 0x01C81C }, + { "Asia/Krasnoyarsk" , 0x01C895 }, + { "Asia/Kuala_Lumpur" , 0x01CA7D }, + { "Asia/Kuching" , 0x01CB3A }, + { "Asia/Kuwait" , 0x01CC28 }, + { "Asia/Macao" , 0x01CC7D }, + { "Asia/Macau" , 0x01CDB8 }, + { "Asia/Magadan" , 0x01CEF3 }, + { "Asia/Makassar" , 0x01D0D5 }, + { "Asia/Manila" , 0x01D19A }, + { "Asia/Muscat" , 0x01D21F }, + { "Asia/Nicosia" , 0x01D274 }, + { "Asia/Novokuznetsk" , 0x01D55C }, + { "Asia/Novosibirsk" , 0x01D75E }, + { "Asia/Omsk" , 0x01D949 }, + { "Asia/Oral" , 0x01DB30 }, + { "Asia/Phnom_Penh" , 0x01DD00 }, + { "Asia/Pontianak" , 0x01DD78 }, + { "Asia/Pyongyang" , 0x01DE3A }, + { "Asia/Qatar" , 0x01DEA7 }, + { "Asia/Qyzylorda" , 0x01DF0D }, + { "Asia/Rangoon" , 0x01E0E3 }, + { "Asia/Riyadh" , 0x01E15B }, + { "Asia/Saigon" , 0x01E1B0 }, + { "Asia/Sakhalin" , 0x01E228 }, + { "Asia/Samarkand" , 0x01E41F }, + { "Asia/Seoul" , 0x01E555 }, + { "Asia/Shanghai" , 0x01E5F9 }, + { "Asia/Singapore" , 0x01E6D9 }, + { "Asia/Taipei" , 0x01E790 }, + { "Asia/Tashkent" , 0x01E8A8 }, + { "Asia/Tbilisi" , 0x01E9D9 }, + { "Asia/Tehran" , 0x01EB93 }, + { "Asia/Tel_Aviv" , 0x01EE01 }, + { "Asia/Thimbu" , 0x01F130 }, + { "Asia/Thimphu" , 0x01F196 }, + { "Asia/Tokyo" , 0x01F1FC }, + { "Asia/Ujung_Pandang" , 0x01F285 }, + { "Asia/Ulaanbaatar" , 0x01F302 }, + { "Asia/Ulan_Bator" , 0x01F45D }, + { "Asia/Urumqi" , 0x01F5AA }, + { "Asia/Ust-Nera" , 0x01F671 }, + { "Asia/Vientiane" , 0x01F876 }, + { "Asia/Vladivostok" , 0x01F8EE }, + { "Asia/Yakutsk" , 0x01FADA }, + { "Asia/Yekaterinburg" , 0x01FCBF }, + { "Asia/Yerevan" , 0x01FECA }, + { "Atlantic/Azores" , 0x0200CA }, + { "Atlantic/Bermuda" , 0x0205CD }, + { "Atlantic/Canary" , 0x0208AE }, + { "Atlantic/Cape_Verde" , 0x020B84 }, + { "Atlantic/Faeroe" , 0x020BFD }, + { "Atlantic/Faroe" , 0x020EA1 }, + { "Atlantic/Jan_Mayen" , 0x021145 }, + { "Atlantic/Madeira" , 0x021477 }, + { "Atlantic/Reykjavik" , 0x021980 }, + { "Atlantic/South_Georgia" , 0x021B39 }, + { "Atlantic/St_Helena" , 0x021D4B }, + { "Atlantic/Stanley" , 0x021B7D }, + { "Australia/ACT" , 0x021DA0 }, + { "Australia/Adelaide" , 0x0220BD }, + { "Australia/Brisbane" , 0x0223E9 }, + { "Australia/Broken_Hill" , 0x0224B0 }, + { "Australia/Canberra" , 0x0227EE }, + { "Australia/Currie" , 0x022B0B }, + { "Australia/Darwin" , 0x022E3E }, + { "Australia/Eucla" , 0x022EC4 }, + { "Australia/Hobart" , 0x022F99 }, + { "Australia/LHI" , 0x0232F7 }, + { "Australia/Lindeman" , 0x023592 }, + { "Australia/Lord_Howe" , 0x023673 }, + { "Australia/Melbourne" , 0x02391E }, + { "Australia/North" , 0x023C43 }, + { "Australia/NSW" , 0x023CB7 }, + { "Australia/Perth" , 0x023FD4 }, + { "Australia/Queensland" , 0x0240AC }, + { "Australia/South" , 0x024158 }, + { "Australia/Sydney" , 0x024475 }, + { "Australia/Tasmania" , 0x0247B2 }, + { "Australia/Victoria" , 0x024AF7 }, + { "Australia/West" , 0x024E14 }, + { "Australia/Yancowinna" , 0x024ECA }, + { "Brazil/Acre" , 0x0251EC }, + { "Brazil/DeNoronha" , 0x0252EB }, + { "Brazil/East" , 0x02540B }, + { "Brazil/West" , 0x0256E8 }, + { "Canada/Atlantic" , 0x0257E0 }, + { "Canada/Central" , 0x025CC8 }, + { "Canada/East-Saskatchewan" , 0x0265D2 }, + { "Canada/Eastern" , 0x0260E2 }, + { "Canada/Mountain" , 0x02675B }, + { "Canada/Newfoundland" , 0x026AD1 }, + { "Canada/Pacific" , 0x026FFC }, + { "Canada/Saskatchewan" , 0x027415 }, + { "Canada/Yukon" , 0x02759E }, + { "CET" , 0x0278A1 }, + { "Chile/Continental" , 0x027BAA }, + { "Chile/EasterIsland" , 0x027F45 }, + { "CST6CDT" , 0x028287 }, + { "Cuba" , 0x0285D8 }, + { "EET" , 0x02894B }, + { "Egypt" , 0x028BFE }, + { "Eire" , 0x028EC1 }, + { "EST" , 0x0293D2 }, + { "EST5EDT" , 0x029416 }, + { "Etc/GMT" , 0x029767 }, + { "Etc/GMT+0" , 0x029833 }, + { "Etc/GMT+1" , 0x0298BD }, + { "Etc/GMT+10" , 0x02994A }, + { "Etc/GMT+11" , 0x0299D8 }, + { "Etc/GMT+12" , 0x029A66 }, + { "Etc/GMT+2" , 0x029B81 }, + { "Etc/GMT+3" , 0x029C0D }, + { "Etc/GMT+4" , 0x029C99 }, + { "Etc/GMT+5" , 0x029D25 }, + { "Etc/GMT+6" , 0x029DB1 }, + { "Etc/GMT+7" , 0x029E3D }, + { "Etc/GMT+8" , 0x029EC9 }, + { "Etc/GMT+9" , 0x029F55 }, + { "Etc/GMT-0" , 0x0297EF }, + { "Etc/GMT-1" , 0x029877 }, + { "Etc/GMT-10" , 0x029903 }, + { "Etc/GMT-11" , 0x029991 }, + { "Etc/GMT-12" , 0x029A1F }, + { "Etc/GMT-13" , 0x029AAD }, + { "Etc/GMT-14" , 0x029AF4 }, + { "Etc/GMT-2" , 0x029B3B }, + { "Etc/GMT-3" , 0x029BC7 }, + { "Etc/GMT-4" , 0x029C53 }, + { "Etc/GMT-5" , 0x029CDF }, + { "Etc/GMT-6" , 0x029D6B }, + { "Etc/GMT-7" , 0x029DF7 }, + { "Etc/GMT-8" , 0x029E83 }, + { "Etc/GMT-9" , 0x029F0F }, + { "Etc/GMT0" , 0x0297AB }, + { "Etc/Greenwich" , 0x029F9B }, + { "Etc/UCT" , 0x029FDF }, + { "Etc/Universal" , 0x02A023 }, + { "Etc/UTC" , 0x02A067 }, + { "Etc/Zulu" , 0x02A0AB }, + { "Europe/Amsterdam" , 0x02A0EF }, + { "Europe/Andorra" , 0x02A52D }, + { "Europe/Athens" , 0x02A7A9 }, + { "Europe/Belfast" , 0x02AAEC }, + { "Europe/Belgrade" , 0x02B023 }, + { "Europe/Berlin" , 0x02B2EC }, + { "Europe/Bratislava" , 0x02B650 }, + { "Europe/Brussels" , 0x02B982 }, + { "Europe/Bucharest" , 0x02BDB9 }, + { "Europe/Budapest" , 0x02C0E3 }, + { "Europe/Busingen" , 0x02C456 }, + { "Europe/Chisinau" , 0x02C70D }, + { "Europe/Copenhagen" , 0x02CA9B }, + { "Europe/Dublin" , 0x02CDA5 }, + { "Europe/Gibraltar" , 0x02D2B6 }, + { "Europe/Guernsey" , 0x02D70D }, + { "Europe/Helsinki" , 0x02DC44 }, + { "Europe/Isle_of_Man" , 0x02DEFA }, + { "Europe/Istanbul" , 0x02E431 }, + { "Europe/Jersey" , 0x02E81E }, + { "Europe/Kaliningrad" , 0x02ED55 }, + { "Europe/Kiev" , 0x02EFBB }, + { "Europe/Lisbon" , 0x02F2D2 }, + { "Europe/Ljubljana" , 0x02F7D6 }, + { "Europe/London" , 0x02FA9F }, + { "Europe/Luxembourg" , 0x02FFD6 }, + { "Europe/Madrid" , 0x03042C }, + { "Europe/Malta" , 0x0307F2 }, + { "Europe/Mariehamn" , 0x030BAB }, + { "Europe/Minsk" , 0x030E61 }, + { "Europe/Monaco" , 0x03106F }, + { "Europe/Moscow" , 0x0314AA }, + { "Europe/Nicosia" , 0x0316FB }, + { "Europe/Oslo" , 0x0319E3 }, + { "Europe/Paris" , 0x031D15 }, + { "Europe/Podgorica" , 0x03215B }, + { "Europe/Prague" , 0x032424 }, + { "Europe/Riga" , 0x032756 }, + { "Europe/Rome" , 0x032A9B }, + { "Europe/Samara" , 0x032E5E }, + { "Europe/San_Marino" , 0x033091 }, + { "Europe/Sarajevo" , 0x033454 }, + { "Europe/Simferopol" , 0x03371D }, + { "Europe/Skopje" , 0x033A48 }, + { "Europe/Sofia" , 0x033D11 }, + { "Europe/Stockholm" , 0x034019 }, + { "Europe/Tallinn" , 0x0342C8 }, + { "Europe/Tirane" , 0x034602 }, + { "Europe/Tiraspol" , 0x034908 }, + { "Europe/Uzhgorod" , 0x034C96 }, + { "Europe/Vaduz" , 0x034FAD }, + { "Europe/Vatican" , 0x03525C }, + { "Europe/Vienna" , 0x03561F }, + { "Europe/Vilnius" , 0x03594C }, + { "Europe/Volgograd" , 0x035C8B }, + { "Europe/Warsaw" , 0x035E8B }, + { "Europe/Zagreb" , 0x03626C }, + { "Europe/Zaporozhye" , 0x036535 }, + { "Europe/Zurich" , 0x036876 }, + { "Factory" , 0x036B25 }, + { "GB" , 0x036B96 }, + { "GB-Eire" , 0x0370CD }, + { "GMT" , 0x037604 }, + { "GMT+0" , 0x0376D0 }, + { "GMT-0" , 0x03768C }, + { "GMT0" , 0x037648 }, + { "Greenwich" , 0x037714 }, + { "Hongkong" , 0x037758 }, + { "HST" , 0x03791A }, + { "Iceland" , 0x03795E }, + { "Indian/Antananarivo" , 0x037B17 }, + { "Indian/Chagos" , 0x037B8B }, + { "Indian/Christmas" , 0x037BED }, + { "Indian/Cocos" , 0x037C31 }, + { "Indian/Comoro" , 0x037C75 }, + { "Indian/Kerguelen" , 0x037CCA }, + { "Indian/Mahe" , 0x037D1F }, + { "Indian/Maldives" , 0x037D74 }, + { "Indian/Mauritius" , 0x037DC9 }, + { "Indian/Mayotte" , 0x037E3F }, + { "Indian/Reunion" , 0x037E94 }, + { "Iran" , 0x037EE9 }, + { "Israel" , 0x038157 }, + { "Jamaica" , 0x038486 }, + { "Japan" , 0x03854B }, + { "Kwajalein" , 0x0385D4 }, + { "Libya" , 0x038637 }, + { "MET" , 0x038830 }, + { "Mexico/BajaNorte" , 0x038B39 }, + { "Mexico/BajaSur" , 0x038EA2 }, + { "Mexico/General" , 0x0390E7 }, + { "MST" , 0x039345 }, + { "MST7MDT" , 0x039389 }, + { "Navajo" , 0x0396DA }, + { "NZ" , 0x039A53 }, + { "NZ-CHAT" , 0x039DD1 }, + { "Pacific/Apia" , 0x03A0B9 }, + { "Pacific/Auckland" , 0x03A255 }, + { "Pacific/Chatham" , 0x03A5E1 }, + { "Pacific/Chuuk" , 0x03A8D8 }, + { "Pacific/Easter" , 0x03A931 }, + { "Pacific/Efate" , 0x03AC8F }, + { "Pacific/Enderbury" , 0x03AD55 }, + { "Pacific/Fakaofo" , 0x03ADC3 }, + { "Pacific/Fiji" , 0x03AE14 }, + { "Pacific/Funafuti" , 0x03AFA7 }, + { "Pacific/Galapagos" , 0x03AFEB }, + { "Pacific/Gambier" , 0x03B063 }, + { "Pacific/Guadalcanal" , 0x03B0C8 }, + { "Pacific/Guam" , 0x03B11D }, + { "Pacific/Honolulu" , 0x03B173 }, + { "Pacific/Johnston" , 0x03B1EA }, + { "Pacific/Kiritimati" , 0x03B269 }, + { "Pacific/Kosrae" , 0x03B2D4 }, + { "Pacific/Kwajalein" , 0x03B331 }, + { "Pacific/Majuro" , 0x03B39D }, + { "Pacific/Marquesas" , 0x03B3FC }, + { "Pacific/Midway" , 0x03B463 }, + { "Pacific/Nauru" , 0x03B4ED }, + { "Pacific/Niue" , 0x03B565 }, + { "Pacific/Norfolk" , 0x03B5C3 }, + { "Pacific/Noumea" , 0x03B618 }, + { "Pacific/Pago_Pago" , 0x03B6A8 }, + { "Pacific/Palau" , 0x03B731 }, + { "Pacific/Pitcairn" , 0x03B775 }, + { "Pacific/Pohnpei" , 0x03B7CA }, + { "Pacific/Ponape" , 0x03B81F }, + { "Pacific/Port_Moresby" , 0x03B864 }, + { "Pacific/Rarotonga" , 0x03B8A8 }, + { "Pacific/Saipan" , 0x03B984 }, + { "Pacific/Samoa" , 0x03B9E7 }, + { "Pacific/Tahiti" , 0x03BA70 }, + { "Pacific/Tarawa" , 0x03BAD5 }, + { "Pacific/Tongatapu" , 0x03BB29 }, + { "Pacific/Truk" , 0x03BBB5 }, + { "Pacific/Wake" , 0x03BBFA }, + { "Pacific/Wallis" , 0x03BC4A }, + { "Pacific/Yap" , 0x03BC8E }, + { "Poland" , 0x03BCD3 }, + { "Portugal" , 0x03C0B4 }, + { "PRC" , 0x03C5B0 }, + { "PST8PDT" , 0x03C661 }, + { "ROC" , 0x03C9B2 }, + { "ROK" , 0x03CACA }, + { "Singapore" , 0x03CB6E }, + { "Turkey" , 0x03CC25 }, + { "UCT" , 0x03D012 }, + { "Universal" , 0x03D056 }, + { "US/Alaska" , 0x03D09A }, + { "US/Aleutian" , 0x03D403 }, + { "US/Arizona" , 0x03D769 }, + { "US/Central" , 0x03D7F7 }, + { "US/East-Indiana" , 0x03E201 }, + { "US/Eastern" , 0x03DD02 }, + { "US/Hawaii" , 0x03E46B }, + { "US/Indiana-Starke" , 0x03E4DC }, + { "US/Michigan" , 0x03E84D }, + { "US/Mountain" , 0x03EB84 }, + { "US/Pacific" , 0x03EEFD }, + { "US/Pacific-New" , 0x03F302 }, + { "US/Samoa" , 0x03F707 }, + { "UTC" , 0x03F790 }, + { "W-SU" , 0x03FA87 }, + { "WET" , 0x03F7D4 }, + { "Zulu" , 0x03FCC1 }, }; /* This is a generated file, do not modify */ -const unsigned char timelib_timezone_db_data_builtin[261525] = { +const unsigned char timelib_timezone_db_data_builtin[261381] = { /* Africa/Abidjan */ @@ -945,7 +945,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* Africa/Juba */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xB6, 0xA3, 0xDA, 0xE0, +0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xB6, 0xA3, 0xDA, 0x00, 0x00, 0x9E, 0x17, 0xE0, 0x01, 0x7A, 0x34, 0x50, 0x02, 0x7D, 0xF9, 0xE0, 0x03, 0x5B, 0x67, 0xD0, 0x04, 0x60, 0x7E, 0xE0, 0x05, 0x3D, 0xEC, 0xD0, 0x06, 0x40, 0x60, 0xE0, 0x07, 0x1F, 0x20, 0x50, 0x08, 0x20, 0x42, 0xE0, 0x09, 0x00, 0x53, 0xD0, 0x0A, 0x00, 0x24, 0xE0, 0x0A, 0xE1, 0x87, 0x50, @@ -956,7 +956,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x1A, 0xF1, 0x8B, 0xE0, 0x1B, 0xD0, 0x4B, 0x50, 0x1C, 0xD1, 0x6D, 0xE0, 0x1D, 0xB1, 0x7E, 0xD0, 0x38, 0x80, 0x45, 0x20, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x00, 0x00, 0x1D, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, +0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x00, 0x00, 0x1E, 0x80, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x41, 0x53, 0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0xBA, 0xC8, 0x01, 0x42, 0xE0, 0x40, 0x00, @@ -1390,8 +1390,8 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/Anguilla */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x35, 0x20, -0x01, 0xFF, 0xFF, 0xC4, 0xE0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA5, 0x19, 0xA0, 0x00, 0xB2, 0x6D, 0x15, 0x00, 0x00, 0x00, 0x00, @@ -1407,7 +1407,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/Araguaina */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x74, 0x30, +0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x74, 0x30, 0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20, 0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20, 0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20, @@ -1420,29 +1420,14 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x34, 0x38, 0x54, 0x30, 0x34, 0xF8, 0xC1, 0x20, 0x36, 0x20, 0x1F, 0x30, 0x36, 0xCF, 0x68, 0xA0, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20, 0x39, 0xDF, 0xE3, 0x30, 0x3A, 0x8F, 0x2C, 0xA0, 0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0, 0x3D, 0xC4, 0x91, 0x30, 0x3E, 0x4E, 0xF0, 0xA0, -0x50, 0x83, 0x65, 0x30, 0x51, 0x20, 0x39, 0xA0, 0x52, 0x63, 0x47, 0x30, 0x53, 0x00, 0x1B, 0xA0, -0x54, 0x43, 0x29, 0x30, 0x54, 0xE9, 0x38, 0x20, 0x56, 0x23, 0x0B, 0x30, 0x56, 0xC9, 0x1A, 0x20, -0x58, 0x02, 0xED, 0x30, 0x58, 0xA8, 0xFC, 0x20, 0x59, 0xE2, 0xCF, 0x30, 0x5A, 0x88, 0xDE, 0x20, -0x5B, 0xCB, 0xEB, 0xB0, 0x5C, 0x68, 0xC0, 0x20, 0x5D, 0xAB, 0xCD, 0xB0, 0x5E, 0x48, 0xA2, 0x20, -0x5F, 0x8B, 0xAF, 0xB0, 0x60, 0x31, 0xBE, 0xA0, 0x61, 0x6B, 0x91, 0xB0, 0x62, 0x11, 0xA0, 0xA0, -0x63, 0x4B, 0x73, 0xB0, 0x63, 0xFA, 0xBD, 0x20, 0x65, 0x2B, 0x55, 0xB0, 0x65, 0xD1, 0x64, 0xA0, -0x67, 0x14, 0x72, 0x30, 0x67, 0xB1, 0x46, 0xA0, 0x68, 0xF4, 0x54, 0x30, 0x69, 0x9A, 0x63, 0x20, -0x6A, 0xD4, 0x36, 0x30, 0x6B, 0x7A, 0x45, 0x20, 0x6C, 0xB4, 0x18, 0x30, 0x6D, 0x5A, 0x27, 0x20, -0x6E, 0x93, 0xFA, 0x30, 0x6F, 0x3A, 0x09, 0x20, 0x70, 0x7D, 0x16, 0xB0, 0x71, 0x19, 0xEB, 0x20, -0x72, 0x5C, 0xF8, 0xB0, 0x72, 0xF9, 0xCD, 0x20, 0x74, 0x3C, 0xDA, 0xB0, 0x74, 0xD9, 0xAF, 0x20, -0x76, 0x1C, 0xBC, 0xB0, 0x76, 0xC2, 0xCB, 0xA0, 0x77, 0xFC, 0x9E, 0xB0, 0x78, 0xAB, 0xE8, 0x20, -0x79, 0xDC, 0x80, 0xB0, 0x7A, 0x82, 0x8F, 0xA0, 0x7B, 0xC5, 0x9D, 0x30, 0x7C, 0x62, 0x71, 0xA0, -0x7D, 0xA5, 0x7F, 0x30, 0x7E, 0x4B, 0x8E, 0x20, 0x7F, 0x85, 0x61, 0x30, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x50, 0x83, 0x65, 0x30, 0x51, 0x20, 0x39, 0xA0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0xFF, 0xFF, 0xD2, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, -0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x57, 0xC0, 0x00, 0xC9, 0x1C, 0x60, 0x00, 0x00, 0x00, -0x09, 0x54, 0x6F, 0x63, 0x61, 0x6E, 0x74, 0x69, 0x6E, 0x73, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xD2, 0xD0, 0x00, +0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x09, 0x4C, 0x4D, 0x54, +0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x7E, 0x57, 0xC0, 0x00, 0xC9, 0x1C, 0x60, 0x00, 0x00, 0x00, 0x09, 0x54, 0x6F, 0x63, 0x61, +0x6E, 0x74, 0x69, 0x6E, 0x73, /* America/Argentina/Buenos_Aires */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1767,7 +1752,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, -0x06, 0x05, 0x04, 0x06, 0x04, 0x05, 0x04, 0x03, 0x06, 0x05, 0x06, 0x05, 0x06, 0xFF, 0xFF, 0xC3, +0x06, 0x05, 0x04, 0x06, 0x04, 0x05, 0x04, 0x03, 0x06, 0x05, 0x06, 0x05, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x12, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, @@ -1839,8 +1824,8 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/Aruba */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x1E, 0x2F, 0x38, -0xF6, 0x98, 0xEC, 0x48, 0x01, 0x02, 0xFF, 0xFF, 0xBE, 0x48, 0x00, 0x00, 0xFF, 0xFF, 0xC0, 0xB8, +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x1E, 0x2E, 0x23, +0xF6, 0x98, 0xEC, 0x48, 0x01, 0x02, 0xFF, 0xFF, 0xBF, 0x5D, 0x00, 0x00, 0xFF, 0xFF, 0xC0, 0xB8, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4E, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9C, 0x67, 0x10, 0x00, 0xA7, 0xE5, 0xC5, 0x00, 0x00, 0x00, 0x00, @@ -2414,8 +2399,8 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/Cayman */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x0F, 0xB5, 0x00, -0x01, 0xFF, 0xFF, 0xB8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0x4B, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x0F, 0xB4, 0xFF, +0x01, 0xFF, 0xFF, 0xB8, 0x01, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA6, 0xC7, 0x50, 0x00, 0x96, 0x7A, 0x22, 0x00, 0x00, 0x00, 0x00, @@ -2889,8 +2874,8 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/Dominica */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x44, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x34, 0x4C, -0x01, 0xFF, 0xFF, 0xC6, 0x70, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xAC, 0xD0, 0x00, 0xB4, 0xF8, 0x20, 0x00, 0x00, 0x00, 0x00, @@ -3292,7 +3277,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/Grand_Turk */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB5, 0x00, +0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB4, 0xFF, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, @@ -3330,23 +3315,23 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, -0xFF, 0xB8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, +0xFF, 0xB8, 0x01, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x08, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAA, 0x15, 0xAA, 0x00, 0xA6, 0x1E, 0x0A, 0x00, 0x00, 0x00, 0x00, /* America/Grenada */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x34, 0x64, -0x01, 0xFF, 0xFF, 0xC6, 0x1C, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9B, 0xB7, 0x48, 0x00, 0xB4, 0x6F, 0x68, 0x00, 0x00, 0x00, 0x00, /* America/Guadeloupe */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xD5, 0xE1, 0xB0, -0x01, 0xFF, 0xFF, 0xC6, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA2, 0x19, 0x65, 0x00, 0xB4, 0xC4, 0x0A, 0x00, 0x00, 0x00, 0x00, @@ -4057,17 +4042,17 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/Jamaica */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4A, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB5, 0x00, +0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB4, 0xFF, 0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xB8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, +0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xB8, 0x01, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, -0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA4, 0xCB, 0x80, 0x00, 0x9D, 0x78, -0x80, 0x00, 0x00, 0x00, 0x00, +0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA4, 0xBF, 0x05, 0x00, 0x9D, 0x7B, +0x1A, 0x00, 0x00, 0x00, 0x00, /* America/Jujuy */ 0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -4573,8 +4558,8 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/Marigot */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xD5, 0xE1, 0xB0, -0x01, 0xFF, 0xFF, 0xC6, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA4, 0xE5, 0x8A, 0x00, 0xB2, 0x66, 0x92, 0x00, 0x00, 0x00, 0x00, @@ -5071,7 +5056,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x00, 0x00, /* America/Montreal */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9C, 0xBD, 0x01, 0xF0, 0x9C, 0xE4, 0x64, 0xC0, 0x9E, 0xB8, 0x93, 0x70, 0x9F, 0xBA, 0xEB, 0x60, 0xA0, 0x87, 0x58, 0xF8, @@ -5149,16 +5134,14 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, 0x00, 0x01, 0x00, 0xCE, 0xC8, 0x32, 0x00, 0xA2, 0x67, 0x85, 0x00, 0x00, 0x00, 0x26, -0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x51, -0x75, 0x65, 0x62, 0x65, 0x63, 0x20, 0x2D, 0x20, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, -0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, +0x00, 0x00, 0x00, 0x01, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, + /* America/Montserrat */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x35, 0x10, -0x01, 0xFF, 0xFF, 0xC5, 0xAC, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA2, 0xD6, 0x32, 0x00, 0xB3, 0xB9, 0x1D, 0x00, 0x00, 0x00, 0x00, @@ -5741,9 +5724,10 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0xFB, 0xE8, 0x58, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xBC, 0x5E, 0x01, 0x00, 0x67, 0xA5, 0xDA, 0x00, 0x00, 0x00, 0x20, 0x4D, 0x6F, +0x00, 0x00, 0x00, 0xBC, 0x5E, 0x01, 0x00, 0x67, 0xA5, 0xDA, 0x00, 0x00, 0x00, 0x30, 0x4D, 0x6F, 0x75, 0x6E, 0x74, 0x61, 0x69, 0x6E, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, -0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x41, 0x72, 0x69, 0x7A, 0x6F, 0x6E, 0x61, +0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x41, 0x72, 0x69, 0x7A, 0x6F, 0x6E, 0x61, 0x20, 0x28, +0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x20, 0x4E, 0x61, 0x76, 0x61, 0x6A, 0x6F, 0x29, /* America/Port-au-Prince */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x48, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -6344,7 +6328,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x74, 0x6F, 0x71, 0x71, 0x6F, 0x72, 0x74, 0x6F, 0x6F, 0x72, 0x6D, 0x69, 0x69, 0x74, /* America/Shiprock */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x3A, 0x90, 0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xA2, 0x65, 0xFE, 0x90, @@ -6398,9 +6382,8 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, -0x00, 0x4D, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0xC1, 0x75, -0x9B, 0x00, 0x6C, 0xD0, 0xE1, 0x00, 0x00, 0x00, 0x16, 0x4D, 0x6F, 0x75, 0x6E, 0x74, 0x61, 0x69, -0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x4E, 0x61, 0x76, 0x61, 0x6A, 0x6F, +0x00, 0x4D, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x89, 0x54, +0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, /* America/Sitka */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -6464,8 +6447,8 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/St_Barthelemy */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xD5, 0xE1, 0xB0, -0x01, 0xFF, 0xFF, 0xC6, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA4, 0x9D, 0xED, 0x00, 0xB2, 0xC1, 0xB8, 0x00, 0x00, 0x00, 0x00, @@ -6560,32 +6543,32 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/St_Kitts */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x34, 0xCC, -0x01, 0xFF, 0xFF, 0xC5, 0x34, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA3, 0xBA, 0x10, 0x00, 0xB2, 0xF5, 0xCD, 0x00, 0x00, 0x00, 0x00, /* America/St_Lucia */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0xC7, 0xB0, -0x01, 0xFF, 0xFF, 0xC6, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x43, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9E, 0xB7, 0x82, 0x00, 0xB5, 0x94, 0x60, 0x00, 0x00, 0x00, 0x00, /* America/St_Thomas */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x56, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x37, 0x60, -0x01, 0xFF, 0xFF, 0xC3, 0x20, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA5, 0x54, 0x38, 0x00, 0xAF, 0x93, 0xEA, 0x00, 0x00, 0x00, 0x00, /* America/St_Vincent */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x56, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0xC7, 0xE8, -0x01, 0xFF, 0xFF, 0xC6, 0x98, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4B, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9D, 0x64, 0xF8, 0x00, 0xB5, 0x39, 0x3A, 0x00, 0x00, 0x00, 0x00, @@ -6853,16 +6836,17 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, 0x00, 0x01, 0x00, 0xCB, 0xEF, 0x08, 0x00, 0x99, 0x87, 0x62, 0x00, 0x00, 0x00, 0x27, +0x00, 0x00, 0x00, 0x01, 0x00, 0xCB, 0xEF, 0x08, 0x00, 0x99, 0x87, 0x62, 0x00, 0x00, 0x00, 0x30, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x4F, -0x6E, 0x74, 0x61, 0x72, 0x69, 0x6F, 0x20, 0x2D, 0x20, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, -0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, +0x6E, 0x74, 0x61, 0x72, 0x69, 0x6F, 0x20, 0x26, 0x20, 0x51, 0x75, 0x65, 0x62, 0x65, 0x63, 0x20, +0x2D, 0x20, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, + /* America/Tortola */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x56, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x37, 0x14, -0x01, 0xFF, 0xFF, 0xC3, 0x6C, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA5, 0x7B, 0x48, 0x00, 0xB0, 0x0F, 0x9D, 0x00, 0x00, 0x00, 0x00, @@ -6939,8 +6923,8 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* America/Virgin */ 0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x37, 0x60, -0x01, 0xFF, 0xFF, 0xC3, 0x20, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, +0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, @@ -7264,54 +7248,64 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* Antarctica/McMurdo */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0E, 0xE5, 0xA9, 0xE9, 0x00, -0x09, 0x18, 0xFD, 0xE0, 0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, -0x0C, 0xD8, 0xC1, 0xE0, 0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, -0x10, 0x98, 0x85, 0xE0, 0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, -0x14, 0x58, 0x49, 0xE0, 0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, -0x18, 0x21, 0x48, 0x60, 0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, -0x1B, 0xE1, 0x0C, 0x60, 0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, -0x1F, 0xA0, 0xD0, 0x60, 0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, -0x23, 0x69, 0xCE, 0xE0, 0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, -0x27, 0x0D, 0xE3, 0x60, 0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, -0x2A, 0xCD, 0xA7, 0x60, 0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, -0x2E, 0x8D, 0x6B, 0x60, 0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, -0x32, 0x56, 0x69, 0xE0, 0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, -0x36, 0x16, 0x2D, 0xE0, 0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, -0x39, 0xD5, 0xF1, 0xE0, 0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, -0x3D, 0x9E, 0xF0, 0x60, 0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, -0x41, 0x5E, 0xB4, 0x60, 0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, -0x45, 0x1E, 0x78, 0x60, 0x45, 0xFB, 0xF4, 0x60, 0x46, 0xFE, 0x5A, 0x60, 0x47, 0xF7, 0x85, 0xE0, -0x48, 0xDE, 0x3C, 0x60, 0x49, 0xD7, 0x67, 0xE0, 0x4A, 0xBE, 0x1E, 0x60, 0x4B, 0xB7, 0x49, 0xE0, -0x4C, 0x9E, 0x00, 0x60, 0x4D, 0x97, 0x2B, 0xE0, 0x4E, 0x7D, 0xE2, 0x60, 0x4F, 0x77, 0x0D, 0xE0, -0x50, 0x66, 0xFE, 0xE0, 0x51, 0x60, 0x2A, 0x60, 0x52, 0x46, 0xE0, 0xE0, 0x53, 0x40, 0x0C, 0x60, -0x54, 0x26, 0xC2, 0xE0, 0x55, 0x1F, 0xEE, 0x60, 0x56, 0x06, 0xA4, 0xE0, 0x56, 0xFF, 0xD0, 0x60, -0x57, 0xE6, 0x86, 0xE0, 0x58, 0xDF, 0xB2, 0x60, 0x59, 0xC6, 0x68, 0xE0, 0x5A, 0xBF, 0x94, 0x60, -0x5B, 0xAF, 0x85, 0x60, 0x5C, 0xA8, 0xB0, 0xE0, 0x5D, 0x8F, 0x67, 0x60, 0x5E, 0x88, 0x92, 0xE0, -0x5F, 0x6F, 0x49, 0x60, 0x60, 0x68, 0x74, 0xE0, 0x61, 0x4F, 0x2B, 0x60, 0x62, 0x48, 0x56, 0xE0, -0x63, 0x2F, 0x0D, 0x60, 0x64, 0x28, 0x38, 0xE0, 0x65, 0x0E, 0xEF, 0x60, 0x66, 0x11, 0x55, 0x60, -0x66, 0xF8, 0x0B, 0xE0, 0x67, 0xF1, 0x37, 0x60, 0x68, 0xD7, 0xED, 0xE0, 0x69, 0xD1, 0x19, 0x60, -0x6A, 0xB7, 0xCF, 0xE0, 0x6B, 0xB0, 0xFB, 0x60, 0x6C, 0x97, 0xB1, 0xE0, 0x6D, 0x90, 0xDD, 0x60, -0x6E, 0x77, 0x93, 0xE0, 0x6F, 0x70, 0xBF, 0x60, 0x70, 0x60, 0xB0, 0x60, 0x71, 0x59, 0xDB, 0xE0, -0x72, 0x40, 0x92, 0x60, 0x73, 0x39, 0xBD, 0xE0, 0x74, 0x20, 0x74, 0x60, 0x75, 0x19, 0x9F, 0xE0, -0x76, 0x00, 0x56, 0x60, 0x76, 0xF9, 0x81, 0xE0, 0x77, 0xE0, 0x38, 0x60, 0x78, 0xD9, 0x63, 0xE0, -0x79, 0xC0, 0x1A, 0x60, 0x7A, 0xB9, 0x45, 0xE0, 0x7B, 0xA9, 0x36, 0xE0, 0x7C, 0xA2, 0x62, 0x60, -0x7D, 0x89, 0x18, 0xE0, 0x7E, 0x82, 0x44, 0x60, 0x7F, 0x68, 0xFA, 0xE0, 0x03, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x9B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F, 0xB0, 0xB4, 0xB2, 0xE8, +0xB1, 0x51, 0x87, 0x58, 0xB2, 0x78, 0xE5, 0x68, 0xB3, 0x43, 0xE5, 0x60, 0xB4, 0x58, 0xC7, 0x68, +0xB5, 0x23, 0xC7, 0x60, 0xB6, 0x38, 0xA9, 0x68, 0xB7, 0x03, 0xA9, 0x60, 0xB8, 0x18, 0x8B, 0x68, +0xB8, 0xEC, 0xC5, 0xE0, 0xB9, 0xF8, 0x6D, 0x68, 0xBA, 0xCC, 0xA7, 0xE0, 0xBB, 0xD8, 0x4F, 0x68, +0xBC, 0xE3, 0xE8, 0xE0, 0xBD, 0xAE, 0xF6, 0xE8, 0xBE, 0xC3, 0xCA, 0xE0, 0xBF, 0x8E, 0xD8, 0xE8, +0xC0, 0xA3, 0xAC, 0xE0, 0xC1, 0x6E, 0xBA, 0xE8, 0xC2, 0x83, 0x8E, 0xE0, 0xC3, 0x4E, 0x9C, 0xE8, +0xC4, 0x63, 0x70, 0xE0, 0xC5, 0x2E, 0x7E, 0xE8, 0xC6, 0x4C, 0x8D, 0x60, 0xC7, 0x0E, 0x60, 0xE8, +0xC8, 0x2C, 0x6F, 0x60, 0xC8, 0xF7, 0x7D, 0x68, 0xD2, 0xDA, 0x9A, 0x40, 0x09, 0x18, 0xFD, 0xE0, +0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, 0x0C, 0xD8, 0xC1, 0xE0, +0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, 0x10, 0x98, 0x85, 0xE0, +0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, 0x14, 0x58, 0x49, 0xE0, +0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, 0x18, 0x21, 0x48, 0x60, +0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, 0x1B, 0xE1, 0x0C, 0x60, +0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, 0x1F, 0xA0, 0xD0, 0x60, +0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, 0x23, 0x69, 0xCE, 0xE0, +0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, 0x27, 0x0D, 0xE3, 0x60, +0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, 0x2A, 0xCD, 0xA7, 0x60, +0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, 0x2E, 0x8D, 0x6B, 0x60, +0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, 0x32, 0x56, 0x69, 0xE0, +0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, 0x36, 0x16, 0x2D, 0xE0, +0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, 0x39, 0xD5, 0xF1, 0xE0, +0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, 0x3D, 0x9E, 0xF0, 0x60, +0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, 0x41, 0x5E, 0xB4, 0x60, +0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, 0x45, 0x1E, 0x78, 0x60, +0x45, 0xFB, 0xF4, 0x60, 0x46, 0xFE, 0x5A, 0x60, 0x47, 0xF7, 0x85, 0xE0, 0x48, 0xDE, 0x3C, 0x60, +0x49, 0xD7, 0x67, 0xE0, 0x4A, 0xBE, 0x1E, 0x60, 0x4B, 0xB7, 0x49, 0xE0, 0x4C, 0x9E, 0x00, 0x60, +0x4D, 0x97, 0x2B, 0xE0, 0x4E, 0x7D, 0xE2, 0x60, 0x4F, 0x77, 0x0D, 0xE0, 0x50, 0x66, 0xFE, 0xE0, +0x51, 0x60, 0x2A, 0x60, 0x52, 0x46, 0xE0, 0xE0, 0x53, 0x40, 0x0C, 0x60, 0x54, 0x26, 0xC2, 0xE0, +0x55, 0x1F, 0xEE, 0x60, 0x56, 0x06, 0xA4, 0xE0, 0x56, 0xFF, 0xD0, 0x60, 0x57, 0xE6, 0x86, 0xE0, +0x58, 0xDF, 0xB2, 0x60, 0x59, 0xC6, 0x68, 0xE0, 0x5A, 0xBF, 0x94, 0x60, 0x5B, 0xAF, 0x85, 0x60, +0x5C, 0xA8, 0xB0, 0xE0, 0x5D, 0x8F, 0x67, 0x60, 0x5E, 0x88, 0x92, 0xE0, 0x5F, 0x6F, 0x49, 0x60, +0x60, 0x68, 0x74, 0xE0, 0x61, 0x4F, 0x2B, 0x60, 0x62, 0x48, 0x56, 0xE0, 0x63, 0x2F, 0x0D, 0x60, +0x64, 0x28, 0x38, 0xE0, 0x65, 0x0E, 0xEF, 0x60, 0x66, 0x11, 0x55, 0x60, 0x66, 0xF8, 0x0B, 0xE0, +0x67, 0xF1, 0x37, 0x60, 0x68, 0xD7, 0xED, 0xE0, 0x69, 0xD1, 0x19, 0x60, 0x6A, 0xB7, 0xCF, 0xE0, +0x6B, 0xB0, 0xFB, 0x60, 0x6C, 0x97, 0xB1, 0xE0, 0x6D, 0x90, 0xDD, 0x60, 0x6E, 0x77, 0x93, 0xE0, +0x6F, 0x70, 0xBF, 0x60, 0x70, 0x60, 0xB0, 0x60, 0x71, 0x59, 0xDB, 0xE0, 0x72, 0x40, 0x92, 0x60, +0x73, 0x39, 0xBD, 0xE0, 0x74, 0x20, 0x74, 0x60, 0x75, 0x19, 0x9F, 0xE0, 0x76, 0x00, 0x56, 0x60, +0x76, 0xF9, 0x81, 0xE0, 0x77, 0xE0, 0x38, 0x60, 0x78, 0xD9, 0x63, 0xE0, 0x79, 0xC0, 0x1A, 0x60, +0x7A, 0xB9, 0x45, 0xE0, 0x7B, 0xA9, 0x36, 0xE0, 0x7C, 0xA2, 0x62, 0x60, 0x7D, 0x89, 0x18, 0xE0, +0x7E, 0x82, 0x44, 0x60, 0x7F, 0x68, 0xFA, 0xE0, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x04, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x09, 0x00, 0x00, -0xA8, 0xC0, 0x00, 0x09, 0x7A, 0x7A, 0x7A, 0x00, 0x4E, 0x5A, 0x44, 0x54, 0x00, 0x4E, 0x5A, 0x53, -0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x90, 0x9A, 0x02, 0x10, -0xDE, 0xA0, 0x00, 0x00, 0x00, 0x1C, 0x4D, 0x63, 0x4D, 0x75, 0x72, 0x64, 0x6F, 0x20, 0x53, 0x74, -0x61, 0x74, 0x69, 0x6F, 0x6E, 0x2C, 0x20, 0x52, 0x6F, 0x73, 0x73, 0x20, 0x49, 0x73, 0x6C, 0x61, -0x6E, 0x64, +0x02, 0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x00, 0x00, 0xAF, 0xC8, 0x01, 0x00, 0x00, 0x00, 0xA1, 0xB8, 0x00, 0x05, 0x00, +0x00, 0xA8, 0xC0, 0x01, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x0A, 0x00, 0x00, 0xA8, 0xC0, 0x00, +0x00, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x00, 0x4E, 0x5A, 0x53, 0x54, 0x00, 0x4E, 0x5A, 0x4D, 0x54, +0x00, 0x4E, 0x5A, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x12, 0x90, 0x9A, 0x02, 0x10, 0xDE, 0xA0, 0x00, 0x00, 0x00, 0x2D, 0x4D, 0x63, +0x4D, 0x75, 0x72, 0x64, 0x6F, 0x2C, 0x20, 0x53, 0x6F, 0x75, 0x74, 0x68, 0x20, 0x50, 0x6F, 0x6C, +0x65, 0x2C, 0x20, 0x53, 0x63, 0x6F, 0x74, 0x74, 0x20, 0x28, 0x4E, 0x65, 0x77, 0x20, 0x5A, 0x65, +0x61, 0x6C, 0x61, 0x6E, 0x64, 0x20, 0x74, 0x69, 0x6D, 0x65, 0x29, /* Antarctica/Palmer */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -7376,55 +7370,62 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x49, 0x73, 0x6C, 0x61, 0x6E, 0x64, /* Antarctica/South_Pole */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0E, 0xE5, 0xA9, 0xE9, 0x00, -0x09, 0x18, 0xFD, 0xE0, 0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, -0x0C, 0xD8, 0xC1, 0xE0, 0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, -0x10, 0x98, 0x85, 0xE0, 0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, -0x14, 0x58, 0x49, 0xE0, 0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, -0x18, 0x21, 0x48, 0x60, 0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, -0x1B, 0xE1, 0x0C, 0x60, 0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, -0x1F, 0xA0, 0xD0, 0x60, 0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, -0x23, 0x69, 0xCE, 0xE0, 0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, -0x27, 0x0D, 0xE3, 0x60, 0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, -0x2A, 0xCD, 0xA7, 0x60, 0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, -0x2E, 0x8D, 0x6B, 0x60, 0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, -0x32, 0x56, 0x69, 0xE0, 0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, -0x36, 0x16, 0x2D, 0xE0, 0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, -0x39, 0xD5, 0xF1, 0xE0, 0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, -0x3D, 0x9E, 0xF0, 0x60, 0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, -0x41, 0x5E, 0xB4, 0x60, 0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, -0x45, 0x1E, 0x78, 0x60, 0x45, 0xFB, 0xF4, 0x60, 0x46, 0xFE, 0x5A, 0x60, 0x47, 0xF7, 0x85, 0xE0, -0x48, 0xDE, 0x3C, 0x60, 0x49, 0xD7, 0x67, 0xE0, 0x4A, 0xBE, 0x1E, 0x60, 0x4B, 0xB7, 0x49, 0xE0, -0x4C, 0x9E, 0x00, 0x60, 0x4D, 0x97, 0x2B, 0xE0, 0x4E, 0x7D, 0xE2, 0x60, 0x4F, 0x77, 0x0D, 0xE0, -0x50, 0x66, 0xFE, 0xE0, 0x51, 0x60, 0x2A, 0x60, 0x52, 0x46, 0xE0, 0xE0, 0x53, 0x40, 0x0C, 0x60, -0x54, 0x26, 0xC2, 0xE0, 0x55, 0x1F, 0xEE, 0x60, 0x56, 0x06, 0xA4, 0xE0, 0x56, 0xFF, 0xD0, 0x60, -0x57, 0xE6, 0x86, 0xE0, 0x58, 0xDF, 0xB2, 0x60, 0x59, 0xC6, 0x68, 0xE0, 0x5A, 0xBF, 0x94, 0x60, -0x5B, 0xAF, 0x85, 0x60, 0x5C, 0xA8, 0xB0, 0xE0, 0x5D, 0x8F, 0x67, 0x60, 0x5E, 0x88, 0x92, 0xE0, -0x5F, 0x6F, 0x49, 0x60, 0x60, 0x68, 0x74, 0xE0, 0x61, 0x4F, 0x2B, 0x60, 0x62, 0x48, 0x56, 0xE0, -0x63, 0x2F, 0x0D, 0x60, 0x64, 0x28, 0x38, 0xE0, 0x65, 0x0E, 0xEF, 0x60, 0x66, 0x11, 0x55, 0x60, -0x66, 0xF8, 0x0B, 0xE0, 0x67, 0xF1, 0x37, 0x60, 0x68, 0xD7, 0xED, 0xE0, 0x69, 0xD1, 0x19, 0x60, -0x6A, 0xB7, 0xCF, 0xE0, 0x6B, 0xB0, 0xFB, 0x60, 0x6C, 0x97, 0xB1, 0xE0, 0x6D, 0x90, 0xDD, 0x60, -0x6E, 0x77, 0x93, 0xE0, 0x6F, 0x70, 0xBF, 0x60, 0x70, 0x60, 0xB0, 0x60, 0x71, 0x59, 0xDB, 0xE0, -0x72, 0x40, 0x92, 0x60, 0x73, 0x39, 0xBD, 0xE0, 0x74, 0x20, 0x74, 0x60, 0x75, 0x19, 0x9F, 0xE0, -0x76, 0x00, 0x56, 0x60, 0x76, 0xF9, 0x81, 0xE0, 0x77, 0xE0, 0x38, 0x60, 0x78, 0xD9, 0x63, 0xE0, -0x79, 0xC0, 0x1A, 0x60, 0x7A, 0xB9, 0x45, 0xE0, 0x7B, 0xA9, 0x36, 0xE0, 0x7C, 0xA2, 0x62, 0x60, -0x7D, 0x89, 0x18, 0xE0, 0x7E, 0x82, 0x44, 0x60, 0x7F, 0x68, 0xFA, 0xE0, 0x03, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x9B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F, 0xB0, 0xB4, 0xB2, 0xE8, +0xB1, 0x51, 0x87, 0x58, 0xB2, 0x78, 0xE5, 0x68, 0xB3, 0x43, 0xE5, 0x60, 0xB4, 0x58, 0xC7, 0x68, +0xB5, 0x23, 0xC7, 0x60, 0xB6, 0x38, 0xA9, 0x68, 0xB7, 0x03, 0xA9, 0x60, 0xB8, 0x18, 0x8B, 0x68, +0xB8, 0xEC, 0xC5, 0xE0, 0xB9, 0xF8, 0x6D, 0x68, 0xBA, 0xCC, 0xA7, 0xE0, 0xBB, 0xD8, 0x4F, 0x68, +0xBC, 0xE3, 0xE8, 0xE0, 0xBD, 0xAE, 0xF6, 0xE8, 0xBE, 0xC3, 0xCA, 0xE0, 0xBF, 0x8E, 0xD8, 0xE8, +0xC0, 0xA3, 0xAC, 0xE0, 0xC1, 0x6E, 0xBA, 0xE8, 0xC2, 0x83, 0x8E, 0xE0, 0xC3, 0x4E, 0x9C, 0xE8, +0xC4, 0x63, 0x70, 0xE0, 0xC5, 0x2E, 0x7E, 0xE8, 0xC6, 0x4C, 0x8D, 0x60, 0xC7, 0x0E, 0x60, 0xE8, +0xC8, 0x2C, 0x6F, 0x60, 0xC8, 0xF7, 0x7D, 0x68, 0xD2, 0xDA, 0x9A, 0x40, 0x09, 0x18, 0xFD, 0xE0, +0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, 0x0C, 0xD8, 0xC1, 0xE0, +0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, 0x10, 0x98, 0x85, 0xE0, +0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, 0x14, 0x58, 0x49, 0xE0, +0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, 0x18, 0x21, 0x48, 0x60, +0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, 0x1B, 0xE1, 0x0C, 0x60, +0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, 0x1F, 0xA0, 0xD0, 0x60, +0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, 0x23, 0x69, 0xCE, 0xE0, +0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, 0x27, 0x0D, 0xE3, 0x60, +0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, 0x2A, 0xCD, 0xA7, 0x60, +0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, 0x2E, 0x8D, 0x6B, 0x60, +0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, 0x32, 0x56, 0x69, 0xE0, +0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, 0x36, 0x16, 0x2D, 0xE0, +0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, 0x39, 0xD5, 0xF1, 0xE0, +0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, 0x3D, 0x9E, 0xF0, 0x60, +0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, 0x41, 0x5E, 0xB4, 0x60, +0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, 0x45, 0x1E, 0x78, 0x60, +0x45, 0xFB, 0xF4, 0x60, 0x46, 0xFE, 0x5A, 0x60, 0x47, 0xF7, 0x85, 0xE0, 0x48, 0xDE, 0x3C, 0x60, +0x49, 0xD7, 0x67, 0xE0, 0x4A, 0xBE, 0x1E, 0x60, 0x4B, 0xB7, 0x49, 0xE0, 0x4C, 0x9E, 0x00, 0x60, +0x4D, 0x97, 0x2B, 0xE0, 0x4E, 0x7D, 0xE2, 0x60, 0x4F, 0x77, 0x0D, 0xE0, 0x50, 0x66, 0xFE, 0xE0, +0x51, 0x60, 0x2A, 0x60, 0x52, 0x46, 0xE0, 0xE0, 0x53, 0x40, 0x0C, 0x60, 0x54, 0x26, 0xC2, 0xE0, +0x55, 0x1F, 0xEE, 0x60, 0x56, 0x06, 0xA4, 0xE0, 0x56, 0xFF, 0xD0, 0x60, 0x57, 0xE6, 0x86, 0xE0, +0x58, 0xDF, 0xB2, 0x60, 0x59, 0xC6, 0x68, 0xE0, 0x5A, 0xBF, 0x94, 0x60, 0x5B, 0xAF, 0x85, 0x60, +0x5C, 0xA8, 0xB0, 0xE0, 0x5D, 0x8F, 0x67, 0x60, 0x5E, 0x88, 0x92, 0xE0, 0x5F, 0x6F, 0x49, 0x60, +0x60, 0x68, 0x74, 0xE0, 0x61, 0x4F, 0x2B, 0x60, 0x62, 0x48, 0x56, 0xE0, 0x63, 0x2F, 0x0D, 0x60, +0x64, 0x28, 0x38, 0xE0, 0x65, 0x0E, 0xEF, 0x60, 0x66, 0x11, 0x55, 0x60, 0x66, 0xF8, 0x0B, 0xE0, +0x67, 0xF1, 0x37, 0x60, 0x68, 0xD7, 0xED, 0xE0, 0x69, 0xD1, 0x19, 0x60, 0x6A, 0xB7, 0xCF, 0xE0, +0x6B, 0xB0, 0xFB, 0x60, 0x6C, 0x97, 0xB1, 0xE0, 0x6D, 0x90, 0xDD, 0x60, 0x6E, 0x77, 0x93, 0xE0, +0x6F, 0x70, 0xBF, 0x60, 0x70, 0x60, 0xB0, 0x60, 0x71, 0x59, 0xDB, 0xE0, 0x72, 0x40, 0x92, 0x60, +0x73, 0x39, 0xBD, 0xE0, 0x74, 0x20, 0x74, 0x60, 0x75, 0x19, 0x9F, 0xE0, 0x76, 0x00, 0x56, 0x60, +0x76, 0xF9, 0x81, 0xE0, 0x77, 0xE0, 0x38, 0x60, 0x78, 0xD9, 0x63, 0xE0, 0x79, 0xC0, 0x1A, 0x60, +0x7A, 0xB9, 0x45, 0xE0, 0x7B, 0xA9, 0x36, 0xE0, 0x7C, 0xA2, 0x62, 0x60, 0x7D, 0x89, 0x18, 0xE0, +0x7E, 0x82, 0x44, 0x60, 0x7F, 0x68, 0xFA, 0xE0, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x04, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x09, 0x00, 0x00, -0xA8, 0xC0, 0x00, 0x09, 0x7A, 0x7A, 0x7A, 0x00, 0x4E, 0x5A, 0x44, 0x54, 0x00, 0x4E, 0x5A, 0x53, -0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x22, 0x41, 0x6D, 0x75, 0x6E, 0x64, 0x73, 0x65, 0x6E, 0x2D, 0x53, -0x63, 0x6F, 0x74, 0x74, 0x20, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x2C, 0x20, 0x53, 0x6F, -0x75, 0x74, 0x68, 0x20, 0x50, 0x6F, 0x6C, 0x65, +0x02, 0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x00, 0x00, 0xAF, 0xC8, 0x01, 0x00, 0x00, 0x00, 0xA1, 0xB8, 0x00, 0x05, 0x00, +0x00, 0xA8, 0xC0, 0x01, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x0A, 0x00, 0x00, 0xA8, 0xC0, 0x00, +0x00, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x00, 0x4E, 0x5A, 0x53, 0x54, 0x00, 0x4E, 0x5A, 0x4D, 0x54, +0x00, 0x4E, 0x5A, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, /* Antarctica/Syowa */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -7535,8 +7536,8 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* Asia/Amman */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4A, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xB6, 0xA3, 0xD6, 0xD0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0xB6, 0xA3, 0xD6, 0xD0, 0x06, 0x72, 0x79, 0xE0, 0x07, 0x0C, 0xAB, 0x50, 0x08, 0x24, 0x37, 0x60, 0x08, 0xED, 0xDE, 0xD0, 0x0A, 0x05, 0x6A, 0xE0, 0x0A, 0xCF, 0x12, 0x50, 0x0B, 0xE7, 0xEF, 0xE0, 0x0C, 0xDA, 0x75, 0xD0, 0x0D, 0xC9, 0x23, 0x60, 0x0E, 0x92, 0xCA, 0xD0, 0x0F, 0xA9, 0x05, 0x60, 0x10, 0x72, 0xAC, 0xD0, @@ -7553,31 +7554,17 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x42, 0x4C, 0x72, 0xE0, 0x43, 0x3C, 0x63, 0xE0, 0x44, 0x2C, 0x54, 0xE0, 0x45, 0x41, 0x2F, 0xE0, 0x46, 0x0C, 0x36, 0xE0, 0x47, 0x21, 0x11, 0xE0, 0x47, 0xEC, 0x18, 0xE0, 0x49, 0x0A, 0x2E, 0x60, 0x49, 0xCB, 0xFA, 0xE0, 0x4A, 0xEA, 0x10, 0x60, 0x4B, 0xAB, 0xDC, 0xE0, 0x4C, 0xC9, 0xF2, 0x60, -0x4D, 0x94, 0xF9, 0x60, 0x4E, 0xA9, 0xD4, 0x60, 0x4F, 0x74, 0xDB, 0x60, 0x52, 0x69, 0x98, 0x60, -0x53, 0x34, 0x9F, 0x60, 0x54, 0x52, 0xB4, 0xE0, 0x55, 0x14, 0x81, 0x60, 0x56, 0x32, 0x96, 0xE0, -0x56, 0xFD, 0x9D, 0xE0, 0x58, 0x12, 0x78, 0xE0, 0x58, 0xDD, 0x7F, 0xE0, 0x59, 0xF2, 0x5A, 0xE0, -0x5A, 0xBD, 0x61, 0xE0, 0x5B, 0xD2, 0x3C, 0xE0, 0x5C, 0x9D, 0x43, 0xE0, 0x5D, 0xB2, 0x1E, 0xE0, -0x5E, 0x7D, 0x25, 0xE0, 0x5F, 0x9B, 0x3B, 0x60, 0x60, 0x5D, 0x07, 0xE0, 0x61, 0x7B, 0x1D, 0x60, -0x62, 0x46, 0x24, 0x60, 0x63, 0x5A, 0xFF, 0x60, 0x64, 0x26, 0x06, 0x60, 0x65, 0x3A, 0xE1, 0x60, -0x66, 0x05, 0xE8, 0x60, 0x67, 0x1A, 0xC3, 0x60, 0x67, 0xE5, 0xCA, 0x60, 0x69, 0x03, 0xDF, 0xE0, -0x69, 0xC5, 0xAC, 0x60, 0x6A, 0xE3, 0xC1, 0xE0, 0x6B, 0xA5, 0x8E, 0x60, 0x6C, 0xC3, 0xA3, 0xE0, -0x6D, 0x8E, 0xAA, 0xE0, 0x6E, 0xA3, 0x85, 0xE0, 0x6F, 0x6E, 0x8C, 0xE0, 0x70, 0x83, 0x67, 0xE0, -0x71, 0x4E, 0x6E, 0xE0, 0x72, 0x63, 0x49, 0xE0, 0x73, 0x2E, 0x50, 0xE0, 0x74, 0x4C, 0x66, 0x60, -0x75, 0x0E, 0x32, 0xE0, 0x76, 0x2C, 0x48, 0x60, 0x76, 0xF7, 0x4F, 0x60, 0x78, 0x0C, 0x2A, 0x60, -0x78, 0xD7, 0x31, 0x60, 0x79, 0xEC, 0x0C, 0x60, 0x7A, 0xB7, 0x13, 0x60, 0x7B, 0xCB, 0xEE, 0x60, -0x7C, 0x96, 0xF5, 0x60, 0x7D, 0xB5, 0x0A, 0xE0, 0x7E, 0x76, 0xD7, 0x60, 0x7F, 0x94, 0xEC, 0xE0, +0x4D, 0x94, 0xF9, 0x60, 0x4E, 0xA9, 0xD4, 0x60, 0x4F, 0x74, 0xDB, 0x60, 0x50, 0x89, 0xB6, 0x60, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, -0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, -0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, -0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, -0x03, 0x01, 0x03, 0x01, 0x03, 0x00, 0x00, 0x21, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, +0x03, 0x01, 0x03, 0x01, 0x05, 0x00, 0x00, 0x21, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, -0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBA, 0x14, 0xB8, 0x01, 0x49, -0x7C, 0xF5, 0x00, 0x00, 0x00, 0x00, +0x30, 0x01, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, +0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBA, 0x14, 0xB8, 0x01, 0x49, 0x7C, 0xF5, 0x00, 0x00, +0x00, 0x00, /* Asia/Anadyr */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -8060,13 +8047,13 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* Asia/Dili */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x10, 0x92, 0xE6, 0x18, 0xC4, +0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x11, 0x92, 0xE6, 0x18, 0xC4, 0xCB, 0x99, 0x32, 0xF0, 0xD2, 0x56, 0xEE, 0x70, 0x0B, 0xEA, 0x30, 0x70, 0x39, 0xC3, 0x99, 0x00, 0x01, 0x02, 0x03, 0x04, 0x03, 0x00, 0x00, 0x75, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x70, -0x80, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x54, 0x4C, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x43, -0x49, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x48, -0x68, 0x01, 0xD2, 0x48, 0x7D, 0x00, 0x00, 0x00, 0x00, +0x80, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x54, 0x4C, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x57, +0x49, 0x54, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, +0x48, 0x68, 0x01, 0xD2, 0x48, 0x7D, 0x00, 0x00, 0x00, 0x00, /* Asia/Dubai */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -8122,19 +8109,19 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x45, 0x12, 0xFD, 0x50, 0x46, 0x0E, 0xD9, 0xE0, 0x46, 0xE8, 0x6F, 0x70, 0x47, 0xEC, 0x18, 0xE0, 0x48, 0xB7, 0x11, 0xD0, 0x49, 0xCB, 0xFA, 0xE0, 0x4A, 0xA0, 0x3C, 0x60, 0x4B, 0xAD, 0x2E, 0x9C, 0x4C, 0x61, 0xBD, 0xD0, 0x4D, 0x94, 0xF9, 0x9C, 0x4E, 0x35, 0xC2, 0x50, 0x4F, 0x74, 0xDB, 0x60, -0x50, 0x5B, 0x91, 0xE0, 0x51, 0x54, 0xBD, 0x60, 0x52, 0x44, 0xAE, 0x60, 0x53, 0x34, 0x9F, 0x60, -0x54, 0x24, 0x90, 0x60, 0x55, 0x14, 0x81, 0x60, 0x56, 0x04, 0x72, 0x60, 0x56, 0xFD, 0x9D, 0xE0, -0x57, 0xE4, 0x54, 0x60, 0x58, 0xDD, 0x7F, 0xE0, 0x59, 0xC4, 0x36, 0x60, 0x5A, 0xBD, 0x61, 0xE0, -0x5B, 0xA4, 0x18, 0x60, 0x5C, 0x9D, 0x43, 0xE0, 0x5D, 0x8D, 0x34, 0xE0, 0x5E, 0x7D, 0x25, 0xE0, -0x5F, 0x6D, 0x16, 0xE0, 0x60, 0x5D, 0x07, 0xE0, 0x61, 0x4C, 0xF8, 0xE0, 0x62, 0x46, 0x24, 0x60, -0x63, 0x2C, 0xDA, 0xE0, 0x64, 0x26, 0x06, 0x60, 0x65, 0x0C, 0xBC, 0xE0, 0x66, 0x05, 0xE8, 0x60, -0x66, 0xF5, 0xD9, 0x60, 0x67, 0xE5, 0xCA, 0x60, 0x68, 0xD5, 0xBB, 0x60, 0x69, 0xC5, 0xAC, 0x60, -0x6A, 0xB5, 0x9D, 0x60, 0x6B, 0xA5, 0x8E, 0x60, 0x6C, 0x95, 0x7F, 0x60, 0x6D, 0x8E, 0xAA, 0xE0, -0x6E, 0x75, 0x61, 0x60, 0x6F, 0x6E, 0x8C, 0xE0, 0x70, 0x55, 0x43, 0x60, 0x71, 0x4E, 0x6E, 0xE0, -0x72, 0x3E, 0x5F, 0xE0, 0x73, 0x2E, 0x50, 0xE0, 0x74, 0x1E, 0x41, 0xE0, 0x75, 0x0E, 0x32, 0xE0, -0x75, 0xFE, 0x23, 0xE0, 0x76, 0xF7, 0x4F, 0x60, 0x77, 0xDE, 0x05, 0xE0, 0x78, 0xD7, 0x31, 0x60, -0x79, 0xBD, 0xE7, 0xE0, 0x7A, 0xB7, 0x13, 0x60, 0x7B, 0x9D, 0xC9, 0xE0, 0x7C, 0x96, 0xF5, 0x60, -0x7D, 0x86, 0xE6, 0x60, 0x7E, 0x76, 0xD7, 0x60, 0x7F, 0x66, 0xC8, 0x60, 0x00, 0x01, 0x00, 0x01, +0x50, 0x5B, 0x91, 0xE0, 0x51, 0x54, 0xBD, 0x60, 0x52, 0x44, 0xA0, 0x50, 0x53, 0x34, 0x9F, 0x60, +0x54, 0x24, 0x82, 0x50, 0x55, 0x14, 0x81, 0x60, 0x56, 0x04, 0x64, 0x50, 0x56, 0xFD, 0x9D, 0xE0, +0x57, 0xE4, 0x46, 0x50, 0x58, 0xDD, 0x7F, 0xE0, 0x59, 0xC4, 0x28, 0x50, 0x5A, 0xBD, 0x61, 0xE0, +0x5B, 0xA4, 0x0A, 0x50, 0x5C, 0x9D, 0x43, 0xE0, 0x5D, 0x8D, 0x26, 0xD0, 0x5E, 0x7D, 0x25, 0xE0, +0x5F, 0x6D, 0x08, 0xD0, 0x60, 0x5D, 0x07, 0xE0, 0x61, 0x4C, 0xEA, 0xD0, 0x62, 0x46, 0x24, 0x60, +0x63, 0x2C, 0xCC, 0xD0, 0x64, 0x26, 0x06, 0x60, 0x65, 0x0C, 0xAE, 0xD0, 0x66, 0x05, 0xE8, 0x60, +0x66, 0xF5, 0xCB, 0x50, 0x67, 0xE5, 0xCA, 0x60, 0x68, 0xD5, 0xAD, 0x50, 0x69, 0xC5, 0xAC, 0x60, +0x6A, 0xB5, 0x8F, 0x50, 0x6B, 0xA5, 0x8E, 0x60, 0x6C, 0x95, 0x71, 0x50, 0x6D, 0x8E, 0xAA, 0xE0, +0x6E, 0x75, 0x53, 0x50, 0x6F, 0x6E, 0x8C, 0xE0, 0x70, 0x55, 0x35, 0x50, 0x71, 0x4E, 0x6E, 0xE0, +0x72, 0x3E, 0x51, 0xD0, 0x73, 0x2E, 0x50, 0xE0, 0x74, 0x1E, 0x33, 0xD0, 0x75, 0x0E, 0x32, 0xE0, +0x75, 0xFE, 0x15, 0xD0, 0x76, 0xF7, 0x4F, 0x60, 0x77, 0xDD, 0xF7, 0xD0, 0x78, 0xD7, 0x31, 0x60, +0x79, 0xBD, 0xD9, 0xD0, 0x7A, 0xB7, 0x13, 0x60, 0x7B, 0x9D, 0xBB, 0xD0, 0x7C, 0x96, 0xF5, 0x60, +0x7D, 0x86, 0xD8, 0x50, 0x7E, 0x76, 0xD7, 0x60, 0x7F, 0x66, 0xBA, 0x50, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, @@ -8196,19 +8183,19 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x48, 0xBB, 0x06, 0x50, 0x49, 0xCB, 0xFA, 0xE0, 0x4A, 0xA0, 0x3C, 0x60, 0x4B, 0xAB, 0xDC, 0xE0, 0x4C, 0x61, 0xBD, 0xD0, 0x4D, 0x94, 0xF9, 0x9C, 0x4E, 0x35, 0xC2, 0x50, 0x4E, 0x5C, 0x0B, 0xE0, 0x4E, 0x84, 0xDC, 0x50, 0x4F, 0x74, 0xDB, 0x60, 0x50, 0x5B, 0x91, 0xE0, 0x51, 0x54, 0xBD, 0x60, -0x52, 0x44, 0xAE, 0x60, 0x53, 0x34, 0x9F, 0x60, 0x54, 0x24, 0x90, 0x60, 0x55, 0x14, 0x81, 0x60, -0x56, 0x04, 0x72, 0x60, 0x56, 0xFD, 0x9D, 0xE0, 0x57, 0xE4, 0x54, 0x60, 0x58, 0xDD, 0x7F, 0xE0, -0x59, 0xC4, 0x36, 0x60, 0x5A, 0xBD, 0x61, 0xE0, 0x5B, 0xA4, 0x18, 0x60, 0x5C, 0x9D, 0x43, 0xE0, -0x5D, 0x8D, 0x34, 0xE0, 0x5E, 0x7D, 0x25, 0xE0, 0x5F, 0x6D, 0x16, 0xE0, 0x60, 0x5D, 0x07, 0xE0, -0x61, 0x4C, 0xF8, 0xE0, 0x62, 0x46, 0x24, 0x60, 0x63, 0x2C, 0xDA, 0xE0, 0x64, 0x26, 0x06, 0x60, -0x65, 0x0C, 0xBC, 0xE0, 0x66, 0x05, 0xE8, 0x60, 0x66, 0xF5, 0xD9, 0x60, 0x67, 0xE5, 0xCA, 0x60, -0x68, 0xD5, 0xBB, 0x60, 0x69, 0xC5, 0xAC, 0x60, 0x6A, 0xB5, 0x9D, 0x60, 0x6B, 0xA5, 0x8E, 0x60, -0x6C, 0x95, 0x7F, 0x60, 0x6D, 0x8E, 0xAA, 0xE0, 0x6E, 0x75, 0x61, 0x60, 0x6F, 0x6E, 0x8C, 0xE0, -0x70, 0x55, 0x43, 0x60, 0x71, 0x4E, 0x6E, 0xE0, 0x72, 0x3E, 0x5F, 0xE0, 0x73, 0x2E, 0x50, 0xE0, -0x74, 0x1E, 0x41, 0xE0, 0x75, 0x0E, 0x32, 0xE0, 0x75, 0xFE, 0x23, 0xE0, 0x76, 0xF7, 0x4F, 0x60, -0x77, 0xDE, 0x05, 0xE0, 0x78, 0xD7, 0x31, 0x60, 0x79, 0xBD, 0xE7, 0xE0, 0x7A, 0xB7, 0x13, 0x60, -0x7B, 0x9D, 0xC9, 0xE0, 0x7C, 0x96, 0xF5, 0x60, 0x7D, 0x86, 0xE6, 0x60, 0x7E, 0x76, 0xD7, 0x60, -0x7F, 0x66, 0xC8, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, +0x52, 0x44, 0xA0, 0x50, 0x53, 0x34, 0x9F, 0x60, 0x54, 0x24, 0x82, 0x50, 0x55, 0x14, 0x81, 0x60, +0x56, 0x04, 0x64, 0x50, 0x56, 0xFD, 0x9D, 0xE0, 0x57, 0xE4, 0x46, 0x50, 0x58, 0xDD, 0x7F, 0xE0, +0x59, 0xC4, 0x28, 0x50, 0x5A, 0xBD, 0x61, 0xE0, 0x5B, 0xA4, 0x0A, 0x50, 0x5C, 0x9D, 0x43, 0xE0, +0x5D, 0x8D, 0x26, 0xD0, 0x5E, 0x7D, 0x25, 0xE0, 0x5F, 0x6D, 0x08, 0xD0, 0x60, 0x5D, 0x07, 0xE0, +0x61, 0x4C, 0xEA, 0xD0, 0x62, 0x46, 0x24, 0x60, 0x63, 0x2C, 0xCC, 0xD0, 0x64, 0x26, 0x06, 0x60, +0x65, 0x0C, 0xAE, 0xD0, 0x66, 0x05, 0xE8, 0x60, 0x66, 0xF5, 0xCB, 0x50, 0x67, 0xE5, 0xCA, 0x60, +0x68, 0xD5, 0xAD, 0x50, 0x69, 0xC5, 0xAC, 0x60, 0x6A, 0xB5, 0x8F, 0x50, 0x6B, 0xA5, 0x8E, 0x60, +0x6C, 0x95, 0x71, 0x50, 0x6D, 0x8E, 0xAA, 0xE0, 0x6E, 0x75, 0x53, 0x50, 0x6F, 0x6E, 0x8C, 0xE0, +0x70, 0x55, 0x35, 0x50, 0x71, 0x4E, 0x6E, 0xE0, 0x72, 0x3E, 0x51, 0xD0, 0x73, 0x2E, 0x50, 0xE0, +0x74, 0x1E, 0x33, 0xD0, 0x75, 0x0E, 0x32, 0xE0, 0x75, 0xFE, 0x15, 0xD0, 0x76, 0xF7, 0x4F, 0x60, +0x77, 0xDD, 0xF7, 0xD0, 0x78, 0xD7, 0x31, 0x60, 0x79, 0xBD, 0xD9, 0xD0, 0x7A, 0xB7, 0x13, 0x60, +0x7B, 0x9D, 0xBB, 0xD0, 0x7C, 0x96, 0xF5, 0x60, 0x7D, 0x86, 0xD8, 0x50, 0x7E, 0x76, 0xD7, 0x60, +0x7F, 0x66, 0xBA, 0x50, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, @@ -8397,7 +8384,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0xDA, 0xFF, 0x26, 0x00, 0xF4, 0xB5, 0xBE, 0x88, 0x01, 0x02, 0x03, 0x02, 0x04, 0x02, 0x05, 0x00, 0x00, 0x64, 0x20, 0x00, 0x00, 0x00, 0x00, 0x67, 0x20, 0x00, 0x04, 0x00, 0x00, 0x69, 0x78, 0x00, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0D, 0x00, 0x00, 0x70, 0x80, 0x00, 0x09, 0x00, 0x00, 0x62, -0x70, 0x00, 0x09, 0x4A, 0x4D, 0x54, 0x00, 0x4A, 0x41, 0x56, 0x54, 0x00, 0x57, 0x49, 0x54, 0x00, +0x70, 0x00, 0x09, 0x42, 0x4D, 0x54, 0x00, 0x4A, 0x41, 0x56, 0x54, 0x00, 0x57, 0x49, 0x42, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xEB, 0x65, 0x01, 0xB5, 0x9F, 0x40, 0x00, 0x00, 0x00, 0x0E, 0x4A, 0x61, 0x76, 0x61, 0x20, 0x26, 0x20, 0x53, 0x75, 0x6D, 0x61, 0x74, 0x72, 0x61, @@ -8408,7 +8395,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xBA, 0x16, 0xC1, 0x98, 0xD0, 0x58, 0xB9, 0xF0, 0xF4, 0xB5, 0xA2, 0x68, 0x01, 0x02, 0x01, 0x00, 0x00, 0x83, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x85, 0x98, 0x00, 0x08, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x49, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x57, 0x49, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x76, 0xAA, 0x01, 0xE9, 0x59, 0x70, 0x00, 0x00, 0x00, 0x31, 0x77, 0x65, 0x73, 0x74, 0x20, 0x4E, 0x65, 0x77, 0x20, 0x47, 0x75, 0x69, 0x6E, 0x65, 0x61, 0x20, 0x28, 0x49, 0x72, 0x69, 0x61, 0x6E, 0x20, 0x4A, 0x61, 0x79, 0x61, 0x29, 0x20, 0x26, 0x20, 0x4D, 0x61, 0x6C, 0x75, 0x6B, 0x75, @@ -8754,17 +8741,17 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* Asia/Makassar */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xA1, 0xF2, 0x5D, 0x90, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xA1, 0xF2, 0x5D, 0x90, 0xBA, 0x16, 0xD5, 0x90, 0xCB, 0x88, 0x1D, 0x80, 0xD2, 0x56, 0xEE, 0x70, 0x01, 0x02, 0x03, 0x02, 0x00, 0x00, 0x6F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x6F, 0xF0, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, -0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x4D, 0x54, 0x00, -0x43, 0x49, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x81, 0x85, 0x8D, 0x01, 0xC8, 0xD9, 0x1F, 0x00, 0x00, 0x00, 0x48, 0x65, 0x61, 0x73, 0x74, -0x20, 0x26, 0x20, 0x73, 0x6F, 0x75, 0x74, 0x68, 0x20, 0x42, 0x6F, 0x72, 0x6E, 0x65, 0x6F, 0x2C, -0x20, 0x53, 0x75, 0x6C, 0x61, 0x77, 0x65, 0x73, 0x69, 0x20, 0x28, 0x43, 0x65, 0x6C, 0x65, 0x62, -0x65, 0x73, 0x29, 0x2C, 0x20, 0x42, 0x61, 0x6C, 0x69, 0x2C, 0x20, 0x4E, 0x75, 0x73, 0x61, 0x20, -0x54, 0x65, 0x6E, 0x67, 0x61, 0x72, 0x72, 0x61, 0x2C, 0x20, 0x77, 0x65, 0x73, 0x74, 0x20, 0x54, -0x69, 0x6D, 0x6F, 0x72, +0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x4D, 0x54, 0x00, +0x57, 0x49, 0x54, 0x41, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x81, 0x85, 0x8D, 0x01, 0xC8, 0xD9, 0x1F, 0x00, 0x00, 0x00, 0x48, 0x65, 0x61, 0x73, +0x74, 0x20, 0x26, 0x20, 0x73, 0x6F, 0x75, 0x74, 0x68, 0x20, 0x42, 0x6F, 0x72, 0x6E, 0x65, 0x6F, +0x2C, 0x20, 0x53, 0x75, 0x6C, 0x61, 0x77, 0x65, 0x73, 0x69, 0x20, 0x28, 0x43, 0x65, 0x6C, 0x65, +0x62, 0x65, 0x73, 0x29, 0x2C, 0x20, 0x42, 0x61, 0x6C, 0x69, 0x2C, 0x20, 0x4E, 0x75, 0x73, 0x61, +0x20, 0x54, 0x65, 0x6E, 0x67, 0x61, 0x72, 0x72, 0x61, 0x2C, 0x20, 0x77, 0x65, 0x73, 0x74, 0x20, +0x54, 0x69, 0x6D, 0x6F, 0x72, /* Asia/Manila */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -8980,17 +8967,17 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* Asia/Pontianak */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x14, 0x8B, 0xFF, 0x8E, 0x00, +0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x8B, 0xFF, 0x8E, 0x00, 0xBA, 0x16, 0xDF, 0x00, 0xCB, 0x79, 0xA4, 0x08, 0xD2, 0x56, 0xEE, 0x70, 0xD7, 0x3C, 0xC6, 0x08, 0xDA, 0xFF, 0x26, 0x00, 0xF4, 0xB5, 0xBE, 0x88, 0x21, 0xDA, 0x74, 0x80, 0x01, 0x02, 0x03, 0x02, 0x04, 0x02, 0x05, 0x06, 0x00, 0x00, 0x66, 0x80, 0x00, 0x00, 0x00, 0x00, 0x66, 0x80, 0x00, 0x04, 0x00, 0x00, 0x69, 0x78, 0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0C, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x10, 0x00, 0x00, 0x62, 0x70, 0x00, 0x08, 0x4C, 0x4D, -0x54, 0x00, 0x50, 0x4D, 0x54, 0x00, 0x57, 0x49, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x43, 0x49, -0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x89, 0x47, 0x3A, 0x01, 0xB9, 0x7C, 0xD5, 0x00, 0x00, 0x00, 0x15, 0x77, 0x65, 0x73, 0x74, -0x20, 0x26, 0x20, 0x63, 0x65, 0x6E, 0x74, 0x72, 0x61, 0x6C, 0x20, 0x42, 0x6F, 0x72, 0x6E, 0x65, -0x6F, +0x54, 0x00, 0x50, 0x4D, 0x54, 0x00, 0x57, 0x49, 0x42, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x57, 0x49, +0x54, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x89, 0x47, 0x3A, 0x01, 0xB9, 0x7C, 0xD5, 0x00, 0x00, 0x00, 0x15, 0x77, 0x65, 0x73, +0x74, 0x20, 0x26, 0x20, 0x63, 0x65, 0x6E, 0x74, 0x72, 0x61, 0x6C, 0x20, 0x42, 0x6F, 0x72, 0x6E, +0x65, 0x6F, /* Asia/Pyongyang */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -9368,12 +9355,12 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* Asia/Ujung_Pandang */ 0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xA1, 0xF2, 0x5D, 0x90, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xA1, 0xF2, 0x5D, 0x90, 0xBA, 0x16, 0xD5, 0x90, 0xCB, 0x88, 0x1D, 0x80, 0xD2, 0x56, 0xEE, 0x70, 0x01, 0x02, 0x03, 0x02, 0x00, 0x00, 0x6F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x6F, 0xF0, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, -0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x4D, 0x54, 0x00, -0x43, 0x49, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, +0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x4D, 0x54, 0x00, +0x57, 0x49, 0x54, 0x41, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, /* Asia/Ulaanbaatar */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -15346,8 +15333,9 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* Europe/Vaduz */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0x15, 0x23, 0xEB, 0x90, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0xCA, 0x17, 0x6A, 0x00, +0xCA, 0xE2, 0x71, 0x00, 0xCB, 0xF7, 0x4C, 0x00, 0xCC, 0xC2, 0x53, 0x00, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, @@ -15376,17 +15364,17 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, -0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0xD1, 0x46, 0x38, 0x01, 0x21, 0x2D, 0xF2, 0x00, -0x00, 0x00, 0x00, +0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, +0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, +0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, +0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, +0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, +0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, +0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, +0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, +0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, +0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, +0x00, 0x01, 0x01, 0x00, 0xD1, 0x46, 0x38, 0x01, 0x21, 0x2D, 0xF2, 0x00, 0x00, 0x00, 0x00, /* Europe/Vatican */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x56, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -16278,14 +16266,14 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* Jamaica */ 0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB5, 0x00, +0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB4, 0xFF, 0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xB8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, +0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xB8, 0x01, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, @@ -16999,19 +16987,19 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x36, 0x3B, 0x17, 0xE0, 0x36, 0xD7, 0xFA, 0x60, 0x38, 0x24, 0x34, 0x60, 0x38, 0xB7, 0xDC, 0x60, 0x4B, 0x11, 0x2C, 0xE0, 0x4B, 0xAE, 0x0F, 0x60, 0x4C, 0xC2, 0xEA, 0x60, 0x4D, 0x72, 0x41, 0xE0, 0x4E, 0xA2, 0xCC, 0x60, 0x4F, 0x1A, 0xC4, 0xE0, 0x50, 0x82, 0xAE, 0x60, 0x50, 0xFA, 0xA6, 0xE0, -0x52, 0x62, 0x90, 0x60, 0x52, 0xDA, 0x88, 0xE0, 0x54, 0x42, 0x72, 0x60, 0x54, 0xBA, 0x6A, 0xE0, -0x56, 0x22, 0x54, 0x60, 0x56, 0xA3, 0x87, 0x60, 0x58, 0x0B, 0x70, 0xE0, 0x58, 0x83, 0x69, 0x60, +0x52, 0x6B, 0xCA, 0xE0, 0x52, 0xDA, 0x88, 0xE0, 0x54, 0x4B, 0xAC, 0xE0, 0x54, 0xBA, 0x6A, 0xE0, +0x56, 0x2B, 0x8E, 0xE0, 0x56, 0xA3, 0x87, 0x60, 0x58, 0x0B, 0x70, 0xE0, 0x58, 0x83, 0x69, 0x60, 0x59, 0xEB, 0x52, 0xE0, 0x5A, 0x63, 0x4B, 0x60, 0x5B, 0xCB, 0x34, 0xE0, 0x5C, 0x43, 0x2D, 0x60, -0x5D, 0xAB, 0x16, 0xE0, 0x5E, 0x23, 0x0F, 0x60, 0x5F, 0x8A, 0xF8, 0xE0, 0x60, 0x0C, 0x2B, 0xE0, +0x5D, 0xB4, 0x51, 0x60, 0x5E, 0x23, 0x0F, 0x60, 0x5F, 0x94, 0x33, 0x60, 0x60, 0x0C, 0x2B, 0xE0, 0x61, 0x74, 0x15, 0x60, 0x61, 0xEC, 0x0D, 0xE0, 0x63, 0x53, 0xF7, 0x60, 0x63, 0xCB, 0xEF, 0xE0, -0x65, 0x33, 0xD9, 0x60, 0x65, 0xAB, 0xD1, 0xE0, 0x67, 0x13, 0xBB, 0x60, 0x67, 0x8B, 0xB3, 0xE0, -0x68, 0xF3, 0x9D, 0x60, 0x69, 0x6B, 0x95, 0xE0, 0x6A, 0xD3, 0x7F, 0x60, 0x6B, 0x54, 0xB2, 0x60, +0x65, 0x33, 0xD9, 0x60, 0x65, 0xAB, 0xD1, 0xE0, 0x67, 0x1C, 0xF5, 0xE0, 0x67, 0x8B, 0xB3, 0xE0, +0x68, 0xFC, 0xD7, 0xE0, 0x69, 0x6B, 0x95, 0xE0, 0x6A, 0xDC, 0xB9, 0xE0, 0x6B, 0x54, 0xB2, 0x60, 0x6C, 0xBC, 0x9B, 0xE0, 0x6D, 0x34, 0x94, 0x60, 0x6E, 0x9C, 0x7D, 0xE0, 0x6F, 0x14, 0x76, 0x60, -0x70, 0x7C, 0x5F, 0xE0, 0x70, 0xF4, 0x58, 0x60, 0x72, 0x5C, 0x41, 0xE0, 0x72, 0xD4, 0x3A, 0x60, -0x74, 0x3C, 0x23, 0xE0, 0x74, 0xB4, 0x1C, 0x60, 0x76, 0x25, 0x40, 0x60, 0x76, 0x9D, 0x38, 0xE0, +0x70, 0x7C, 0x5F, 0xE0, 0x70, 0xF4, 0x58, 0x60, 0x72, 0x65, 0x7C, 0x60, 0x72, 0xD4, 0x3A, 0x60, +0x74, 0x45, 0x5E, 0x60, 0x74, 0xB4, 0x1C, 0x60, 0x76, 0x25, 0x40, 0x60, 0x76, 0x9D, 0x38, 0xE0, 0x78, 0x05, 0x22, 0x60, 0x78, 0x7D, 0x1A, 0xE0, 0x79, 0xE5, 0x04, 0x60, 0x7A, 0x5C, 0xFC, 0xE0, -0x7B, 0xC4, 0xE6, 0x60, 0x7C, 0x3C, 0xDE, 0xE0, 0x7D, 0xA4, 0xC8, 0x60, 0x7E, 0x1C, 0xC0, 0xE0, -0x7F, 0x84, 0xAA, 0x60, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x7B, 0xC4, 0xE6, 0x60, 0x7C, 0x3C, 0xDE, 0xE0, 0x7D, 0xAE, 0x02, 0xE0, 0x7E, 0x1C, 0xC0, 0xE0, +0x7F, 0x8D, 0xE4, 0xE0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, @@ -17074,11 +17062,13 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { /* Pacific/Johnston */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0x73, 0x60, -0x00, 0x00, 0x48, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0xA2, 0xE3, 0x38, 0x00, 0x0F, 0xFF, 0x0D, -0x00, 0x00, 0x00, 0x0E, 0x4A, 0x6F, 0x68, 0x6E, 0x73, 0x74, 0x6F, 0x6E, 0x20, 0x41, 0x74, 0x6F, -0x6C, 0x6C, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0xBB, 0x05, 0x43, 0x48, +0xBB, 0x21, 0x71, 0x58, 0xCB, 0x89, 0x3D, 0xC8, 0xD2, 0x61, 0x49, 0x38, 0xD5, 0x8D, 0x73, 0x48, +0x01, 0x00, 0x01, 0x00, 0x02, 0xFF, 0xFF, 0x6C, 0x58, 0x00, 0x00, 0xFF, 0xFF, 0x7A, 0x68, 0x01, +0x04, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x00, 0x48, 0x53, 0x54, 0x00, 0x48, 0x44, 0x54, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA2, 0xE3, 0x38, 0x00, 0x0F, 0xFF, 0x0D, 0x00, 0x00, 0x00, +0x0E, 0x4A, 0x6F, 0x68, 0x6E, 0x73, 0x74, 0x6F, 0x6E, 0x20, 0x41, 0x74, 0x6F, 0x6C, 0x6C, /* Pacific/Kiritimati */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -18410,4 +18400,4 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, }; -const timelib_tzdb timezonedb_builtin = { "2013.4", 579, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; +const timelib_tzdb timezonedb_builtin = { "2013.6", 579, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 8afe47fbccf11..13a645117c959 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -480,7 +480,7 @@ const zend_function_entry date_funcs_immutable[] = { PHP_ME(DateTimeImmutable, __construct, arginfo_date_create, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) PHP_ME(DateTime, __wakeup, NULL, ZEND_ACC_PUBLIC) PHP_ME(DateTimeImmutable, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME_MAPPING(createFromFormat, date_create_from_format, arginfo_date_create_from_format, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME_MAPPING(createFromFormat, date_create_immutable_from_format, arginfo_date_create_from_format, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME_MAPPING(getLastErrors, date_get_last_errors, arginfo_date_get_last_errors, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME_MAPPING(format, date_format, arginfo_date_method_format, 0) PHP_ME_MAPPING(getTimezone, date_timezone_get, arginfo_date_method_timezone_get, 0) @@ -1406,6 +1406,7 @@ PHPAPI signed long php_parse_date(char *string, signed long *now) parsed_time = timelib_strtotime(string, strlen(string), &error, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper); if (error->error_count) { + timelib_time_dtor(parsed_time); timelib_error_container_dtor(error); return -1; } @@ -2142,27 +2143,21 @@ static zval* date_clone_immutable(zval *object TSRMLS_DC) static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC) { - if (Z_TYPE_P(d1) == IS_OBJECT && Z_TYPE_P(d2) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(d1), date_ce_date TSRMLS_CC) && - instanceof_function(Z_OBJCE_P(d2), date_ce_date TSRMLS_CC)) { - php_date_obj *o1 = zend_object_store_get_object(d1 TSRMLS_CC); - php_date_obj *o2 = zend_object_store_get_object(d2 TSRMLS_CC); + php_date_obj *o1 = zend_object_store_get_object(d1 TSRMLS_CC); + php_date_obj *o2 = zend_object_store_get_object(d2 TSRMLS_CC); - if (!o1->time || !o2->time) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to compare an incomplete DateTime object"); - return 1; - } - if (!o1->time->sse_uptodate) { - timelib_update_ts(o1->time, o1->time->tz_info); - } - if (!o2->time->sse_uptodate) { - timelib_update_ts(o2->time, o2->time->tz_info); - } - - return (o1->time->sse == o2->time->sse) ? 0 : ((o1->time->sse < o2->time->sse) ? -1 : 1); + if (!o1->time || !o2->time) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to compare an incomplete DateTime or DateTimeImmutable object"); + return 1; + } + if (!o1->time->sse_uptodate) { + timelib_update_ts(o1->time, o1->time->tz_info); + } + if (!o2->time->sse_uptodate) { + timelib_update_ts(o2->time, o2->time->tz_info); } - return 1; + return (o1->time->sse == o2->time->sse) ? 0 : ((o1->time->sse < o2->time->sse) ? -1 : 1); } static HashTable *date_object_get_gc(zval *object, zval ***table, int *n TSRMLS_DC) @@ -2198,13 +2193,13 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC) /* first we add the date and time in ISO format */ MAKE_STD_ZVAL(zv); ZVAL_STRING(zv, date_format("Y-m-d H:i:s", 12, dateobj->time, 1), 0); - zend_hash_update(props, "date", 5, &zv, sizeof(zval), NULL); + zend_hash_update(props, "date", 5, &zv, sizeof(zv), NULL); /* then we add the timezone name (or similar) */ if (dateobj->time->is_localtime) { MAKE_STD_ZVAL(zv); ZVAL_LONG(zv, dateobj->time->zone_type); - zend_hash_update(props, "timezone_type", 14, &zv, sizeof(zval), NULL); + zend_hash_update(props, "timezone_type", 14, &zv, sizeof(zv), NULL); MAKE_STD_ZVAL(zv); switch (dateobj->time->zone_type) { @@ -2227,7 +2222,7 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC) ZVAL_STRING(zv, dateobj->time->tz_abbr, 1); break; } - zend_hash_update(props, "timezone", 9, &zv, sizeof(zval), NULL); + zend_hash_update(props, "timezone", 9, &zv, sizeof(zv), NULL); } return props; @@ -2305,7 +2300,7 @@ static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC) MAKE_STD_ZVAL(zv); ZVAL_LONG(zv, tzobj->type); - zend_hash_update(props, "timezone_type", 14, &zv, sizeof(zval), NULL); + zend_hash_update(props, "timezone_type", 14, &zv, sizeof(zv), NULL); MAKE_STD_ZVAL(zv); switch (tzobj->type) { @@ -2327,7 +2322,7 @@ static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC) ZVAL_STRING(zv, tzobj->tzi.z.abbr, 1); break; } - zend_hash_update(props, "timezone", 9, &zv, sizeof(zval), NULL); + zend_hash_update(props, "timezone", 9, &zv, sizeof(zv), NULL); return props; } @@ -2394,7 +2389,7 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC) #define PHP_DATE_INTERVAL_ADD_PROPERTY(n,f) \ MAKE_STD_ZVAL(zv); \ ZVAL_LONG(zv, (long)intervalobj->diff->f); \ - zend_hash_update(props, n, strlen(n) + 1, &zv, sizeof(zval), NULL); + zend_hash_update(props, n, strlen(n) + 1, &zv, sizeof(zv), NULL); PHP_DATE_INTERVAL_ADD_PROPERTY("y", y); PHP_DATE_INTERVAL_ADD_PROPERTY("m", m); @@ -2411,7 +2406,7 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC) } else { MAKE_STD_ZVAL(zv); ZVAL_FALSE(zv); - zend_hash_update(props, "days", 5, &zv, sizeof(zval), NULL); + zend_hash_update(props, "days", 5, &zv, sizeof(zv), NULL); } PHP_DATE_INTERVAL_ADD_PROPERTY("special_type", special.type); PHP_DATE_INTERVAL_ADD_PROPERTY("special_amount", special.amount); diff --git a/ext/date/tests/bug64157.phpt b/ext/date/tests/bug64157.phpt new file mode 100644 index 0000000000000..fb71495430c72 --- /dev/null +++ b/ext/date/tests/bug64157.phpt @@ -0,0 +1,14 @@ +--TEST-- +Test for bug #64157: DateTime::createFromFormat() reports confusing error message +--CREDITS-- +Boro Sitnikovski +--INI-- +date.timezone = UTC +--FILE-- + +--EXPECT-- +A two digit second could not be found diff --git a/ext/date/tests/bug65502.phpt b/ext/date/tests/bug65502.phpt new file mode 100644 index 0000000000000..8819c1ff745f2 --- /dev/null +++ b/ext/date/tests/bug65502.phpt @@ -0,0 +1,12 @@ +--TEST-- +Test for bug #65502: DateTimeImmutable::createFromFormat returns DateTime +--CREDITS-- +Boro Sitnikovski +--INI-- +date.timezone = UTC +--FILE-- + +--EXPECT-- +DateTimeImmutable diff --git a/ext/date/tests/bug65548.phpt b/ext/date/tests/bug65548.phpt new file mode 100644 index 0000000000000..53f2519f6d371 --- /dev/null +++ b/ext/date/tests/bug65548.phpt @@ -0,0 +1,34 @@ +--TEST-- +Test for bug #65548: Comparison for DateTimeImmutable doesn't work +--CREDITS-- +Boro Sitnikovski +--INI-- +date.timezone = UTC +--FILE-- + $iTomorrow); + +var_dump($iToday == $mToday); +var_dump($iToday === $mToday); + +var_dump($iToday < $mTomorrow); +var_dump($iToday == $mTomorrow); +var_dump($iToday > $mTomorrow); +?> +--EXPECT-- +bool(true) +bool(false) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(false) diff --git a/ext/dba/dba.c b/ext/dba/dba.c index 8005101de34b1..ced90f0c62299 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -226,12 +226,17 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS *key_free = *key_str; return len; } else { - *key_free = NULL; + zval tmp = *key; + int len; - convert_to_string(key); - *key_str = Z_STRVAL_P(key); + zval_copy_ctor(&tmp); + convert_to_string(&tmp); - return Z_STRLEN_P(key); + *key_free = *key_str = estrndup(Z_STRVAL(tmp), Z_STRLEN(tmp)); + len = Z_STRLEN(tmp); + + zval_dtor(&tmp); + return len; } } /* }}} */ @@ -297,6 +302,14 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS RETURN_FALSE; \ } +/* the same check, but with a call to DBA_ID_DONE before returning */ +#define DBA_WRITE_CHECK_WITH_ID \ + if(info->mode != DBA_WRITER && info->mode != DBA_TRUNC && info->mode != DBA_CREAT) { \ + php_error_docref(NULL TSRMLS_CC, E_WARNING, "You cannot perform a modification to a database without proper access"); \ + DBA_ID_DONE; \ + RETURN_FALSE; \ + } + /* }}} */ /* {{{ globals */ @@ -557,7 +570,7 @@ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode) DBA_FETCH_RESOURCE(info, &id); - DBA_WRITE_CHECK; + DBA_WRITE_CHECK_WITH_ID; if (info->hnd->update(info, key_str, key_len, val, val_len, mode TSRMLS_CC) == SUCCESS) { DBA_ID_DONE; @@ -612,7 +625,8 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) char *file_mode; char mode[4], *pmode, *lock_file_mode = NULL; int persistent_flag = persistent ? STREAM_OPEN_PERSISTENT : 0; - char *opened_path, *lock_name; + char *opened_path = NULL; + char *lock_name; if(ac < 2) { WRONG_PARAM_COUNT; @@ -835,8 +849,10 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) if (!persistent) { info->lock.name = opened_path; } else { - info->lock.name = pestrdup(opened_path, persistent); - efree(opened_path); + if (opened_path) { + info->lock.name = pestrdup(opened_path, persistent); + efree(opened_path); + } } } } @@ -1110,7 +1126,7 @@ PHP_FUNCTION(dba_delete) { DBA_ID_GET2; - DBA_WRITE_CHECK; + DBA_WRITE_CHECK_WITH_ID; if(info->hnd->delete(info, key_str, key_len TSRMLS_CC) == SUCCESS) { diff --git a/ext/dba/tests/bug65708.phpt b/ext/dba/tests/bug65708.phpt new file mode 100644 index 0000000000000..b77138f6ed438 --- /dev/null +++ b/ext/dba/tests/bug65708.phpt @@ -0,0 +1,38 @@ +--TEST-- +Bug #65708 (dba functions cast $key param to string in-place, bypassing copy on write) +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECT-- +integer +integer +integer +integer diff --git a/ext/exif/exif.c b/ext/exif/exif.c index ec121a6c326bc..f886bb4fea783 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -2633,6 +2633,7 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP } else { decode = ImageInfo->decode_unicode_le; } + /* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */ if (zend_multibyte_encoding_converter( (unsigned char**)pszInfoPtr, &len, @@ -2640,7 +2641,7 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP ByteCount, zend_multibyte_fetch_encoding(ImageInfo->encode_unicode TSRMLS_CC), zend_multibyte_fetch_encoding(decode TSRMLS_CC) - TSRMLS_CC) < 0) { + TSRMLS_CC) == (size_t)-1) { len = exif_process_string_raw(pszInfoPtr, szValuePtr, ByteCount); } return len; @@ -2653,6 +2654,7 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP *pszEncoding = estrdup((const char*)szValuePtr); szValuePtr = szValuePtr+8; ByteCount -= 8; + /* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */ if (zend_multibyte_encoding_converter( (unsigned char**)pszInfoPtr, &len, @@ -2660,7 +2662,7 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP ByteCount, zend_multibyte_fetch_encoding(ImageInfo->encode_jis TSRMLS_CC), zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_jis_be : ImageInfo->decode_jis_le TSRMLS_CC) - TSRMLS_CC) < 0) { + TSRMLS_CC) == (size_t)-1) { len = exif_process_string_raw(pszInfoPtr, szValuePtr, ByteCount); } return len; @@ -2690,8 +2692,8 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_field, int tag, char *szValuePtr, int ByteCount TSRMLS_DC) { xp_field->tag = tag; - - /* Copy the comment */ + + /* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */ if (zend_multibyte_encoding_converter( (unsigned char**)&xp_field->value, &xp_field->size, @@ -2699,7 +2701,7 @@ static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_fi ByteCount, zend_multibyte_fetch_encoding(ImageInfo->encode_unicode TSRMLS_CC), zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_unicode_be : ImageInfo->decode_unicode_le TSRMLS_CC) - TSRMLS_CC) < 0) { + TSRMLS_CC) == (size_t)-1) { xp_field->size = exif_process_string_raw(&xp_field->value, szValuePtr, ByteCount); } return xp_field->size; diff --git a/ext/exif/tests/bug62523_1.jpg b/ext/exif/tests/bug62523_1.jpg new file mode 100644 index 0000000000000..9a63d1e84d90b --- /dev/null +++ b/ext/exif/tests/bug62523_1.jpg @@ -0,0 +1,9 @@ + + +301 Moved Permanently + +

Moved Permanently

+

The document has moved here.

+
+
Apache Server at getid3.org Port 80
+ diff --git a/ext/exif/tests/bug62523_1.phpt b/ext/exif/tests/bug62523_1.phpt new file mode 100644 index 0000000000000..28d42f021d073 --- /dev/null +++ b/ext/exif/tests/bug62523_1.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug 62523 (php crashes with segfault when exif_read_data called) +--SKIPIF-- + +--FILE-- + +Done +--EXPECTF-- +Test + +Warning: exif_read_data(bug62523_1.jpg): File not supported in %sbug62523_1.php on line %d +int(1) +Done diff --git a/ext/exif/tests/bug62523_2.jpg b/ext/exif/tests/bug62523_2.jpg new file mode 100644 index 0000000000000..8d7fc6c5f41ba Binary files /dev/null and b/ext/exif/tests/bug62523_2.jpg differ diff --git a/ext/exif/tests/bug62523_2.phpt b/ext/exif/tests/bug62523_2.phpt new file mode 100644 index 0000000000000..ddc8ae824e82e --- /dev/null +++ b/ext/exif/tests/bug62523_2.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug 62523 (php crashes with segfault when exif_read_data called) +--SKIPIF-- + +--FILE-- + +Done +--EXPECT-- +Test +int(76) +Done diff --git a/ext/exif/tests/bug62523_3.jpg b/ext/exif/tests/bug62523_3.jpg new file mode 100644 index 0000000000000..3ee91368ceb86 --- /dev/null +++ b/ext/exif/tests/bug62523_3.jpg @@ -0,0 +1,12 @@ + + Found + +

Found

+

The resource was found at http://dl.dropboxusercontent.com/u/7562584/Bugs/Php/bad_exif.jpeg; +you should be redirected automatically. + +

+
+
WSGI Server
+ + diff --git a/ext/exif/tests/bug62523_3.phpt b/ext/exif/tests/bug62523_3.phpt new file mode 100644 index 0000000000000..6e11354c5a725 --- /dev/null +++ b/ext/exif/tests/bug62523_3.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug 62523 (php crashes with segfault when exif_read_data called) +--SKIPIF-- + +--FILE-- + +Done +--EXPECTF-- +Test + +Warning: exif_read_data(bug62523_3.jpg): File not supported in %sbug62523_3.php on line %d +int(1) +Done diff --git a/ext/exif/tests/exif_encoding_crash.jpg b/ext/exif/tests/exif_encoding_crash.jpg new file mode 100644 index 0000000000000..55138abe55210 Binary files /dev/null and b/ext/exif/tests/exif_encoding_crash.jpg differ diff --git a/ext/exif/tests/exif_encoding_crash.phpt b/ext/exif/tests/exif_encoding_crash.phpt new file mode 100644 index 0000000000000..1c4ad63860346 --- /dev/null +++ b/ext/exif/tests/exif_encoding_crash.phpt @@ -0,0 +1,14 @@ +--TEST-- +PHP crash when zend_multibyte_encoding_converter returns (size_t)-1) +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +*** no core dump *** +===DONE=== diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index b8df2183b9d86..39433d6ece8b4 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -484,10 +484,6 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ } s++; } - - if (*(e - 1) == '.') { - goto bad_url; - } } if ( @@ -718,6 +714,7 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ if (flags & FILTER_FLAG_NO_RES_RANGE) { if ( (ip[0] == 0) || + (ip[0] == 100 && (ip[1] >= 64 && ip[1] <= 127)) || (ip[0] == 128 && ip[1] == 0) || (ip[0] == 191 && ip[1] == 255) || (ip[0] == 169 && ip[1] == 254) || diff --git a/ext/filter/tests/018.phpt b/ext/filter/tests/018.phpt index af52b2e60d67e..75bbd13427994 100644 --- a/ext/filter/tests/018.phpt +++ b/ext/filter/tests/018.phpt @@ -15,6 +15,8 @@ var_dump(filter_var("192.168.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE var_dump(filter_var("192.0.34.166", FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE)); var_dump(filter_var("127.0.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE)); var_dump(filter_var("192.0.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE)); +var_dump(filter_var("100.64.0.0", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE)); +var_dump(filter_var("100.127.255.255", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE)); var_dump(filter_var("192.0.34.166", FILTER_VALIDATE_IP)); var_dump(filter_var("256.1237.123.1", FILTER_VALIDATE_IP)); var_dump(filter_var("255.255.255.255", FILTER_VALIDATE_IP)); @@ -40,6 +42,8 @@ bool(false) string(12) "192.0.34.166" bool(false) string(9) "192.0.0.1" +bool(false) +bool(false) string(12) "192.0.34.166" bool(false) string(15) "255.255.255.255" diff --git a/ext/filter/tests/bug64441.phpt b/ext/filter/tests/bug64441.phpt new file mode 100644 index 0000000000000..149079ec05323 --- /dev/null +++ b/ext/filter/tests/bug64441.phpt @@ -0,0 +1,11 @@ +--TEST-- +bug 64441, FILTER_VALIDATE_URL will invalidate a hostname that ended by dot +--SKIPIF-- + +--FILE-- +inbuf) { + if (response) { *response = estrdup(ftp->inbuf); } @@ -1638,7 +1638,7 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) if (ftp->resp == 226) { ftp->data = data_close(ftp, data); php_stream_close(tmpstream); - return ecalloc(1, sizeof(char**)); + return ecalloc(1, sizeof(char*)); } /* pull data buffer into tmpfile */ @@ -1666,11 +1666,11 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) } } - ftp->data = data = data_close(ftp, data); + ftp->data = data_close(ftp, data); php_stream_rewind(tmpstream); - ret = safe_emalloc((lines + 1), sizeof(char**), size * sizeof(char*)); + ret = safe_emalloc((lines + 1), sizeof(char*), size); entry = ret; text = (char*) (ret + lines + 1); diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index da22e0b63eb3a..21e13ea460563 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -968,7 +968,9 @@ PHP_FUNCTION(ftp_nb_get) RETURN_LONG(PHP_FTP_FAILED); } - php_stream_close(outstream); + if (ret == PHP_FTP_FINISHED){ + php_stream_close(outstream); + } RETURN_LONG(ret); } diff --git a/ext/ftp/tests/ftp_fget_basic1.phpt b/ext/ftp/tests/ftp_fget_basic1.phpt index 475f7183d2532..5909d35cef608 100644 --- a/ext/ftp/tests/ftp_fget_basic1.phpt +++ b/ext/ftp/tests/ftp_fget_basic1.phpt @@ -16,7 +16,7 @@ ftp_login($ftp, 'user', 'pass'); if (!$ftp) die("Couldn't connect to the server"); ftp_set_option($ftp, FTP_AUTOSEEK, false); -$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic1.txt"; $handle = fopen($local_file, 'w'); var_dump(ftp_fget($ftp, $handle, 'fget.txt', FTP_ASCII, FTP_AUTORESUME)); @@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file)); ?> --CLEAN-- --EXPECT-- bool(true) diff --git a/ext/ftp/tests/ftp_fget_basic2.phpt b/ext/ftp/tests/ftp_fget_basic2.phpt index 00a26752d9150..622cea3683b0d 100644 --- a/ext/ftp/tests/ftp_fget_basic2.phpt +++ b/ext/ftp/tests/ftp_fget_basic2.phpt @@ -15,7 +15,7 @@ $ftp = ftp_connect('127.0.0.1', $port); ftp_login($ftp, 'user', 'pass'); if (!$ftp) die("Couldn't connect to the server"); -$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic2.txt"; file_put_contents($local_file, 'ASCIIFoo'); $handle = fopen($local_file, 'a'); @@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file)); ?> --CLEAN-- --EXPECT-- bool(true) diff --git a/ext/ftp/tests/ftp_fget_basic3.phpt b/ext/ftp/tests/ftp_fget_basic3.phpt index b7098701ab12e..9485473b1c6a3 100644 --- a/ext/ftp/tests/ftp_fget_basic3.phpt +++ b/ext/ftp/tests/ftp_fget_basic3.phpt @@ -15,7 +15,7 @@ $ftp = ftp_connect('127.0.0.1', $port); ftp_login($ftp, 'user', 'pass'); if (!$ftp) die("Couldn't connect to the server"); -$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic3.txt"; file_put_contents($local_file, 'ASCIIFoo'); $handle = fopen($local_file, 'a'); @@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file)); ?> --CLEAN-- --EXPECT-- bool(true) diff --git a/ext/ftp/tests/ftp_nb_continue.phpt b/ext/ftp/tests/ftp_nb_continue.phpt new file mode 100644 index 0000000000000..1f703399139bf --- /dev/null +++ b/ext/ftp/tests/ftp_nb_continue.phpt @@ -0,0 +1,182 @@ +--TEST-- +Testing whether ftp_nb_continue() fetches more data +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECT-- +This is line 0 of the test data. +This is line 1 of the test data. +This is line 2 of the test data. +This is line 3 of the test data. +This is line 4 of the test data. +This is line 5 of the test data. +This is line 6 of the test data. +This is line 7 of the test data. +This is line 8 of the test data. +This is line 9 of the test data. +This is line 10 of the test data. +This is line 11 of the test data. +This is line 12 of the test data. +This is line 13 of the test data. +This is line 14 of the test data. +This is line 15 of the test data. +This is line 16 of the test data. +This is line 17 of the test data. +This is line 18 of the test data. +This is line 19 of the test data. +This is line 20 of the test data. +This is line 21 of the test data. +This is line 22 of the test data. +This is line 23 of the test data. +This is line 24 of the test data. +This is line 25 of the test data. +This is line 26 of the test data. +This is line 27 of the test data. +This is line 28 of the test data. +This is line 29 of the test data. +This is line 30 of the test data. +This is line 31 of the test data. +This is line 32 of the test data. +This is line 33 of the test data. +This is line 34 of the test data. +This is line 35 of the test data. +This is line 36 of the test data. +This is line 37 of the test data. +This is line 38 of the test data. +This is line 39 of the test data. +This is line 40 of the test data. +This is line 41 of the test data. +This is line 42 of the test data. +This is line 43 of the test data. +This is line 44 of the test data. +This is line 45 of the test data. +This is line 46 of the test data. +This is line 47 of the test data. +This is line 48 of the test data. +This is line 49 of the test data. +This is line 50 of the test data. +This is line 51 of the test data. +This is line 52 of the test data. +This is line 53 of the test data. +This is line 54 of the test data. +This is line 55 of the test data. +This is line 56 of the test data. +This is line 57 of the test data. +This is line 58 of the test data. +This is line 59 of the test data. +This is line 60 of the test data. +This is line 61 of the test data. +This is line 62 of the test data. +This is line 63 of the test data. +This is line 64 of the test data. +This is line 65 of the test data. +This is line 66 of the test data. +This is line 67 of the test data. +This is line 68 of the test data. +This is line 69 of the test data. +This is line 70 of the test data. +This is line 71 of the test data. +This is line 72 of the test data. +This is line 73 of the test data. +This is line 74 of the test data. +This is line 75 of the test data. +This is line 76 of the test data. +This is line 77 of the test data. +This is line 78 of the test data. +This is line 79 of the test data. +This is line 80 of the test data. +This is line 81 of the test data. +This is line 82 of the test data. +This is line 83 of the test data. +This is line 84 of the test data. +This is line 85 of the test data. +This is line 86 of the test data. +This is line 87 of the test data. +This is line 88 of the test data. +This is line 89 of the test data. +This is line 90 of the test data. +This is line 91 of the test data. +This is line 92 of the test data. +This is line 93 of the test data. +This is line 94 of the test data. +This is line 95 of the test data. +This is line 96 of the test data. +This is line 97 of the test data. +This is line 98 of the test data. +This is line 99 of the test data. +This is line 100 of the test data. +This is line 101 of the test data. +This is line 102 of the test data. +This is line 103 of the test data. +This is line 104 of the test data. +This is line 105 of the test data. +This is line 106 of the test data. +This is line 107 of the test data. +This is line 108 of the test data. +This is line 109 of the test data. +This is line 110 of the test data. +This is line 111 of the test data. +This is line 112 of the test data. +This is line 113 of the test data. +This is line 114 of the test data. +This is line 115 of the test data. +This is line 116 of the test data. +This is line 117 of the test data. +This is line 118 of the test data. +This is line 119 of the test data. +This is line 120 of the test data. +This is line 121 of the test data. +This is line 122 of the test data. +This is line 123 of the test data. +This is line 124 of the test data. +This is line 125 of the test data. +This is line 126 of the test data. +This is line 127 of the test data. +This is line 128 of the test data. +This is line 129 of the test data. +This is line 130 of the test data. +This is line 131 of the test data. +This is line 132 of the test data. +This is line 133 of the test data. +This is line 134 of the test data. +This is line 135 of the test data. +This is line 136 of the test data. +This is line 137 of the test data. +This is line 138 of the test data. +This is line 139 of the test data. +This is line 140 of the test data. +This is line 141 of the test data. +This is line 142 of the test data. +This is line 143 of the test data. +This is line 144 of the test data. +This is line 145 of the test data. +This is line 146 of the test data. +This is line 147 of the test data. +This is line 148 of the test data. +This is line 149 of the test data. diff --git a/ext/ftp/tests/ftp_nb_fget_basic1.phpt b/ext/ftp/tests/ftp_nb_fget_basic1.phpt index cac4eec56bc99..5e6389ff1336a 100644 --- a/ext/ftp/tests/ftp_nb_fget_basic1.phpt +++ b/ext/ftp/tests/ftp_nb_fget_basic1.phpt @@ -16,7 +16,7 @@ ftp_login($ftp, 'user', 'pass'); if (!$ftp) die("Couldn't connect to the server"); ftp_set_option($ftp, FTP_AUTOSEEK, false); -$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic1.txt"; $handle = fopen($local_file, 'w'); var_dump(ftp_nb_fget($ftp, $handle, 'fget.txt', FTP_ASCII, FTP_AUTORESUME)); @@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file)); ?> --CLEAN-- --EXPECT-- int(2) diff --git a/ext/ftp/tests/ftp_nb_fget_basic2.phpt b/ext/ftp/tests/ftp_nb_fget_basic2.phpt index dc92f4e23bc99..215b79ac4a986 100644 --- a/ext/ftp/tests/ftp_nb_fget_basic2.phpt +++ b/ext/ftp/tests/ftp_nb_fget_basic2.phpt @@ -15,7 +15,7 @@ $ftp = ftp_connect('127.0.0.1', $port); ftp_login($ftp, 'user', 'pass'); if (!$ftp) die("Couldn't connect to the server"); -$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic2.txt"; file_put_contents($local_file, 'ASCIIFoo'); $handle = fopen($local_file, 'a'); @@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file)); ?> --CLEAN-- --EXPECT-- int(2) diff --git a/ext/ftp/tests/ftp_nb_fget_basic3.phpt b/ext/ftp/tests/ftp_nb_fget_basic3.phpt index d1a87c4f3dfe3..66daf2ba0a030 100644 --- a/ext/ftp/tests/ftp_nb_fget_basic3.phpt +++ b/ext/ftp/tests/ftp_nb_fget_basic3.phpt @@ -15,7 +15,7 @@ $ftp = ftp_connect('127.0.0.1', $port); ftp_login($ftp, 'user', 'pass'); if (!$ftp) die("Couldn't connect to the server"); -$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic3.txt"; file_put_contents($local_file, 'ASCIIFoo'); $handle = fopen($local_file, 'a'); @@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file)); ?> --CLEAN-- --EXPECT-- int(2) diff --git a/ext/ftp/tests/ftp_nb_get_large.phpt b/ext/ftp/tests/ftp_nb_get_large.phpt index 3fbf2a4831d14..0c354d7c1978f 100644 --- a/ext/ftp/tests/ftp_nb_get_large.phpt +++ b/ext/ftp/tests/ftp_nb_get_large.phpt @@ -18,7 +18,7 @@ $ftp = ftp_connect('127.0.0.1', $port); ftp_login($ftp, 'user', 'pass'); if (!$ftp) die("Couldn't connect to the server"); -$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_get_large.txt"; touch($local_file); ftp_nb_get($ftp, $local_file, 'fget_large.txt', FTP_BINARY, 5368709119); $fp = fopen($local_file, 'r'); @@ -29,7 +29,7 @@ fclose($fp); ?> --CLEAN-- --EXPECT-- string(1) "X" diff --git a/ext/ftp/tests/server.inc b/ext/ftp/tests/server.inc index 7dc8fa08d99ff..bb0c1ff10bec9 100644 --- a/ext/ftp/tests/server.inc +++ b/ext/ftp/tests/server.inc @@ -368,6 +368,13 @@ if ($pid) { } fputs($s, "226 Closing data Connection.\r\n"); break; + case "mediumfile": + fputs($s, "150 File status okay; about to open data connection.\r\n"); + for($i = 0; $i < 150; $i++){ + fputs($fs, "This is line $i of the test data.\n"); + } + fputs($s, "226 Closing data Connection.\r\n"); + default: fputs($s, "550 {$matches[1]}: No such file or directory \r\n"); break; diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c index b6e7c69201f9b..e34242bb73646 100644 --- a/ext/gd/libgd/gd_interpolation.c +++ b/ext/gd/libgd/gd_interpolation.c @@ -1063,6 +1063,7 @@ gdImagePtr gdImageScaleTwoPass(const gdImagePtr src, const unsigned int src_widt if (tmp_im == NULL) { return NULL; } + gdImageSetInterpolationMethod(tmp_im, src->interpolation_id); _gdScaleHoriz(src, src_width, src_height, tmp_im, new_width, src_height); dst = gdImageCreateTrueColor(new_width, new_height); @@ -1070,6 +1071,7 @@ gdImagePtr gdImageScaleTwoPass(const gdImagePtr src, const unsigned int src_widt gdFree(tmp_im); return NULL; } + gdImageSetInterpolationMethod(dst, src->interpolation_id); _gdScaleVert(tmp_im, new_width, src_height, dst, new_width, new_height); gdFree(tmp_im); @@ -1084,8 +1086,9 @@ gdImagePtr Scale(const gdImagePtr src, const unsigned int src_width, const unsig if (tmp_im == NULL) { return NULL; } - _gdScaleHoriz(src, src_width, src_height, tmp_im, new_width, src_height); + gdImageSetInterpolationMethod(tmp_im, src->interpolation_id); + _gdScaleHoriz(src, src_width, src_height, tmp_im, new_width, src_height); _gdScaleVert(tmp_im, new_width, src_height, dst, new_width, new_height); gdFree(tmp_im); diff --git a/ext/gd/php_gd.h b/ext/gd/php_gd.h index 269c315e88be5..22fac40dd0ea3 100644 --- a/ext/gd/php_gd.h +++ b/ext/gd/php_gd.h @@ -59,7 +59,7 @@ PHPAPI extern const char php_sig_gif[3]; PHPAPI extern const char php_sig_jpg[3]; -PHPAPI extern const char php_sig_png[3]; +PHPAPI extern const char php_sig_png[8]; extern zend_module_entry gd_module_entry; #define phpext_gd_ptr &gd_module_entry diff --git a/ext/hash/hash.c b/ext/hash/hash.c index 117221484e363..87f19c5cacb1e 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -986,6 +986,7 @@ PHP_MINIT_FUNCTION(hash) php_hash_register_algo("snefru", &php_hash_snefru_ops); php_hash_register_algo("snefru256", &php_hash_snefru_ops); php_hash_register_algo("gost", &php_hash_gost_ops); + php_hash_register_algo("gost-crypto", &php_hash_gost_crypto_ops); php_hash_register_algo("adler32", &php_hash_adler32_ops); php_hash_register_algo("crc32", &php_hash_crc32_ops); php_hash_register_algo("crc32b", &php_hash_crc32b_ops); diff --git a/ext/hash/hash_gost.c b/ext/hash/hash_gost.c index 3961c4f2d5c36..da65bb5903e62 100644 --- a/ext/hash/hash_gost.c +++ b/ext/hash/hash_gost.c @@ -27,7 +27,7 @@ * derived from gost_compress() by Markku-Juhani Saarinen */ -#define round(k1, k2) \ +#define round(tables, k1, k2) \ t = (k1) + r; \ l ^= tables[0][t & 0xff] ^ tables[1][(t >> 8) & 0xff] ^ \ tables[2][(t >> 16) & 0xff] ^ tables[3][t >> 24]; \ @@ -35,25 +35,25 @@ r ^= tables[0][t & 0xff] ^ tables[1][(t >> 8) & 0xff] ^ \ tables[2][(t >> 16) & 0xff] ^ tables[3][t >> 24]; -#define R(key, h, i, t, l, r) \ +#define R(tables, key, h, i, t, l, r) \ r = h[i]; \ l = h[i + 1]; \ - round(key[0], key[1]) \ - round(key[2], key[3]) \ - round(key[4], key[5]) \ - round(key[6], key[7]) \ - round(key[0], key[1]) \ - round(key[2], key[3]) \ - round(key[4], key[5]) \ - round(key[6], key[7]) \ - round(key[0], key[1]) \ - round(key[2], key[3]) \ - round(key[4], key[5]) \ - round(key[6], key[7]) \ - round(key[7], key[6]) \ - round(key[5], key[4]) \ - round(key[3], key[2]) \ - round(key[1], key[0]) \ + round(tables, key[0], key[1]) \ + round(tables, key[2], key[3]) \ + round(tables, key[4], key[5]) \ + round(tables, key[6], key[7]) \ + round(tables, key[0], key[1]) \ + round(tables, key[2], key[3]) \ + round(tables, key[4], key[5]) \ + round(tables, key[6], key[7]) \ + round(tables, key[0], key[1]) \ + round(tables, key[2], key[3]) \ + round(tables, key[4], key[5]) \ + round(tables, key[6], key[7]) \ + round(tables, key[7], key[6]) \ + round(tables, key[5], key[4]) \ + round(tables, key[3], key[2]) \ + round(tables, key[1], key[0]) \ t = r; \ r = l; \ l = t; \ @@ -194,10 +194,10 @@ (v[3] >> 16) ^ v[3] ^ (v[4] << 16) ^ v[4] ^ (v[5] >> 16) ^ v[5] ^ \ (v[6] << 16) ^ (v[6] >> 16) ^ (v[7] << 16) ^ v[7]; -#define PASS \ +#define PASS(tables) \ X(w, u, v); \ P(key, w); \ - R(key, h, i, t, l, r); \ + R((tables), key, h, i, t, l, r); \ S(s, l, r); \ if (i != 6) { \ A(u, l, r); \ @@ -207,16 +207,16 @@ AA(v, l, r); \ } -static inline void Gost(php_hash_uint32 state[8], php_hash_uint32 data[8]) +static inline void Gost(PHP_GOST_CTX *context, php_hash_uint32 data[8]) { int i; - php_hash_uint32 l, r, t, key[8], u[8], v[8], w[8], s[8], *h = state, *m = data; + php_hash_uint32 l, r, t, key[8], u[8], v[8], w[8], s[8], *h = context->state, *m = data; - memcpy(u, state, sizeof(u)); + memcpy(u, context->state, sizeof(u)); memcpy(v, data, sizeof(v)); for (i = 0; i < 8; i += 2) { - PASS; + PASS(*context->tables); } SHIFT12(u, m, s); SHIFT16(h, v, u); @@ -237,12 +237,19 @@ static inline void GostTransform(PHP_GOST_CTX *context, const unsigned char inpu temp = ((context->state[i + 8] < data[i]) || (context->state[i + 8] < save)) ? 1 : 0; } - Gost(context->state, data); + Gost(context, data); } PHP_HASH_API void PHP_GOSTInit(PHP_GOST_CTX *context) { memset(context, 0, sizeof(*context)); + context->tables = &tables_test; +} + +PHP_HASH_API void PHP_GOSTInitCrypto(PHP_GOST_CTX *context) +{ + PHP_GOSTInit(context); + context->tables = &tables_crypto; } static const php_hash_uint32 MAX32 = 0xffffffffLU; @@ -288,9 +295,9 @@ PHP_HASH_API void PHP_GOSTFinal(unsigned char digest[32], PHP_GOST_CTX *context) } memcpy(l, context->count, sizeof(context->count)); - Gost(context->state, l); + Gost(context, l); memcpy(l, &context->state[8], sizeof(l)); - Gost(context->state, l); + Gost(context, l); for (i = 0, j = 0; j < 32; i++, j += 4) { digest[j] = (unsigned char) (context->state[i] & 0xff); @@ -312,6 +319,16 @@ const php_hash_ops php_hash_gost_ops = { sizeof(PHP_GOST_CTX) }; +const php_hash_ops php_hash_gost_crypto_ops = { + (php_hash_init_func_t) PHP_GOSTInitCrypto, + (php_hash_update_func_t) PHP_GOSTUpdate, + (php_hash_final_func_t) PHP_GOSTFinal, + (php_hash_copy_func_t) php_hash_copy, + 32, + 32, + sizeof(PHP_GOST_CTX) +}; + /* * Local variables: * tab-width: 4 diff --git a/ext/hash/php_hash.h b/ext/hash/php_hash.h index 3f5e7ced3a19b..e92572216aea4 100644 --- a/ext/hash/php_hash.h +++ b/ext/hash/php_hash.h @@ -80,6 +80,7 @@ extern const php_hash_ops php_hash_4tiger160_ops; extern const php_hash_ops php_hash_4tiger192_ops; extern const php_hash_ops php_hash_snefru_ops; extern const php_hash_ops php_hash_gost_ops; +extern const php_hash_ops php_hash_gost_crypto_ops; extern const php_hash_ops php_hash_adler32_ops; extern const php_hash_ops php_hash_crc32_ops; extern const php_hash_ops php_hash_crc32b_ops; diff --git a/ext/hash/php_hash_gost.h b/ext/hash/php_hash_gost.h index 6a4af310dc64c..a9c137530c4ae 100644 --- a/ext/hash/php_hash_gost.h +++ b/ext/hash/php_hash_gost.h @@ -29,6 +29,7 @@ typedef struct { php_hash_uint32 count[2]; unsigned char length; unsigned char buffer[32]; + const php_hash_uint32 (*tables)[4][256]; } PHP_GOST_CTX; PHP_HASH_API void PHP_GOSTInit(PHP_GOST_CTX *); diff --git a/ext/hash/php_hash_gost_tables.h b/ext/hash/php_hash_gost_tables.h index 5d05e593cb13a..a00d8b74907d2 100644 --- a/ext/hash/php_hash_gost_tables.h +++ b/ext/hash/php_hash_gost_tables.h @@ -1,4 +1,4 @@ -static const php_hash_uint32 tables[4][256] = { +static const php_hash_uint32 tables_test[4][256] = { { /* table 1 */ 0x00072000LU, 0x00075000LU, 0x00074800LU, 0x00071000LU, 0x00076800LU, 0x00074000LU, 0x00070000LU, 0x00077000LU, 0x00073000LU, 0x00075800LU, 0x00070800LU, 0x00076000LU, 0x00073800LU, 0x00077800LU, 0x00072800LU, 0x00071800LU, @@ -136,3 +136,142 @@ static const php_hash_uint32 tables[4][256] = { 0x00000600LU, 0x00000650LU, 0x00000670LU, 0x00000638LU, 0x00000630LU, 0x00000640LU, 0x00000610LU, 0x00000660LU, }, }; + +static const php_hash_uint32 tables_crypto[4][256] = { + { /* table 1 */ + 0x0002d000LU, 0x0002a000LU, 0x0002a800LU, 0x0002b000LU, 0x0002c000LU, 0x00028800LU, 0x00029800LU, 0x0002b800LU, + 0x0002e800LU, 0x0002e000LU, 0x0002f000LU, 0x00028000LU, 0x0002c800LU, 0x00029000LU, 0x0002d800LU, 0x0002f800LU, + 0x0007d000LU, 0x0007a000LU, 0x0007a800LU, 0x0007b000LU, 0x0007c000LU, 0x00078800LU, 0x00079800LU, 0x0007b800LU, + 0x0007e800LU, 0x0007e000LU, 0x0007f000LU, 0x00078000LU, 0x0007c800LU, 0x00079000LU, 0x0007d800LU, 0x0007f800LU, + 0x00025000LU, 0x00022000LU, 0x00022800LU, 0x00023000LU, 0x00024000LU, 0x00020800LU, 0x00021800LU, 0x00023800LU, + 0x00026800LU, 0x00026000LU, 0x00027000LU, 0x00020000LU, 0x00024800LU, 0x00021000LU, 0x00025800LU, 0x00027800LU, + 0x00005000LU, 0x00002000LU, 0x00002800LU, 0x00003000LU, 0x00004000LU, 0x00000800LU, 0x00001800LU, 0x00003800LU, + 0x00006800LU, 0x00006000LU, 0x00007000LU, 0x00000000LU, 0x00004800LU, 0x00001000LU, 0x00005800LU, 0x00007800LU, + 0x00015000LU, 0x00012000LU, 0x00012800LU, 0x00013000LU, 0x00014000LU, 0x00010800LU, 0x00011800LU, 0x00013800LU, + 0x00016800LU, 0x00016000LU, 0x00017000LU, 0x00010000LU, 0x00014800LU, 0x00011000LU, 0x00015800LU, 0x00017800LU, + 0x0006d000LU, 0x0006a000LU, 0x0006a800LU, 0x0006b000LU, 0x0006c000LU, 0x00068800LU, 0x00069800LU, 0x0006b800LU, + 0x0006e800LU, 0x0006e000LU, 0x0006f000LU, 0x00068000LU, 0x0006c800LU, 0x00069000LU, 0x0006d800LU, 0x0006f800LU, + 0x0005d000LU, 0x0005a000LU, 0x0005a800LU, 0x0005b000LU, 0x0005c000LU, 0x00058800LU, 0x00059800LU, 0x0005b800LU, + 0x0005e800LU, 0x0005e000LU, 0x0005f000LU, 0x00058000LU, 0x0005c800LU, 0x00059000LU, 0x0005d800LU, 0x0005f800LU, + 0x0004d000LU, 0x0004a000LU, 0x0004a800LU, 0x0004b000LU, 0x0004c000LU, 0x00048800LU, 0x00049800LU, 0x0004b800LU, + 0x0004e800LU, 0x0004e000LU, 0x0004f000LU, 0x00048000LU, 0x0004c800LU, 0x00049000LU, 0x0004d800LU, 0x0004f800LU, + 0x0000d000LU, 0x0000a000LU, 0x0000a800LU, 0x0000b000LU, 0x0000c000LU, 0x00008800LU, 0x00009800LU, 0x0000b800LU, + 0x0000e800LU, 0x0000e000LU, 0x0000f000LU, 0x00008000LU, 0x0000c800LU, 0x00009000LU, 0x0000d800LU, 0x0000f800LU, + 0x0003d000LU, 0x0003a000LU, 0x0003a800LU, 0x0003b000LU, 0x0003c000LU, 0x00038800LU, 0x00039800LU, 0x0003b800LU, + 0x0003e800LU, 0x0003e000LU, 0x0003f000LU, 0x00038000LU, 0x0003c800LU, 0x00039000LU, 0x0003d800LU, 0x0003f800LU, + 0x00035000LU, 0x00032000LU, 0x00032800LU, 0x00033000LU, 0x00034000LU, 0x00030800LU, 0x00031800LU, 0x00033800LU, + 0x00036800LU, 0x00036000LU, 0x00037000LU, 0x00030000LU, 0x00034800LU, 0x00031000LU, 0x00035800LU, 0x00037800LU, + 0x0001d000LU, 0x0001a000LU, 0x0001a800LU, 0x0001b000LU, 0x0001c000LU, 0x00018800LU, 0x00019800LU, 0x0001b800LU, + 0x0001e800LU, 0x0001e000LU, 0x0001f000LU, 0x00018000LU, 0x0001c800LU, 0x00019000LU, 0x0001d800LU, 0x0001f800LU, + 0x00065000LU, 0x00062000LU, 0x00062800LU, 0x00063000LU, 0x00064000LU, 0x00060800LU, 0x00061800LU, 0x00063800LU, + 0x00066800LU, 0x00066000LU, 0x00067000LU, 0x00060000LU, 0x00064800LU, 0x00061000LU, 0x00065800LU, 0x00067800LU, + 0x00075000LU, 0x00072000LU, 0x00072800LU, 0x00073000LU, 0x00074000LU, 0x00070800LU, 0x00071800LU, 0x00073800LU, + 0x00076800LU, 0x00076000LU, 0x00077000LU, 0x00070000LU, 0x00074800LU, 0x00071000LU, 0x00075800LU, 0x00077800LU, + 0x00055000LU, 0x00052000LU, 0x00052800LU, 0x00053000LU, 0x00054000LU, 0x00050800LU, 0x00051800LU, 0x00053800LU, + 0x00056800LU, 0x00056000LU, 0x00057000LU, 0x00050000LU, 0x00054800LU, 0x00051000LU, 0x00055800LU, 0x00057800LU, + 0x00045000LU, 0x00042000LU, 0x00042800LU, 0x00043000LU, 0x00044000LU, 0x00040800LU, 0x00041800LU, 0x00043800LU, + 0x00046800LU, 0x00046000LU, 0x00047000LU, 0x00040000LU, 0x00044800LU, 0x00041000LU, 0x00045800LU, 0x00047800LU, + }, + { /* table 2 */ + 0x02380000LU, 0x02780000LU, 0x02600000LU, 0x02700000LU, 0x02480000LU, 0x02200000LU, 0x02080000LU, 0x02000000LU, + 0x02180000LU, 0x02580000LU, 0x02280000LU, 0x02100000LU, 0x02300000LU, 0x02500000LU, 0x02400000LU, 0x02680000LU, + 0x05380000LU, 0x05780000LU, 0x05600000LU, 0x05700000LU, 0x05480000LU, 0x05200000LU, 0x05080000LU, 0x05000000LU, + 0x05180000LU, 0x05580000LU, 0x05280000LU, 0x05100000LU, 0x05300000LU, 0x05500000LU, 0x05400000LU, 0x05680000LU, + 0x03b80000LU, 0x03f80000LU, 0x03e00000LU, 0x03f00000LU, 0x03c80000LU, 0x03a00000LU, 0x03880000LU, 0x03800000LU, + 0x03980000LU, 0x03d80000LU, 0x03a80000LU, 0x03900000LU, 0x03b00000LU, 0x03d00000LU, 0x03c00000LU, 0x03e80000LU, + 0x06380000LU, 0x06780000LU, 0x06600000LU, 0x06700000LU, 0x06480000LU, 0x06200000LU, 0x06080000LU, 0x06000000LU, + 0x06180000LU, 0x06580000LU, 0x06280000LU, 0x06100000LU, 0x06300000LU, 0x06500000LU, 0x06400000LU, 0x06680000LU, + 0x00380000LU, 0x00780000LU, 0x00600000LU, 0x00700000LU, 0x00480000LU, 0x00200000LU, 0x00080000LU, 0x00000000LU, + 0x00180000LU, 0x00580000LU, 0x00280000LU, 0x00100000LU, 0x00300000LU, 0x00500000LU, 0x00400000LU, 0x00680000LU, + 0x07b80000LU, 0x07f80000LU, 0x07e00000LU, 0x07f00000LU, 0x07c80000LU, 0x07a00000LU, 0x07880000LU, 0x07800000LU, + 0x07980000LU, 0x07d80000LU, 0x07a80000LU, 0x07900000LU, 0x07b00000LU, 0x07d00000LU, 0x07c00000LU, 0x07e80000LU, + 0x01380000LU, 0x01780000LU, 0x01600000LU, 0x01700000LU, 0x01480000LU, 0x01200000LU, 0x01080000LU, 0x01000000LU, + 0x01180000LU, 0x01580000LU, 0x01280000LU, 0x01100000LU, 0x01300000LU, 0x01500000LU, 0x01400000LU, 0x01680000LU, + 0x04380000LU, 0x04780000LU, 0x04600000LU, 0x04700000LU, 0x04480000LU, 0x04200000LU, 0x04080000LU, 0x04000000LU, + 0x04180000LU, 0x04580000LU, 0x04280000LU, 0x04100000LU, 0x04300000LU, 0x04500000LU, 0x04400000LU, 0x04680000LU, + 0x07380000LU, 0x07780000LU, 0x07600000LU, 0x07700000LU, 0x07480000LU, 0x07200000LU, 0x07080000LU, 0x07000000LU, + 0x07180000LU, 0x07580000LU, 0x07280000LU, 0x07100000LU, 0x07300000LU, 0x07500000LU, 0x07400000LU, 0x07680000LU, + 0x00b80000LU, 0x00f80000LU, 0x00e00000LU, 0x00f00000LU, 0x00c80000LU, 0x00a00000LU, 0x00880000LU, 0x00800000LU, + 0x00980000LU, 0x00d80000LU, 0x00a80000LU, 0x00900000LU, 0x00b00000LU, 0x00d00000LU, 0x00c00000LU, 0x00e80000LU, + 0x03380000LU, 0x03780000LU, 0x03600000LU, 0x03700000LU, 0x03480000LU, 0x03200000LU, 0x03080000LU, 0x03000000LU, + 0x03180000LU, 0x03580000LU, 0x03280000LU, 0x03100000LU, 0x03300000LU, 0x03500000LU, 0x03400000LU, 0x03680000LU, + 0x02b80000LU, 0x02f80000LU, 0x02e00000LU, 0x02f00000LU, 0x02c80000LU, 0x02a00000LU, 0x02880000LU, 0x02800000LU, + 0x02980000LU, 0x02d80000LU, 0x02a80000LU, 0x02900000LU, 0x02b00000LU, 0x02d00000LU, 0x02c00000LU, 0x02e80000LU, + 0x06b80000LU, 0x06f80000LU, 0x06e00000LU, 0x06f00000LU, 0x06c80000LU, 0x06a00000LU, 0x06880000LU, 0x06800000LU, + 0x06980000LU, 0x06d80000LU, 0x06a80000LU, 0x06900000LU, 0x06b00000LU, 0x06d00000LU, 0x06c00000LU, 0x06e80000LU, + 0x05b80000LU, 0x05f80000LU, 0x05e00000LU, 0x05f00000LU, 0x05c80000LU, 0x05a00000LU, 0x05880000LU, 0x05800000LU, + 0x05980000LU, 0x05d80000LU, 0x05a80000LU, 0x05900000LU, 0x05b00000LU, 0x05d00000LU, 0x05c00000LU, 0x05e80000LU, + 0x04b80000LU, 0x04f80000LU, 0x04e00000LU, 0x04f00000LU, 0x04c80000LU, 0x04a00000LU, 0x04880000LU, 0x04800000LU, + 0x04980000LU, 0x04d80000LU, 0x04a80000LU, 0x04900000LU, 0x04b00000LU, 0x04d00000LU, 0x04c00000LU, 0x04e80000LU, + 0x01b80000LU, 0x01f80000LU, 0x01e00000LU, 0x01f00000LU, 0x01c80000LU, 0x01a00000LU, 0x01880000LU, 0x01800000LU, + 0x01980000LU, 0x01d80000LU, 0x01a80000LU, 0x01900000LU, 0x01b00000LU, 0x01d00000LU, 0x01c00000LU, 0x01e80000LU, + }, + { /* table 3 */ + 0xb8000003LU, 0xb0000003LU, 0xa0000003LU, 0xd8000003LU, 0xc8000003LU, 0xe0000003LU, 0x90000003LU, 0xd0000003LU, + 0x88000003LU, 0xc0000003LU, 0x80000003LU, 0xf0000003LU, 0xf8000003LU, 0xe8000003LU, 0x98000003LU, 0xa8000003LU, + 0x38000003LU, 0x30000003LU, 0x20000003LU, 0x58000003LU, 0x48000003LU, 0x60000003LU, 0x10000003LU, 0x50000003LU, + 0x08000003LU, 0x40000003LU, 0x00000003LU, 0x70000003LU, 0x78000003LU, 0x68000003LU, 0x18000003LU, 0x28000003LU, + 0x38000001LU, 0x30000001LU, 0x20000001LU, 0x58000001LU, 0x48000001LU, 0x60000001LU, 0x10000001LU, 0x50000001LU, + 0x08000001LU, 0x40000001LU, 0x00000001LU, 0x70000001LU, 0x78000001LU, 0x68000001LU, 0x18000001LU, 0x28000001LU, + 0x38000002LU, 0x30000002LU, 0x20000002LU, 0x58000002LU, 0x48000002LU, 0x60000002LU, 0x10000002LU, 0x50000002LU, + 0x08000002LU, 0x40000002LU, 0x00000002LU, 0x70000002LU, 0x78000002LU, 0x68000002LU, 0x18000002LU, 0x28000002LU, + 0xb8000006LU, 0xb0000006LU, 0xa0000006LU, 0xd8000006LU, 0xc8000006LU, 0xe0000006LU, 0x90000006LU, 0xd0000006LU, + 0x88000006LU, 0xc0000006LU, 0x80000006LU, 0xf0000006LU, 0xf8000006LU, 0xe8000006LU, 0x98000006LU, 0xa8000006LU, + 0xb8000004LU, 0xb0000004LU, 0xa0000004LU, 0xd8000004LU, 0xc8000004LU, 0xe0000004LU, 0x90000004LU, 0xd0000004LU, + 0x88000004LU, 0xc0000004LU, 0x80000004LU, 0xf0000004LU, 0xf8000004LU, 0xe8000004LU, 0x98000004LU, 0xa8000004LU, + 0xb8000007LU, 0xb0000007LU, 0xa0000007LU, 0xd8000007LU, 0xc8000007LU, 0xe0000007LU, 0x90000007LU, 0xd0000007LU, + 0x88000007LU, 0xc0000007LU, 0x80000007LU, 0xf0000007LU, 0xf8000007LU, 0xe8000007LU, 0x98000007LU, 0xa8000007LU, + 0x38000000LU, 0x30000000LU, 0x20000000LU, 0x58000000LU, 0x48000000LU, 0x60000000LU, 0x10000000LU, 0x50000000LU, + 0x08000000LU, 0x40000000LU, 0x00000000LU, 0x70000000LU, 0x78000000LU, 0x68000000LU, 0x18000000LU, 0x28000000LU, + 0x38000005LU, 0x30000005LU, 0x20000005LU, 0x58000005LU, 0x48000005LU, 0x60000005LU, 0x10000005LU, 0x50000005LU, + 0x08000005LU, 0x40000005LU, 0x00000005LU, 0x70000005LU, 0x78000005LU, 0x68000005LU, 0x18000005LU, 0x28000005LU, + 0xb8000000LU, 0xb0000000LU, 0xa0000000LU, 0xd8000000LU, 0xc8000000LU, 0xe0000000LU, 0x90000000LU, 0xd0000000LU, + 0x88000000LU, 0xc0000000LU, 0x80000000LU, 0xf0000000LU, 0xf8000000LU, 0xe8000000LU, 0x98000000LU, 0xa8000000LU, + 0xb8000002LU, 0xb0000002LU, 0xa0000002LU, 0xd8000002LU, 0xc8000002LU, 0xe0000002LU, 0x90000002LU, 0xd0000002LU, + 0x88000002LU, 0xc0000002LU, 0x80000002LU, 0xf0000002LU, 0xf8000002LU, 0xe8000002LU, 0x98000002LU, 0xa8000002LU, + 0xb8000005LU, 0xb0000005LU, 0xa0000005LU, 0xd8000005LU, 0xc8000005LU, 0xe0000005LU, 0x90000005LU, 0xd0000005LU, + 0x88000005LU, 0xc0000005LU, 0x80000005LU, 0xf0000005LU, 0xf8000005LU, 0xe8000005LU, 0x98000005LU, 0xa8000005LU, + 0x38000004LU, 0x30000004LU, 0x20000004LU, 0x58000004LU, 0x48000004LU, 0x60000004LU, 0x10000004LU, 0x50000004LU, + 0x08000004LU, 0x40000004LU, 0x00000004LU, 0x70000004LU, 0x78000004LU, 0x68000004LU, 0x18000004LU, 0x28000004LU, + 0x38000007LU, 0x30000007LU, 0x20000007LU, 0x58000007LU, 0x48000007LU, 0x60000007LU, 0x10000007LU, 0x50000007LU, + 0x08000007LU, 0x40000007LU, 0x00000007LU, 0x70000007LU, 0x78000007LU, 0x68000007LU, 0x18000007LU, 0x28000007LU, + 0x38000006LU, 0x30000006LU, 0x20000006LU, 0x58000006LU, 0x48000006LU, 0x60000006LU, 0x10000006LU, 0x50000006LU, + 0x08000006LU, 0x40000006LU, 0x00000006LU, 0x70000006LU, 0x78000006LU, 0x68000006LU, 0x18000006LU, 0x28000006LU, + 0xb8000001LU, 0xb0000001LU, 0xa0000001LU, 0xd8000001LU, 0xc8000001LU, 0xe0000001LU, 0x90000001LU, 0xd0000001LU, + 0x88000001LU, 0xc0000001LU, 0x80000001LU, 0xf0000001LU, 0xf8000001LU, 0xe8000001LU, 0x98000001LU, 0xa8000001LU, + }, + { /* table 4 */ + 0x000000e8LU, 0x000000f0LU, 0x000000a0LU, 0x00000088LU, 0x000000b8LU, 0x00000080LU, 0x000000a8LU, 0x000000d0LU, + 0x00000098LU, 0x000000e0LU, 0x000000c0LU, 0x000000f8LU, 0x000000b0LU, 0x00000090LU, 0x000000c8LU, 0x000000d8LU, + 0x000001e8LU, 0x000001f0LU, 0x000001a0LU, 0x00000188LU, 0x000001b8LU, 0x00000180LU, 0x000001a8LU, 0x000001d0LU, + 0x00000198LU, 0x000001e0LU, 0x000001c0LU, 0x000001f8LU, 0x000001b0LU, 0x00000190LU, 0x000001c8LU, 0x000001d8LU, + 0x00000568LU, 0x00000570LU, 0x00000520LU, 0x00000508LU, 0x00000538LU, 0x00000500LU, 0x00000528LU, 0x00000550LU, + 0x00000518LU, 0x00000560LU, 0x00000540LU, 0x00000578LU, 0x00000530LU, 0x00000510LU, 0x00000548LU, 0x00000558LU, + 0x000004e8LU, 0x000004f0LU, 0x000004a0LU, 0x00000488LU, 0x000004b8LU, 0x00000480LU, 0x000004a8LU, 0x000004d0LU, + 0x00000498LU, 0x000004e0LU, 0x000004c0LU, 0x000004f8LU, 0x000004b0LU, 0x00000490LU, 0x000004c8LU, 0x000004d8LU, + 0x000002e8LU, 0x000002f0LU, 0x000002a0LU, 0x00000288LU, 0x000002b8LU, 0x00000280LU, 0x000002a8LU, 0x000002d0LU, + 0x00000298LU, 0x000002e0LU, 0x000002c0LU, 0x000002f8LU, 0x000002b0LU, 0x00000290LU, 0x000002c8LU, 0x000002d8LU, + 0x000005e8LU, 0x000005f0LU, 0x000005a0LU, 0x00000588LU, 0x000005b8LU, 0x00000580LU, 0x000005a8LU, 0x000005d0LU, + 0x00000598LU, 0x000005e0LU, 0x000005c0LU, 0x000005f8LU, 0x000005b0LU, 0x00000590LU, 0x000005c8LU, 0x000005d8LU, + 0x00000268LU, 0x00000270LU, 0x00000220LU, 0x00000208LU, 0x00000238LU, 0x00000200LU, 0x00000228LU, 0x00000250LU, + 0x00000218LU, 0x00000260LU, 0x00000240LU, 0x00000278LU, 0x00000230LU, 0x00000210LU, 0x00000248LU, 0x00000258LU, + 0x000007e8LU, 0x000007f0LU, 0x000007a0LU, 0x00000788LU, 0x000007b8LU, 0x00000780LU, 0x000007a8LU, 0x000007d0LU, + 0x00000798LU, 0x000007e0LU, 0x000007c0LU, 0x000007f8LU, 0x000007b0LU, 0x00000790LU, 0x000007c8LU, 0x000007d8LU, + 0x00000468LU, 0x00000470LU, 0x00000420LU, 0x00000408LU, 0x00000438LU, 0x00000400LU, 0x00000428LU, 0x00000450LU, + 0x00000418LU, 0x00000460LU, 0x00000440LU, 0x00000478LU, 0x00000430LU, 0x00000410LU, 0x00000448LU, 0x00000458LU, + 0x00000368LU, 0x00000370LU, 0x00000320LU, 0x00000308LU, 0x00000338LU, 0x00000300LU, 0x00000328LU, 0x00000350LU, + 0x00000318LU, 0x00000360LU, 0x00000340LU, 0x00000378LU, 0x00000330LU, 0x00000310LU, 0x00000348LU, 0x00000358LU, + 0x000003e8LU, 0x000003f0LU, 0x000003a0LU, 0x00000388LU, 0x000003b8LU, 0x00000380LU, 0x000003a8LU, 0x000003d0LU, + 0x00000398LU, 0x000003e0LU, 0x000003c0LU, 0x000003f8LU, 0x000003b0LU, 0x00000390LU, 0x000003c8LU, 0x000003d8LU, + 0x00000768LU, 0x00000770LU, 0x00000720LU, 0x00000708LU, 0x00000738LU, 0x00000700LU, 0x00000728LU, 0x00000750LU, + 0x00000718LU, 0x00000760LU, 0x00000740LU, 0x00000778LU, 0x00000730LU, 0x00000710LU, 0x00000748LU, 0x00000758LU, + 0x000006e8LU, 0x000006f0LU, 0x000006a0LU, 0x00000688LU, 0x000006b8LU, 0x00000680LU, 0x000006a8LU, 0x000006d0LU, + 0x00000698LU, 0x000006e0LU, 0x000006c0LU, 0x000006f8LU, 0x000006b0LU, 0x00000690LU, 0x000006c8LU, 0x000006d8LU, + 0x00000068LU, 0x00000070LU, 0x00000020LU, 0x00000008LU, 0x00000038LU, 0x00000000LU, 0x00000028LU, 0x00000050LU, + 0x00000018LU, 0x00000060LU, 0x00000040LU, 0x00000078LU, 0x00000030LU, 0x00000010LU, 0x00000048LU, 0x00000058LU, + 0x00000168LU, 0x00000170LU, 0x00000120LU, 0x00000108LU, 0x00000138LU, 0x00000100LU, 0x00000128LU, 0x00000150LU, + 0x00000118LU, 0x00000160LU, 0x00000140LU, 0x00000178LU, 0x00000130LU, 0x00000110LU, 0x00000148LU, 0x00000158LU, + 0x00000668LU, 0x00000670LU, 0x00000620LU, 0x00000608LU, 0x00000638LU, 0x00000600LU, 0x00000628LU, 0x00000650LU, + 0x00000618LU, 0x00000660LU, 0x00000640LU, 0x00000678LU, 0x00000630LU, 0x00000610LU, 0x00000648LU, 0x00000658LU, + }, +}; diff --git a/ext/hash/tests/gost.phpt b/ext/hash/tests/gost.phpt index b800e112e85c3..6ce00242b1a40 100644 --- a/ext/hash/tests/gost.phpt +++ b/ext/hash/tests/gost.phpt @@ -10,6 +10,13 @@ echo hash('gost', 'The quick brown fox jumps over the lazy cog'), "\n"; echo hash('gost', str_repeat('a', 31)), "\n"; echo hash('gost', str_repeat('a', 32)), "\n"; echo hash('gost', str_repeat('a', 33)), "\n"; + +echo hash('gost-crypto', ''), "\n"; +echo hash('gost-crypto', 'The quick brown fox jumps over the lazy dog'), "\n"; +echo hash('gost-crypto', 'The quick brown fox jumps over the lazy cog'), "\n"; +echo hash('gost-crypto', str_repeat('a', 31)), "\n"; +echo hash('gost-crypto', str_repeat('a', 32)), "\n"; +echo hash('gost-crypto', str_repeat('a', 33)), "\n"; ?> --EXPECT-- ce85b99cc46752fffee35cab9a7b0278abb4c2d2055cff685af4912c49490f8d @@ -18,3 +25,9 @@ a3ebc4daaab78b0be131dab5737a7f67e602670d543521319150d2e14eeec445 03840d6348763f11e28e7b1ecc4da0cdf7f898fa555b928ef684c6c5b8f46d9f fd1b746d9397e78edd311baef391450434271e02816caa37680d6d7381c79d4e 715e59cdc8ebde9fdf0fe2a2e811b3bf7f48209a01505e467d2cd2aa2bbb5ecf +981e5f3ca30c841487830f84fb433e13ac1101569b9c13584ac483234cd656c0 +9004294a361a508c586fe53d1f1b02746765e71b765472786e4770d565830a76 +a93124f5bf2c6d83c3bbf722bc55569310245ca5957541f4dbd7dfaf8137e6f2 +8978e06b0ecf54ea81ec51ca4e02bcb4eb390b3f04cb5f65ee8de195ffae591b +e121e3740ae94ca6d289e6d653ff31695783efff3dd960417a1098a0130fa720 +d3e8f22d9762a148ddfc84a6043d97a608604dae7c05baee72b55f559d03dd74 diff --git a/ext/hash/tests/hash_algos.phpt b/ext/hash/tests/hash_algos.phpt index 55796ecbce9aa..7773fe979a72d 100644 --- a/ext/hash/tests/hash_algos.phpt +++ b/ext/hash/tests/hash_algos.phpt @@ -18,7 +18,7 @@ var_dump(hash_algos()); ===Done=== --EXPECTF-- *** Testing hash_algos() : basic functionality *** -array(43) { +array(44) { [%d]=> string(3) "md2" [%d]=> @@ -64,6 +64,8 @@ array(43) { [%d]=> string(4) "gost" [%d]=> + string(11) "gost-crypto" + [%d]=> string(7) "adler32" [%d]=> string(5) "crc32" @@ -106,4 +108,4 @@ array(43) { [%d]=> string(10) "haval256,5" } -===Done=== \ No newline at end of file +===Done=== diff --git a/ext/hash/tests/hash_copy_001.phpt b/ext/hash/tests/hash_copy_001.phpt index 638b7f5fc109a..bb4a49da89712 100644 --- a/ext/hash/tests/hash_copy_001.phpt +++ b/ext/hash/tests/hash_copy_001.phpt @@ -97,6 +97,9 @@ string(64) "fbe88daa74c89b9e29468fa3cd3a657d31845e21bb58dd3f8d806f5179a85c26" string(4) "gost" string(64) "5820c7c4a0650587538b30ef4099f2b5993069758d5c847a552e6ef7360766a5" string(64) "5820c7c4a0650587538b30ef4099f2b5993069758d5c847a552e6ef7360766a5" +string(11) "gost-crypto" +string(64) "f7c4e35548d66aabe2b106f20515d289fde90969225d3d7b83f6dd12d694f043" +string(64) "f7c4e35548d66aabe2b106f20515d289fde90969225d3d7b83f6dd12d694f043" string(7) "adler32" string(8) "6f7c0928" string(8) "6f7c0928" @@ -226,6 +229,9 @@ string(64) "614ca924864fa0e8fa309aa0944e047d5edbfd4964a35858f4d8ec66a0fb88b0" string(4) "gost" string(64) "5820c7c4a0650587538b30ef4099f2b5993069758d5c847a552e6ef7360766a5" string(64) "a00961e371287c71c527a41c14564f13b6ed12ac7cd9d5f5dfb3542a25e28d3b" +string(11) "gost-crypto" +string(64) "f7c4e35548d66aabe2b106f20515d289fde90969225d3d7b83f6dd12d694f043" +string(64) "68ca9aea6729dc07d995fbe071a4b5c6490bb27fc4dc65ec0e96200d5e082996" string(7) "adler32" string(8) "6f7c0928" string(8) "d9141747" diff --git a/ext/imap/config.m4 b/ext/imap/config.m4 index d7deae102662a..d664215e6686e 100644 --- a/ext/imap/config.m4 +++ b/ext/imap/config.m4 @@ -198,9 +198,9 @@ if test "$PHP_IMAP" != "no"; then AC_MSG_ERROR(Cannot find rfc822.h. Please check your c-client installation.) fi - if test ! -r "$IMAP_DIR/c-client/libc-client.a" && -r "$IMAP_DIR/c-client/c-client.a" ; then + if test ! -r "$IMAP_DIR/c-client/libc-client.a" && test -r "$IMAP_DIR/c-client/c-client.a" ; then ln -s "$IMAP_DIR/c-client/c-client.a" "$IMAP_DIR/c-client/libc-client.a" >/dev/null 2>&1 - elif test ! -r "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" && -r "$IMAP_DIR/$PHP_LIBDIR/c-client.a"; then + elif test ! -r "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" && test -r "$IMAP_DIR/$PHP_LIBDIR/c-client.a"; then ln -s "$IMAP_DIR/$PHP_LIBDIR/c-client.a" "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" >/dev/null 2>&1 fi diff --git a/ext/intl/collator/collator_create.c b/ext/intl/collator/collator_create.c index b2a8c7f6bac07..7ed4c534394b4 100644 --- a/ext/intl/collator/collator_create.c +++ b/ext/intl/collator/collator_create.c @@ -27,7 +27,7 @@ /* {{{ */ static void collator_ctor(INTERNAL_FUNCTION_PARAMETERS) { - char* locale; + const char* locale; int locale_len = 0; zval* object; Collator_object* co; diff --git a/ext/intl/dateformat/dateformat_parse.c b/ext/intl/dateformat/dateformat_parse.c index 4193e890175b9..993077854646e 100644 --- a/ext/intl/dateformat/dateformat_parse.c +++ b/ext/intl/dateformat/dateformat_parse.c @@ -62,7 +62,7 @@ static void internal_parse_to_timestamp(IntlDateFormatter_object *dfo, char* tex } /* }}} */ -static void add_to_localtime_arr( IntlDateFormatter_object *dfo, zval* return_value, UCalendar parsed_calendar, long calendar_field, char* key_name TSRMLS_DC) +static void add_to_localtime_arr( IntlDateFormatter_object *dfo, zval* return_value, const UCalendar *parsed_calendar, long calendar_field, char* key_name TSRMLS_DC) { long calendar_field_val = ucal_get( parsed_calendar, calendar_field, &INTL_DATA_ERROR_CODE(dfo)); INTL_METHOD_CHECK_STATUS( dfo, "Date parsing - localtime failed : could not get a field from calendar" ); @@ -83,7 +83,7 @@ static void add_to_localtime_arr( IntlDateFormatter_object *dfo, zval* return_va */ static void internal_parse_to_localtime(IntlDateFormatter_object *dfo, char* text_to_parse, int32_t text_len, int32_t *parse_pos, zval *return_value TSRMLS_DC) { - UCalendar* parsed_calendar = NULL; + UCalendar *parsed_calendar = NULL; UChar* text_utf16 = NULL; int32_t text_utf16_len = 0; long isInDST = 0; @@ -92,7 +92,7 @@ static void internal_parse_to_localtime(IntlDateFormatter_object *dfo, char* tex intl_convert_utf8_to_utf16(&text_utf16, &text_utf16_len, text_to_parse, text_len, &INTL_DATA_ERROR_CODE(dfo)); INTL_METHOD_CHECK_STATUS(dfo, "Error converting timezone to UTF-16" ); - parsed_calendar = udat_getCalendar(DATE_FORMAT_OBJECT(dfo)); + parsed_calendar = (UCalendar *)udat_getCalendar(DATE_FORMAT_OBJECT(dfo)); udat_parseCalendar( DATE_FORMAT_OBJECT(dfo), parsed_calendar, text_utf16, text_utf16_len, parse_pos, &INTL_DATA_ERROR_CODE(dfo)); if (text_utf16) { diff --git a/ext/intl/formatter/formatter_main.c b/ext/intl/formatter/formatter_main.c index d0671a88b5e47..0a568472c4835 100644 --- a/ext/intl/formatter/formatter_main.c +++ b/ext/intl/formatter/formatter_main.c @@ -27,7 +27,7 @@ /* {{{ */ static void numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS) { - char* locale; + const char* locale; char* pattern = NULL; int locale_len = 0, pattern_len = 0; long style; diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c index d1a86d8ee27f4..21b5847f2d339 100644 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@ -121,12 +121,15 @@ static int16_t findOffset(const char* const* list, const char* key) } /*}}}*/ -static char* getPreferredTag(char* gf_tag) +static char* getPreferredTag(const char* gf_tag) { char* result = NULL; int grOffset = 0; grOffset = findOffset( LOC_GRANDFATHERED ,gf_tag); + if(grOffset < 0) { + return NULL; + } if( grOffset < LOC_PREFERRED_GRANDFATHERED_LEN ){ /* return preferred tag */ result = estrdup( LOC_PREFERRED_GRANDFATHERED[grOffset] ); @@ -172,7 +175,7 @@ static int getStrrtokenPos(char* str, int savedPos) * returns -1 if no singleton * strtok equivalent search for singleton */ -static int getSingletonPos(char* str) +static int getSingletonPos(const char* str) { int result =-1; int i=0; @@ -248,7 +251,7 @@ PHP_NAMED_FUNCTION(zif_locale_set_default) * common code shared by get_primary_language,get_script or get_region or get_variant * result = 0 if error, 1 if successful , -1 if no value */ -static char* get_icu_value_internal( char* loc_name , char* tag_name, int* result , int fromParseLocale) +static char* get_icu_value_internal( const char* loc_name , char* tag_name, int* result , int fromParseLocale) { char* tag_value = NULL; int32_t tag_value_len = 512; @@ -278,7 +281,7 @@ static char* get_icu_value_internal( char* loc_name , char* tag_name, int* resul /* Handle singletons */ if( strcmp(tag_name , LOC_LANG_TAG)==0 ){ if( strlen(loc_name)>1 && (isIDPrefix(loc_name) ==1 ) ){ - return loc_name; + return (char *)loc_name; } } @@ -367,7 +370,7 @@ static char* get_icu_value_internal( char* loc_name , char* tag_name, int* resul static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS) { - char* loc_name = NULL; + const char* loc_name = NULL; int loc_name_len = 0; char* tag_value = NULL; @@ -462,10 +465,10 @@ PHP_FUNCTION(locale_get_primary_language ) }}} */ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS) { - char* loc_name = NULL; + const char* loc_name = NULL; int loc_name_len = 0; - char* disp_loc_name = NULL; + const char* disp_loc_name = NULL; int disp_loc_name_len = 0; int free_loc_name = 0; @@ -558,7 +561,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME efree( mod_loc_name ); } if (free_loc_name) { - efree(disp_loc_name); + efree((void *)disp_loc_name); disp_loc_name = NULL; } RETURN_FALSE; @@ -569,7 +572,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME efree( mod_loc_name ); } if (free_loc_name) { - efree(disp_loc_name); + efree((void *)disp_loc_name); disp_loc_name = NULL; } /* Convert display locale name from UTF-16 to UTF-8. */ @@ -663,10 +666,10 @@ PHP_FUNCTION( locale_get_keywords ) UEnumeration* e = NULL; UErrorCode status = U_ZERO_ERROR; - const char* kw_key = NULL; + const char* kw_key = NULL; int32_t kw_key_len = 0; - char* loc_name = NULL; + const char* loc_name = NULL; int loc_name_len = 0; /* @@ -713,7 +716,7 @@ PHP_FUNCTION( locale_get_keywords ) kw_value = erealloc( kw_value , kw_value_len+1); } if (U_FAILURE(status)) { - intl_error_set( NULL, FAILURE, "locale_get_keywords: Error encountered while getting the keyword value for the keyword", 0 TSRMLS_CC ); + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "locale_get_keywords: Error encountered while getting the keyword value for the keyword", 0 TSRMLS_CC ); if( kw_value){ efree( kw_value ); } @@ -971,12 +974,12 @@ PHP_FUNCTION(locale_compose) * e.g. for locale='en_US-x-prv1-prv2-prv3' * returns a pointer to the string 'prv1-prv2-prv3' */ -static char* get_private_subtags(char* loc_name) +static char* get_private_subtags(const char* loc_name) { char* result =NULL; int singletonPos = 0; int len =0; - char* mod_loc_name =NULL; + const char* mod_loc_name =NULL; if( loc_name && (len = strlen(loc_name)>0 ) ){ mod_loc_name = loc_name ; @@ -1016,7 +1019,7 @@ static char* get_private_subtags(char* loc_name) /* {{{ code used by locale_parse */ -static int add_array_entry(char* loc_name, zval* hash_arr, char* key_name TSRMLS_DC) +static int add_array_entry(const char* loc_name, zval* hash_arr, char* key_name TSRMLS_DC) { char* key_value = NULL; char* cur_key_name = NULL; @@ -1081,7 +1084,7 @@ static int add_array_entry(char* loc_name, zval* hash_arr, char* key_name TSRMLS */ PHP_FUNCTION(locale_parse) { - char* loc_name = NULL; + const char* loc_name = NULL; int loc_name_len = 0; int grOffset = 0; @@ -1125,8 +1128,8 @@ PHP_FUNCTION(locale_parse) */ PHP_FUNCTION(locale_get_all_variants) { - char* loc_name = NULL; - int loc_name_len = 0; + const char* loc_name = NULL; + int loc_name_len = 0; int result = 0; char* token = NULL; @@ -1179,10 +1182,10 @@ PHP_FUNCTION(locale_get_all_variants) /*{{{ * Converts to lower case and also replaces all hyphens with the underscore */ -static int strToMatch(char* str ,char *retstr) +static int strToMatch(const char* str ,char *retstr) { char* anchor = NULL; - char* anchor1 = NULL; + const char* anchor1 = NULL; int result = 0; int len = 0; @@ -1222,7 +1225,7 @@ PHP_FUNCTION(locale_filter_matches) { char* lang_tag = NULL; int lang_tag_len = 0; - char* loc_range = NULL; + const char* loc_range = NULL; int loc_range_len = 0; int result = 0; @@ -1398,7 +1401,7 @@ static void array_cleanup( char* arr[] , int arr_size) * returns the lookup result to lookup_loc_range_src_php * internal function */ -static char* lookup_loc_range(char* loc_range, HashTable* hash_arr, int canonicalize TSRMLS_DC) +static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int canonicalize TSRMLS_DC) { int i = 0; int cur_arr_len = 0; @@ -1520,7 +1523,7 @@ PHP_FUNCTION(locale_lookup) { char* fallback_loc = NULL; int fallback_loc_len = 0; - char* loc_range = NULL; + const char* loc_range = NULL; int loc_range_len = 0; zval* arr = NULL; diff --git a/ext/intl/msgformat/msgformat.c b/ext/intl/msgformat/msgformat.c index 6a9f04f32b463..7d8cd958e3c08 100644 --- a/ext/intl/msgformat/msgformat.c +++ b/ext/intl/msgformat/msgformat.c @@ -28,7 +28,7 @@ /* {{{ */ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS) { - char* locale; + const char* locale; char* pattern; int locale_len = 0, pattern_len = 0; UChar* spattern = NULL; diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c index 4b81cfe2b454c..55ec9e84ba0e8 100644 --- a/ext/intl/msgformat/msgformat_format.c +++ b/ext/intl/msgformat/msgformat_format.c @@ -103,7 +103,7 @@ PHP_FUNCTION( msgfmt_format_message ) int spattern_len = 0; char *pattern = NULL; int pattern_len = 0; - char *slocale = NULL; + const char *slocale = NULL; int slocale_len = 0; MessageFormatter_object mf = {0}; MessageFormatter_object *mfo = &mf; diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index c4456d54f3c84..f75fd91dce775 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -209,6 +209,9 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo, continue; } } + } else { + intl_errors_set(&err, U_INVALID_FORMAT_ERROR, "Invalid part type encountered", 0 TSRMLS_CC); + continue; } UMessagePatternArgType argType = p.getArgType(); diff --git a/ext/intl/msgformat/msgformat_parse.c b/ext/intl/msgformat/msgformat_parse.c index 413d3b1f15d89..14a6363424bf0 100644 --- a/ext/intl/msgformat/msgformat_parse.c +++ b/ext/intl/msgformat/msgformat_parse.c @@ -93,7 +93,7 @@ PHP_FUNCTION( msgfmt_parse_message ) int spattern_len = 0; char *pattern = NULL; int pattern_len = 0; - char *slocale = NULL; + const char *slocale = NULL; int slocale_len = 0; char *source = NULL; int src_len = 0; diff --git a/ext/intl/tests/bug58756_MessageFormatter.phpt b/ext/intl/tests/bug58756_MessageFormatter.phpt index bbe96b7045a10..18566b666c9c4 100644 --- a/ext/intl/tests/bug58756_MessageFormatter.phpt +++ b/ext/intl/tests/bug58756_MessageFormatter.phpt @@ -4,6 +4,9 @@ Bug #58756: w.r.t MessageFormatter = 0) + die('skip for ICU < 51.2'); +?> --FILE-- format(array($time, 'date')), " ", --EXPECT-- date: Tuesday, July 7, 2009 8:41:13 PM EDT msgf: Tuesday, July 7, 2009 8:41:13 PM EDT -==DONE== \ No newline at end of file +==DONE== diff --git a/ext/intl/tests/bug58756_MessageFormatter_variant2.phpt b/ext/intl/tests/bug58756_MessageFormatter_variant2.phpt new file mode 100644 index 0000000000000..4fcfdbc08c073 --- /dev/null +++ b/ext/intl/tests/bug58756_MessageFormatter_variant2.phpt @@ -0,0 +1,37 @@ +--TEST-- +Bug #58756: w.r.t MessageFormatter +--SKIPIF-- += 51.2'); +?> +--FILE-- +format(array($time)) . "\n"; + +//NOT FIXED: +/*$msgf = new MessageFormatter('en_US', +'{1, select, date {{0,date,full}} other {{0,time,h:m:s a V}}}'); + +echo "msgf2: ", $msgf->format(array($time, 'date')), " ", + $msgf->format(array($time, 'time')), "\n"; +*/ + +?> +==DONE== +--EXPECT-- +date: Tuesday, July 7, 2009 8:41:13 PM EDT +msgf: Tuesday, July 7, 2009 8:41:13 PM usnyc +==DONE== diff --git a/ext/intl/tests/collator_asort.phpt b/ext/intl/tests/collator_asort.phpt index a614ddc3f88e2..308f3a3ca3742 100644 --- a/ext/intl/tests/collator_asort.phpt +++ b/ext/intl/tests/collator_asort.phpt @@ -2,6 +2,7 @@ asort() --SKIPIF-- += 0) die('skip for ICU < 51.2'); ?> --FILE-- += 51.2'); ?> +--FILE-- + 'y' , + 'c' => 'i' , + 'a' => 'k' ), + + array( 'a' => 'a' , + 'b' => 'aaa', + 'c' => 'aa' ), + + array( 'a' => 'a' , + 'aaa'=> 'a' , + 'aa' => 'a' ), + + array( '1' => 'abc', + '5' => '!' , + '2' => null , + '7' => '' ), + + array( '1' => '100', + '2' => '25' , + '3' => '36' ), + + array( '1' => 5 , + '2' => '30' , + '3' => 2 ) + ); + + $res_str .= sort_arrays( 'en_US', $test_params ); + + // Sort an array in SORT_STRING mode using en_US locale. + $test_params = array( + array( '1' => '100', + '2' => '25' , + '3' => '36' ), + + array( '1' => 5 , + '2' => '30' , + '3' => 2 ), + + array( '1' => 'd' , + '2' => '' , + '3' => ' a' ), + + array( '1' => 'y' , + '2' => 'k' , + '3' => 'i' ) + ); + + $res_str .= sort_arrays( 'en_US', $test_params, Collator::SORT_STRING ); + + // Sort a non-ASCII array using ru_RU locale. + $test_params = array( + array( 'п' => 'у', + 'б' => 'в', + 'е' => 'а' ), + + array( '1' => 'п', + '4' => '', + '7' => 'd', + '2' => 'пп' ) + ); + + $res_str .= sort_arrays( 'ru_RU', $test_params ); + + + // Sort an array using Lithuanian locale. + $test_params = array( + array( 'd' => 'y', + 'c' => 'i', + 'a' => 'k' ) + ); + + $res_str .= sort_arrays( 'lt_LT', $test_params ); + + return $res_str . "\n"; +} + +include_once( 'ut_common.inc' ); +ut_run(); +?> +--EXPECT-- +Test 1.162b81ac12878b817fc39063097e45b5: +array ( + 'c' => 'i', + 'a' => 'k', + 'd' => 'y', +) + Result: true + +Test 2.93d96e22f692d8a281b0a389f01f8d1e: +array ( + 'a' => 'a', + 'c' => 'aa', + 'b' => 'aaa', +) + Result: true + +Test 3.9f25de4482bc7b58de508e278113317c: +array ( + 'aa' => 'a', + 'aaa' => 'a', + 'a' => 'a', +) + Result: true + +Test 4.a85a41ea78e45b651080cfd98c0b431d: +array ( + 7 => '', + 2 => NULL, + 5 => '!', + 1 => 'abc', +) + Result: true + +Test 5.99dc71f405b286e03d489061b36e6900: +array ( + 2 => '25', + 3 => '36', + 1 => '100', +) + Result: true + +Test 6.bf5bba243307c9d12934e756ad4be190: +array ( + 3 => 2, + 1 => 5, + 2 => '30', +) + Result: true + +Test 7.e4ee7024c61476e9e7a6c28b5e47df6f: +array ( + 1 => '100', + 2 => '25', + 3 => '36', +) + Result: true + +Test 8.5fa7033dd43784be0db1474eb48b83c8: +array ( + 3 => 2, + 2 => '30', + 1 => 5, +) + Result: true + +Test 9.588cdf4692bc09aa92ffe7e48f9e4579: +array ( + 2 => '', + 3 => ' a', + 1 => 'd', +) + Result: true + +Test 10.be02641a47ebcccd23e4183ca3a415f7: +array ( + 3 => 'i', + 2 => 'k', + 1 => 'y', +) + Result: true + +Test 11.153d9b11d1e5936afc917a94a4e11f34: +array ( + 'е' => 'а', + 'б' => 'в', + 'п' => 'у', +) + Result: true + +Test 12.e1f5cb037b564dce39ffbd0a61562d59: +array ( + 4 => '', + 1 => 'п', + 2 => 'пп', + 7 => 'd', +) + Result: true + +Test 13.8800d48abb960a59002eef77f1d73ae0: +array ( + 'c' => 'i', + 'd' => 'y', + 'a' => 'k', +) + Result: true diff --git a/ext/intl/tests/collator_compare.phpt b/ext/intl/tests/collator_compare.phpt index f10b5708f405c..7c07204b70309 100644 --- a/ext/intl/tests/collator_compare.phpt +++ b/ext/intl/tests/collator_compare.phpt @@ -2,6 +2,7 @@ compare() --SKIPIF-- += 0) die('skip for ICU < 51.2'); ?> --FILE-- += 51.2'); ?> +--FILE-- +'; + case -1: // UCOL_LESS + return '<'; + default: + return '?'; + } +} + +/* + * Compare string pairs in the given array + * using specified locale. + */ +function compare_pairs( $locale, $test_array ) +{ + $res_str = ''; + + $coll = ut_coll_create( $locale ); + + foreach( $test_array as $test_strings ) + { + list( $str1, $str2 ) = $test_strings; + + // Compare strings. + $res_val = cmp_to_char( ut_coll_compare( $coll, $str1, $str2 ) ); + + // Concatenate result strings. + $res_str .= dump( $str1 ) . + ' ' . $res_val . ' ' . + dump( $str2 ) . "\n"; + } + + return $res_str; + +} + +function ut_main() +{ + $res_str = ''; + + // Compare strings using en_US locale. + $test_params = array( + array( 'abc', 'abc' ), + array( 'Abc', 'abc' ), + array( 'a' , 'abc' ), + array( 'a' , '' ), + array( '' , '' ), + array( 'a' , 'b' ), + array( 'ab' , 'b' ), + array( 'ab' , 'a' ), + array( 123 , 'abc' ), + array( 'ac' , null ), + array( '.' , '.' ), + // Try to compare long strings. + array( 'abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcde', + 'abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdea'), + array( null , null ) + ); + + $res_str .= compare_pairs( 'en_US', $test_params ); + + + // Compare strings using ru_RU locale. + $test_params = array( + array( 'а', 'б' ), + array( 'а', 'аа' ), + array( 'аб', 'ба' ), + array( 'а', ',' ), + array( 'а', 'b' ), + array( 'а', 'bb' ), + array( 'а', 'ab' ), + array( 'а', null ) + ); + + $res_str .= compare_pairs( 'ru_RU', $test_params ); + + + // Compare strings using lt_LT locale. + $test_params = array( + array( 'y', 'k' ) + ); + + $res_str .= compare_pairs( 'lt_LT', $test_params ); + + return $res_str; +} + +include_once( 'ut_common.inc' ); +ut_run(); +?> +--EXPECT-- +'abc' = 'abc' +'Abc' > 'abc' +'a' < 'abc' +'a' > '' +'' = '' +'a' < 'b' +'ab' < 'b' +'ab' > 'a' +123 < 'abc' +'ac' > NULL +'.' = '.' +'abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcde' < 'abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdea' +NULL = NULL +'а' < 'б' +'а' < 'аа' +'аб' < 'ба' +'а' > ',' +'а' < 'b' +'а' < 'bb' +'а' < 'ab' +'а' > NULL +'y' < 'k' diff --git a/ext/intl/tests/collator_get_sort_key.phpt b/ext/intl/tests/collator_get_sort_key.phpt index a9c4d71348129..58240d426c52c 100644 --- a/ext/intl/tests/collator_get_sort_key.phpt +++ b/ext/intl/tests/collator_get_sort_key.phpt @@ -3,6 +3,8 @@ collator_get_sort_key() --SKIPIF-- = 4.8 only'; ?> += 4.8 and < 51.2 */ +if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?> --FILE-- += 51.2'); ?> +--FILE-- + +--EXPECT-- +source: abc +key: 27292b01070107 +source: abd +key: 27292d01070107 +source: aaa +key: 27272701070107 +source: аа +key: 5c0a0a01060106 +source: а +key: 5c0a01050105 +source: z +key: 5901050105 +source: +key: 0101 +source: +key: 0101 +source: 3 +key: 1801050105 +source: y +key: 5701050105 +source: i +key: 3701050105 +source: k +key: 3b01050105 +source: абг +key: 260a161a01070107 +source: абв +key: 260a161801070107 +source: жжж +key: 263a3a3a01070107 +source: эюя +key: 273b3f4501070107 +source: абг +key: 5c0a161a01070107 +source: абв +key: 5c0a161801070107 +source: жжж +key: 5c3a3a3a01070107 +source: эюя +key: 5d3b3f4501070107 diff --git a/ext/intl/tests/collator_sort.phpt b/ext/intl/tests/collator_sort.phpt index 5cefe2fd7cefd..e16eeea1e8503 100644 --- a/ext/intl/tests/collator_sort.phpt +++ b/ext/intl/tests/collator_sort.phpt @@ -2,6 +2,7 @@ sort() --SKIPIF-- += 0) die('skip for ICU < 51.2'); ?> --FILE-- += 51.2'); ?> +--FILE-- + +--EXPECT-- +Test 1.e8f1cd28133d79ecd660002f1c660d0e: +array ( + 0 => 'aaa', + 1 => 'abc', + 2 => 'abd', +) + Result: true + +Test 2.c2ded12173dd2996927378cae37eb275: +array ( + 0 => '_', + 1 => '1', + 2 => 'm', +) + Result: true + +Test 3.54071c968d71cb98c5d379145f8d7d38: +array ( + 0 => 'a', + 1 => 'aa', + 2 => 'aaa', +) + Result: true + +Test 4.19abe63d6f6dfef65b0e3c9ab4826b07: +array ( + 0 => 'ab', + 1 => 'b', + 2 => 'ba', +) + Result: true + +Test 5.9a8dc0a9bc771368c2f1fc3d02754610: +array ( + 0 => 'a', + 1 => 'c', + 2 => 'e', +) + Result: true + +Test 6.ab530b060e5e54a65bfb8b9f8fc61870: +array ( + 0 => '25', + 1 => '36', + 2 => '100', +) + Result: true + +Test 7.0718dd838509017bded2ed307a6e785f: +array ( + 0 => 2, + 1 => 5, + 2 => '30', +) + Result: true + +Test 8.923d65739c5219c634616ffd100a50e4: +array ( + 0 => '', + 1 => ' a', + 2 => 'd', +) + Result: true + +Test 9.289bc2f28e87d3201ec9d7e8477ae1b0: +array ( + 0 => ' a', + 1 => 'd ', + 2 => 'f ', +) + Result: true + +Test 10.de0fd958484f2377a645835d7fbcf124: +array ( + 0 => NULL, + 1 => '3', + 2 => 'a', +) + Result: true + +Test 11.dd2b8f0adb37c45d528cad1a0cc0f361: +array ( + 0 => 'i', + 1 => 'k', + 2 => 'y', +) + Result: true + +Test 12.1e6b4d6f7df9d4580317634ea46d8208: +array ( + 0 => '100', + 1 => '25', + 2 => '36', +) + Result: true + +Test 13.cec115dc9850b98dfbdf102efa09e61b: +array ( + 0 => 2, + 1 => '30', + 2 => 5, +) + Result: true + +Test 14.923d65739c5219c634616ffd100a50e4: +array ( + 0 => '', + 1 => ' a', + 2 => 'd', +) + Result: true + +Test 15.dd2b8f0adb37c45d528cad1a0cc0f361: +array ( + 0 => 'i', + 1 => 'k', + 2 => 'y', +) + Result: true + +Test 16.49056308afb2b800363c5baa735ed247: +array ( + 0 => 'ааа', + 1 => 'абв', + 2 => 'абг', + 3 => 'abc', +) + Result: true + +Test 17.91480b10473a0c96a4cd6d88c23c577a: +array ( + 0 => 'а', + 1 => 'аа', + 2 => 'ааа', +) + Result: true + +Test 18.fdd3fe3981476039164aa000bf9177f2: +array ( + 0 => 'i', + 1 => 'y', + 2 => 'k', +) + Result: true diff --git a/ext/intl/tests/collator_sort_with_sort_keys.phpt b/ext/intl/tests/collator_sort_with_sort_keys.phpt index 2f489d745cb90..8be9c97789cc6 100644 --- a/ext/intl/tests/collator_sort_with_sort_keys.phpt +++ b/ext/intl/tests/collator_sort_with_sort_keys.phpt @@ -2,6 +2,7 @@ sort_with_sort_keys() --SKIPIF-- += 0) die('skip for ICU < 51.2'); ?> --FILE-- += 51.2'); ?> +--FILE-- + +--EXPECT-- +Test 1.e8f1cd28133d79ecd660002f1c660d0e: +array ( + 0 => 'aaa', + 1 => 'abc', + 2 => 'abd', +) + Result: true + +Test 2.c2ded12173dd2996927378cae37eb275: +array ( + 0 => '_', + 1 => '1', + 2 => 'm', +) + Result: true + +Test 3.54071c968d71cb98c5d379145f8d7d38: +array ( + 0 => 'a', + 1 => 'aa', + 2 => 'aaa', +) + Result: true + +Test 4.19abe63d6f6dfef65b0e3c9ab4826b07: +array ( + 0 => 'ab', + 1 => 'b', + 2 => 'ba', +) + Result: true + +Test 5.9a8dc0a9bc771368c2f1fc3d02754610: +array ( + 0 => 'a', + 1 => 'c', + 2 => 'e', +) + Result: true + +Test 6.923d65739c5219c634616ffd100a50e4: +array ( + 0 => '', + 1 => ' a', + 2 => 'd', +) + Result: true + +Test 7.289bc2f28e87d3201ec9d7e8477ae1b0: +array ( + 0 => ' a', + 1 => 'd ', + 2 => 'f ', +) + Result: true + +Test 8.de0fd958484f2377a645835d7fbcf124: +array ( + 0 => NULL, + 1 => '3', + 2 => 'a', +) + Result: true + +Test 9.dd2b8f0adb37c45d528cad1a0cc0f361: +array ( + 0 => 'i', + 1 => 'k', + 2 => 'y', +) + Result: true + +Test 10.49056308afb2b800363c5baa735ed247: +array ( + 0 => 'ааа', + 1 => 'абв', + 2 => 'абг', + 3 => 'abc', +) + Result: true + +Test 11.91480b10473a0c96a4cd6d88c23c577a: +array ( + 0 => 'а', + 1 => 'аа', + 2 => 'ааа', +) + Result: true + +Test 12.fdd3fe3981476039164aa000bf9177f2: +array ( + 0 => 'i', + 1 => 'y', + 2 => 'k', +) + Result: true diff --git a/ext/intl/tests/dateformat_calendars.phpt b/ext/intl/tests/dateformat_calendars.phpt index 6af02e51c14e6..2239af28dfc68 100644 --- a/ext/intl/tests/dateformat_calendars.phpt +++ b/ext/intl/tests/dateformat_calendars.phpt @@ -4,8 +4,8 @@ IntlDateFormatter, calendars and time zone date.timezone=Atlantic/Azores --SKIPIF-- += 0) die('skip for ICU < 51.2'); ?> --FILE-- += 51.2'); ?> +--FILE-- +format(strtotime('2012-01-01 00:00:00 +0000'))); +var_dump($fmt2->format(strtotime('2012-01-01 00:00:00 +0000'))); +var_dump($fmt3->format(strtotime('2012-01-01 00:00:00 +0000'))); + +new IntlDateFormatter('en_US@calendar=hebrew', + IntlDateFormatter::FULL, + IntlDateFormatter::FULL, + 'GMT+05:12', + -1); +?> +==DONE== +--EXPECTF-- +string(47) "Sunday, January 1, 2012 at 5:12:00 AM GMT+05:12" +string(47) "Sunday, January 1, 2012 at 5:12:00 AM GMT+05:12" +string(48) "Sunday, Tevet 6, 5772 AM at 5:12:00 AM GMT+05:12" + +Warning: IntlDateFormatter::__construct(): datefmt_create: invalid value for calendar type; it must be one of IntlDateFormatter::TRADITIONAL (locale's default calendar) or IntlDateFormatter::GREGORIAN. Alternatively, it can be an IntlCalendar object in %sdateformat_calendars_variant2.php on line %d +==DONE== diff --git a/ext/intl/tests/dateformat_create_cal_arg.phpt b/ext/intl/tests/dateformat_create_cal_arg.phpt index 53fb084af95e6..a8f351247bde4 100644 --- a/ext/intl/tests/dateformat_create_cal_arg.phpt +++ b/ext/intl/tests/dateformat_create_cal_arg.phpt @@ -2,8 +2,8 @@ IntlDateFormatter: several forms of the calendar arg --SKIPIF-- += 0) die('skip for ICU < 51.2'); ?> --FILE-- += 51.2'); ?> +--FILE-- +format($ts), "\n"; + +$cal = IntlCalendar::createInstance('UTC', 'en@calendar=islamic'); +$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal); +echo $df->format($ts), "\n"; + +//override calendar's timezone +$cal = new IntlGregorianCalendar('UTC', NULL); +$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Madrid', $cal); +echo $df->format($ts), "\n"; + +//default calendar is gregorian +$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0); +echo $df->format($ts), "\n"; + +//try now with traditional +$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, NULL, IntlDateFormatter::TRADITIONAL); +echo $df->format($ts), "\n"; + +//the timezone can be overridden when not specifying a calendar +$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, 'UTC', IntlDateFormatter::TRADITIONAL); +echo $df->format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, 'UTC', 0); +echo $df->format($ts), "\n"; + +?> +==DONE== +--EXPECTF-- +domingo%S 1 de enero de 2012 00:00:00 GMT +domingo%S 8 de Safar de 1433 00:00:00 GMT +domingo%S 1 de enero de 2012 01:00:00 Hora estándar de Europa central +sábado%S 31 de diciembre de 2011 d.C. 23:00:00 Hora %Sde las Azores +sábado%S 7 de Safar de 1433 AH 23:00:00 Hora %Sde las Azores +domingo%S 8 de Safar de 1433 AH 00:00:00 GMT +domingo%S 1 de enero de 2012 00:00:00 GMT +==DONE== diff --git a/ext/intl/tests/dateformat_format.phpt b/ext/intl/tests/dateformat_format.phpt index 8664eea319888..c3f6c297d96df 100644 --- a/ext/intl/tests/dateformat_format.phpt +++ b/ext/intl/tests/dateformat_format.phpt @@ -2,6 +2,7 @@ datefmt_format_code() --SKIPIF-- += 0) die('skip for ICU < 51.2'); ?> --FILE-- += 0) die('skip for ICU < 51.2'); ?> --FILE-- += 51.2'); ?> +--FILE-- +setTime(strtotime('2012-01-01 00:00:00')*1000.); +echo IntlDateFormatter::formatObject($cal), "\n"; +echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL, "en-US"), "\n"; + +?> +==DONE== + +--EXPECTF-- +01/01/2012, 00:00:00 +Domingo, 1 de Janeiro de 2012 às 00:00:00 Hora %Sda Europa Ocidental +Jan 1, 2012, 12:00:00 AM +1/1/12, 12:00:00 AM Western European Standard %STime +Sun 2012-01-1 00,00,00.000 Portugal Time +Domingo, 1 de Janeiro de 2012 às 05:00:00 GMT+03:00 +06/02/1433, 00:00:00 +Sunday, Safar 6, 1433 at 12:00:00 AM Western European Standard Time +==DONE== diff --git a/ext/intl/tests/dateformat_formatObject_datetime.phpt b/ext/intl/tests/dateformat_formatObject_datetime.phpt index 6427ad5a988c6..d9ddb0e644324 100644 --- a/ext/intl/tests/dateformat_formatObject_datetime.phpt +++ b/ext/intl/tests/dateformat_formatObject_datetime.phpt @@ -2,8 +2,8 @@ IntlDateFormatter::formatObject(): DateTime tests --SKIPIF-- += 0) die('skip for ICU < 51.2'); ?> --FILE-- += 51.2'); ?> +--FILE-- + +==DONE== + +--EXPECTF-- +01/01/2012, 00:00:00 +Domingo, 1 de Janeiro de 2012 às 00:00:00 Hora %Sda Europa Ocidental +Jan 1, 2012, 12:00:00 AM +1/1/12, 12:00:00 AM Western European Standard %STime +Sun 2012-01-1 00,00,00.000 Portugal Time +Domingo, 1 de Janeiro de 2012 às 05:00:00 GMT+03:00 +==DONE== diff --git a/ext/intl/tests/dateformat_format_parse.phpt b/ext/intl/tests/dateformat_format_parse.phpt index 6bd3d8a8ff9ef..dfb479e937b97 100644 --- a/ext/intl/tests/dateformat_format_parse.phpt +++ b/ext/intl/tests/dateformat_format_parse.phpt @@ -2,6 +2,7 @@ datefmt_format_code() and datefmt_parse_code() --SKIPIF-- += 0) die('skip for ICU < 51.2'); ?> --FILE-- += 51.2'); ?> +--FILE-- + 24 , + 'tm_min' => 3, + 'tm_hour' => 19, + 'tm_mday' => 3, + 'tm_mon' => 3, + 'tm_year' => 105, + ); + $localtime_arr2 = array ( + 'tm_sec' => 21, + 'tm_min' => 5, + 'tm_hour' => 7, + 'tm_mday' => 13, + 'tm_mon' => 7, + 'tm_year' => 205, + ); + $localtime_arr3 = array ( + 'tm_sec' => 11, + 'tm_min' => 13, + 'tm_hour' => 0, + 'tm_mday' => 17, + 'tm_mon' => 11, + 'tm_year' => -5 + ); + + $localtime_arr = array ( + $localtime_arr1, + $localtime_arr2, + $localtime_arr3 + ); + + //Test format and parse with a timestamp : long + foreach( $time_arr as $timestamp_entry){ + $res_str .= "\n------------\n"; + $res_str .= "\nInput timestamp is : $timestamp_entry"; + $res_str .= "\n------------\n"; + foreach( $locale_arr as $locale_entry ){ + foreach( $datetype_arr as $datetype_entry ) { + $res_str .= "\nIntlDateFormatter locale= $locale_entry ,datetype = $datetype_entry ,timetype =$datetype_entry "; + $fmt = ut_datefmt_create( $locale_entry , $datetype_entry ,$datetype_entry,$timezone); + $formatted = ut_datefmt_format( $fmt , $timestamp_entry); + $res_str .= "\nFormatted timestamp is : $formatted"; + $parsed = ut_datefmt_parse( $fmt , $formatted); + if( intl_get_error_code() == U_ZERO_ERROR){ + $res_str .= "\nParsed timestamp is : $parsed"; + }else{ + $res_str .= "\nError while parsing as: '".intl_get_error_message()."'"; + } + } + } + } + + //Test format and parse with a localtime :array + foreach( $localtime_arr as $localtime_entry){ + $res_str .= "\n------------\n"; + $res_str .= "\nInput localtime is : "; + foreach( $localtime_entry as $key => $value){ + $res_str .= "$key : '$value' , "; + } + + $res_str .= "\n------------\n"; + foreach( $locale_arr as $locale_entry ){ + foreach( $datetype_arr as $datetype_entry ) { + $res_str .= "\nIntlDateFormatter locale= $locale_entry ,datetype = $datetype_entry ,timetype =$datetype_entry "; + $fmt = ut_datefmt_create( $locale_entry , $datetype_entry ,$datetype_entry,$timezone); + $formatted1 = ut_datefmt_format( $fmt , $localtime_entry); + if( intl_get_error_code() == U_ZERO_ERROR){ + $res_str .= "\nFormatted localtime_array is : $formatted1"; + }else{ + $res_str .= "\nError while formatting as: '".intl_get_error_message()."'"; + } + //Parsing + $parsed_arr = ut_datefmt_localtime( $fmt, $formatted1 ); + + if( $parsed_arr){ + $res_str .= "\nParsed array is: "; + foreach( $parsed_arr as $key => $value){ + $res_str .= "$key : '$value' , "; + } + } +/* + else{ + //$res_str .= "No values found from LocaleTime parsing."; + $res_str .= "\tError : '".intl_get_error_message()."'"; + } +*/ + } + } + } + + return $res_str; + +} + +include_once( 'ut_common.inc' ); + +// Run the test +ut_run(); +?> +--EXPECT-- +------------ + +Input timestamp is : 0 +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted timestamp is : Thursday, January 1, 1970 at 5:00:00 AM GMT+05:00 +Parsed timestamp is : 0 +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted timestamp is : January 1, 1970 at 5:00:00 AM GMT+5 +Parsed timestamp is : 0 +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted timestamp is : Jan 1, 1970, 5:00:00 AM +Parsed timestamp is : 0 +------------ + +Input timestamp is : -1200000 +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted timestamp is : Thursday, December 18, 1969 at 7:40:00 AM GMT+05:00 +Parsed timestamp is : -1200000 +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted timestamp is : December 18, 1969 at 7:40:00 AM GMT+5 +Parsed timestamp is : -1200000 +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted timestamp is : Dec 18, 1969, 7:40:00 AM +Parsed timestamp is : -1200000 +------------ + +Input timestamp is : 1200000 +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted timestamp is : Thursday, January 15, 1970 at 2:20:00 AM GMT+05:00 +Parsed timestamp is : 1200000 +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted timestamp is : January 15, 1970 at 2:20:00 AM GMT+5 +Parsed timestamp is : 1200000 +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted timestamp is : Jan 15, 1970, 2:20:00 AM +Parsed timestamp is : 1200000 +------------ + +Input timestamp is : 2200000000 +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted timestamp is : Monday, September 19, 2039 at 4:06:40 AM GMT+05:00 +Parsed timestamp is : 2200000000 +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted timestamp is : September 19, 2039 at 4:06:40 AM GMT+5 +Parsed timestamp is : 2200000000 +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted timestamp is : Sep 19, 2039, 4:06:40 AM +Parsed timestamp is : 2200000000 +------------ + +Input timestamp is : -2200000000 +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted timestamp is : Sunday, April 15, 1900 at 5:53:20 AM GMT+05:00 +Parsed timestamp is : -2200000000 +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted timestamp is : April 15, 1900 at 5:53:20 AM GMT+5 +Parsed timestamp is : -2200000000 +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted timestamp is : Apr 15, 1900, 5:53:20 AM +Parsed timestamp is : -2200000000 +------------ + +Input timestamp is : 90099999 +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted timestamp is : Thursday, November 9, 1972 at 12:46:39 AM GMT+05:00 +Parsed timestamp is : 90099999 +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted timestamp is : November 9, 1972 at 12:46:39 AM GMT+5 +Parsed timestamp is : 90099999 +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted timestamp is : Nov 9, 1972, 12:46:39 AM +Parsed timestamp is : 90099999 +------------ + +Input timestamp is : 3600 +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted timestamp is : Thursday, January 1, 1970 at 6:00:00 AM GMT+05:00 +Parsed timestamp is : 3600 +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted timestamp is : January 1, 1970 at 6:00:00 AM GMT+5 +Parsed timestamp is : 3600 +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted timestamp is : Jan 1, 1970, 6:00:00 AM +Parsed timestamp is : 3600 +------------ + +Input timestamp is : -3600 +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted timestamp is : Thursday, January 1, 1970 at 4:00:00 AM GMT+05:00 +Parsed timestamp is : -3600 +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted timestamp is : January 1, 1970 at 4:00:00 AM GMT+5 +Parsed timestamp is : -3600 +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted timestamp is : Jan 1, 1970, 4:00:00 AM +Parsed timestamp is : -3600 +------------ + +Input localtime is : tm_sec : '24' , tm_min : '3' , tm_hour : '19' , tm_mday : '3' , tm_mon : '3' , tm_year : '105' , +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted localtime_array is : Sunday, April 3, 2005 at 7:03:24 PM GMT+05:00 +Parsed array is: tm_sec : '24' , tm_min : '3' , tm_hour : '19' , tm_year : '105' , tm_mday : '3' , tm_wday : '0' , tm_yday : '93' , tm_mon : '3' , tm_isdst : '0' , +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted localtime_array is : April 3, 2005 at 7:03:24 PM GMT+5 +Parsed array is: tm_sec : '24' , tm_min : '3' , tm_hour : '19' , tm_year : '105' , tm_mday : '3' , tm_wday : '0' , tm_yday : '93' , tm_mon : '3' , tm_isdst : '0' , +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted localtime_array is : Apr 3, 2005, 7:03:24 PM +Parsed array is: tm_sec : '24' , tm_min : '3' , tm_hour : '19' , tm_year : '105' , tm_mday : '3' , tm_wday : '0' , tm_yday : '93' , tm_mon : '3' , tm_isdst : '0' , +------------ + +Input localtime is : tm_sec : '21' , tm_min : '5' , tm_hour : '7' , tm_mday : '13' , tm_mon : '7' , tm_year : '205' , +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted localtime_array is : Thursday, August 13, 2105 at 7:05:21 AM GMT+05:00 +Parsed array is: tm_sec : '21' , tm_min : '5' , tm_hour : '7' , tm_year : '205' , tm_mday : '13' , tm_wday : '4' , tm_yday : '225' , tm_mon : '7' , tm_isdst : '0' , +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted localtime_array is : August 13, 2105 at 7:05:21 AM GMT+5 +Parsed array is: tm_sec : '21' , tm_min : '5' , tm_hour : '7' , tm_year : '205' , tm_mday : '13' , tm_wday : '4' , tm_yday : '225' , tm_mon : '7' , tm_isdst : '0' , +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted localtime_array is : Aug 13, 2105, 7:05:21 AM +Parsed array is: tm_sec : '21' , tm_min : '5' , tm_hour : '7' , tm_year : '205' , tm_mday : '13' , tm_wday : '4' , tm_yday : '225' , tm_mon : '7' , tm_isdst : '0' , +------------ + +Input localtime is : tm_sec : '11' , tm_min : '13' , tm_hour : '0' , tm_mday : '17' , tm_mon : '11' , tm_year : '-5' , +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted localtime_array is : Tuesday, December 17, 1895 at 12:13:11 AM GMT+05:00 +Parsed array is: tm_sec : '11' , tm_min : '13' , tm_hour : '0' , tm_year : '-5' , tm_mday : '17' , tm_wday : '2' , tm_yday : '351' , tm_mon : '11' , tm_isdst : '0' , +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted localtime_array is : December 17, 1895 at 12:13:11 AM GMT+5 +Parsed array is: tm_sec : '11' , tm_min : '13' , tm_hour : '0' , tm_year : '-5' , tm_mday : '17' , tm_wday : '2' , tm_yday : '351' , tm_mon : '11' , tm_isdst : '0' , +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted localtime_array is : Dec 17, 1895, 12:13:11 AM +Parsed array is: tm_sec : '11' , tm_min : '13' , tm_hour : '0' , tm_year : '-5' , tm_mday : '17' , tm_wday : '2' , tm_yday : '351' , tm_mon : '11' , tm_isdst : '0' , diff --git a/ext/intl/tests/dateformat_format_variant2.phpt b/ext/intl/tests/dateformat_format_variant2.phpt new file mode 100644 index 0000000000000..7c5bcfcfd43f5 --- /dev/null +++ b/ext/intl/tests/dateformat_format_variant2.phpt @@ -0,0 +1,423 @@ +--TEST-- +datefmt_format_code() +--SKIPIF-- + += 51.2'); ?> +--FILE-- + 24 , + 'tm_min' => 3, + 'tm_hour' => 19, + 'tm_mday' => 3, + 'tm_mon' => 3, + 'tm_year' => 105, + ); + $localtime_arr2 = array ( + 'tm_sec' => 21, + 'tm_min' => 5, + 'tm_hour' => 7, + 'tm_mday' => 13, + 'tm_mon' => 4, + 'tm_year' => 205, + ); + $localtime_arr3 = array ( + 'tm_sec' => 11, + 'tm_min' => 13, + 'tm_hour' => 0, + 'tm_mday' => 17, + 'tm_mon' => 11, + 'tm_year' => -5 + ); + + $localtime_arr = array ( + $localtime_arr1, + $localtime_arr2, + $localtime_arr3 + ); + + $d1 = new DateTime("2010-01-01 01:02:03", new DateTimeZone("UTC")); + $d2 = new DateTime("2000-12-31 03:04:05", new DateTimeZone("UTC")); + $d2->setTimezone(new DateTimeZone("PDT")); + $dates = array( + $d1, + $d2, + new StdClass(), + ); + + //Test format with input as a timestamp : integer + foreach( $time_arr as $timestamp_entry){ + $res_str .= "\n------------\n"; + $res_str .= "\nInput timestamp is : $timestamp_entry"; + $res_str .= "\n------------\n"; + foreach( $locale_arr as $locale_entry ){ + foreach( $datetype_arr as $datetype_entry ) + { + $res_str .= "\nIntlDateFormatter locale= $locale_entry ,datetype = $datetype_entry ,timetype =$datetype_entry "; + $fmt = ut_datefmt_create( $locale_entry , $datetype_entry ,$datetype_entry, $timezone, IntlDateFormatter::GREGORIAN); + $formatted = ut_datefmt_format( $fmt , $timestamp_entry); + $res_str .= "\nFormatted timestamp is : $formatted"; + } + } + } + + //Test format with input as a localtime :array + foreach( $localtime_arr as $localtime_entry){ + $res_str .= "\n------------\n"; + $res_str .= "\nInput localtime is : "; + foreach( $localtime_entry as $key => $value){ + $res_str .= "$key : '$value' , "; + } + + $res_str .= "\n------------\n"; + foreach( $locale_arr as $locale_entry ){ + foreach( $datetype_arr as $datetype_entry ) + { + $res_str .= "\nIntlDateFormatter locale= $locale_entry ,datetype = $datetype_entry ,timetype =$datetype_entry "; + $fmt = ut_datefmt_create( $locale_entry , $datetype_entry ,$datetype_entry, $timezone, IntlDateFormatter::GREGORIAN ); + $formatted1 = ut_datefmt_format( $fmt , $localtime_entry); + if( intl_get_error_code() == U_ZERO_ERROR){ + $res_str .= "\nFormatted localtime_array is : $formatted1"; + }else{ + $res_str .= "\nError while formatting as: '".intl_get_error_message()."'"; + } + } + } + } + + foreach($dates as $date_entry) { + foreach( $locale_arr as $locale_entry ){ + foreach( $datetype_arr as $datetype_entry ) { + $res_str .= "\n------------"; + $res_str .= "\nDate is: ".var_export($date_entry, true); + $res_str .= "\n------------"; + + $fmt = ut_datefmt_create( $locale_entry , $datetype_entry ,$datetype_entry, $timezone, IntlDateFormatter::GREGORIAN ); + $formatted1 = ut_datefmt_format( $fmt , $date_entry); + if( intl_get_error_code() == U_ZERO_ERROR){ + $res_str .= "\nFormatted DateTime is : $formatted1"; + }else{ + $res_str .= "\nError while formatting as: '".intl_get_error_message()."'"; + } + } + } + } + + return $res_str; + +} + +include_once( 'ut_common.inc' ); + +// Run the test +ut_run(); +?> +--EXPECT-- +------------ + +Input timestamp is : 0 +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted timestamp is : Wednesday, December 31, 1969 at 2:00:00 PM GMT-10:00 +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted timestamp is : December 31, 1969 at 2:00:00 PM GMT-10 +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted timestamp is : Dec 31, 1969, 2:00:00 PM +IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3 +Formatted timestamp is : 12/31/69, 2:00 PM +IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1 +Formatted timestamp is : 19691231 02:00 PM +------------ + +Input timestamp is : -1200000 +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted timestamp is : Wednesday, December 17, 1969 at 4:40:00 PM GMT-10:00 +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted timestamp is : December 17, 1969 at 4:40:00 PM GMT-10 +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted timestamp is : Dec 17, 1969, 4:40:00 PM +IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3 +Formatted timestamp is : 12/17/69, 4:40 PM +IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1 +Formatted timestamp is : 19691217 04:40 PM +------------ + +Input timestamp is : 1200000 +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted timestamp is : Wednesday, January 14, 1970 at 11:20:00 AM GMT-10:00 +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted timestamp is : January 14, 1970 at 11:20:00 AM GMT-10 +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted timestamp is : Jan 14, 1970, 11:20:00 AM +IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3 +Formatted timestamp is : 1/14/70, 11:20 AM +IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1 +Formatted timestamp is : 19700114 11:20 AM +------------ + +Input timestamp is : 2200000000 +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted timestamp is : Sunday, September 18, 2039 at 1:06:40 PM GMT-10:00 +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted timestamp is : September 18, 2039 at 1:06:40 PM GMT-10 +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted timestamp is : Sep 18, 2039, 1:06:40 PM +IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3 +Formatted timestamp is : 9/18/39, 1:06 PM +IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1 +Formatted timestamp is : 20390918 01:06 PM +------------ + +Input timestamp is : -2200000000 +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted timestamp is : Saturday, April 14, 1900 at 2:53:20 PM GMT-10:00 +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted timestamp is : April 14, 1900 at 2:53:20 PM GMT-10 +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted timestamp is : Apr 14, 1900, 2:53:20 PM +IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3 +Formatted timestamp is : 4/14/00, 2:53 PM +IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1 +Formatted timestamp is : 19000414 02:53 PM +------------ + +Input timestamp is : 90099999 +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted timestamp is : Wednesday, November 8, 1972 at 9:46:39 AM GMT-10:00 +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted timestamp is : November 8, 1972 at 9:46:39 AM GMT-10 +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted timestamp is : Nov 8, 1972, 9:46:39 AM +IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3 +Formatted timestamp is : 11/8/72, 9:46 AM +IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1 +Formatted timestamp is : 19721108 09:46 AM +------------ + +Input timestamp is : 3600 +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted timestamp is : Wednesday, December 31, 1969 at 3:00:00 PM GMT-10:00 +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted timestamp is : December 31, 1969 at 3:00:00 PM GMT-10 +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted timestamp is : Dec 31, 1969, 3:00:00 PM +IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3 +Formatted timestamp is : 12/31/69, 3:00 PM +IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1 +Formatted timestamp is : 19691231 03:00 PM +------------ + +Input timestamp is : -3600 +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted timestamp is : Wednesday, December 31, 1969 at 1:00:00 PM GMT-10:00 +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted timestamp is : December 31, 1969 at 1:00:00 PM GMT-10 +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted timestamp is : Dec 31, 1969, 1:00:00 PM +IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3 +Formatted timestamp is : 12/31/69, 1:00 PM +IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1 +Formatted timestamp is : 19691231 01:00 PM +------------ + +Input localtime is : tm_sec : '24' , tm_min : '3' , tm_hour : '19' , tm_mday : '3' , tm_mon : '3' , tm_year : '105' , +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted localtime_array is : Sunday, April 3, 2005 at 7:03:24 PM GMT-10:00 +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted localtime_array is : April 3, 2005 at 7:03:24 PM GMT-10 +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted localtime_array is : Apr 3, 2005, 7:03:24 PM +IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3 +Formatted localtime_array is : 4/3/05, 7:03 PM +IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1 +Formatted localtime_array is : 20050403 07:03 PM +------------ + +Input localtime is : tm_sec : '21' , tm_min : '5' , tm_hour : '7' , tm_mday : '13' , tm_mon : '4' , tm_year : '205' , +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted localtime_array is : Wednesday, May 13, 2105 at 7:05:21 AM GMT-10:00 +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted localtime_array is : May 13, 2105 at 7:05:21 AM GMT-10 +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted localtime_array is : May 13, 2105, 7:05:21 AM +IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3 +Formatted localtime_array is : 5/13/05, 7:05 AM +IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1 +Formatted localtime_array is : 21050513 07:05 AM +------------ + +Input localtime is : tm_sec : '11' , tm_min : '13' , tm_hour : '0' , tm_mday : '17' , tm_mon : '11' , tm_year : '-5' , +------------ + +IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0 +Formatted localtime_array is : Tuesday, December 17, 1895 at 12:13:11 AM GMT-10:00 +IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1 +Formatted localtime_array is : December 17, 1895 at 12:13:11 AM GMT-10 +IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2 +Formatted localtime_array is : Dec 17, 1895, 12:13:11 AM +IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3 +Formatted localtime_array is : 12/17/95, 12:13 AM +IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1 +Formatted localtime_array is : 18951217 12:13 AM +------------ +Date is: DateTime::__set_state(array( + 'date' => '2010-01-01 01:02:03', + 'timezone_type' => 3, + 'timezone' => 'UTC', +)) +------------ +Formatted DateTime is : Thursday, December 31, 2009 at 3:02:03 PM GMT-10:00 +------------ +Date is: DateTime::__set_state(array( + 'date' => '2010-01-01 01:02:03', + 'timezone_type' => 3, + 'timezone' => 'UTC', +)) +------------ +Formatted DateTime is : December 31, 2009 at 3:02:03 PM GMT-10 +------------ +Date is: DateTime::__set_state(array( + 'date' => '2010-01-01 01:02:03', + 'timezone_type' => 3, + 'timezone' => 'UTC', +)) +------------ +Formatted DateTime is : Dec 31, 2009, 3:02:03 PM +------------ +Date is: DateTime::__set_state(array( + 'date' => '2010-01-01 01:02:03', + 'timezone_type' => 3, + 'timezone' => 'UTC', +)) +------------ +Formatted DateTime is : 12/31/09, 3:02 PM +------------ +Date is: DateTime::__set_state(array( + 'date' => '2010-01-01 01:02:03', + 'timezone_type' => 3, + 'timezone' => 'UTC', +)) +------------ +Formatted DateTime is : 20091231 03:02 PM +------------ +Date is: DateTime::__set_state(array( + 'date' => '2000-12-30 19:04:05', + 'timezone_type' => 3, + 'timezone' => 'America/Los_Angeles', +)) +------------ +Formatted DateTime is : Saturday, December 30, 2000 at 5:04:05 PM GMT-10:00 +------------ +Date is: DateTime::__set_state(array( + 'date' => '2000-12-30 19:04:05', + 'timezone_type' => 3, + 'timezone' => 'America/Los_Angeles', +)) +------------ +Formatted DateTime is : December 30, 2000 at 5:04:05 PM GMT-10 +------------ +Date is: DateTime::__set_state(array( + 'date' => '2000-12-30 19:04:05', + 'timezone_type' => 3, + 'timezone' => 'America/Los_Angeles', +)) +------------ +Formatted DateTime is : Dec 30, 2000, 5:04:05 PM +------------ +Date is: DateTime::__set_state(array( + 'date' => '2000-12-30 19:04:05', + 'timezone_type' => 3, + 'timezone' => 'America/Los_Angeles', +)) +------------ +Formatted DateTime is : 12/30/00, 5:04 PM +------------ +Date is: DateTime::__set_state(array( + 'date' => '2000-12-30 19:04:05', + 'timezone_type' => 3, + 'timezone' => 'America/Los_Angeles', +)) +------------ +Formatted DateTime is : 20001230 05:04 PM +------------ +Date is: stdClass::__set_state(array( +)) +------------ +Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR' +------------ +Date is: stdClass::__set_state(array( +)) +------------ +Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR' +------------ +Date is: stdClass::__set_state(array( +)) +------------ +Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR' +------------ +Date is: stdClass::__set_state(array( +)) +------------ +Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR' +------------ +Date is: stdClass::__set_state(array( +)) +------------ +Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR' diff --git a/ext/intl/tests/dateformat_get_set_calendar.phpt b/ext/intl/tests/dateformat_get_set_calendar.phpt index dbb3e6cd2391c..f91fe5c775a21 100644 --- a/ext/intl/tests/dateformat_get_set_calendar.phpt +++ b/ext/intl/tests/dateformat_get_set_calendar.phpt @@ -2,8 +2,8 @@ IntlDateFormatter: setCalendar()/getCalendar()/getCalendarObject() --SKIPIF-- += 0) die('skip for ICU < 51.2'); ?> --FILE-- += 51.2'); ?> +--FILE-- +format($ts), "\n"; +var_dump($df->getCalendar(), +$df->getCalendarObject()->getType(), +$df->getCalendarObject()->getTimeZone()->getId()); +echo "\n"; +} + +$df = new IntlDateFormatter('fr@calendar=islamic', 0, 0, 'Europe/Minsk'); +d($df); + + +//changing the calendar with a cal type should not change tz +$df->setCalendar(IntlDateFormatter::TRADITIONAL); +d($df); + +//but changing with an actual calendar should +$cal = IntlCalendar::createInstance("UTC"); +$df->setCalendar($cal); +d($df); + +?> +==DONE== +--EXPECT-- +dimanche 1 janvier 2012 ap. J.-C. 03:00:00 UTC+03:00 +int(1) +string(9) "gregorian" +string(12) "Europe/Minsk" + +dimanche 8 safar 1433 AH 03:00:00 UTC+03:00 +int(0) +string(7) "islamic" +string(12) "Europe/Minsk" + +dimanche 1 janvier 2012 ap. J.-C. 00:00:00 UTC +bool(false) +string(9) "gregorian" +string(3) "UTC" + +==DONE== diff --git a/ext/intl/tests/dateformat_get_set_timezone.phpt b/ext/intl/tests/dateformat_get_set_timezone.phpt index 41aa35b9cf3c6..2a7ffa6c7393c 100644 --- a/ext/intl/tests/dateformat_get_set_timezone.phpt +++ b/ext/intl/tests/dateformat_get_set_timezone.phpt @@ -2,8 +2,8 @@ IntlDateFormatter: get/setTimeZone() --SKIPIF-- += 0) die('skip for ICU < 51.2'); ?> --FILE-- += 51.2'); ?> +--FILE-- +format($ts), "\n"; +var_dump( +$df->getTimeZoneID(), +$df->getTimeZone()->getID()); +echo "\n"; +} + +$df = new IntlDateFormatter('pt_PT', 0, 0, 'Europe/Minsk'); +d($df); + +$df->setTimeZone(NULL); +d($df); + +$df->setTimeZone('Europe/Madrid'); +d($df); + +$df->setTimeZone(IntlTimeZone::createTimeZone('Europe/Paris')); +d($df); + +$df->setTimeZone(new DateTimeZone('Europe/Amsterdam')); +d($df); + +?> +==DONE== +--EXPECTF-- +Domingo, 1 de Janeiro de 2012 às 03:00:00 GMT+03:00 +string(12) "Europe/Minsk" +string(12) "Europe/Minsk" + +Sábado, 31 de Dezembro de 2011 às 23:00:00 Hor%s %Sdos Açores +string(15) "Atlantic/Azores" +string(15) "Atlantic/Azores" + +Domingo, 1 de Janeiro de 2012 às 01:00:00 Hor%s %Sda Europa Central +string(13) "Europe/Madrid" +string(13) "Europe/Madrid" + +Domingo, 1 de Janeiro de 2012 às 01:00:00 Hor%s %Sda Europa Central +string(12) "Europe/Paris" +string(12) "Europe/Paris" + +Domingo, 1 de Janeiro de 2012 às 01:00:00 Hor%s %Sda Europa Central +string(16) "Europe/Amsterdam" +string(16) "Europe/Amsterdam" + +==DONE== diff --git a/ext/intl/tests/dateformat_set_timezone_id2.phpt b/ext/intl/tests/dateformat_set_timezone_id2.phpt index ce9b89d1fdbbf..a1ee440e71d99 100644 --- a/ext/intl/tests/dateformat_set_timezone_id2.phpt +++ b/ext/intl/tests/dateformat_set_timezone_id2.phpt @@ -5,6 +5,7 @@ date.timezone=Atlantic/Azores --SKIPIF-- += 0) die('skip for ICU < 51.2'); ?> --FILE-- = 4.8 +--INI-- +date.timezone=Atlantic/Azores +--SKIPIF-- + += 51.2'); ?> +--FILE-- + +--EXPECTF-- +Warning: IntlDateFormatter::setTimeZoneId(): datefmt_set_timezone: no such time zone: 'CN' in %sut_common.inc on line %d + +Warning: datefmt_set_timezone_id(): datefmt_set_timezone: no such time zone: 'CN' in %sut_common.inc on line %d + +After creation of the dateformatter : timezone_id= US/Pacific +----------- +Trying to set timezone_id= America/New_York +After call to set_timezone_id : timezone_id= America/New_York +Formatting timestamp=0 resulted in Wednesday, December 31, 1969 at 7:00:00 PM Eastern Standard Time +Formatting timestamp=3600 resulted in Wednesday, December 31, 1969 at 8:00:00 PM Eastern Standard Time +----------- +Trying to set timezone_id= America/Los_Angeles +After call to set_timezone_id : timezone_id= America/Los_Angeles +Formatting timestamp=0 resulted in Wednesday, December 31, 1969 at 4:00:00 PM Pacific Standard Time +Formatting timestamp=3600 resulted in Wednesday, December 31, 1969 at 5:00:00 PM Pacific Standard Time +----------- +Trying to set timezone_id= America/Chicago +After call to set_timezone_id : timezone_id= America/Chicago +Formatting timestamp=0 resulted in Wednesday, December 31, 1969 at 6:00:00 PM Central Standard Time +Formatting timestamp=3600 resulted in Wednesday, December 31, 1969 at 7:00:00 PM Central Standard Time +----------- +Trying to set timezone_id= CN +After call to set_timezone_id : timezone_id= America/Chicago +Formatting timestamp=0 resulted in Wednesday, December 31, 1969 at 6:00:00 PM Central Standard Time +Formatting timestamp=3600 resulted in Wednesday, December 31, 1969 at 7:00:00 PM Central Standard Time diff --git a/ext/intl/tests/dateformat_timezone_arg_variations.phpt b/ext/intl/tests/dateformat_timezone_arg_variations.phpt index ccfb5e19646a6..9fbb145c72e0b 100644 --- a/ext/intl/tests/dateformat_timezone_arg_variations.phpt +++ b/ext/intl/tests/dateformat_timezone_arg_variations.phpt @@ -2,8 +2,8 @@ IntlDateFormatter: several forms of the timezone arg --SKIPIF-- += 0) die('skip for ICU < 51.2'); ?> --FILE-- += 51.2'); ?> +--FILE-- +format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam'); +echo $df->format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, new DateTimeZone('Europe/Lisbon')); +echo $df->format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, IntlTimeZone::createTimeZone('America/New_York')); +echo $df->format($ts), "\n"; + +//time zone has priority +$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', new IntlGregorianCalendar('Europe/Lisbon')); +echo $df->format($ts), "\n"; + +//calendar has priority +$df = new IntlDateFormatter('es_ES', 0, 0, NULL, new IntlGregorianCalendar('Europe/Lisbon')); +echo $df->format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', 0); +echo $df->format($ts), "\n"; + +--EXPECTF-- +sábado%S, 31 de diciembre de 2011 23:00:00 Hora estándar de las Azores +domingo%S, 1 de enero de 2012 01:00:00 Hora estándar de Europa central +domingo%S, 1 de enero de 2012 00:00:00 Hora%S de Europa occidental +sábado%S, 31 de diciembre de 2011 19:00:00 Hora estándar oriental +domingo%S, 1 de enero de 2012 01:00:00 Hora estándar de Europa central +domingo%S, 1 de enero de 2012 00:00:00 Hora%S de Europa occidental +domingo%S, 1 de enero de 2012 01:00:00 Hora estándar de Europa central diff --git a/ext/intl/tests/formatter_get_locale.phpt b/ext/intl/tests/formatter_get_locale.phpt index 3d4fb2ae4e036..7474eabbbacdd 100644 --- a/ext/intl/tests/formatter_get_locale.phpt +++ b/ext/intl/tests/formatter_get_locale.phpt @@ -2,6 +2,7 @@ numfmt_get_locale() --SKIPIF-- += 0) die('skip for ICU < 51.2'); ?> --FILE-- += 51.2'); ?> +--FILE-- + 'actual', + Locale::VALID_LOCALE => 'valid', + ); + + $res_str = ''; + + foreach( $locales as $locale ) + { + $fmt = ut_nfmt_create( $locale, NumberFormatter::DECIMAL ); + $res_str .= "$locale: "; + foreach( $loc_types as $loc_type => $loc_type_name ) + $res_str .= sprintf( " %s=%s", + $loc_type_name, + dump( ut_nfmt_get_locale( $fmt, $loc_type ) ) ); + $res_str .= "\n"; + } + + return $res_str; +} + +include_once( 'ut_common.inc' ); + +// Run the test +ut_run(); +?> +--EXPECT-- +en_UK: actual='en' valid='en' +en_US@California: actual='en' valid='en' +fr_CA: actual='fr' valid='fr_CA' diff --git a/ext/intl/tests/locale_filter_matches2.phpt b/ext/intl/tests/locale_filter_matches2.phpt index 37f9e5a37737a..12d247dc6be7e 100644 --- a/ext/intl/tests/locale_filter_matches2.phpt +++ b/ext/intl/tests/locale_filter_matches2.phpt @@ -1,8 +1,9 @@ --TEST-- -locale_filter_matches.phpt() icu >= 4.8 +locale_filter_matches.phpt() icu >= 4.8 && icu < 51.2 --SKIPIF-- += 0) die('skip for ICU < 51.2'); ?> --FILE-- = 51.2 +--SKIPIF-- + += 51.2'); ?> +--FILE-- + +--EXPECT-- +-------------- +loc_range:de-de matches lang_tag de-DEVA ? NO +loc_range:de_DE canonically matches lang_tag de_Deva ? NO +-------------- +loc_range:de-de matches lang_tag de-DE-1996 ? YES +loc_range:de_DE canonically matches lang_tag de_DE_1996 ? YES +-------------- +loc_range:de-de matches lang_tag de-DE ? YES +loc_range:de_DE canonically matches lang_tag de_DE ? YES +-------------- +loc_range:de-de matches lang_tag zh_Hans ? NO +loc_range:de_DE canonically matches lang_tag zh_Hans ? NO +-------------- +loc_range:de-de matches lang_tag de-CH-1996 ? NO +loc_range:de_DE canonically matches lang_tag de_CH_1996 ? NO +-------------- +loc_range:de-de matches lang_tag sl_IT ? NO +loc_range:de_DE canonically matches lang_tag sl_IT ? NO +-------------- +loc_range:de-de matches lang_tag sl_IT_nedis-a-kirti-x-xyz ? NO +loc_range:de_DE canonically matches lang_tag sl_IT_NEDIS_A_KIRTI_X_XYZ ? NO +-------------- +loc_range:de-de matches lang_tag sl_IT_rozaj ? NO +loc_range:de_DE canonically matches lang_tag sl_IT_ROZAJ ? NO +-------------- +loc_range:de-de matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? NO +loc_range:de_DE canonically matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? NO +-------------- +loc_range:de-de matches lang_tag i-enochian ? NO +loc_range:de_DE canonically matches lang_tag @x=i-enochian ? NO +-------------- +loc_range:de-de matches lang_tag sgn-CH-de ? NO +loc_range:de_DE canonically matches lang_tag sgn_CH_DE ? NO +-------------- +loc_range:de-de matches lang_tag art-lojban ? NO +loc_range:de_DE canonically matches lang_tag art__LOJBAN ? NO +-------------- +loc_range:de-de matches lang_tag i-lux ? NO +loc_range:de_DE canonically matches lang_tag lb ? NO +-------------- +loc_range:de-de matches lang_tag art-lojban ? NO +loc_range:de_DE canonically matches lang_tag art__LOJBAN ? NO +-------------- +loc_range:de-de matches lang_tag jbo ? NO +loc_range:de_DE canonically matches lang_tag jbo ? NO +-------------- +loc_range:de-de matches lang_tag en_sl_IT ? NO +loc_range:de_DE canonically matches lang_tag en_SL_IT ? NO +-------------- +loc_range:sl_IT matches lang_tag de-DEVA ? NO +loc_range:sl_IT canonically matches lang_tag de_Deva ? NO +-------------- +loc_range:sl_IT matches lang_tag de-DE-1996 ? NO +loc_range:sl_IT canonically matches lang_tag de_DE_1996 ? NO +-------------- +loc_range:sl_IT matches lang_tag de-DE ? NO +loc_range:sl_IT canonically matches lang_tag de_DE ? NO +-------------- +loc_range:sl_IT matches lang_tag zh_Hans ? NO +loc_range:sl_IT canonically matches lang_tag zh_Hans ? NO +-------------- +loc_range:sl_IT matches lang_tag de-CH-1996 ? NO +loc_range:sl_IT canonically matches lang_tag de_CH_1996 ? NO +-------------- +loc_range:sl_IT matches lang_tag sl_IT ? YES +loc_range:sl_IT canonically matches lang_tag sl_IT ? YES +-------------- +loc_range:sl_IT matches lang_tag sl_IT_nedis-a-kirti-x-xyz ? YES +loc_range:sl_IT canonically matches lang_tag sl_IT_NEDIS_A_KIRTI_X_XYZ ? YES +-------------- +loc_range:sl_IT matches lang_tag sl_IT_rozaj ? YES +loc_range:sl_IT canonically matches lang_tag sl_IT_ROZAJ ? YES +-------------- +loc_range:sl_IT matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? YES +loc_range:sl_IT canonically matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? YES +-------------- +loc_range:sl_IT matches lang_tag i-enochian ? NO +loc_range:sl_IT canonically matches lang_tag @x=i-enochian ? NO +-------------- +loc_range:sl_IT matches lang_tag sgn-CH-de ? NO +loc_range:sl_IT canonically matches lang_tag sgn_CH_DE ? NO +-------------- +loc_range:sl_IT matches lang_tag art-lojban ? NO +loc_range:sl_IT canonically matches lang_tag art__LOJBAN ? NO +-------------- +loc_range:sl_IT matches lang_tag i-lux ? NO +loc_range:sl_IT canonically matches lang_tag lb ? NO +-------------- +loc_range:sl_IT matches lang_tag art-lojban ? NO +loc_range:sl_IT canonically matches lang_tag art__LOJBAN ? NO +-------------- +loc_range:sl_IT matches lang_tag jbo ? NO +loc_range:sl_IT canonically matches lang_tag jbo ? NO +-------------- +loc_range:sl_IT matches lang_tag en_sl_IT ? NO +loc_range:sl_IT canonically matches lang_tag en_SL_IT ? NO +-------------- +loc_range:sl_IT_Nedis matches lang_tag de-DEVA ? NO +loc_range:sl_IT_NEDIS canonically matches lang_tag de_Deva ? NO +-------------- +loc_range:sl_IT_Nedis matches lang_tag de-DE-1996 ? NO +loc_range:sl_IT_NEDIS canonically matches lang_tag de_DE_1996 ? NO +-------------- +loc_range:sl_IT_Nedis matches lang_tag de-DE ? NO +loc_range:sl_IT_NEDIS canonically matches lang_tag de_DE ? NO +-------------- +loc_range:sl_IT_Nedis matches lang_tag zh_Hans ? NO +loc_range:sl_IT_NEDIS canonically matches lang_tag zh_Hans ? NO +-------------- +loc_range:sl_IT_Nedis matches lang_tag de-CH-1996 ? NO +loc_range:sl_IT_NEDIS canonically matches lang_tag de_CH_1996 ? NO +-------------- +loc_range:sl_IT_Nedis matches lang_tag sl_IT ? NO +loc_range:sl_IT_NEDIS canonically matches lang_tag sl_IT ? NO +-------------- +loc_range:sl_IT_Nedis matches lang_tag sl_IT_nedis-a-kirti-x-xyz ? YES +loc_range:sl_IT_NEDIS canonically matches lang_tag sl_IT_NEDIS_A_KIRTI_X_XYZ ? YES +-------------- +loc_range:sl_IT_Nedis matches lang_tag sl_IT_rozaj ? NO +loc_range:sl_IT_NEDIS canonically matches lang_tag sl_IT_ROZAJ ? NO +-------------- +loc_range:sl_IT_Nedis matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? YES +loc_range:sl_IT_NEDIS canonically matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? YES +-------------- +loc_range:sl_IT_Nedis matches lang_tag i-enochian ? NO +loc_range:sl_IT_NEDIS canonically matches lang_tag @x=i-enochian ? NO +-------------- +loc_range:sl_IT_Nedis matches lang_tag sgn-CH-de ? NO +loc_range:sl_IT_NEDIS canonically matches lang_tag sgn_CH_DE ? NO +-------------- +loc_range:sl_IT_Nedis matches lang_tag art-lojban ? NO +loc_range:sl_IT_NEDIS canonically matches lang_tag art__LOJBAN ? NO +-------------- +loc_range:sl_IT_Nedis matches lang_tag i-lux ? NO +loc_range:sl_IT_NEDIS canonically matches lang_tag lb ? NO +-------------- +loc_range:sl_IT_Nedis matches lang_tag art-lojban ? NO +loc_range:sl_IT_NEDIS canonically matches lang_tag art__LOJBAN ? NO +-------------- +loc_range:sl_IT_Nedis matches lang_tag jbo ? NO +loc_range:sl_IT_NEDIS canonically matches lang_tag jbo ? NO +-------------- +loc_range:sl_IT_Nedis matches lang_tag en_sl_IT ? NO +loc_range:sl_IT_NEDIS canonically matches lang_tag en_SL_IT ? NO +-------------- +loc_range:jbo matches lang_tag de-DEVA ? NO +loc_range:jbo canonically matches lang_tag de_Deva ? NO +-------------- +loc_range:jbo matches lang_tag de-DE-1996 ? NO +loc_range:jbo canonically matches lang_tag de_DE_1996 ? NO +-------------- +loc_range:jbo matches lang_tag de-DE ? NO +loc_range:jbo canonically matches lang_tag de_DE ? NO +-------------- +loc_range:jbo matches lang_tag zh_Hans ? NO +loc_range:jbo canonically matches lang_tag zh_Hans ? NO +-------------- +loc_range:jbo matches lang_tag de-CH-1996 ? NO +loc_range:jbo canonically matches lang_tag de_CH_1996 ? NO +-------------- +loc_range:jbo matches lang_tag sl_IT ? NO +loc_range:jbo canonically matches lang_tag sl_IT ? NO +-------------- +loc_range:jbo matches lang_tag sl_IT_nedis-a-kirti-x-xyz ? NO +loc_range:jbo canonically matches lang_tag sl_IT_NEDIS_A_KIRTI_X_XYZ ? NO +-------------- +loc_range:jbo matches lang_tag sl_IT_rozaj ? NO +loc_range:jbo canonically matches lang_tag sl_IT_ROZAJ ? NO +-------------- +loc_range:jbo matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? NO +loc_range:jbo canonically matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? NO +-------------- +loc_range:jbo matches lang_tag i-enochian ? NO +loc_range:jbo canonically matches lang_tag @x=i-enochian ? NO +-------------- +loc_range:jbo matches lang_tag sgn-CH-de ? NO +loc_range:jbo canonically matches lang_tag sgn_CH_DE ? NO +-------------- +loc_range:jbo matches lang_tag art-lojban ? NO +loc_range:jbo canonically matches lang_tag art__LOJBAN ? NO +-------------- +loc_range:jbo matches lang_tag i-lux ? NO +loc_range:jbo canonically matches lang_tag lb ? NO +-------------- +loc_range:jbo matches lang_tag art-lojban ? NO +loc_range:jbo canonically matches lang_tag art__LOJBAN ? NO +-------------- +loc_range:jbo matches lang_tag jbo ? YES +loc_range:jbo canonically matches lang_tag jbo ? YES +-------------- +loc_range:jbo matches lang_tag en_sl_IT ? NO +loc_range:jbo canonically matches lang_tag en_SL_IT ? NO +-------------- +loc_range:art-lojban matches lang_tag de-DEVA ? NO +loc_range:art__LOJBAN canonically matches lang_tag de_Deva ? NO +-------------- +loc_range:art-lojban matches lang_tag de-DE-1996 ? NO +loc_range:art__LOJBAN canonically matches lang_tag de_DE_1996 ? NO +-------------- +loc_range:art-lojban matches lang_tag de-DE ? NO +loc_range:art__LOJBAN canonically matches lang_tag de_DE ? NO +-------------- +loc_range:art-lojban matches lang_tag zh_Hans ? NO +loc_range:art__LOJBAN canonically matches lang_tag zh_Hans ? NO +-------------- +loc_range:art-lojban matches lang_tag de-CH-1996 ? NO +loc_range:art__LOJBAN canonically matches lang_tag de_CH_1996 ? NO +-------------- +loc_range:art-lojban matches lang_tag sl_IT ? NO +loc_range:art__LOJBAN canonically matches lang_tag sl_IT ? NO +-------------- +loc_range:art-lojban matches lang_tag sl_IT_nedis-a-kirti-x-xyz ? NO +loc_range:art__LOJBAN canonically matches lang_tag sl_IT_NEDIS_A_KIRTI_X_XYZ ? NO +-------------- +loc_range:art-lojban matches lang_tag sl_IT_rozaj ? NO +loc_range:art__LOJBAN canonically matches lang_tag sl_IT_ROZAJ ? NO +-------------- +loc_range:art-lojban matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? NO +loc_range:art__LOJBAN canonically matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? NO +-------------- +loc_range:art-lojban matches lang_tag i-enochian ? NO +loc_range:art__LOJBAN canonically matches lang_tag @x=i-enochian ? NO +-------------- +loc_range:art-lojban matches lang_tag sgn-CH-de ? NO +loc_range:art__LOJBAN canonically matches lang_tag sgn_CH_DE ? NO +-------------- +loc_range:art-lojban matches lang_tag art-lojban ? YES +loc_range:art__LOJBAN canonically matches lang_tag art__LOJBAN ? YES +-------------- +loc_range:art-lojban matches lang_tag i-lux ? NO +loc_range:art__LOJBAN canonically matches lang_tag lb ? NO +-------------- +loc_range:art-lojban matches lang_tag art-lojban ? YES +loc_range:art__LOJBAN canonically matches lang_tag art__LOJBAN ? YES +-------------- +loc_range:art-lojban matches lang_tag jbo ? NO +loc_range:art__LOJBAN canonically matches lang_tag jbo ? NO +-------------- +loc_range:art-lojban matches lang_tag en_sl_IT ? NO +loc_range:art__LOJBAN canonically matches lang_tag en_SL_IT ? NO +-------------- +loc_range:sl_IT matches lang_tag de-DEVA ? NO +loc_range:sl_IT canonically matches lang_tag de_Deva ? NO +-------------- +loc_range:sl_IT matches lang_tag de-DE-1996 ? NO +loc_range:sl_IT canonically matches lang_tag de_DE_1996 ? NO +-------------- +loc_range:sl_IT matches lang_tag de-DE ? NO +loc_range:sl_IT canonically matches lang_tag de_DE ? NO +-------------- +loc_range:sl_IT matches lang_tag zh_Hans ? NO +loc_range:sl_IT canonically matches lang_tag zh_Hans ? NO +-------------- +loc_range:sl_IT matches lang_tag de-CH-1996 ? NO +loc_range:sl_IT canonically matches lang_tag de_CH_1996 ? NO +-------------- +loc_range:sl_IT matches lang_tag sl_IT ? YES +loc_range:sl_IT canonically matches lang_tag sl_IT ? YES +-------------- +loc_range:sl_IT matches lang_tag sl_IT_nedis-a-kirti-x-xyz ? YES +loc_range:sl_IT canonically matches lang_tag sl_IT_NEDIS_A_KIRTI_X_XYZ ? YES +-------------- +loc_range:sl_IT matches lang_tag sl_IT_rozaj ? YES +loc_range:sl_IT canonically matches lang_tag sl_IT_ROZAJ ? YES +-------------- +loc_range:sl_IT matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? YES +loc_range:sl_IT canonically matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? YES +-------------- +loc_range:sl_IT matches lang_tag i-enochian ? NO +loc_range:sl_IT canonically matches lang_tag @x=i-enochian ? NO +-------------- +loc_range:sl_IT matches lang_tag sgn-CH-de ? NO +loc_range:sl_IT canonically matches lang_tag sgn_CH_DE ? NO +-------------- +loc_range:sl_IT matches lang_tag art-lojban ? NO +loc_range:sl_IT canonically matches lang_tag art__LOJBAN ? NO +-------------- +loc_range:sl_IT matches lang_tag i-lux ? NO +loc_range:sl_IT canonically matches lang_tag lb ? NO +-------------- +loc_range:sl_IT matches lang_tag art-lojban ? NO +loc_range:sl_IT canonically matches lang_tag art__LOJBAN ? NO +-------------- +loc_range:sl_IT matches lang_tag jbo ? NO +loc_range:sl_IT canonically matches lang_tag jbo ? NO +-------------- +loc_range:sl_IT matches lang_tag en_sl_IT ? NO +loc_range:sl_IT canonically matches lang_tag en_SL_IT ? NO diff --git a/ext/intl/tests/locale_get_display_name2.phpt b/ext/intl/tests/locale_get_display_name2.phpt index 40ccc0c2c50fb..bd8cb50cd53c8 100644 --- a/ext/intl/tests/locale_get_display_name2.phpt +++ b/ext/intl/tests/locale_get_display_name2.phpt @@ -1,8 +1,9 @@ --TEST-- -locale_get_display_name() icu >= 4.8 +locale_get_display_name() icu >= 4.8 && icu < 51.2 --SKIPIF-- += 0) die('skip for ICU < 51.2'); ?> --FILE-- = 51.2 +--SKIPIF-- + += 51.2'); ?> +--FILE-- + +--EXPECTREGEX-- +locale='sl_IT_nedis_KIRTI' +disp_locale=en : display_name=Slovenian #Italy, NEDIS_KIRTI# +disp_locale=fr : display_name=slovène #Italie, NEDIS_KIRTI# +disp_locale=de : display_name=Slowenisch #Italien, NEDIS_KIRTI# +----------------- +locale='sl_IT_nedis-a-kirti-x-xyz' +disp_locale=en : display_name=Slovenian #Italy, NEDIS_A_KIRTI_X_XYZ# +disp_locale=fr : display_name=slovène #Italie, NEDIS_A_KIRTI_X_XYZ# +disp_locale=de : display_name=Slowenisch #Italien, NEDIS_A_KIRTI_X_XYZ# +----------------- +locale='sl_IT_rozaj' +disp_locale=en : display_name=Slovenian #Italy, Resian# +disp_locale=fr : display_name=slovène #Italie, dialecte de Resia# +disp_locale=de : display_name=Slowenisch #Italien, (ROZAJ|Resianisch)# +----------------- +locale='sl_IT_NEDIS_ROJAZ_1901' +disp_locale=en : display_name=Slovenian #Italy, NEDIS_ROJAZ_1901# +disp_locale=fr : display_name=slovène #Italie, NEDIS_ROJAZ_1901# +disp_locale=de : display_name=Slowenisch #Italien, NEDIS_ROJAZ_1901# +----------------- +locale='i-enochian' +disp_locale=en : display_name=i-enochian #Private-Use=i-enochian# +disp_locale=fr : display_name=i-enochian #Usage privé=i-enochian# +disp_locale=de : display_name=i-enochian #Privatnutzung=i-enochian# +----------------- +locale='zh-hakka' +disp_locale=en : display_name=Chinese( #HAKKA#)? +disp_locale=fr : display_name=chinois( #HAKKA#)? +disp_locale=de : display_name=Chinesisch( #HAKKA#)? +----------------- +locale='zh-wuu' +disp_locale=en : display_name=Chinese #WUU# +disp_locale=fr : display_name=chinois #WUU# +disp_locale=de : display_name=Chinesisch #WUU# +----------------- +locale='i-tay' +disp_locale=en : display_name=i-tay +disp_locale=fr : display_name=i-tay +disp_locale=de : display_name=i-tay +----------------- +locale='sgn-BE-nl' +disp_locale=en : display_name=Sign Languages? #Belgium, NL# +disp_locale=fr : display_name=langues? des signes #Belgique, NL# +disp_locale=de : display_name=Gebärdensprache #Belgien, NL# +----------------- +locale='sgn-CH-de' +disp_locale=en : display_name=Sign Languages? #Switzerland, DE# +disp_locale=fr : display_name=langues? des signes #Suisse, DE# +disp_locale=de : display_name=Gebärdensprache #Schweiz, DE# +----------------- +locale='sl_IT_rozaj@currency=EUR' +disp_locale=en : display_name=Slovenian #Italy, Resian, [Cc]urrency=Euro# +disp_locale=fr : display_name=slovène #Italie, dialecte de Resia, [Dd]evise=euro# +disp_locale=de : display_name=Slowenisch #Italien, (ROZAJ|Resianisch), Währung=Euro# +----------------- +locale='uk-ua_CALIFORNIA@currency=;currency=GRN' +disp_locale=en : display_name=Ukrainian #Ukraine, CALIFORNIA, [Cc]urrency# +disp_locale=fr : display_name=ukrainien #Ukraine, CALIFORNIA, [Dd]evise# +disp_locale=de : display_name=Ukrainisch #Ukraine, CALIFORNIA, Währung# +----------------- +locale='root' +disp_locale=en : display_name=Root +disp_locale=fr : display_name=racine +disp_locale=de : display_name=[Rr]oot +----------------- +locale='uk@currency=EURO' +disp_locale=en : display_name=Ukrainian #[Cc]urrency=EURO# +disp_locale=fr : display_name=ukrainien #[Dd]evise=EURO# +disp_locale=de : display_name=Ukrainisch #Währung=EURO# +----------------- +locale='Hindi' +disp_locale=en : display_name=hindi +disp_locale=fr : display_name=hindi +disp_locale=de : display_name=hindi +----------------- +locale='de' +disp_locale=en : display_name=German +disp_locale=fr : display_name=allemand +disp_locale=de : display_name=Deutsch +----------------- +locale='fr' +disp_locale=en : display_name=French +disp_locale=fr : display_name=français +disp_locale=de : display_name=Französisch +----------------- +locale='ja' +disp_locale=en : display_name=Japanese +disp_locale=fr : display_name=japonais +disp_locale=de : display_name=Japanisch +----------------- +locale='i-enochian' +disp_locale=en : display_name=i-enochian #Private-Use=i-enochian# +disp_locale=fr : display_name=i-enochian #Usage privé=i-enochian# +disp_locale=de : display_name=i-enochian #Privatnutzung=i-enochian# +----------------- +locale='zh-Hant' +disp_locale=en : display_name=Chinese #Traditional# +disp_locale=fr : display_name=chinois #traditionnel# +disp_locale=de : display_name=Chinesisch #Traditionell# +----------------- +locale='zh-Hans' +disp_locale=en : display_name=Chinese #Simplified# +disp_locale=fr : display_name=chinois #simplifié# +disp_locale=de : display_name=Chinesisch #Vereinfacht# +----------------- +locale='sr-Cyrl' +disp_locale=en : display_name=Serbian #Cyrillic# +disp_locale=fr : display_name=serbe #cyrillique# +disp_locale=de : display_name=Serbisch #Kyrillisch# +----------------- +locale='sr-Latn' +disp_locale=en : display_name=Serbian #Latin# +disp_locale=fr : display_name=serbe #latin# +disp_locale=de : display_name=Serbisch #Lateinisch# +----------------- +locale='zh-Hans-CN' +disp_locale=en : display_name=Chinese #Simplified, China# +disp_locale=fr : display_name=chinois #simplifié, Chine# +disp_locale=de : display_name=Chinesisch #Vereinfacht, China# +----------------- +locale='sr-Latn-CS' +disp_locale=en : display_name=Serbian #Latin, Serbia# +disp_locale=fr : display_name=serbe #latin, Serbie# +disp_locale=de : display_name=Serbisch #Lateinisch, Serbien# +----------------- +locale='sl-rozaj' +disp_locale=en : display_name=Slovenian #Resian# +disp_locale=fr : display_name=slovène #dialecte de Resia# +disp_locale=de : display_name=Slowenisch( #(ROZAJ|Resianisch)#)? +----------------- +locale='sl-nedis' +disp_locale=en : display_name=Slovenian #Natisone dialect# +disp_locale=fr : display_name=slovène #dialecte de Natisone# +disp_locale=de : display_name=Slowenisch #Natisone-Dialekt# +----------------- +locale='de-CH-1901' +disp_locale=en : display_name=German #Switzerland, Traditional German orthography# +disp_locale=fr : display_name=allemand #Suisse, orthographe allemande traditionnelle# +disp_locale=de : display_name=Deutsch #Schweiz, (1901|[aA]lte deutsche Rechtschreibung)# +----------------- +locale='sl-IT-nedis' +disp_locale=en : display_name=Slovenian #Italy, Natisone dialect# +disp_locale=fr : display_name=slovène #Italie, dialecte de Natisone# +disp_locale=de : display_name=Slowenisch #Italien, (NEDIS|Natisone-Dialekt)# +----------------- +locale='sl-Latn-IT-nedis' +disp_locale=en : display_name=Slovenian #Latin, Italy, Natisone dialect# +disp_locale=fr : display_name=slovène #latin, Italie, dialecte de Natisone# +disp_locale=de : display_name=Slowenisch #Lateinisch, Italien, (NEDIS|Natisone-Dialekt)# +----------------- +locale='de-DE' +disp_locale=en : display_name=German #Germany# +disp_locale=fr : display_name=allemand #Allemagne# +disp_locale=de : display_name=Deutsch #Deutschland# +----------------- +locale='en-US' +disp_locale=en : display_name=English #United States# +disp_locale=fr : display_name=anglais #États-Unis# +disp_locale=de : display_name=Englisch #Vereinigte Staaten# +----------------- +locale='es-419' +disp_locale=en : display_name=Spanish #Latin America# +disp_locale=fr : display_name=espagnol #Amérique latine# +disp_locale=de : display_name=Spanisch #Lateinamerika# +----------------- +locale='de-CH-x-phonebk' +disp_locale=en : display_name=German #Switzerland, Private-Use=phonebk# +disp_locale=fr : display_name=allemand #Suisse, Usage privé=phonebk# +disp_locale=de : display_name=Deutsch #Schweiz, Privatnutzung=phonebk# +----------------- +locale='az-Arab-x-AZE-derbend' +disp_locale=en : display_name=Azerbaijani #Arabic, Private-Use=aze-derbend# +disp_locale=fr : display_name=azéri #arabe, Usage privé=aze-derbend# +disp_locale=de : display_name=Aserbaidschanisch #Arabisch, Privatnutzung=aze-derbend# +----------------- +locale='zh-min' +disp_locale=en : display_name=Chinese #MIN# +disp_locale=fr : display_name=chinois #MIN# +disp_locale=de : display_name=Chinesisch #MIN# +----------------- +locale='zh-min-nan-Hant-CN' +disp_locale=en : display_name=Chinese #MIN, NAN_HANT_CN# +disp_locale=fr : display_name=chinois #MIN, NAN_HANT_CN# +disp_locale=de : display_name=Chinesisch #MIN, NAN_HANT_CN# +----------------- +locale='x-whatever' +disp_locale=en : display_name=x-whatever #Private-Use=whatever# +disp_locale=fr : display_name=x-whatever #Usage privé=whatever# +disp_locale=de : display_name=x-whatever #Privatnutzung=whatever# +----------------- +locale='qaa-Qaaa-QM-x-southern' +disp_locale=en : display_name=qaa #Qaaa, QM, Private-Use=southern# +disp_locale=fr : display_name=qaa #Qaaa, QM, Usage privé=southern# +disp_locale=de : display_name=qaa #Qaaa, QM, Privatnutzung=southern# +----------------- +locale='sr-Latn-QM' +disp_locale=en : display_name=Serbian #Latin, QM# +disp_locale=fr : display_name=serbe #latin, QM# +disp_locale=de : display_name=Serbisch #Lateinisch, QM# +----------------- +locale='sr-Qaaa-CS' +disp_locale=en : display_name=Serbian #Qaaa, Serbia# +disp_locale=fr : display_name=serbe #Qaaa, Serbie# +disp_locale=de : display_name=Serbisch #Qaaa, Serbien# +----------------- +locale='en-US-u-islamCal' +disp_locale=en : display_name=English #United States, attribute=islamcal# +disp_locale=fr : display_name=anglais #États-Unis, attribute=islamcal# +disp_locale=de : display_name=Englisch #Vereinigte Staaten, attribute=islamcal# +----------------- +locale='zh-CN-a-myExt-x-private' +disp_locale=en : display_name=Chinese #China, a=myext, Private-Use=private# +disp_locale=fr : display_name=chinois #Chine, a=myext, Usage privé=private# +disp_locale=de : display_name=Chinesisch #China, a=myext, Privatnutzung=private# +----------------- +locale='en-a-myExt-b-another' +disp_locale=en : display_name=English #a=myext, b=another# +disp_locale=fr : display_name=anglais #a=myext, b=another# +disp_locale=de : display_name=Englisch #a=myext, b=another# +----------------- +locale='de-419-DE' +disp_locale=en : display_name=German #Latin America, DE# +disp_locale=fr : display_name=allemand #Amérique latine, DE# +disp_locale=de : display_name=Deutsch #Lateinamerika, DE# +----------------- +locale='a-DE' +disp_locale=en : display_name=a #Germany# +disp_locale=fr : display_name=a #Allemagne# +disp_locale=de : display_name=a #Deutschland# +----------------- +locale='ar-a-aaa-b-bbb-a-ccc' +disp_locale=en : display_name=Arabic #a=aaa, b=bbb# +disp_locale=fr : display_name=arabe #a=aaa, b=bbb# +disp_locale=de : display_name=Arabisch #a=aaa, b=bbb# +----------------- diff --git a/ext/intl/tests/locale_get_display_region2.phpt b/ext/intl/tests/locale_get_display_region2.phpt index f1b584188aa22..1d7354bd1bc87 100644 --- a/ext/intl/tests/locale_get_display_region2.phpt +++ b/ext/intl/tests/locale_get_display_region2.phpt @@ -1,8 +1,9 @@ --TEST-- -locale_get_display_region() icu >= 4.8 +locale_get_display_region() icu >= 4.8 && icu < 51.2 --SKIPIF-- += 0) die('skip for ICU < 51.2'); ?> --FILE-- = 51.2 +--SKIPIF-- + += 51.2'); ?> +--FILE-- + +--EXPECTREGEX-- +locale='uk-ua_CALIFORNIA@currency=;currency=GRN' +disp_locale=en : display_region=Ukraine +disp_locale=fr : display_region=Ukraine +disp_locale=de : display_region=Ukraine +----------------- +locale='root' +disp_locale=en : display_region= +disp_locale=fr : display_region= +disp_locale=de : display_region= +----------------- +locale='uk@currency=EURO' +disp_locale=en : display_region= +disp_locale=fr : display_region= +disp_locale=de : display_region= +----------------- +locale='Hindi' +disp_locale=en : display_region= +disp_locale=fr : display_region= +disp_locale=de : display_region= +----------------- +locale='de' +disp_locale=en : display_region= +disp_locale=fr : display_region= +disp_locale=de : display_region= +----------------- +locale='fr' +disp_locale=en : display_region= +disp_locale=fr : display_region= +disp_locale=de : display_region= +----------------- +locale='ja' +disp_locale=en : display_region= +disp_locale=fr : display_region= +disp_locale=de : display_region= +----------------- +locale='i-enochian' +disp_locale=en : display_region= +disp_locale=fr : display_region= +disp_locale=de : display_region= +----------------- +locale='zh-Hant' +disp_locale=en : display_region= +disp_locale=fr : display_region= +disp_locale=de : display_region= +----------------- +locale='zh-Hans' +disp_locale=en : display_region= +disp_locale=fr : display_region= +disp_locale=de : display_region= +----------------- +locale='sr-Cyrl' +disp_locale=en : display_region= +disp_locale=fr : display_region= +disp_locale=de : display_region= +----------------- +locale='sr-Latn' +disp_locale=en : display_region= +disp_locale=fr : display_region= +disp_locale=de : display_region= +----------------- +locale='zh-Hans-CN' +disp_locale=en : display_region=China +disp_locale=fr : display_region=Chine +disp_locale=de : display_region=China +----------------- +locale='sr-Latn-CS' +disp_locale=en : display_region=Serbia +disp_locale=fr : display_region=Serbie +disp_locale=de : display_region=Serbien +----------------- +locale='sl-rozaj' +disp_locale=en : display_region=(ROZAJ)? +disp_locale=fr : display_region=(ROZAJ)? +disp_locale=de : display_region=(ROZAJ)? +----------------- +locale='sl-nedis' +disp_locale=en : display_region=(NEDIS)? +disp_locale=fr : display_region=(NEDIS)? +disp_locale=de : display_region=(NEDIS)? +----------------- +locale='de-CH-1901' +disp_locale=en : display_region=Switzerland +disp_locale=fr : display_region=Suisse +disp_locale=de : display_region=Schweiz +----------------- +locale='sl-IT-nedis' +disp_locale=en : display_region=Italy +disp_locale=fr : display_region=Italie +disp_locale=de : display_region=Italien +----------------- +locale='sl-Latn-IT-nedis' +disp_locale=en : display_region=Italy +disp_locale=fr : display_region=Italie +disp_locale=de : display_region=Italien +----------------- +locale='de-DE' +disp_locale=en : display_region=Germany +disp_locale=fr : display_region=Allemagne +disp_locale=de : display_region=Deutschland +----------------- +locale='en-US' +disp_locale=en : display_region=United States +disp_locale=fr : display_region=États-Unis +disp_locale=de : display_region=Vereinigte Staaten +----------------- +locale='es-419' +disp_locale=en : display_region=Latin America +disp_locale=fr : display_region=Amérique latine +disp_locale=de : display_region=Lateinamerika +----------------- +locale='de-CH-x-phonebk' +disp_locale=en : display_region=Switzerland +disp_locale=fr : display_region=Suisse +disp_locale=de : display_region=Schweiz +----------------- +locale='az-Arab-x-AZE-derbend' +disp_locale=en : display_region=X? +disp_locale=fr : display_region=X? +disp_locale=de : display_region=X? +----------------- +locale='zh-min' +disp_locale=en : display_region= +disp_locale=fr : display_region= +disp_locale=de : display_region= +----------------- +locale='zh-min-nan-Hant-CN' +disp_locale=en : display_region=MIN +disp_locale=fr : display_region=MIN +disp_locale=de : display_region=MIN +----------------- +locale='x-whatever' +disp_locale=en : display_region= +disp_locale=fr : display_region= +disp_locale=de : display_region= +----------------- +locale='qaa-Qaaa-QM-x-southern' +disp_locale=en : display_region=QM +disp_locale=fr : display_region=QM +disp_locale=de : display_region=QM +----------------- +locale='sr-Latn-QM' +disp_locale=en : display_region=QM +disp_locale=fr : display_region=QM +disp_locale=de : display_region=QM +----------------- +locale='sr-Qaaa-CS' +disp_locale=en : display_region=Serbia +disp_locale=fr : display_region=Serbie +disp_locale=de : display_region=Serbien +----------------- +locale='en-US-u-islamCal' +disp_locale=en : display_region=United States +disp_locale=fr : display_region=États-Unis +disp_locale=de : display_region=Vereinigte Staaten +----------------- +locale='zh-CN-a-myExt-x-private' +disp_locale=en : display_region=China +disp_locale=fr : display_region=Chine +disp_locale=de : display_region=China +----------------- +locale='en-a-myExt-b-another' +disp_locale=en : display_region=A? +disp_locale=fr : display_region=A? +disp_locale=de : display_region=A? +----------------- +locale='de-419-DE' +disp_locale=en : display_region=Latin America +disp_locale=fr : display_region=Amérique latine +disp_locale=de : display_region=Lateinamerika +----------------- +locale='a-DE' +disp_locale=en : display_region=Germany +disp_locale=fr : display_region=Allemagne +disp_locale=de : display_region=Deutschland +----------------- +locale='ar-a-aaa-b-bbb-a-ccc' +disp_locale=en : display_region=A? +disp_locale=fr : display_region=A? +disp_locale=de : display_region=A? +----------------- diff --git a/ext/intl/tests/locale_lookup.phpt b/ext/intl/tests/locale_lookup.phpt index f0affafa6f2bb..df5204f07d84b 100644 --- a/ext/intl/tests/locale_lookup.phpt +++ b/ext/intl/tests/locale_lookup.phpt @@ -2,6 +2,7 @@ locale_lookup.phpt() --SKIPIF-- += 0) die('skip for ICU < 51.2'); ?> --FILE-- += 51.2'); ?> +--FILE-- + +--EXPECT-- +-------------- +loc_range:de-de +lang_tags: de-DEVA,de-DE-1996,de-DE,zh_Hans,de-CH-1996,sl_IT,sl_IT_nedis-a-kirti-x-xyz,sl_IT_rozaj,sl_IT_NEDIS_ROJAZ_1901,i-enochian,sgn-CH-de,art-lojban,i-lux,art-lojban,jbo,en_sl_IT,zh-Hant-CN-x-prv1-prv2 + +lookup result:de-DE +Canonical lookup result:de_de +-------------- +loc_range:sl_IT +lang_tags: de-DEVA,de-DE-1996,de-DE,zh_Hans,de-CH-1996,sl_IT,sl_IT_nedis-a-kirti-x-xyz,sl_IT_rozaj,sl_IT_NEDIS_ROJAZ_1901,i-enochian,sgn-CH-de,art-lojban,i-lux,art-lojban,jbo,en_sl_IT,zh-Hant-CN-x-prv1-prv2 + +lookup result:sl_IT +Canonical lookup result:sl_it +-------------- +loc_range:sl_IT_Nedis +lang_tags: de-DEVA,de-DE-1996,de-DE,zh_Hans,de-CH-1996,sl_IT,sl_IT_nedis-a-kirti-x-xyz,sl_IT_rozaj,sl_IT_NEDIS_ROJAZ_1901,i-enochian,sgn-CH-de,art-lojban,i-lux,art-lojban,jbo,en_sl_IT,zh-Hant-CN-x-prv1-prv2 + +lookup result:sl_IT +Canonical lookup result:sl_it +-------------- +loc_range:jbo +lang_tags: de-DEVA,de-DE-1996,de-DE,zh_Hans,de-CH-1996,sl_IT,sl_IT_nedis-a-kirti-x-xyz,sl_IT_rozaj,sl_IT_NEDIS_ROJAZ_1901,i-enochian,sgn-CH-de,art-lojban,i-lux,art-lojban,jbo,en_sl_IT,zh-Hant-CN-x-prv1-prv2 + +lookup result:jbo +Canonical lookup result:jbo +-------------- +loc_range:art-lojban +lang_tags: de-DEVA,de-DE-1996,de-DE,zh_Hans,de-CH-1996,sl_IT,sl_IT_nedis-a-kirti-x-xyz,sl_IT_rozaj,sl_IT_NEDIS_ROJAZ_1901,i-enochian,sgn-CH-de,art-lojban,i-lux,art-lojban,jbo,en_sl_IT,zh-Hant-CN-x-prv1-prv2 + +lookup result:art-lojban +Canonical lookup result:art__lojban diff --git a/ext/intl/tests/msgfmt_format_intlcalendar.phpt b/ext/intl/tests/msgfmt_format_intlcalendar.phpt index 6ae78a91400c0..a6bff2ecddfba 100644 --- a/ext/intl/tests/msgfmt_format_intlcalendar.phpt +++ b/ext/intl/tests/msgfmt_format_intlcalendar.phpt @@ -2,8 +2,8 @@ MessageFormat accepts IntlCalendar args --SKIPIF-- += 0) die('skip for ICU < 51.2'); ?> --FILE-- format(array($time, 'date')), " ", ==DONE== --EXPECT-- Quinta-feira, 17 de Maio de 2012 5:35:36 p.m. WEST -==DONE== \ No newline at end of file +==DONE== diff --git a/ext/intl/tests/msgfmt_format_intlcalendar_variant2.phpt b/ext/intl/tests/msgfmt_format_intlcalendar_variant2.phpt new file mode 100644 index 0000000000000..f2d16b899dcdf --- /dev/null +++ b/ext/intl/tests/msgfmt_format_intlcalendar_variant2.phpt @@ -0,0 +1,30 @@ +--TEST-- +MessageFormat accepts IntlCalendar args +--SKIPIF-- + += 51.2'); ?> +--FILE-- +format(array($cal)), "\n"; + +//NOT FIXED: +/*$msgf = new MessageFormatter('en_US', +'{1, select, date {{0,date,full}} other {{0,time,h:m:s a V}}}'); + +echo "msgf2: ", $msgf->format(array($time, 'date')), " ", + $msgf->format(array($time, 'time')), "\n"; +*/ + +?> +==DONE== +--EXPECT-- +Quinta-feira, 17 de Maio de 2012 5:35:36 PM ptlis +==DONE== diff --git a/ext/intl/tests/resourcebundle_null_mandatory_args.phpt b/ext/intl/tests/resourcebundle_null_mandatory_args.phpt index 17fab6d630a5e..bbbc1b1e91ce2 100644 --- a/ext/intl/tests/resourcebundle_null_mandatory_args.phpt +++ b/ext/intl/tests/resourcebundle_null_mandatory_args.phpt @@ -3,11 +3,9 @@ ResourceBundle constructor bundle accepts NULL for first two arguments --INI-- date.timezone=Atlantic/Azores --SKIPIF-- -= 4.8 only'); + += 4.8 only'); ?> += 0) die('skip for ICU < 51.2'); ?> --FILE-- += 51.2'); ?> +--FILE-- +get('calendar')->get('gregorian')->get('DateTimePatterns')->get(0); +var_dump($c); + +ini_set('intl.default_locale', 'pt_PT'); +$r = new ResourceBundle(NULL, NULL); +$c = $r->get('calendar')->get('gregorian')->get('DateTimePatterns')->get(0); +var_dump($c); +?> +==DONE== +--EXPECT-- +string(14) "h:mm:ss a zzzz" +string(13) "HH:mm:ss zzzz" +==DONE== diff --git a/ext/intl/tests/timezone_getDisplayName_variant2-49+.phpt b/ext/intl/tests/timezone_getDisplayName_variant2-49+.phpt index 4ee30aee12642..8f60f2904021f 100644 --- a/ext/intl/tests/timezone_getDisplayName_variant2-49+.phpt +++ b/ext/intl/tests/timezone_getDisplayName_variant2-49+.phpt @@ -1,11 +1,9 @@ --TEST-- -IntlTimeZone::getDisplayName(): type parameter (ICU >= 49) +IntlTimeZone::getDisplayName(): type parameter (ICU >= 49 && ICU < 51.2) --SKIPIF-- - + += 0) die('skip for ICU < 51.2'); ?> --FILE-- = 51.2) +--SKIPIF-- + += 51.2'); ?> +--FILE-- +getDisplayName(false, IntlTimeZone::DISPLAY_SHORT)); +var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG)); +var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_SHORT_GENERIC)); +var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG_GENERIC)); +var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_SHORT_GMT)); +var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG_GMT)); +var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_SHORT_COMMONLY_USED)); +var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_GENERIC_LOCATION)); + +?> +==DONE== +--EXPECT-- +string(3) "GMT" +string(30) "Western European Standard Time" +string(13) "Portugal Time" +string(21) "Western European Time" +string(5) "+0000" +string(3) "GMT" +string(3) "GMT" +string(13) "Portugal Time" +==DONE== diff --git a/ext/ldap/config.m4 b/ext/ldap/config.m4 index 3c8e23ea8e852..2804cd5968ebf 100644 --- a/ext/ldap/config.m4 +++ b/ext/ldap/config.m4 @@ -15,6 +15,28 @@ AC_DEFUN([PHP_LDAP_CHECKS], [ LDAP_DIR=$1 LDAP_INCDIR=$1/ldap/public LDAP_LIBDIR=$1/$PHP_LIBDIR + else + + dnl Find Oracle Instant Client RPM header location corresponding to the given lib path e.g. for --with-ldap=/usr/lib/oracle/12.1/client64/lib + AC_CHECK_SIZEOF(long int, 4) + if test "$ac_cv_sizeof_long_int" = "4"; then + PHP_OCI8_IC_LIBDIR_SUFFIX="" + else + PHP_OCI8_IC_LIBDIR_SUFFIX=64 + fi + OCISDKRPMINC=`echo "$1" | $SED -e 's!^/usr/lib/oracle/\(.*\)/client\('${PHP_OCI8_IC_LIBDIR_SUFFIX}'\)*/lib[/]*$!/usr/include/oracle/\1/client\2!'` + + dnl Check for Oracle Instant Client RPM install + if test -f $OCISDKRPMINC/ldap.h; then + LDAP_DIR=$1 + LDAP_INCDIR=$OCISDKRPMINC + LDAP_LIBDIR=$1 + dnl Check for Oracle Instant Client ZIP install + elif test -f $1/sdk/include/ldap.h; then + LDAP_DIR=$1 + LDAP_INCDIR=$1/sdk/include + LDAP_LIBDIR=$1 + fi fi ]) @@ -143,12 +165,21 @@ if test "$PHP_LDAP" != "no"; then PHP_ADD_LIBRARY_WITH_PATH(umich_lber, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) PHP_ADD_LIBRARY_WITH_PATH(umich_ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME; then + elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME.12.1; then PHP_ADD_LIBRARY_WITH_PATH(clntsh, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) AC_DEFINE(HAVE_ORALDAP,1,[ ]) - if test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then - AC_DEFINE(HAVE_ORALDAP_10,1,[ ]) - fi + AC_DEFINE(HAVE_ORALDAP_12,1,[ ]) + + elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME.11.1; then + PHP_ADD_LIBRARY_WITH_PATH(clntsh, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) + AC_DEFINE(HAVE_ORALDAP,1,[ ]) + AC_DEFINE(HAVE_ORALDAP_11,1,[ ]) + + elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME; then + PHP_ADD_LIBRARY_WITH_PATH(clntsh, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) + AC_DEFINE(HAVE_ORALDAP,1,[ ]) + AC_DEFINE(HAVE_ORALDAP_10,1,[ ]) + else AC_MSG_ERROR(Cannot find ldap libraries in $LDAP_LIBDIR.) fi diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 3cfa2092e776e..d50b78321fb89 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -67,6 +67,9 @@ #include #endif +#define PHP_LDAP_ESCAPE_FILTER 0x01 +#define PHP_LDAP_ESCAPE_DN 0x02 + typedef struct { LDAP *link; #if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC) @@ -152,7 +155,7 @@ PHP_MINIT_FUNCTION(ldap) REGISTER_LONG_CONSTANT("LDAP_DEREF_FINDING", LDAP_DEREF_FINDING, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("LDAP_DEREF_ALWAYS", LDAP_DEREF_ALWAYS, CONST_PERSISTENT | CONST_CS); -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 +#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP /* LDAP options */ REGISTER_LONG_CONSTANT("LDAP_OPT_DEREF", LDAP_OPT_DEREF, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("LDAP_OPT_SIZELIMIT", LDAP_OPT_SIZELIMIT, CONST_PERSISTENT | CONST_CS); @@ -195,6 +198,9 @@ PHP_MINIT_FUNCTION(ldap) REGISTER_LONG_CONSTANT("GSLC_SSL_TWOWAY_AUTH", GSLC_SSL_TWOWAY_AUTH, CONST_PERSISTENT | CONST_CS); #endif + REGISTER_LONG_CONSTANT("LDAP_ESCAPE_FILTER", PHP_LDAP_ESCAPE_FILTER, CONST_PERSISTENT | CONST_CS); + REGISTER_LONG_CONSTANT("LDAP_ESCAPE_DN", PHP_LDAP_ESCAPE_DN, CONST_PERSISTENT | CONST_CS); + le_link = zend_register_list_destructors_ex(_close_ldap_link, NULL, "ldap link", module_number); le_result = zend_register_list_destructors_ex(_free_ldap_result, NULL, "ldap result", module_number); le_result_entry = zend_register_list_destructors_ex(_free_ldap_result_entry, NULL, "ldap result entry", module_number); @@ -361,7 +367,7 @@ PHP_FUNCTION(ldap_connect) static int _get_lderrno(LDAP *ldap) { #if !HAVE_NSLDAP -#if LDAP_API_VERSION > 2000 || HAVE_ORALDAP_10 +#if LDAP_API_VERSION > 2000 || HAVE_ORALDAP int lderr; /* New versions of OpenLDAP do it this way */ @@ -550,7 +556,7 @@ static void php_set_opts(LDAP *ldap, int sizelimit, int timelimit, int deref, in { /* sizelimit */ if (sizelimit > -1) { -#if (LDAP_API_VERSION >= 2004) || HAVE_NSLDAP || HAVE_ORALDAP_10 +#if (LDAP_API_VERSION >= 2004) || HAVE_NSLDAP || HAVE_ORALDAP ldap_get_option(ldap, LDAP_OPT_SIZELIMIT, old_sizelimit); ldap_set_option(ldap, LDAP_OPT_SIZELIMIT, &sizelimit); #else @@ -561,7 +567,7 @@ static void php_set_opts(LDAP *ldap, int sizelimit, int timelimit, int deref, in /* timelimit */ if (timelimit > -1) { -#if (LDAP_API_VERSION >= 2004) || HAVE_NSLDAP || HAVE_ORALDAP_10 +#if (LDAP_API_VERSION >= 2004) || HAVE_NSLDAP || HAVE_ORALDAP ldap_get_option(ldap, LDAP_OPT_SIZELIMIT, old_timelimit); ldap_set_option(ldap, LDAP_OPT_TIMELIMIT, &timelimit); #else @@ -572,7 +578,7 @@ static void php_set_opts(LDAP *ldap, int sizelimit, int timelimit, int deref, in /* deref */ if (deref > -1) { -#if (LDAP_API_VERSION >= 2004) || HAVE_NSLDAP || HAVE_ORALDAP_10 +#if (LDAP_API_VERSION >= 2004) || HAVE_NSLDAP || HAVE_ORALDAP ldap_get_option(ldap, LDAP_OPT_SIZELIMIT, old_deref); ldap_set_option(ldap, LDAP_OPT_DEREF, &deref); #else @@ -975,12 +981,12 @@ PHP_FUNCTION(ldap_get_entries) add_index_string(tmp1, num_attrib, attribute, 1); num_attrib++; -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS +#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP || WINDOWS ldap_memfree(attribute); #endif attribute = ldap_next_attribute(ldap, ldap_result_entry, ber); } -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS +#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP || WINDOWS if (ber != NULL) { ber_free(ber, 0); } @@ -989,7 +995,7 @@ PHP_FUNCTION(ldap_get_entries) add_assoc_long(tmp1, "count", num_attrib); dn = ldap_get_dn(ldap, ldap_result_entry); add_assoc_string(tmp1, "dn", dn, 1); -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS +#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP || WINDOWS ldap_memfree(dn); #else free(dn); @@ -1027,7 +1033,7 @@ PHP_FUNCTION(ldap_first_attribute) RETURN_FALSE; } else { RETVAL_STRING(attribute, 1); -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS +#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP || WINDOWS ldap_memfree(attribute); #endif } @@ -1057,7 +1063,7 @@ PHP_FUNCTION(ldap_next_attribute) } if ((attribute = ldap_next_attribute(ld->link, resultentry->data, resultentry->ber)) == NULL) { -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS +#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP || WINDOWS if (resultentry->ber != NULL) { ber_free(resultentry->ber, 0); resultentry->ber = NULL; @@ -1066,7 +1072,7 @@ PHP_FUNCTION(ldap_next_attribute) RETURN_FALSE; } else { RETVAL_STRING(attribute, 1); -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS +#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP || WINDOWS ldap_memfree(attribute); #endif } @@ -1113,12 +1119,12 @@ PHP_FUNCTION(ldap_get_attributes) add_index_string(return_value, num_attrib, attribute, 1); num_attrib++; -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS +#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP || WINDOWS ldap_memfree(attribute); #endif attribute = ldap_next_attribute(ld->link, resultentry->data, ber); } -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS +#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP || WINDOWS if (ber != NULL) { ber_free(ber, 0); } @@ -1183,7 +1189,7 @@ PHP_FUNCTION(ldap_get_dn) text = ldap_get_dn(ld->link, resultentry->data); if (text != NULL) { RETVAL_STRING(text, 1); -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS +#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP || WINDOWS ldap_memfree(text); #else free(text); @@ -1241,7 +1247,7 @@ PHP_FUNCTION(ldap_dn2ufn) if (ufn != NULL) { RETVAL_STRING(ufn, 1); -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS +#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP || WINDOWS ldap_memfree(ufn); #endif } else { @@ -1546,7 +1552,7 @@ PHP_FUNCTION(ldap_sort) } /* }}} */ -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 +#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP /* {{{ proto bool ldap_get_option(resource link, int option, mixed retval) Get the current value of various session-wide parameters */ PHP_FUNCTION(ldap_get_option) @@ -2003,7 +2009,7 @@ PHP_FUNCTION(ldap_rename) newparent = NULL; } -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 +#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP rc = ldap_rename_s(ld->link, dn, newrdn, newparent, deleteoldrdn, NULL, NULL); #else if (newparent_len != 0) { @@ -2047,7 +2053,7 @@ PHP_FUNCTION(ldap_start_tls) } /* }}} */ #endif -#endif /* (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 */ +#endif /* (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP */ #if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC) /* {{{ _ldap_rebind_proc() @@ -2107,6 +2113,7 @@ PHP_FUNCTION(ldap_set_rebind_proc) /* unregister rebind procedure */ if (ld->rebindproc != NULL) { zval_dtor(ld->rebindproc); + FREE_ZVAL(ld->rebindproc); ld->rebindproc = NULL; ldap_set_rebind_proc(ld->link, NULL, NULL); } @@ -2136,6 +2143,83 @@ PHP_FUNCTION(ldap_set_rebind_proc) /* }}} */ #endif +static void php_ldap_do_escape(const zend_bool *map, const char *value, size_t valuelen, char **result, size_t *resultlen) +{ + char hex[] = "0123456789abcdef"; + int i, p = 0; + size_t len = 0; + + for (i = 0; i < valuelen; i++) { + len += (map[(unsigned char) value[i]]) ? 3 : 1; + } + + (*result) = (char *) safe_emalloc(1, len, 1); + (*resultlen) = len; + + for (i = 0; i < valuelen; i++) { + unsigned char v = (unsigned char) value[i]; + + if (map[v]) { + (*result)[p++] = '\\'; + (*result)[p++] = hex[v >> 4]; + (*result)[p++] = hex[v & 0x0f]; + } else { + (*result)[p++] = v; + } + } + + (*result)[p++] = '\0'; +} + +static void php_ldap_escape_map_set_chars(zend_bool *map, const char *chars, const int charslen, char escape) +{ + int i = 0; + while (i < charslen) { + map[(unsigned char) chars[i++]] = escape; + } +} + +PHP_FUNCTION(ldap_escape) +{ + char *value, *ignores, *result; + int valuelen = 0, ignoreslen = 0, i; + size_t resultlen; + long flags = 0; + zend_bool map[256] = {0}, havecharlist = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sl", &value, &valuelen, &ignores, &ignoreslen, &flags) != SUCCESS) { + return; + } + + if (!valuelen) { + RETURN_EMPTY_STRING(); + } + + if (flags & PHP_LDAP_ESCAPE_FILTER) { + havecharlist = 1; + php_ldap_escape_map_set_chars(map, "\\*()\0", sizeof("\\*()\0") - 1, 1); + } + + if (flags & PHP_LDAP_ESCAPE_DN) { + havecharlist = 1; + php_ldap_escape_map_set_chars(map, "\\,=+<>;\"#", sizeof("\\,=+<>;\"#") - 1, 1); + } + + if (!havecharlist) { + for (i = 0; i < 256; i++) { + map[i] = 1; + } + } + + if (ignoreslen) { + php_ldap_escape_map_set_chars(map, ignores, ignoreslen, 0); + } + + php_ldap_do_escape(map, value, valuelen, &result, &resultlen); + + RETURN_STRINGL(result, resultlen, 0); +} + #ifdef STR_TRANSLATION /* {{{ php_ldap_do_translate */ @@ -2566,7 +2650,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_control_paged_result_response, 0, 0, 2) ZEND_END_ARG_INFO(); #endif -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 +#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_rename, 0, 0, 5) ZEND_ARG_INFO(0, link_identifier) ZEND_ARG_INFO(0, dn) @@ -2625,6 +2709,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_set_rebind_proc, 0, 0, 2) ZEND_END_ARG_INFO() #endif +ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_escape, 0, 0, 1) + ZEND_ARG_INFO(0, value) + ZEND_ARG_INFO(0, ignore) + ZEND_ARG_INFO(0, flags) +ZEND_END_ARG_INFO() + #ifdef STR_TRANSLATION ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_t61_to_8859, 0, 0, 1) ZEND_ARG_INFO(0, value) @@ -2682,7 +2772,7 @@ const zend_function_entry ldap_functions[] = { PHP_FE(ldap_compare, arginfo_ldap_compare) PHP_FE(ldap_sort, arginfo_ldap_sort) -#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 +#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP PHP_FE(ldap_rename, arginfo_ldap_rename) PHP_FE(ldap_get_option, arginfo_ldap_get_option) PHP_FE(ldap_set_option, arginfo_ldap_set_option) @@ -2703,6 +2793,8 @@ const zend_function_entry ldap_functions[] = { PHP_FE(ldap_set_rebind_proc, arginfo_ldap_set_rebind_proc) #endif + PHP_FE(ldap_escape, arginfo_ldap_escape) + #ifdef STR_TRANSLATION PHP_FE(ldap_t61_to_8859, arginfo_ldap_t61_to_8859) PHP_FE(ldap_8859_to_t61, arginfo_ldap_8859_to_t61) diff --git a/ext/ldap/tests/ldap_escape_all.phpt b/ext/ldap/tests/ldap_escape_all.phpt new file mode 100644 index 0000000000000..a79be004ffe56 --- /dev/null +++ b/ext/ldap/tests/ldap_escape_all.phpt @@ -0,0 +1,14 @@ +--TEST-- +ldap_escape() test all +--SKIPIF-- + +--FILE-- + +--EXPECT-- +string(39) "\66\6f\6f\3d\62\61\72\28\62\61\7a\29\2a" \ No newline at end of file diff --git a/ext/ldap/tests/ldap_escape_both.phpt b/ext/ldap/tests/ldap_escape_both.phpt new file mode 100644 index 0000000000000..2169c0ad2e75c --- /dev/null +++ b/ext/ldap/tests/ldap_escape_both.phpt @@ -0,0 +1,14 @@ +--TEST-- +ldap_escape() test filter and DN +--SKIPIF-- + +--FILE-- + +--EXPECT-- +string(21) "foo\3dbar\28baz\29\2a" \ No newline at end of file diff --git a/ext/ldap/tests/ldap_escape_dn.phpt b/ext/ldap/tests/ldap_escape_dn.phpt new file mode 100644 index 0000000000000..fbcb0545ae4e8 --- /dev/null +++ b/ext/ldap/tests/ldap_escape_dn.phpt @@ -0,0 +1,14 @@ +--TEST-- +ldap_escape() test DN +--SKIPIF-- + +--FILE-- + +--EXPECT-- +string(15) "foo\3dbar(baz)*" \ No newline at end of file diff --git a/ext/ldap/tests/ldap_escape_filter.phpt b/ext/ldap/tests/ldap_escape_filter.phpt new file mode 100644 index 0000000000000..e4540a452d3f6 --- /dev/null +++ b/ext/ldap/tests/ldap_escape_filter.phpt @@ -0,0 +1,14 @@ +--TEST-- +ldap_escape() test filter +--SKIPIF-- + +--FILE-- + +--EXPECT-- +string(19) "foo=bar\28baz\29\2a" \ No newline at end of file diff --git a/ext/ldap/tests/ldap_escape_ignore.phpt b/ext/ldap/tests/ldap_escape_ignore.phpt new file mode 100644 index 0000000000000..ab56aa2d0e91f --- /dev/null +++ b/ext/ldap/tests/ldap_escape_ignore.phpt @@ -0,0 +1,15 @@ +--TEST-- +ldap_escape() test ignore +--SKIPIF-- + +--FILE-- + +--EXPECT-- +string(31) "\66oo\3d\62a\72\28\62a\7a\29\2a" \ No newline at end of file diff --git a/ext/ldap/tests/ldap_search_variation6.phpt b/ext/ldap/tests/ldap_search_variation6.phpt index a29e4524df46b..5139ebb77dece 100644 --- a/ext/ldap/tests/ldap_search_variation6.phpt +++ b/ext/ldap/tests/ldap_search_variation6.phpt @@ -217,14 +217,26 @@ array(2) { [1]=> resource(%d) of type (ldap result) } -NULL -NULL +array(1) { + ["count"]=> + int(0) +} +array(1) { + ["count"]=> + int(0) +} array(2) { [0]=> resource(%d) of type (ldap result) [1]=> resource(%d) of type (ldap result) } -NULL -NULL +array(1) { + ["count"]=> + int(0) +} +array(1) { + ["count"]=> + int(0) +} ===DONE=== diff --git a/ext/libxml/tests/bug61367-read.phpt b/ext/libxml/tests/bug61367-read.phpt index 75d0006a3f35e..b4ecaa0324292 100644 --- a/ext/libxml/tests/bug61367-read.phpt +++ b/ext/libxml/tests/bug61367-read.phpt @@ -32,10 +32,10 @@ XML } } -var_dump(mkdir('test_bug_61367')); -var_dump(mkdir('test_bug_61367/base')); -var_dump(file_put_contents('test_bug_61367/bad', 'blah')); -var_dump(chdir('test_bug_61367/base')); +var_dump(mkdir('test_bug_61367-read')); +var_dump(mkdir('test_bug_61367-read/base')); +var_dump(file_put_contents('test_bug_61367-read/bad', 'blah')); +var_dump(chdir('test_bug_61367-read/base')); stream_wrapper_register( 'exploit', 'StreamExploiter' ); $s = fopen( 'exploit://', 'r' ); @@ -43,9 +43,9 @@ $s = fopen( 'exploit://', 'r' ); ?> --CLEAN-- --EXPECTF-- bool(true) @@ -53,7 +53,7 @@ bool(true) int(4) bool(true) -Warning: DOMDocument::loadXML(): I/O warning : failed to load external entity "file:///%s/test_bug_61367/bad" in %s on line %d +Warning: DOMDocument::loadXML(): I/O warning : failed to load external entity "file:///%s/test_bug_61367-read/bad" in %s on line %d Warning: DOMDocument::loadXML(): Failure to process entity file in Entity, line: 4 in %s on line %d diff --git a/ext/libxml/tests/bug61367-write.phpt b/ext/libxml/tests/bug61367-write.phpt index e18b07149a7cb..63e99a8e50a2f 100644 --- a/ext/libxml/tests/bug61367-write.phpt +++ b/ext/libxml/tests/bug61367-write.phpt @@ -19,10 +19,10 @@ class StreamExploiter { } } -var_dump(mkdir('test_bug_61367')); -var_dump(mkdir('test_bug_61367/base')); -var_dump(file_put_contents('test_bug_61367/bad', 'blah')); -var_dump(chdir('test_bug_61367/base')); +var_dump(mkdir('test_bug_61367-write')); +var_dump(mkdir('test_bug_61367-write/base')); +var_dump(file_put_contents('test_bug_61367-write/bad', 'blah')); +var_dump(chdir('test_bug_61367-write/base')); stream_wrapper_register( 'exploit', 'StreamExploiter' ); $s = fopen( 'exploit://', 'r' ); @@ -30,9 +30,9 @@ $s = fopen( 'exploit://', 'r' ); ?> --CLEAN-- --EXPECTF-- bool(true) diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c b/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c index 4deb02960c3a3..03e9633cae756 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c @@ -142,7 +142,7 @@ const struct mbfl_convert_vtbl vtbl_wchar_2022jp_kddi = { int mbfl_filt_conv_2022jp_mobile_wchar(int c, mbfl_convert_filter *filter) { - int c1, s, w, snd; + int c1, s, w, snd = 0; retry: switch (filter->status & 0xf) { diff --git a/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c b/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c index 4e1838f0601c5..87bb2f21fd5f2 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c @@ -134,7 +134,7 @@ int mbfl_filt_conv_jis2004_wchar(int c, mbfl_convert_filter *filter) { int k; - int c1, c2, s, s1, s2, w = 0, w1; + int c1, c2, s, s1 = 0, s2 = 0, w = 0, w1; retry: switch (filter->status & 0xf) { diff --git a/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c b/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c index 7a549af666587..93ac34644a833 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c @@ -605,7 +605,7 @@ mbfilter_unicode2sjis_emoji_sb(int c, int *s1, mbfl_convert_filter *filter) int mbfl_filt_conv_sjis_mobile_wchar(int c, mbfl_convert_filter *filter) { - int c1, s, s1, s2, w; + int c1, s, s1 = 0, s2 = 0, w; int snd = 0; retry: diff --git a/ext/mbstring/libmbfl/mbfl/mbfilter.c b/ext/mbstring/libmbfl/mbfl/mbfilter.c index b3759f940d549..3b14727d6b6c1 100644 --- a/ext/mbstring/libmbfl/mbfl/mbfilter.c +++ b/ext/mbstring/libmbfl/mbfl/mbfilter.c @@ -985,7 +985,7 @@ mbfl_strpos( { int result; mbfl_string _haystack_u8, _needle_u8; - const mbfl_string *haystack_u8, *needle_u8; + const mbfl_string *haystack_u8, *needle_u8 = NULL; const unsigned char *u8_tbl; if (haystack == NULL || haystack->val == NULL || needle == NULL || needle->val == NULL) { diff --git a/ext/mbstring/mb_gpc.c b/ext/mbstring/mb_gpc.c index 5ecc8f365e8ae..30764dc8076d3 100644 --- a/ext/mbstring/mb_gpc.c +++ b/ext/mbstring/mb_gpc.c @@ -364,6 +364,7 @@ SAPI_POST_HANDLER_FUNC(php_mb_post_handler) { const mbfl_encoding *detected; php_mb_encoding_handler_info_t info; + char *post_data_str = NULL; MBSTRG(http_input_identify_post) = NULL; @@ -376,7 +377,10 @@ SAPI_POST_HANDLER_FUNC(php_mb_post_handler) info.num_from_encodings = MBSTRG(http_input_list_size); info.from_language = MBSTRG(language); - detected = _php_mb_encoding_handler_ex(&info, arg, SG(request_info).post_data TSRMLS_CC); + php_stream_rewind(SG(request_info).request_body); + php_stream_copy_to_mem(SG(request_info).request_body, &post_data_str, PHP_STREAM_COPY_ALL, 0); + detected = _php_mb_encoding_handler_ex(&info, arg, post_data_str TSRMLS_CC); + STR_FREE(post_data_str); MBSTRG(http_input_identify) = detected; if (detected) { diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 4e430b6ea2364..168b133c6429f 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -402,10 +402,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_convert_kana, 0, 0, 1) ZEND_ARG_INFO(0, encoding) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_convert_variables, 1, 0, 3) +ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_convert_variables, 0, 0, 3) ZEND_ARG_INFO(0, to) ZEND_ARG_INFO(0, from) - ZEND_ARG_INFO(1, ...) + ZEND_ARG_VARIADIC_INFO(1, vars) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_encode_numericentity, 0, 0, 2) diff --git a/ext/mysqli/mysqli_fe.c b/ext/mysqli/mysqli_fe.c index 6f2e404087843..eb94ff65bbebf 100644 --- a/ext/mysqli/mysqli_fe.c +++ b/ext/mysqli/mysqli_fe.c @@ -43,23 +43,28 @@ #define MYSQLI_ZEND_ARG_OBJ_INFO_STMT() ZEND_ARG_INFO(0, stmt) #endif -ZEND_BEGIN_ARG_INFO(arginfo_mysqli_stmt_bind_result, 1) +ZEND_BEGIN_ARG_INFO(arginfo_mysqli_stmt_bind_result, 0) MYSQLI_ZEND_ARG_OBJ_INFO_STMT() + ZEND_ARG_VARIADIC_INFO(1, vars) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO(arginfo_mysqli_stmt_bind_param, 1) +ZEND_BEGIN_ARG_INFO(arginfo_mysqli_stmt_bind_param, 0) MYSQLI_ZEND_ARG_OBJ_INFO_STMT() ZEND_ARG_INFO(0, types) + ZEND_ARG_VARIADIC_INFO(1, vars) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO(arginfo_class_mysqli_stmt_bind_result, 1) +ZEND_BEGIN_ARG_INFO(arginfo_class_mysqli_stmt_bind_result, 0) + ZEND_ARG_VARIADIC_INFO(1, vars) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO(arginfo_class_mysqli_stmt_bind_param, 1) +ZEND_BEGIN_ARG_INFO(arginfo_class_mysqli_stmt_bind_param, 0) ZEND_ARG_INFO(0, types) + ZEND_ARG_VARIADIC_INFO(1, vars) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO(all_args_force_by_ref, 1) +ZEND_BEGIN_ARG_INFO(all_args_force_by_ref, 0) + ZEND_ARG_VARIADIC_INFO(1, vars) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_poll, 0, 0, 4) diff --git a/ext/oci8/README b/ext/oci8/README index af5beeb5c0745..d662072743fd1 100644 --- a/ext/oci8/README +++ b/ext/oci8/README @@ -1,13 +1,20 @@ The OCI8 Extension ------------------ -Use the OCI8 extension to access Oracle Database. +Use the OCI8 extension to access Oracle Database. Documentation is at http://php.net/oci8 -The extension can be built with PHP versions 4.3.9 to 5.x using Oracle -Database 9.2, 10, 11 or 12 client libraries. Oracle's standard -cross-version connectivity applies. For example PHP linked with -Oracle 11.2 client libraries can connect to Oracle Database 9.2 -onwards. See Oracle's note "Oracle Client / Server Interoperability -Support" (ID 207303.1) for details. +The extension can be linked with Oracle client libraries from Oracle +Database 10.2, 11, or 12.1. These libraries are found in the database +installation, or in the free Oracle Instant Client available from +Oracle. + +Oracle's standard cross-version connectivity applies. For example, +PHP OCI8 linked with Instant Client 11.2 can connect to Oracle +Database 9.2 onward. See Oracle's note "Oracle Client / Server +Interoperability Support" (ID 207303.1) for details. + +PHP OCI8 2.0 can be built with PHP 5.2 onward. Use the older PHP OCI8 +1.4.10 when using PHP 4.3.9 through to PHP 5.1.x, or when only Oracle +Database 9.2 client libraries are available. diff --git a/ext/oci8/config.m4 b/ext/oci8/config.m4 index 2af75a27f3e49..0d08d21c29e61 100644 --- a/ext/oci8/config.m4 +++ b/ext/oci8/config.m4 @@ -15,22 +15,6 @@ else PHP_OCI8_TAIL1="tail -1" fi -AC_DEFUN([PHP_OCI_IF_DEFINED],[ - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=$3 - AC_EGREP_CPP(yes,[ -#include -#if defined($1) - yes -#endif - ],[ - CPPFLAGS=$old_CPPFLAGS - $2 - ],[ - CPPFLAGS=$old_CPPFLAGS - ]) -]) - AC_DEFUN([AC_OCI8_CHECK_LIB_DIR],[ AC_MSG_CHECKING([ORACLE_HOME library validity]) if test ! -d "$OCI8_DIR"; then @@ -98,13 +82,99 @@ AC_DEFUN([AC_OCI8_ORACLE_VERSION],[ AC_MSG_RESULT($OCI8_ORACLE_VERSION) ]) +dnl +dnl OCI8_INIT_DTRACE(providerdesc, header-file, sources) +dnl This mimics PHP_INIT_DTRACE from PHP 5.4's acinclude.m4. It is +dnl necessarily different from PHP_INIT_DTRACE which doesn't currently +dnl support DTrace for extensions. Creating OCI8_INIT_DTRACE +dnl independently instead of using a refactored PHP_INIT_DTRACE allows +dnl OCI8 to be DTraced on versions of PHP where core PHP DTrace support +dnl isn't available. +dnl +AC_DEFUN([OCI8_INIT_DTRACE],[ + ac_srcdir=[]PHP_EXT_SRCDIR([oci8])/ + ac_bdir=[]PHP_EXT_BUILDDIR([oci8])/ + +dnl providerdesc + ac_provsrc=$1 + +dnl header-file + ac_hdrobj=$2 + +dnl DTrace objects + old_IFS=[$]IFS + for ac_src in $3; do + IFS=. + set $ac_src + ac_obj=[$]1 + IFS=$old_IFS + + OCI8_DTRACE_OBJS="[$]OCI8_DTRACE_OBJS [$]ac_bdir[$]ac_obj.lo" + done; + + for ac_lo in $OCI8_DTRACE_OBJS; do + dtrace_oci8_objs="[$]dtrace_oci8_objs `echo $ac_lo | $SED -e 's,\.lo$,.o,' -e 's#\(.*\)\/#\1\/.libs\/#'`" + done; + +dnl Generate Makefile.objects entry +dnl The empty $ac_provsrc command stops an implicit circular dependency +dnl in GNU Make which causes the .d file to be overwritten (Bug 61268) + cat>>Makefile.objects< \$[]@ + +\$(OCI8_DTRACE_OBJS): $ac_bdir[$]ac_hdrobj + +EOF + + case $host_alias in + *solaris*|*linux*) + dtrace_prov_name="`echo $ac_provsrc | $SED -e 's#\(.*\)\/##'`.o" + dtrace_lib_dir="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/[^/]*#\1#'`/.libs" + dtrace_d_obj="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/\([^/]*\)#\1/.libs/\2#'`.o" + dtrace_nolib_objs='$(OCI8_DTRACE_OBJS:.lo=.o)' + for ac_lo in $OCI8_DTRACE_OBJS; do + dtrace_oci8_lib_objs="[$]dtrace_oci8_lib_objs `echo $ac_lo | $SED -e 's,\.lo$,.o,' -e 's#\(.*\)\/#\1\/.libs\/#'`" + done; +dnl Always attempt to create both PIC and non-PIC DTrace objects (Bug 63692) + cat>>Makefile.objects< \$[]@ + @test -d "$dtrace_lib_dir" || mkdir $dtrace_lib_dir + if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $dtrace_d_obj -s $ac_srcdir[$]ac_provsrc $dtrace_oci8_lib_objs 2> /dev/null && test -f "$dtrace_d_obj"; then [\\] + echo "pic_object=['].libs/$dtrace_prov_name[']" >> \$[]@ [;\\] + else [\\] + echo "pic_object='none'" >> \$[]@ [;\\] + fi + if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $ac_bdir[$]ac_provsrc.o -s $ac_srcdir[$]ac_provsrc $dtrace_nolib_objs 2> /dev/null && test -f "$ac_bdir[$]ac_provsrc.o"; then [\\] + echo "non_pic_object=[']$dtrace_prov_name[']" >> \$[]@ [;\\] + else [\\] + echo "non_pic_object='none'" >> \$[]@ [;\\] + fi + +EOF + ;; + *) + AC_MSG_WARN([OCI8 extension: OCI8 DTrace support is not confirmed on this platform]) +cat>>Makefile.objects< | + | Authors: Stig Sæther Bakken | | Thies C. Arntzen | | Maxim Maletsky | | | @@ -39,12 +39,9 @@ #if HAVE_OCI8 -#if PHP_MAJOR_VERSION > 5 -#error This version of the PHP OCI8 extension is not compatible with PHP 6 or later -#elif PHP_MAJOR_VERSION < 5 -#ifdef ZTS -#error The PHP OCI8 extension does not support ZTS mode in PHP 4 -#endif +/* PHP 5.2 is the minimum supported version for OCI8 2.0 */ +#if PHP_MAJOR_VERSION < 5 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION <= 1) +#error Use PHP OCI8 1.4 for your version of PHP #endif #include "php_oci8.h" @@ -66,11 +63,8 @@ #endif ZEND_DECLARE_MODULE_GLOBALS(oci) -#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5) -/* This "if" allows PECL builds from this file to be portable to older PHP releases */ static PHP_GINIT_FUNCTION(oci); static PHP_GSHUTDOWN_FUNCTION(oci); -#endif /* Allow PHP 5.3 branch to be used in PECL for 5.x compatible builds */ #ifndef Z_ADDREF_P @@ -151,7 +145,7 @@ static sword php_oci_ping_init(php_oci_connection *connection, OCIError *errh TS /* }}} */ /* {{{ dynamically loadable module stuff */ -#if defined(COMPILE_DL_OCI8) || defined(COMPILE_DL_OCI8_11G) +#if defined(COMPILE_DL_OCI8) || defined(COMPILE_DL_OCI8_11G) || defined(COMPILE_DL_OCI8_12C) ZEND_GET_MODULE(oci8) #endif /* COMPILE_DL */ /* }}} */ @@ -457,6 +451,13 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_set_client_info, 0, 0, 2) ZEND_ARG_INFO(0, client_information) ZEND_END_ARG_INFO() +#ifdef WAITIING_ORACLE_BUG_16695981_FIX +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_set_db_operation, 0, 0, 2) +ZEND_ARG_INFO(0, connection_resource) +ZEND_ARG_INFO(0, action) +ZEND_END_ARG_INFO() +#endif + ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_password_change, 0, 0, 4) ZEND_ARG_INFO(0, connection_resource_or_connection_string) ZEND_ARG_INFO(0, username) @@ -708,6 +709,9 @@ static unsigned char arginfo_oci_bind_array_by_name[] = { 3, BYREF_NONE, BYREF_N #define arginfo_oci_set_module_name NULL #define arginfo_oci_set_action NULL #define arginfo_oci_set_client_info NULL +#ifdef WAITIING_ORACLE_BUG_16695981_FIX +#define arginfo_oci_set_db_operation NULL +#endif #define arginfo_oci_password_change NULL #define arginfo_oci_new_cursor NULL #define arginfo_oci_result NULL @@ -799,6 +803,9 @@ PHP_FUNCTION(oci_statement_type); PHP_FUNCTION(oci_num_rows); PHP_FUNCTION(oci_set_prefetch); PHP_FUNCTION(oci_set_client_identifier); +#ifdef WAITIING_ORACLE_BUG_16695981_FIX +PHP_FUNCTION(oci_set_db_operation); +#endif PHP_FUNCTION(oci_set_edition); PHP_FUNCTION(oci_set_module_name); PHP_FUNCTION(oci_set_action); @@ -904,6 +911,9 @@ zend_function_entry php_oci_functions[] = { PHP_FE(oci_new_descriptor, arginfo_oci_new_descriptor) PHP_FE(oci_set_prefetch, arginfo_oci_set_prefetch) PHP_FE(oci_set_client_identifier, arginfo_oci_set_client_identifier) +#ifdef WAITIING_ORACLE_BUG_16695981_FIX + PHP_FE(oci_set_db_operation, arginfo_oci_set_db_operation) +#endif PHP_FE(oci_set_edition, arginfo_oci_set_edition) PHP_FE(oci_set_module_name, arginfo_oci_set_module_name) PHP_FE(oci_set_action, arginfo_oci_set_action) @@ -1039,16 +1049,11 @@ zend_module_entry oci8_module_entry = { PHP_RSHUTDOWN(oci), /* per-request shutdown function */ PHP_MINFO(oci), /* information function */ PHP_OCI8_VERSION, -#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5) - /* This check allows PECL builds from this file to be portable to older PHP releases */ PHP_MODULE_GLOBALS(oci), /* globals descriptor */ PHP_GINIT(oci), /* globals ctor */ PHP_GSHUTDOWN(oci), /* globals dtor */ NULL, /* post deactivate */ STANDARD_MODULE_PROPERTIES_EX -#else - STANDARD_MODULE_PROPERTIES -#endif }; /* }}} */ @@ -1167,12 +1172,7 @@ static void php_oci_cleanup_global_handles(TSRMLS_D) * * Zerofill globals during module init */ -#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5) -/* This check allows PECL builds from this file to be portable to older PHP releases */ static PHP_GINIT_FUNCTION(oci) -#else -static void php_oci_init_globals(zend_oci_globals *oci_globals TSRMLS_DC) -#endif { memset(oci_globals, 0, sizeof(zend_oci_globals)); } @@ -1182,12 +1182,7 @@ static void php_oci_init_globals(zend_oci_globals *oci_globals TSRMLS_DC) * * Called for thread shutdown in ZTS, after module shutdown for non-ZTS */ -/* This check allows PECL builds from this file to be portable to older PHP releases */ -#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5) static PHP_GSHUTDOWN_FUNCTION(oci) -#else -static void php_oci_shutdown_globals(zend_oci_globals *oci_globals TSRMLS_DC) -#endif { php_oci_cleanup_global_handles(TSRMLS_C); } @@ -1198,12 +1193,6 @@ PHP_MINIT_FUNCTION(oci) zend_class_entry oci_lob_class_entry; zend_class_entry oci_coll_class_entry; -#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5) - /* This check allows PECL builds from this file to be portable to older PHP releases */ - /* this is handled by new globals management code */ -#else - ZEND_INIT_MODULE_GLOBALS(oci, php_oci_init_globals, php_oci_shutdown_globals); -#endif REGISTER_INI_ENTRIES(); le_statement = zend_register_list_destructors_ex(php_oci_statement_list_dtor, NULL, "oci8 statement", module_number); @@ -1306,7 +1295,6 @@ PHP_MINIT_FUNCTION(oci) PHP_RINIT_FUNCTION(oci) { - OCI_G(debug_mode) = 0; /* start "fresh" */ OCI_G(num_links) = OCI_G(num_persistent); OCI_G(errcode) = 0; OCI_G(edition) = NULL; @@ -1316,13 +1304,6 @@ PHP_RINIT_FUNCTION(oci) PHP_MSHUTDOWN_FUNCTION(oci) { -/* Work around PHP_GSHUTDOWN_FUNCTION not being called in older versions of PHP */ -#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 2) || (PHP_MAJOR_VERSION < 5) -#ifndef ZTS - php_oci_cleanup_global_handles(TSRMLS_C); -#endif -#endif - OCI_G(shutdown) = 1; UNREGISTER_INI_ENTRIES(); @@ -1354,6 +1335,11 @@ PHP_MINFO_FUNCTION(oci) php_info_print_table_start(); php_info_print_table_row(2, "OCI8 Support", "enabled"); +#if defined(HAVE_OCI8_DTRACE) + php_info_print_table_row(2, "OCI8 DTrace Support", "enabled"); +#else + php_info_print_table_row(2, "OCI8 DTrace Support", "disabled"); +#endif php_info_print_table_row(2, "OCI8 Version", PHP_OCI8_VERSION); php_info_print_table_row(2, "Revision", "$Id$"); @@ -1361,6 +1347,8 @@ PHP_MINFO_FUNCTION(oci) php_oci_client_get_version(&ver TSRMLS_CC); php_info_print_table_row(2, "Oracle Run-time Client Library Version", ver); efree(ver); +#else + php_info_print_table_row(2, "Oracle Run-time Client Library Version", "Unknown"); #endif #if defined(OCI_MAJOR_VERSION) && defined(OCI_MINOR_VERSION) snprintf(buf, sizeof(buf), "%d.%d", OCI_MAJOR_VERSION, OCI_MINOR_VERSION); @@ -1384,6 +1372,7 @@ PHP_MINFO_FUNCTION(oci) #endif #endif + php_info_print_table_end(); DISPLAY_INI_ENTRIES(); @@ -1467,11 +1456,11 @@ static void php_oci_pconnection_list_np_dtor(zend_rsrc_list_entry *entry TSRMLS_ OCI_G(num_persistent)--; } -#ifdef HAVE_DTRACE +#ifdef HAVE_OCI8_DTRACE if (DTRACE_OCI8_CONNECT_P_DTOR_CLOSE_ENABLED()) { DTRACE_OCI8_CONNECT_P_DTOR_CLOSE(connection); } -#endif /* HAVE_DTRACE */ +#endif /* HAVE_OCI8_DTRACE */ } else { /* * Release the connection to underlying pool. We do this unconditionally so that @@ -1484,11 +1473,11 @@ static void php_oci_pconnection_list_np_dtor(zend_rsrc_list_entry *entry TSRMLS_ */ php_oci_connection_release(connection TSRMLS_CC); -#ifdef HAVE_DTRACE +#ifdef HAVE_OCI8_DTRACE if (DTRACE_OCI8_CONNECT_P_DTOR_RELEASE_ENABLED()) { DTRACE_OCI8_CONNECT_P_DTOR_RELEASE(connection); } -#endif /* HAVE_DTRACE */ +#endif /* HAVE_OCI8_DTRACE */ } } /* }}} */ @@ -1635,12 +1624,12 @@ void php_oci_connection_descriptors_free(php_oci_connection *connection TSRMLS_D * Fetch & print out error message if we get an error * Returns an Oracle error number */ -sb4 php_oci_error(OCIError *err_p, sword status TSRMLS_DC) +sb4 php_oci_error(OCIError *err_p, sword errstatus TSRMLS_DC) { text *errbuf = (text *)NULL; - sb4 errcode = 0; + sb4 errcode = 0; /* Oracle error number */ - switch (status) { + switch (errstatus) { case OCI_SUCCESS: break; case OCI_SUCCESS_WITH_INFO: @@ -1683,15 +1672,15 @@ sb4 php_oci_error(OCIError *err_p, sword status TSRMLS_DC) php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_CONTINUE"); break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown OCI error code: %d", status); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown OCI error code: %d", errstatus); break; } -#ifdef HAVE_DTRACE +#ifdef HAVE_OCI8_DTRACE if (DTRACE_OCI8_ERROR_ENABLED()) { - DTRACE_OCI8_ERROR(status, errcode); + DTRACE_OCI8_ERROR((int)errstatus, (long)errcode); } -#endif /* HAVE_DTRACE */ +#endif /* HAVE_OCI8_DTRACE */ return errcode; } @@ -1771,11 +1760,11 @@ void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclus return; } -#ifdef HAVE_DTRACE +#ifdef HAVE_OCI8_DTRACE if (DTRACE_OCI8_CONNECT_ENTRY_ENABLED()) { DTRACE_OCI8_CONNECT_ENTRY(username, dbname, charset, session_mode, persistent, exclusive); } -#endif /* HAVE_DTRACE */ +#endif /* HAVE_OCI8_DTRACE */ if (!charset_len) { charset = NULL; @@ -1783,11 +1772,11 @@ void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclus connection = php_oci_do_connect_ex(username, username_len, password, password_len, NULL, 0, dbname, dbname_len, charset, session_mode, persistent, exclusive TSRMLS_CC); -#ifdef HAVE_DTRACE +#ifdef HAVE_OCI8_DTRACE if (DTRACE_OCI8_CONNECT_RETURN_ENABLED()) { DTRACE_OCI8_CONNECT_RETURN(connection); } -#endif /* HAVE_DTRACE */ +#endif /* HAVE_OCI8_DTRACE */ if (!connection) { @@ -1955,11 +1944,11 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char } } -#ifdef HAVE_DTRACE +#ifdef HAVE_OCI8_DTRACE if (DTRACE_OCI8_CONNECT_LOOKUP_ENABLED()) { DTRACE_OCI8_CONNECT_LOOKUP(connection, connection && connection->is_stub ? 1 : 0); } -#endif /* HAVE_DTRACE */ +#endif /* HAVE_OCI8_DTRACE */ /* If we got a pconnection stub, then 'load'(OCISessionGet) the real connection from its * private spool A connection is a stub if it is only a cached structure and the real @@ -2090,6 +2079,9 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char connection = (php_oci_connection *) ecalloc(1, sizeof(php_oci_connection)); connection->hash_key = estrndup(hashed_details.c, hashed_details.len); connection->is_persistent = 0; +#ifdef HAVE_OCI8_DTRACE + connection->client_id = NULL; +#endif } else { connection = (php_oci_connection *) calloc(1, sizeof(php_oci_connection)); if (connection == NULL) { @@ -2101,11 +2093,17 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char return NULL; } connection->is_persistent = 1; +#ifdef HAVE_OCI8_DTRACE + connection->client_id = NULL; +#endif } } else { connection = (php_oci_connection *) ecalloc(1, sizeof(php_oci_connection)); connection->hash_key = estrndup(hashed_details.c, hashed_details.len); connection->is_persistent = 0; +#ifdef HAVE_OCI8_DTRACE + connection->client_id = NULL; +#endif } /* {{{ Get the session pool that suits this connection request from the persistent list. This @@ -2186,11 +2184,11 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char OCI_G(num_links)++; } -#ifdef HAVE_DTRACE +#ifdef HAVE_OCI8_DTRACE if (DTRACE_OCI8_CONNECT_TYPE_ENABLED()) { DTRACE_OCI8_CONNECT_TYPE(connection->is_persistent ? 1 : 0, exclusive ? 1 : 0, connection, OCI_G(num_persistent), OCI_G(num_links)); } -#endif /* HAVE_DTRACE */ +#endif /* HAVE_OCI8_DTRACE */ return connection; } @@ -2202,20 +2200,24 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char */ static int php_oci_connection_ping(php_oci_connection *connection TSRMLS_DC) { + sword errstatus; + + OCI_G(errcode) = 0; /* assume ping is successful */ + /* Use OCIPing instead of OCIServerVersion. If OCIPing returns ORA-1010 (invalid OCI operation) * such as from Pre-10.1 servers, the error is still from the server and we would have * successfully performed a roundtrip and validated the connection. Use OCIServerVersion for * Pre-10.2 clients */ #if ((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2))) /* OCIPing available 10.2 onwards */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIPing, (connection->svc, OCI_G(err), OCI_DEFAULT)); + PHP_OCI_CALL_RETURN(errstatus, OCIPing, (connection->svc, OCI_G(err), OCI_DEFAULT)); #else char version[256]; /* use good old OCIServerVersion() */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIServerVersion, (connection->svc, OCI_G(err), (text *)version, sizeof(version), OCI_HTYPE_SVCCTX)); + PHP_OCI_CALL_RETURN(errstatus, OCIServerVersion, (connection->svc, OCI_G(err), (text *)version, sizeof(version), OCI_HTYPE_SVCCTX)); #endif - if (OCI_G(errcode) == OCI_SUCCESS) { + if (errstatus == OCI_SUCCESS) { return 1; } else { sb4 error_code = 0; @@ -2226,10 +2228,9 @@ static int php_oci_connection_ping(php_oci_connection *connection TSRMLS_DC) if (error_code == 1010) { return 1; } + OCI_G(errcode) = error_code; } - /* ignore errors here, just return failure - * php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); */ return 0; } /* }}} */ @@ -2240,17 +2241,17 @@ static int php_oci_connection_ping(php_oci_connection *connection TSRMLS_DC) */ static int php_oci_connection_status(php_oci_connection *connection TSRMLS_DC) { - ub4 ss = 0; + ub4 ss = OCI_SERVER_NOT_CONNECTED; + sword errstatus; /* get OCI_ATTR_SERVER_STATUS */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrGet, ((dvoid *)connection->server, OCI_HTYPE_SERVER, (dvoid *)&ss, (ub4 *)0, OCI_ATTR_SERVER_STATUS, OCI_G(err))); + PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)connection->server, OCI_HTYPE_SERVER, (dvoid *)&ss, (ub4 *)0, OCI_ATTR_SERVER_STATUS, OCI_G(err))); - if (OCI_G(errcode) == OCI_SUCCESS && ss == OCI_SERVER_NORMAL) { + if (errstatus == OCI_SUCCESS && ss == OCI_SERVER_NORMAL) { return 1; } - /* ignore errors here, just return failure - * php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); */ + /* ignore errors here, just return failure */ return 0; } /* }}} */ @@ -2261,14 +2262,17 @@ static int php_oci_connection_status(php_oci_connection *connection TSRMLS_DC) */ int php_oci_connection_rollback(php_oci_connection *connection TSRMLS_DC) { - PHP_OCI_CALL_RETURN(connection->errcode, OCITransRollback, (connection->svc, connection->err, (ub4) 0)); + sword errstatus; + + PHP_OCI_CALL_RETURN(errstatus, OCITransRollback, (connection->svc, connection->err, (ub4) 0)); connection->rb_on_disconnect = 0; - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -2279,14 +2283,17 @@ int php_oci_connection_rollback(php_oci_connection *connection TSRMLS_DC) */ int php_oci_connection_commit(php_oci_connection *connection TSRMLS_DC) { - PHP_OCI_CALL_RETURN(connection->errcode, OCITransCommit, (connection->svc, connection->err, (ub4) 0)); + sword errstatus; + + PHP_OCI_CALL_RETURN(errstatus, OCITransCommit, (connection->svc, connection->err, (ub4) 0)); connection->rb_on_disconnect = 0; - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -2300,6 +2307,12 @@ static int php_oci_connection_close(php_oci_connection *connection TSRMLS_DC) int result = 0; zend_bool in_call_save = OCI_G(in_call); +#ifdef HAVE_OCI8_DTRACE + if (DTRACE_OCI8_CONNECTION_CLOSE_ENABLED()) { + DTRACE_OCI8_CONNECTION_CLOSE(connection); + } +#endif /* HAVE_OCI8_DTRACE */ + if (!connection->is_stub) { /* Release resources associated with connection */ php_oci_connection_release(connection TSRMLS_CC); @@ -2327,7 +2340,7 @@ static int php_oci_connection_close(php_oci_connection *connection TSRMLS_DC) } if (connection->svc) { - PHP_OCI_CALL(OCIHandleFree, ((dvoid *) connection->svc, (ub4) OCI_HTYPE_SVCCTX)); + PHP_OCI_CALL(OCIHandleFree, ((dvoid *) connection->svc, (ub4) OCI_HTYPE_SVCCTX)); } if (connection->server) { @@ -2344,17 +2357,15 @@ static int php_oci_connection_close(php_oci_connection *connection TSRMLS_DC) php_oci_spool_close(connection->private_spool TSRMLS_CC); } - if (connection->is_persistent) { - if (connection->hash_key) { - free(connection->hash_key); - } - free(connection); - } else { - if (connection->hash_key) { - efree(connection->hash_key); - } - efree(connection); + if (connection->hash_key) { + pefree(connection->hash_key, connection->is_persistent); + } +#ifdef HAVE_OCI8_DTRACE + if (connection->client_id) { + pefree(connection->client_id, connection->is_persistent); } +#endif /* HAVE_OCI8_DTRACE */ + pefree(connection, connection->is_persistent); connection = NULL; OCI_G(in_call) = in_call_save; return result; @@ -2441,6 +2452,12 @@ int php_oci_connection_release(php_oci_connection *connection TSRMLS_DC) * the OCI session */ connection->next_pingp = NULL; +#ifdef HAVE_OCI8_DTRACE + if (connection->client_id) { + pefree(connection->client_id, connection->is_persistent); + connection->client_id = NULL; + } +#endif /* HAVE_OCI8_DTRACE */ } OCI_G(in_call) = in_call_save; @@ -2454,13 +2471,16 @@ int php_oci_connection_release(php_oci_connection *connection TSRMLS_DC) */ int php_oci_password_change(php_oci_connection *connection, char *user, int user_len, char *pass_old, int pass_old_len, char *pass_new, int pass_new_len TSRMLS_DC) { - PHP_OCI_CALL_RETURN(connection->errcode, OCIPasswordChange, (connection->svc, connection->err, (text *)user, user_len, (text *)pass_old, pass_old_len, (text *)pass_new, pass_new_len, OCI_DEFAULT)); + sword errstatus; + + PHP_OCI_CALL_RETURN(errstatus, OCIPasswordChange, (connection->svc, connection->err, (text *)user, user_len, (text *)pass_old, pass_old_len, (text *)pass_new, pass_new_len, OCI_DEFAULT)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ connection->passwd_changed = 1; return 0; } @@ -2495,12 +2515,13 @@ void php_oci_client_get_version(char **version TSRMLS_DC) */ int php_oci_server_get_version(php_oci_connection *connection, char **version TSRMLS_DC) { + sword errstatus; char version_buff[256]; - PHP_OCI_CALL_RETURN(connection->errcode, OCIServerVersion, (connection->svc, connection->err, (text *)version_buff, sizeof(version_buff), OCI_HTYPE_SVCCTX)); + PHP_OCI_CALL_RETURN(errstatus, OCIServerVersion, (connection->svc, connection->err, (text *)version_buff, sizeof(version_buff), OCI_HTYPE_SVCCTX)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } @@ -2773,11 +2794,11 @@ static int php_oci_persistent_helper(zend_rsrc_list_entry *le TSRMLS_DC) connection = (php_oci_connection *)le->ptr; if (!connection->used_this_request && OCI_G(persistent_timeout) != -1) { -#ifdef HAVE_DTRACE +#ifdef HAVE_OCI8_DTRACE if (DTRACE_OCI8_CONNECT_EXPIRY_ENABLED()) { - DTRACE_OCI8_CONNECT_EXPIRY(connection, connection->is_stub ? 1 : 0, connection->idle_expiry, timestamp); + DTRACE_OCI8_CONNECT_EXPIRY(connection, connection->is_stub ? 1 : 0, (long)connection->idle_expiry, (long)timestamp); } -#endif /* HAVE_DTRACE */ +#endif /* HAVE_OCI8_DTRACE */ if (connection->idle_expiry < timestamp) { /* connection has timed out */ return ZEND_HASH_APPLY_REMOVE; @@ -2798,6 +2819,7 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha zend_bool iserror = 0; ub4 poolmode = OCI_DEFAULT; /* Mode to be passed to OCISessionPoolCreate */ OCIAuthInfo *spoolAuth = NULL; + sword errstatus; /* Allocate sessionpool out of persistent memory */ session_pool = (php_oci_spool *) calloc(1, sizeof(php_oci_spool)); @@ -2822,10 +2844,10 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha } /* Allocate the pool handle */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (session_pool->env, (dvoid **) &session_pool->poolh, OCI_HTYPE_SPOOL, (size_t) 0, (dvoid **) 0)); + PHP_OCI_CALL_RETURN(errstatus, OCIHandleAlloc, (session_pool->env, (dvoid **) &session_pool->poolh, OCI_HTYPE_SPOOL, (size_t) 0, (dvoid **) 0)); - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC); iserror = 1; goto exit_create_spool; } @@ -2834,10 +2856,10 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha * generic bug which can free up the OCI_G(err) variable before destroying connections. We * cannot use this for other roundtrip calls as there is no way the user can access this error */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, ((dvoid *) session_pool->env, (dvoid **)&(session_pool->err), (ub4) OCI_HTYPE_ERROR,(size_t) 0, (dvoid **) 0)); + PHP_OCI_CALL_RETURN(errstatus, OCIHandleAlloc, ((dvoid *) session_pool->env, (dvoid **)&(session_pool->err), (ub4) OCI_HTYPE_ERROR,(size_t) 0, (dvoid **) 0)); - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC); iserror = 1; goto exit_create_spool; } @@ -2851,10 +2873,10 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha #if ((OCI_MAJOR_VERSION > 11) || ((OCI_MAJOR_VERSION == 11) && (OCI_MINOR_VERSION >= 2))) /* {{{ Allocate auth handle for session pool */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (session_pool->env, (dvoid **)&(spoolAuth), OCI_HTYPE_AUTHINFO, 0, NULL)); + PHP_OCI_CALL_RETURN(errstatus, OCIHandleAlloc, (session_pool->env, (dvoid **)&(spoolAuth), OCI_HTYPE_AUTHINFO, 0, NULL)); - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC); iserror = 1; goto exit_create_spool; } @@ -2862,10 +2884,10 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha /* {{{ Set the edition attribute on the auth handle */ if (OCI_G(edition)) { - PHP_OCI_CALL_RETURN(OCI_G(errcode),OCIAttrSet, ((dvoid *) spoolAuth, (ub4) OCI_HTYPE_AUTHINFO, (dvoid *) OCI_G(edition), (ub4)(strlen(OCI_G(edition))), (ub4)OCI_ATTR_EDITION, OCI_G(err))); + PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) spoolAuth, (ub4) OCI_HTYPE_AUTHINFO, (dvoid *) OCI_G(edition), (ub4)(strlen(OCI_G(edition))), (ub4)OCI_ATTR_EDITION, OCI_G(err))); - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC); iserror = 1; goto exit_create_spool; } @@ -2873,20 +2895,20 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha /* }}} */ /* {{{ Set the driver name attribute on the auth handle */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) spoolAuth, (ub4) OCI_HTYPE_AUTHINFO, (dvoid *) PHP_OCI8_DRIVER_NAME, (ub4) sizeof(PHP_OCI8_DRIVER_NAME)-1, (ub4) OCI_ATTR_DRIVER_NAME, OCI_G(err))); + PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) spoolAuth, (ub4) OCI_HTYPE_AUTHINFO, (dvoid *) PHP_OCI8_DRIVER_NAME, (ub4) sizeof(PHP_OCI8_DRIVER_NAME)-1, (ub4) OCI_ATTR_DRIVER_NAME, OCI_G(err))); - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC); iserror = 1; goto exit_create_spool; } /* }}} */ /* {{{ Set the auth handle on the session pool */ - PHP_OCI_CALL_RETURN(OCI_G(errcode),OCIAttrSet, ((dvoid *) (session_pool->poolh),(ub4) OCI_HTYPE_SPOOL, (dvoid *) spoolAuth, (ub4)0, (ub4)OCI_ATTR_SPOOL_AUTH, OCI_G(err))); + PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) (session_pool->poolh),(ub4) OCI_HTYPE_SPOOL, (dvoid *) spoolAuth, (ub4)0, (ub4)OCI_ATTR_SPOOL_AUTH, OCI_G(err))); - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC); iserror = 1; goto exit_create_spool; } @@ -2896,10 +2918,10 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha /* Create the homogeneous session pool - We have different session pools for every different * username, password, charset and dbname. */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCISessionPoolCreate,(session_pool->env, OCI_G(err), session_pool->poolh, (OraText **)&session_pool->poolname, &session_pool->poolname_len, (OraText *)dbname, (ub4)dbname_len, 0, UB4MAXVAL, 1,(OraText *)username, (ub4)username_len, (OraText *)password,(ub4)password_len, poolmode)); + PHP_OCI_CALL_RETURN(errstatus, OCISessionPoolCreate,(session_pool->env, OCI_G(err), session_pool->poolh, (OraText **)&session_pool->poolname, &session_pool->poolname_len, (OraText *)dbname, (ub4)dbname_len, 0, UB4MAXVAL, 1,(OraText *)username, (ub4)username_len, (OraText *)password,(ub4)password_len, poolmode)); - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC); iserror = 1; } @@ -2913,11 +2935,11 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha PHP_OCI_CALL(OCIHandleFree, ((dvoid *) spoolAuth, (ub4) OCI_HTYPE_AUTHINFO)); } -#ifdef HAVE_DTRACE +#ifdef HAVE_OCI8_DTRACE if (DTRACE_OCI8_SESSPOOL_CREATE_ENABLED()) { DTRACE_OCI8_SESSPOOL_CREATE(session_pool); } -#endif /* HAVE_DTRACE */ +#endif /* HAVE_OCI8_DTRACE */ return session_pool; } @@ -3241,11 +3263,11 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool connection->using_spool = 1; } -#ifdef HAVE_DTRACE +#ifdef HAVE_OCI8_DTRACE if (DTRACE_OCI8_SESSPOOL_TYPE_ENABLED()) { DTRACE_OCI8_SESSPOOL_TYPE(session_pool ? 1 : 0, session_pool ? session_pool : connection->private_spool); } -#endif /* HAVE_DTRACE */ +#endif /* HAVE_OCI8_DTRACE */ /* The passed in "connection" can be a cached stub from plist or freshly created. In the former * case, we do not have to allocate any handles @@ -3294,7 +3316,7 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool /* }}} */ /* {{{ Debug statements */ -#ifdef HAVE_DTRACE +#ifdef HAVE_OCI8_DTRACE if (DTRACE_OCI8_SESSPOOL_STATS_ENABLED()) { ub4 numfree = 0, numbusy = 0, numopen = 0; PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrGet, ((dvoid *)actual_spool->poolh, OCI_HTYPE_SPOOL, (dvoid *)&numopen, (ub4 *)0, OCI_ATTR_SPOOL_OPEN_COUNT, OCI_G(err))); @@ -3302,7 +3324,7 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool numfree = numopen - numbusy; /* number of free connections in the pool */ DTRACE_OCI8_SESSPOOL_STATS(numfree, numbusy, numopen); } -#endif /* HAVE_DTRACE */ +#endif /* HAVE_OCI8_DTRACE */ /* }}} */ /* Ping loop: Ping and loop till we get a good connection. When a database instance goes @@ -3469,13 +3491,13 @@ static sword php_oci_ping_init(php_oci_connection *connection, OCIError *errh TS * * DTrace output for connections that may have become invalid and marked for reopening */ -void php_oci_dtrace_check_connection(php_oci_connection *connection, sword errcode, ub4 serverStatus) +void php_oci_dtrace_check_connection(php_oci_connection *connection, sb4 errcode, ub4 serverStatus) { -#ifdef HAVE_DTRACE +#ifdef HAVE_OCI8_DTRACE if (DTRACE_OCI8_CHECK_CONNECTION_ENABLED()) { - DTRACE_OCI8_CHECK_CONNECTION(connection, connection && connection->is_open ? 1 : 0, (int)errcode, (unsigned long)serverStatus); + DTRACE_OCI8_CHECK_CONNECTION(connection, connection->client_id, connection->is_open ? 1 : 0, (long)errcode, (unsigned long)serverStatus); } -#endif /* HAVE_DTRACE */ +#endif /* HAVE_OCI8_DTRACE */ } /* }}} */ diff --git a/ext/oci8/oci8_collection.c b/ext/oci8/oci8_collection.c index 4abfbd6cfd58c..35b70fa7af73f 100644 --- a/ext/oci8/oci8_collection.c +++ b/ext/oci8/oci8_collection.c @@ -44,12 +44,13 @@ /* {{{ php_oci_collection_create() Create and return connection handle */ -php_oci_collection * php_oci_collection_create(php_oci_connection *connection, char *tdo, int tdo_len, char *schema, int schema_len TSRMLS_DC) +php_oci_collection *php_oci_collection_create(php_oci_connection *connection, char *tdo, int tdo_len, char *schema, int schema_len TSRMLS_DC) { dvoid *dschp1 = NULL; dvoid *parmp1; dvoid *parmp2; php_oci_collection *collection; + sword errstatus; collection = emalloc(sizeof(php_oci_collection)); @@ -58,7 +59,7 @@ php_oci_collection * php_oci_collection_create(php_oci_connection *connection, c zend_list_addref(collection->connection->id); /* get type handle by name */ - PHP_OCI_CALL_RETURN(connection->errcode, OCITypeByName, + PHP_OCI_CALL_RETURN(errstatus, OCITypeByName, ( connection->env, connection->err, @@ -75,19 +76,19 @@ php_oci_collection * php_oci_collection_create(php_oci_connection *connection, c ) ); - if (connection->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { goto CLEANUP; } /* allocate describe handle */ - PHP_OCI_CALL_RETURN(connection->errcode, OCIHandleAlloc, (connection->env, (dvoid **) &dschp1, (ub4) OCI_HTYPE_DESCRIBE, (size_t) 0, (dvoid **) 0)); + PHP_OCI_CALL_RETURN(errstatus, OCIHandleAlloc, (connection->env, (dvoid **) &dschp1, (ub4) OCI_HTYPE_DESCRIBE, (size_t) 0, (dvoid **) 0)); - if (connection->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { goto CLEANUP; } /* describe TDO */ - PHP_OCI_CALL_RETURN(connection->errcode, OCIDescribeAny, + PHP_OCI_CALL_RETURN(errstatus, OCIDescribeAny, ( connection->svc, connection->err, @@ -100,19 +101,19 @@ php_oci_collection * php_oci_collection_create(php_oci_connection *connection, c ) ); - if (connection->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { goto CLEANUP; } /* get first parameter handle */ - PHP_OCI_CALL_RETURN(connection->errcode, OCIAttrGet, ((dvoid *) dschp1, (ub4) OCI_HTYPE_DESCRIBE, (dvoid *)&parmp1, (ub4 *)0, (ub4)OCI_ATTR_PARAM, connection->err)); + PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *) dschp1, (ub4) OCI_HTYPE_DESCRIBE, (dvoid *)&parmp1, (ub4 *)0, (ub4)OCI_ATTR_PARAM, connection->err)); - if (connection->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { goto CLEANUP; } /* get the collection type code of the attribute */ - PHP_OCI_CALL_RETURN(connection->errcode, OCIAttrGet, + PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ( (dvoid*) parmp1, (ub4) OCI_DTYPE_PARAM, @@ -123,7 +124,7 @@ php_oci_collection * php_oci_collection_create(php_oci_connection *connection, c ) ); - if (connection->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { goto CLEANUP; } @@ -131,7 +132,7 @@ php_oci_collection * php_oci_collection_create(php_oci_connection *connection, c case OCI_TYPECODE_TABLE: case OCI_TYPECODE_VARRAY: /* get collection element handle */ - PHP_OCI_CALL_RETURN(connection->errcode, OCIAttrGet, + PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ( (dvoid*) parmp1, (ub4) OCI_DTYPE_PARAM, @@ -142,12 +143,12 @@ php_oci_collection * php_oci_collection_create(php_oci_connection *connection, c ) ); - if (connection->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { goto CLEANUP; } /* get REF of the TDO for the type */ - PHP_OCI_CALL_RETURN(connection->errcode, OCIAttrGet, + PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ( (dvoid*) parmp2, (ub4) OCI_DTYPE_PARAM, @@ -158,12 +159,12 @@ php_oci_collection * php_oci_collection_create(php_oci_connection *connection, c ) ); - if (connection->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { goto CLEANUP; } /* get the TDO (only header) */ - PHP_OCI_CALL_RETURN(connection->errcode, OCITypeByRef, + PHP_OCI_CALL_RETURN(errstatus, OCITypeByRef, ( connection->env, connection->err, @@ -174,12 +175,12 @@ php_oci_collection * php_oci_collection_create(php_oci_connection *connection, c ) ); - if (connection->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { goto CLEANUP; } /* get typecode */ - PHP_OCI_CALL_RETURN(connection->errcode, OCIAttrGet, + PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ( (dvoid*) parmp2, (ub4) OCI_DTYPE_PARAM, @@ -190,7 +191,7 @@ php_oci_collection * php_oci_collection_create(php_oci_connection *connection, c ) ); - if (connection->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { goto CLEANUP; } break; @@ -201,7 +202,7 @@ php_oci_collection * php_oci_collection_create(php_oci_connection *connection, c } /* Create object to hold return table */ - PHP_OCI_CALL_RETURN(connection->errcode, OCIObjectNew, + PHP_OCI_CALL_RETURN(errstatus, OCIObjectNew, ( connection->env, connection->err, @@ -215,13 +216,14 @@ php_oci_collection * php_oci_collection_create(php_oci_connection *connection, c ) ); - if (connection->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { goto CLEANUP; } /* free the describe handle (Bug #44113) */ PHP_OCI_CALL(OCIHandleFree, ((dvoid *) dschp1, OCI_HTYPE_DESCRIBE)); PHP_OCI_REGISTER_RESOURCE(collection, le_collection); + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return collection; CLEANUP: @@ -230,7 +232,7 @@ php_oci_collection * php_oci_collection_create(php_oci_connection *connection, c /* free the describe handle (Bug #44113) */ PHP_OCI_CALL(OCIHandleFree, ((dvoid *) dschp1, OCI_HTYPE_DESCRIBE)); } - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); php_oci_collection_close(collection TSRMLS_CC); return NULL; @@ -242,14 +244,16 @@ php_oci_collection * php_oci_collection_create(php_oci_connection *connection, c int php_oci_collection_size(php_oci_collection *collection, sb4 *size TSRMLS_DC) { php_oci_connection *connection = collection->connection; + sword errstatus; - PHP_OCI_CALL_RETURN(connection->errcode, OCICollSize, (connection->env, connection->err, collection->collection, (sb4 *)size)); + PHP_OCI_CALL_RETURN(errstatus, OCICollSize, (connection->env, connection->err, collection->collection, (sb4 *)size)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -272,14 +276,16 @@ int php_oci_collection_max(php_oci_collection *collection, long *max TSRMLS_DC) int php_oci_collection_trim(php_oci_collection *collection, long trim_size TSRMLS_DC) { php_oci_connection *connection = collection->connection; - - PHP_OCI_CALL_RETURN(connection->errcode, OCICollTrim, (connection->env, connection->err, trim_size, collection->collection)); + sword errstatus; + + PHP_OCI_CALL_RETURN(errstatus, OCICollTrim, (connection->env, connection->err, trim_size, collection->collection)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + errstatus = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -290,15 +296,17 @@ int php_oci_collection_append_null(php_oci_collection *collection TSRMLS_DC) { OCIInd null_index = OCI_IND_NULL; php_oci_connection *connection = collection->connection; + sword errstatus; /* append NULL element */ - PHP_OCI_CALL_RETURN(connection->errcode, OCICollAppend, (connection->env, connection->err, (dvoid *)0, &null_index, collection->collection)); + PHP_OCI_CALL_RETURN(errstatus, OCICollAppend, (connection->env, connection->err, (dvoid *)0, &null_index, collection->collection)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + errstatus = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -310,18 +318,19 @@ int php_oci_collection_append_date(php_oci_collection *collection, char *date, i OCIInd new_index = OCI_IND_NOTNULL; OCIDate oci_date; php_oci_connection *connection = collection->connection; + sword errstatus; /* format and language are NULLs, so format is "DD-MON-YY" and language is the default language of the session */ - PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (CONST text *)date, date_len, NULL, 0, NULL, 0, &oci_date)); + PHP_OCI_CALL_RETURN(errstatus, OCIDateFromText, (connection->err, (CONST text *)date, date_len, NULL, 0, NULL, 0, &oci_date)); - if (connection->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { /* failed to convert string to date */ - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - PHP_OCI_CALL_RETURN(connection->errcode, OCICollAppend, + PHP_OCI_CALL_RETURN(errstatus, OCICollAppend, ( connection->env, connection->err, @@ -331,12 +340,13 @@ int php_oci_collection_append_date(php_oci_collection *collection, char *date, i ) ); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -349,24 +359,19 @@ int php_oci_collection_append_number(php_oci_collection *collection, char *numbe double element_double; OCINumber oci_number; php_oci_connection *connection = collection->connection; + sword errstatus; -#if (PHP_MAJOR_VERSION == 4 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION < 10) - /* minimum PHP version ext/oci8/config.m4 accepts is 4.3.9 */ - element_double = strtod(number, NULL); -#else - /* zend_strtod was introduced in PHP 4.3.10 */ element_double = zend_strtod(number, NULL); -#endif - PHP_OCI_CALL_RETURN(connection->errcode, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number)); + PHP_OCI_CALL_RETURN(errstatus, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - PHP_OCI_CALL_RETURN(connection->errcode, OCICollAppend, + PHP_OCI_CALL_RETURN(errstatus, OCICollAppend, ( connection->env, connection->err, @@ -376,12 +381,13 @@ int php_oci_collection_append_number(php_oci_collection *collection, char *numbe ) ); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -393,16 +399,17 @@ int php_oci_collection_append_string(php_oci_collection *collection, char *eleme OCIInd new_index = OCI_IND_NOTNULL; OCIString *ocistr = (OCIString *)0; php_oci_connection *connection = collection->connection; + sword errstatus; - PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element, element_len, &ocistr)); + PHP_OCI_CALL_RETURN(errstatus, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element, element_len, &ocistr)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - PHP_OCI_CALL_RETURN(connection->errcode, OCICollAppend, + PHP_OCI_CALL_RETURN(errstatus, OCICollAppend, ( connection->env, connection->err, @@ -412,12 +419,13 @@ int php_oci_collection_append_string(php_oci_collection *collection, char *eleme ) ); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -473,11 +481,14 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z boolean exists; oratext buff[1024]; ub4 buff_len = 1024; + sword errstatus; MAKE_STD_ZVAL(*result_element); ZVAL_NULL(*result_element); - PHP_OCI_CALL_RETURN(connection->errcode, OCICollGetElem, + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ + + PHP_OCI_CALL_RETURN(errstatus, OCICollGetElem, ( connection->env, connection->err, @@ -489,8 +500,8 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z ) ); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); FREE_ZVAL(*result_element); return 1; @@ -509,10 +520,10 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z switch (collection->element_typecode) { case OCI_TYPECODE_DATE: - PHP_OCI_CALL_RETURN(connection->errcode, OCIDateToText, (connection->err, element, 0, 0, 0, 0, &buff_len, buff)); + PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, element, 0, 0, 0, 0, &buff_len, buff)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); FREE_ZVAL(*result_element); return 1; @@ -552,10 +563,10 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z { double double_number; - PHP_OCI_CALL_RETURN(connection->errcode, OCINumberToReal, (connection->err, (CONST OCINumber *) element, (uword) sizeof(double), (dvoid *) &double_number)); + PHP_OCI_CALL_RETURN(errstatus, OCINumberToReal, (connection->err, (CONST OCINumber *) element, (uword) sizeof(double), (dvoid *) &double_number)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); FREE_ZVAL(*result_element); return 1; @@ -583,15 +594,17 @@ int php_oci_collection_element_set_null(php_oci_collection *collection, long ind { OCIInd null_index = OCI_IND_NULL; php_oci_connection *connection = collection->connection; + sword errstatus; /* set NULL element */ - PHP_OCI_CALL_RETURN(connection->errcode, OCICollAssignElem, (connection->env, connection->err, (ub4) index, (dvoid *)"", &null_index, collection->collection)); + PHP_OCI_CALL_RETURN(errstatus, OCICollAssignElem, (connection->env, connection->err, (ub4) index, (dvoid *)"", &null_index, collection->collection)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -603,18 +616,19 @@ int php_oci_collection_element_set_date(php_oci_collection *collection, long ind OCIInd new_index = OCI_IND_NOTNULL; OCIDate oci_date; php_oci_connection *connection = collection->connection; + sword errstatus; /* format and language are NULLs, so format is "DD-MON-YY" and language is the default language of the session */ - PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (CONST text *)date, date_len, NULL, 0, NULL, 0, &oci_date)); + PHP_OCI_CALL_RETURN(errstatus, OCIDateFromText, (connection->err, (CONST text *)date, date_len, NULL, 0, NULL, 0, &oci_date)); - if (connection->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { /* failed to convert string to date */ - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - PHP_OCI_CALL_RETURN(connection->errcode, OCICollAssignElem, + PHP_OCI_CALL_RETURN(errstatus, OCICollAssignElem, ( connection->env, connection->err, @@ -625,12 +639,13 @@ int php_oci_collection_element_set_date(php_oci_collection *collection, long ind ) ); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -643,24 +658,19 @@ int php_oci_collection_element_set_number(php_oci_collection *collection, long i double element_double; OCINumber oci_number; php_oci_connection *connection = collection->connection; + sword errstatus; -#if (PHP_MAJOR_VERSION == 4 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION < 10) - /* minimum PHP version ext/oci8/config.m4 accepts is 4.3.9 */ - element_double = strtod(number, NULL); -#else - /* zend_strtod was introduced in PHP 4.3.10 */ element_double = zend_strtod(number, NULL); -#endif - PHP_OCI_CALL_RETURN(connection->errcode, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number)); + PHP_OCI_CALL_RETURN(errstatus, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - PHP_OCI_CALL_RETURN(connection->errcode, OCICollAssignElem, + PHP_OCI_CALL_RETURN(errstatus, OCICollAssignElem, ( connection->env, connection->err, @@ -671,12 +681,13 @@ int php_oci_collection_element_set_number(php_oci_collection *collection, long i ) ); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -688,16 +699,17 @@ int php_oci_collection_element_set_string(php_oci_collection *collection, long i OCIInd new_index = OCI_IND_NOTNULL; OCIString *ocistr = (OCIString *)0; php_oci_connection *connection = collection->connection; + sword errstatus; - PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element, element_len, &ocistr)); + PHP_OCI_CALL_RETURN(errstatus, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element, element_len, &ocistr)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - PHP_OCI_CALL_RETURN(connection->errcode, OCICollAssignElem, + PHP_OCI_CALL_RETURN(errstatus, OCICollAssignElem, ( connection->env, connection->err, @@ -708,12 +720,13 @@ int php_oci_collection_element_set_string(php_oci_collection *collection, long i ) ); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -764,14 +777,16 @@ int php_oci_collection_element_set(php_oci_collection *collection, long index, c int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_collection *collection_from TSRMLS_DC) { php_oci_connection *connection = collection_dest->connection; + sword errstatus; - PHP_OCI_CALL_RETURN(connection->errcode, OCICollAssign, (connection->env, connection->err, collection_from->collection, collection_dest->collection)); + PHP_OCI_CALL_RETURN(errstatus, OCICollAssign, (connection->env, connection->err, collection_from->collection, collection_dest->collection)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -781,18 +796,20 @@ int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_colle void php_oci_collection_close(php_oci_collection *collection TSRMLS_DC) { php_oci_connection *connection = collection->connection; + sword errstatus; if (collection->collection) { - PHP_OCI_CALL_RETURN(connection->errcode, OCIObjectFree, (connection->env, connection->err, (dvoid *)collection->collection, (ub2)OCI_OBJECTFREE_FORCE)); + PHP_OCI_CALL_RETURN(errstatus, OCIObjectFree, (connection->env, connection->err, (dvoid *)collection->collection, (ub2)OCI_OBJECTFREE_FORCE)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); + } else { + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ } } zend_list_delete(collection->connection->id); - efree(collection); return; } diff --git a/ext/oci8/oci8_dtrace.d b/ext/oci8/oci8_dtrace.d index 15d210cf6dfbc..30c98de912828 100644 --- a/ext/oci8/oci8_dtrace.d +++ b/ext/oci8/oci8_dtrace.d @@ -16,18 +16,19 @@ +----------------------------------------------------------------------+ */ -provider php { +provider phpoci { + probe oci8__check__connection(void *connection, char *client_id, int is_open, long errcode, unsigned long server_status); probe oci8__connect__entry(char *username, char *dbname, char *charset, long session_mode, int persistent, int exclusive); probe oci8__connect__return(void *connection); - probe oci8__check__connection(void *connection, int is_open, int errcode, unsigned long serverstatus); - probe oci8__sqltext(char *sql); + probe oci8__connection__close(void *connection); probe oci8__error(int status, long errcode); - probe oci8__execute__mode(unsigned int mode); + probe oci8__execute__mode(void *connection, char *client_id, void *statement, unsigned int mode); + probe oci8__sqltext(void *connection, char *client_id, void *statement, char *sql); probe oci8__connect__p__dtor__close(void *connection); probe oci8__connect__p__dtor__release(void *connection); probe oci8__connect__lookup(void *connection, int is_stub); - probe oci8__connect__expiry(void *connection, int is_stub, time_t idle_expiry, time_t timestamp); + probe oci8__connect__expiry(void *connection, int is_stub, long idle_expiry, long timestamp); probe oci8__connect__type(int persistent, int exclusive, void *connection, long num_persistent, long num_connections); probe oci8__sesspool__create(void *session_pool); probe oci8__sesspool__stats(unsigned long free, unsigned long busy, unsigned long open); diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c index aee876d736954..ccaed797429f1 100644 --- a/ext/oci8/oci8_interface.c +++ b/ext/oci8/oci8_interface.c @@ -1308,12 +1308,7 @@ PHP_FUNCTION(oci_field_is_null) Toggle internal debugging output for the OCI extension */ PHP_FUNCTION(oci_internal_debug) { - zend_bool on_off; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &on_off) == FAILURE) { - return; - } - OCI_G(debug_mode) = on_off; + /* NOP in OCI8 2.0. Obsoleted by DTrace probes */ } /* }}} */ @@ -1434,13 +1429,7 @@ PHP_FUNCTION(oci_fetch_all) if (flags & PHP_OCI_NUM) { zend_hash_next_index_insert(Z_ARRVAL_P(row), &element, sizeof(zval*), NULL); } else { /* default to ASSOC */ -#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5) - /* zend_symtable_update is only available in 5.2+ */ zend_symtable_update(Z_ARRVAL_P(row), columns[ i ]->name, columns[ i ]->name_len+1, &element, sizeof(zval*), NULL); -#else - /* This code path means Bug #45458 will remain broken when OCI8 is built with PHP 4 */ - zend_hash_update(Z_ARRVAL_P(row), columns[ i ]->name, columns[ i ]->name_len+1, &element, sizeof(zval*), NULL); -#endif } } @@ -1472,13 +1461,7 @@ PHP_FUNCTION(oci_fetch_all) MAKE_STD_ZVAL(tmp); array_init(tmp); -#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5) - /* zend_symtable_update is only available in 5.2+ */ zend_symtable_update(Z_ARRVAL_P(array), columns[ i ]->name, columns[ i ]->name_len+1, (void *) &tmp, sizeof(zval*), (void **) &(outarrs[ i ])); -#else - /* This code path means Bug #45458 will remain broken when OCI8 is built with PHP 4 */ - zend_hash_update(Z_ARRVAL_P(array), columns[ i ]->name, columns[ i ]->name_len+1, (void *) &tmp, sizeof(zval*), (void **) &(outarrs[ i ])); -#endif } } @@ -1624,7 +1607,6 @@ PHP_FUNCTION(oci_error) php_oci_connection *connection; text *errbuf; sb4 errcode = 0; - sword error = OCI_SUCCESS; dvoid *errh = NULL; ub2 error_offset = 0; text *sqltext = NULL; @@ -1635,10 +1617,9 @@ PHP_FUNCTION(oci_error) if (ZEND_NUM_ARGS() > 0) { statement = (php_oci_statement *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_statement); - if (statement) { errh = statement->err; - error = statement->errcode; + errcode = statement->errcode; if (php_oci_fetch_sqltext_offset(statement, &sqltext, &error_offset TSRMLS_CC)) { RETURN_FALSE; @@ -1649,23 +1630,23 @@ PHP_FUNCTION(oci_error) connection = (php_oci_connection *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_connection); if (connection) { errh = connection->err; - error = connection->errcode; + errcode = connection->errcode; goto go_out; } connection = (php_oci_connection *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_pconnection); if (connection) { errh = connection->err; - error = connection->errcode; + errcode = connection->errcode; goto go_out; } } else { errh = OCI_G(err); - error = OCI_G(errcode); + errcode = OCI_G(errcode); } go_out: - if (error == OCI_SUCCESS) { /* no error set in the handle */ + if (errcode == 0) { /* no error set in the handle */ RETURN_FALSE; } @@ -1764,6 +1745,7 @@ PHP_FUNCTION(oci_set_client_identifier) php_oci_connection *connection; char *client_id; int client_id_len; + sword errstatus; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &client_id, &client_id_len) == FAILURE) { return; @@ -1771,13 +1753,37 @@ PHP_FUNCTION(oci_set_client_identifier) PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) client_id, (ub4) client_id_len, (ub4) OCI_ATTR_CLIENT_IDENTIFIER, OCI_G(err))); + PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) client_id, (ub4) client_id_len, (ub4) OCI_ATTR_CLIENT_IDENTIFIER, connection->err)); - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); RETURN_FALSE; } +#ifdef HAVE_OCI8_DTRACE + /* The alternatives to storing client_id like done below are + i) display it in a probe here in oci_set_client_identifier and + let the user D script correlate the connection address probe + argument and the client_id. This would likely require user D + script variables, which would use kernel memory. + ii) call OCIAttrGet for each probe definition that uses + client_id. This would be slower than storing it. + */ + + if (connection->client_id) { + pefree(connection->client_id, connection->is_persistent); + } + + if (client_id) { + /* this long winded copy allows compatibility with older PHP versions */ + connection->client_id = (char *)pemalloc(client_id_len+1, connection->is_persistent); + memcpy(connection->client_id, client_id, client_id_len); + connection->client_id[client_id_len] = '\0'; + } else { + connection->client_id = NULL; + } +#endif /* HAVE_OCI8_DTRACE */ + RETURN_TRUE; } /* }}} */ @@ -1796,13 +1802,14 @@ PHP_FUNCTION(oci_set_edition) if (OCI_G(edition)) { efree(OCI_G(edition)); - OCI_G(edition) = NULL; } if (edition) { - OCI_G(edition) = (char *)safe_emalloc(edition_len+1, sizeof(text), 0); + OCI_G(edition) = (char *)safe_emalloc(edition_len+1, sizeof(char), 0); memcpy(OCI_G(edition), edition, edition_len); OCI_G(edition)[edition_len] = '\0'; + } else { + OCI_G(edition) = NULL; } RETURN_TRUE; @@ -1822,6 +1829,7 @@ PHP_FUNCTION(oci_set_module_name) php_oci_connection *connection; char *module; int module_len; + sword errstatus; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &module, &module_len) == FAILURE) { return; @@ -1829,10 +1837,10 @@ PHP_FUNCTION(oci_set_module_name) PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) module, (ub4) module_len, (ub4) OCI_ATTR_MODULE, OCI_G(err))); + PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) module, (ub4) module_len, (ub4) OCI_ATTR_MODULE, connection->err)); - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); RETURN_FALSE; } @@ -1853,6 +1861,7 @@ PHP_FUNCTION(oci_set_action) php_oci_connection *connection; char *action; int action_len; + sword errstatus; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &action, &action_len) == FAILURE) { return; @@ -1860,10 +1869,10 @@ PHP_FUNCTION(oci_set_action) PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) action, (ub4) action_len, (ub4) OCI_ATTR_ACTION, OCI_G(err))); + PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) action, (ub4) action_len, (ub4) OCI_ATTR_ACTION, connection->err)); - if (OCI_G(errcode) != OCI_SUCCESS) { - php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); RETURN_FALSE; } @@ -1884,6 +1893,7 @@ PHP_FUNCTION(oci_set_client_info) php_oci_connection *connection; char *client_info; int client_info_len; + sword errstatus; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &client_info, &client_info_len) == FAILURE) { return; @@ -1891,13 +1901,44 @@ PHP_FUNCTION(oci_set_client_info) PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) client_info, (ub4) client_info_len, (ub4) OCI_ATTR_CLIENT_INFO, OCI_G(err))); + PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) client_info, (ub4) client_info_len, (ub4) OCI_ATTR_CLIENT_INFO, connection->err)); + + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + RETURN_FALSE; + } + + RETURN_TRUE; +#else + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unsupported attribute type"); + RETURN_FALSE; +#endif +} +/* }}} */ + +#ifdef WAITIING_ORACLE_BUG_16695981_FIX +/* {{{ proto bool oci_set_db_operation(resource connection, string value) + Sets the "DB operation" on the connection for Oracle end-to-end tracing */ +PHP_FUNCTION(oci_set_db_operation) +{ +#if (OCI_MAJOR_VERSION > 11) + zval *z_connection; + php_oci_connection *connection; + char *dbop_name; + int dbop_name_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &dbop_name, &dbop_name_len) == FAILURE) { + return; + } + + PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); + + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) dbop_name, (ub4) dbop_name_len, (ub4) OCI_ATTR_DBOP, OCI_G(err))); if (OCI_G(errcode) != OCI_SUCCESS) { php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); RETURN_FALSE; } - RETURN_TRUE; #else php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unsupported attribute type"); @@ -1905,6 +1946,7 @@ PHP_FUNCTION(oci_set_client_info) #endif } /* }}} */ +#endif /* WAITIING_ORACLE_BUG_16695981_FIX */ /* {{{ proto bool oci_password_change(resource connection, string username, string old_password, string new_password) Changes the password of an account */ diff --git a/ext/oci8/oci8_lob.c b/ext/oci8/oci8_lob.c index 87ce84843f809..4f58c65737f97 100644 --- a/ext/oci8/oci8_lob.c +++ b/ext/oci8/oci8_lob.c @@ -54,6 +54,7 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, long type TSRMLS_DC) { php_oci_descriptor *descriptor; + sword errstatus; switch (type) { case OCI_DTYPE_FILE: @@ -72,13 +73,15 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, long typ descriptor->connection = connection; zend_list_addref(descriptor->connection->id); - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIDescriptorAlloc, (connection->env, (dvoid*)&(descriptor->descriptor), descriptor->type, (size_t) 0, (dvoid **) 0)); + PHP_OCI_CALL_RETURN(errstatus, OCIDescriptorAlloc, (connection->env, (dvoid*)&(descriptor->descriptor), descriptor->type, (size_t) 0, (dvoid **) 0)); - if (OCI_G(errcode) != OCI_SUCCESS) { - OCI_G(errcode) = php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, OCI_G(errcode)); efree(descriptor); return NULL; + } else { + OCI_G(errcode) = 0; /* retain backwards compat with OCI8 1.4 */ } PHP_OCI_REGISTER_RESOURCE(descriptor, le_descriptor); @@ -117,6 +120,7 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, long typ int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length TSRMLS_DC) { php_oci_connection *connection = descriptor->connection; + sword errstatus; *length = 0; @@ -125,18 +129,18 @@ int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length TSRMLS_D return 0; } else { if (descriptor->type == OCI_DTYPE_FILE) { - PHP_OCI_CALL_RETURN(connection->errcode, OCILobFileOpen, (connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + PHP_OCI_CALL_RETURN(errstatus, OCILobFileOpen, (connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY)); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } } - PHP_OCI_CALL_RETURN(connection->errcode, OCILobGetLength, (connection->svc, connection->err, descriptor->descriptor, (ub4 *)length)); + PHP_OCI_CALL_RETURN(errstatus, OCILobGetLength, (connection->svc, connection->err, descriptor->descriptor, (ub4 *)length)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } @@ -144,14 +148,16 @@ int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length TSRMLS_D descriptor->lob_size = *length; if (descriptor->type == OCI_DTYPE_FILE) { - PHP_OCI_CALL_RETURN(connection->errcode, OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor)); + PHP_OCI_CALL_RETURN(errstatus, OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } } + + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ } return 0; } @@ -159,11 +165,7 @@ int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length TSRMLS_D /* {{{ php_oci_lob_callback() Append LOB portion to a memory buffer */ -#if defined(HAVE_OCI_LOB_READ2) sb4 php_oci_lob_callback (dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece, dvoid **changed_bufpp, oraub8 *changed_lenp) -#else -sb4 php_oci_lob_callback (dvoid *ctxp, CONST dvoid *bufxp, ub4 len, ub1 piece) -#endif { ub4 lenp = (ub4) len; php_oci_lob_ctx *ctx = (php_oci_lob_ctx *)ctxp; @@ -211,20 +213,22 @@ static inline int php_oci_lob_calculate_buffer(php_oci_descriptor *descriptor, l { php_oci_connection *connection = descriptor->connection; ub4 chunk_size; + sword errstatus; if (descriptor->type == OCI_DTYPE_FILE) { return read_length; } if (!descriptor->chunk_size) { - PHP_OCI_CALL_RETURN(connection->errcode, OCILobGetChunkSize, (connection->svc, connection->err, descriptor->descriptor, &chunk_size)); + PHP_OCI_CALL_RETURN(errstatus, OCILobGetChunkSize, (connection->svc, connection->err, descriptor->descriptor, &chunk_size)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return read_length; /* we have to return original length here */ } descriptor->chunk_size = chunk_size; + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ } if ((read_length % descriptor->chunk_size) != 0) { @@ -243,16 +247,12 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long ini int buffer_size = PHP_OCI_LOB_BUFFER_SIZE; php_oci_lob_ctx ctx; ub1 *bufp; -#if defined(HAVE_OCI_LOB_READ2) oraub8 bytes_read, offset = 0; oraub8 requested_len = read_length; /* this is by default */ oraub8 chars_read = 0; -#else - int bytes_read, offset = 0; - int requested_len = read_length; /* this is by default */ -#endif int is_clob = 0; sb4 bytes_per_char = 1; + sword errstatus; *data_len = 0; *data = NULL; @@ -289,20 +289,20 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long ini offset = initial_offset; if (descriptor->type == OCI_DTYPE_FILE) { - PHP_OCI_CALL_RETURN(connection->errcode, OCILobFileOpen, (connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY)); + PHP_OCI_CALL_RETURN(errstatus, OCILobFileOpen, (connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } } else { ub2 charset_id = 0; - PHP_OCI_CALL_RETURN(connection->errcode, OCILobCharSetId, (connection->env, connection->err, descriptor->descriptor, &charset_id)); + PHP_OCI_CALL_RETURN(errstatus, OCILobCharSetId, (connection->env, connection->err, descriptor->descriptor, &charset_id)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } @@ -313,10 +313,10 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long ini } if (is_clob) { - PHP_OCI_CALL_RETURN(connection->errcode, OCINlsNumericInfoGet, (connection->env, connection->err, &bytes_per_char, OCI_NLS_CHARSET_MAXBYTESZ)); + PHP_OCI_CALL_RETURN(errstatus, OCINlsNumericInfoGet, (connection->env, connection->err, &bytes_per_char, OCI_NLS_CHARSET_MAXBYTESZ)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } @@ -327,7 +327,6 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long ini ctx.alloc_len = (requested_len + 1) * bytes_per_char; *data = ecalloc(bytes_per_char, requested_len + 1); -#ifdef HAVE_OCI_LOB_READ2 if (is_clob) { chars_read = requested_len; bytes_read = 0; @@ -340,7 +339,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long ini buffer_size = php_oci_lob_calculate_buffer(descriptor, buffer_size TSRMLS_CC); /* use chunk size */ bufp = (ub1 *) ecalloc(1, buffer_size); - PHP_OCI_CALL_RETURN(connection->errcode, OCILobRead2, + PHP_OCI_CALL_RETURN(errstatus, OCILobRead2, ( connection->svc, connection->err, @@ -365,37 +364,9 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long ini } else { offset = descriptor->lob_current_position + bytes_read; } - -#else - - bytes_read = requested_len; - buffer_size = (requested_len < buffer_size ) ? requested_len : buffer_size; /* optimize buffer size */ - buffer_size = php_oci_lob_calculate_buffer(descriptor, buffer_size TSRMLS_CC); /* use chunk size */ - - bufp = (ub1 *) ecalloc(1, buffer_size); - PHP_OCI_CALL_RETURN(connection->errcode, OCILobRead, - ( - connection->svc, - connection->err, - descriptor->descriptor, - &bytes_read, /* IN/OUT bytes toread/read */ - offset + 1, /* offset (starts with 1) */ - (dvoid *) bufp, - (ub4) buffer_size, /* size of buffer */ - (dvoid *)&ctx, - (OCICallbackLobRead) php_oci_lob_callback, /* callback... */ - (ub2) descriptor->charset_id, /* The character set ID of the buffer data. */ - (ub1) descriptor->charset_form /* The character set form of the buffer data. */ - ) - ); - - efree(bufp); - offset = descriptor->lob_current_position + bytes_read; - -#endif - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); if (*data) { efree(*data); @@ -408,10 +379,10 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long ini descriptor->lob_current_position = (int)offset; if (descriptor->type == OCI_DTYPE_FILE) { - PHP_OCI_CALL_RETURN(connection->errcode, OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor)); + PHP_OCI_CALL_RETURN(errstatus, OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); if (*data) { efree(*data); @@ -422,6 +393,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long ini } } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -433,6 +405,7 @@ int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, i OCILobLocator *lob = (OCILobLocator *) descriptor->descriptor; php_oci_connection *connection = (php_oci_connection *) descriptor->connection; ub4 lob_length; + sword errstatus; *bytes_written = 0; if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) { @@ -451,7 +424,7 @@ int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, i offset = descriptor->lob_current_position; } - PHP_OCI_CALL_RETURN(connection->errcode, OCILobWrite, + PHP_OCI_CALL_RETURN(errstatus, OCILobWrite, ( connection->svc, connection->err, @@ -468,8 +441,8 @@ int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, i ) ); - if (connection->errcode) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); *bytes_written = 0; return 1; @@ -486,6 +459,7 @@ int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, i descriptor->buffering = PHP_OCI_LOB_BUFFER_USED; } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -495,6 +469,7 @@ int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, i int php_oci_lob_set_buffering (php_oci_descriptor *descriptor, int on_off TSRMLS_DC) { php_oci_connection *connection = descriptor->connection; + sword errstatus; if (!on_off && descriptor->buffering == PHP_OCI_LOB_BUFFER_DISABLED) { /* disabling when it's already off */ @@ -507,17 +482,18 @@ int php_oci_lob_set_buffering (php_oci_descriptor *descriptor, int on_off TSRMLS } if (on_off) { - PHP_OCI_CALL_RETURN(connection->errcode, OCILobEnableBuffering, (connection->svc, connection->err, descriptor->descriptor)); + PHP_OCI_CALL_RETURN(errstatus, OCILobEnableBuffering, (connection->svc, connection->err, descriptor->descriptor)); } else { - PHP_OCI_CALL_RETURN(connection->errcode, OCILobDisableBuffering, (connection->svc, connection->err, descriptor->descriptor)); + PHP_OCI_CALL_RETURN(errstatus, OCILobDisableBuffering, (connection->svc, connection->err, descriptor->descriptor)); } - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } descriptor->buffering = on_off ? PHP_OCI_LOB_BUFFER_ENABLED : PHP_OCI_LOB_BUFFER_DISABLED; + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -540,6 +516,7 @@ int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *d { php_oci_connection *connection = descriptor_dest->connection; ub4 length_dest, length_from, copy_len; + sword errstatus; if (php_oci_lob_get_length(descriptor_dest, &length_dest TSRMLS_CC)) { return 1; @@ -560,7 +537,7 @@ int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *d return 1; } - PHP_OCI_CALL_RETURN(connection->errcode, OCILobCopy, + PHP_OCI_CALL_RETURN(errstatus, OCILobCopy, ( connection->svc, connection->err, @@ -572,12 +549,13 @@ int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *d ) ); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -587,15 +565,17 @@ int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *d int php_oci_lob_close (php_oci_descriptor *descriptor TSRMLS_DC) { php_oci_connection *connection = descriptor->connection; - + sword errstatus; + if (descriptor->is_open) { - PHP_OCI_CALL_RETURN(connection->errcode, OCILobClose, (connection->svc, connection->err, descriptor->descriptor)); - } + PHP_OCI_CALL_RETURN(errstatus, OCILobClose, (connection->svc, connection->err, descriptor->descriptor)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + PHP_OCI_HANDLE_ERROR(connection, connection->errcode); + return 1; + } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ } if (php_oci_temp_lob_close(descriptor TSRMLS_CC)) { @@ -612,24 +592,26 @@ int php_oci_temp_lob_close (php_oci_descriptor *descriptor TSRMLS_DC) { php_oci_connection *connection = descriptor->connection; int is_temporary; + sword errstatus; - PHP_OCI_CALL_RETURN(connection->errcode, OCILobIsTemporary, (connection->env,connection->err, descriptor->descriptor, &is_temporary)); + PHP_OCI_CALL_RETURN(errstatus, OCILobIsTemporary, (connection->env,connection->err, descriptor->descriptor, &is_temporary)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } if (is_temporary) { - PHP_OCI_CALL_RETURN(connection->errcode, OCILobFreeTemporary, (connection->svc, connection->err, descriptor->descriptor)); + PHP_OCI_CALL_RETURN(errstatus, OCILobFreeTemporary, (connection->svc, connection->err, descriptor->descriptor)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -640,7 +622,8 @@ int php_oci_lob_flush(php_oci_descriptor *descriptor, long flush_flag TSRMLS_DC) { OCILobLocator *lob = descriptor->descriptor; php_oci_connection *connection = descriptor->connection; - + sword errstatus; + if (!lob) { return 1; } @@ -663,16 +646,17 @@ int php_oci_lob_flush(php_oci_descriptor *descriptor, long flush_flag TSRMLS_DC) return 0; } - PHP_OCI_CALL_RETURN(connection->errcode, OCILobFlushBuffer, (connection->svc, connection->err, lob, flush_flag)); + PHP_OCI_CALL_RETURN(errstatus, OCILobFlushBuffer, (connection->svc, connection->err, lob, flush_flag)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } /* marking buffer as enabled and not used */ descriptor->buffering = PHP_OCI_LOB_BUFFER_ENABLED; + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -734,6 +718,7 @@ int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename TSRMLS_DC php_oci_connection *connection = descriptor->connection; char buf[8192]; ub4 offset = 1; + sword errstatus; #if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5) /* Safe mode has been removed in PHP 5.4 */ @@ -750,7 +735,7 @@ int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename TSRMLS_DC } while ((loblen = read(fp, &buf, sizeof(buf))) > 0) { - PHP_OCI_CALL_RETURN(connection->errcode, + PHP_OCI_CALL_RETURN(errstatus, OCILobWrite, ( connection->svc, @@ -768,11 +753,13 @@ int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename TSRMLS_DC ) ); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); close(fp); return 1; + } else { + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ } offset += loblen; } @@ -790,6 +777,7 @@ int php_oci_lob_append (php_oci_descriptor *descriptor_dest, php_oci_descriptor OCILobLocator *lob_dest = descriptor_dest->descriptor; OCILobLocator *lob_from = descriptor_from->descriptor; ub4 dest_len, from_len; + sword errstatus; if (php_oci_lob_get_length(descriptor_dest, &dest_len TSRMLS_CC)) { return 1; @@ -803,13 +791,14 @@ int php_oci_lob_append (php_oci_descriptor *descriptor_dest, php_oci_descriptor return 0; } - PHP_OCI_CALL_RETURN(connection->errcode, OCILobAppend, (connection->svc, connection->err, lob_dest, lob_from)); + PHP_OCI_CALL_RETURN(errstatus, OCILobAppend, (connection->svc, connection->err, lob_dest, lob_from)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -821,6 +810,7 @@ int php_oci_lob_truncate (php_oci_descriptor *descriptor, long new_lob_length TS php_oci_connection *connection = descriptor->connection; OCILobLocator *lob = descriptor->descriptor; ub4 lob_length; + sword errstatus; if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) { return 1; @@ -840,15 +830,17 @@ int php_oci_lob_truncate (php_oci_descriptor *descriptor, long new_lob_length TS return 1; } - PHP_OCI_CALL_RETURN(connection->errcode, OCILobTrim, (connection->svc, connection->err, lob, new_lob_length)); + PHP_OCI_CALL_RETURN(errstatus, OCILobTrim, (connection->svc, connection->err, lob, new_lob_length)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } descriptor->lob_size = new_lob_length; + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ + return 0; } /* }}} */ @@ -860,6 +852,7 @@ int php_oci_lob_erase (php_oci_descriptor *descriptor, long offset, ub4 length, php_oci_connection *connection = descriptor->connection; OCILobLocator *lob = descriptor->descriptor; ub4 lob_length; + sword errstatus; *bytes_erased = 0; @@ -875,15 +868,16 @@ int php_oci_lob_erase (php_oci_descriptor *descriptor, long offset, ub4 length, length = lob_length; } - PHP_OCI_CALL_RETURN(connection->errcode, OCILobErase, (connection->svc, connection->err, lob, (ub4 *)&length, offset+1)); + PHP_OCI_CALL_RETURN(errstatus, OCILobErase, (connection->svc, connection->err, lob, (ub4 *)&length, offset+1)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } *bytes_erased = length; + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -895,14 +889,16 @@ int php_oci_lob_is_equal (php_oci_descriptor *descriptor_first, php_oci_descript php_oci_connection *connection = descriptor_first->connection; OCILobLocator *first_lob = descriptor_first->descriptor; OCILobLocator *second_lob = descriptor_second->descriptor; + sword errstatus; - PHP_OCI_CALL_RETURN(connection->errcode, OCILobIsEqual, (connection->env, first_lob, second_lob, result)); + PHP_OCI_CALL_RETURN(errstatus, OCILobIsEqual, (connection->env, first_lob, second_lob, result)); - if (connection->errcode) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -914,6 +910,7 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, long type, char *data php_oci_connection *connection = descriptor->connection; OCILobLocator *lob = descriptor->descriptor; ub4 bytes_written = 0; + sword errstatus; switch (type) { case OCI_TEMP_BLOB: @@ -930,7 +927,7 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, long type, char *data return 1; } - PHP_OCI_CALL_RETURN(connection->errcode, OCILobCreateTemporary, + PHP_OCI_CALL_RETURN(errstatus, OCILobCreateTemporary, ( connection->svc, connection->err, @@ -943,21 +940,22 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, long type, char *data ) ); - if (connection->errcode) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - PHP_OCI_CALL_RETURN(connection->errcode, OCILobOpen, (connection->svc, connection->err, lob, OCI_LOB_READWRITE)); + PHP_OCI_CALL_RETURN(errstatus, OCILobOpen, (connection->svc, connection->err, lob, OCI_LOB_READWRITE)); - if (connection->errcode) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } descriptor->is_open = 1; + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return php_oci_lob_write(descriptor, 0, data, data_len, &bytes_written TSRMLS_CC); } diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c index cf8d23dc882a8..1e66308e53ca4 100644 --- a/ext/oci8/oci8_statement.c +++ b/ext/oci8/oci8_statement.c @@ -46,24 +46,21 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char *query, int query_len TSRMLS_DC) { php_oci_statement *statement; - + sword errstatus; + + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ + statement = ecalloc(1,sizeof(php_oci_statement)); if (!query_len) { /* do not allocate stmt handle for refcursors, we'll get it from OCIStmtPrepare2() */ PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid **)&(statement->stmt), OCI_HTYPE_STMT, 0, NULL)); - } else { -#ifdef HAVE_DTRACE - if (DTRACE_OCI8_SQLTEXT_ENABLED()) { - DTRACE_OCI8_SQLTEXT(query); - } -#endif /* HAVE_DTRACE */ } - + PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid **)&(statement->err), OCI_HTYPE_ERROR, 0, NULL)); if (query_len > 0) { - PHP_OCI_CALL_RETURN(connection->errcode, OCIStmtPrepare2, + PHP_OCI_CALL_RETURN(errstatus, OCIStmtPrepare2, ( connection->svc, &(statement->stmt), @@ -76,14 +73,19 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char OCI_DEFAULT ) ); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); +#ifdef HAVE_OCI8_DTRACE + if (DTRACE_OCI8_SQLTEXT_ENABLED()) { + DTRACE_OCI8_SQLTEXT(connection, connection->client_id, statement, query); + } +#endif /* HAVE_OCI8_DTRACE */ - PHP_OCI_CALL(OCIStmtRelease, (statement->stmt, statement->err, NULL, 0, statement->errcode ? OCI_STRLS_CACHE_DELETE : OCI_DEFAULT)); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + + PHP_OCI_CALL(OCIStmtRelease, (statement->stmt, statement->err, NULL, 0, OCI_STRLS_CACHE_DELETE)); PHP_OCI_CALL(OCIHandleFree,(statement->err, OCI_HTYPE_ERROR)); - - efree(statement); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); + efree(statement); return NULL; } } @@ -131,9 +133,10 @@ php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement T void *result; ub4 rtype; php_oci_statement *statement2; /* implicit result set statement handle */ + sword errstatus; - PHP_OCI_CALL_RETURN(statement->errcode, OCIStmtGetNextResult, (statement->stmt, statement->err, &result, &rtype, OCI_DEFAULT)); - if (statement->errcode == OCI_NO_DATA) { + PHP_OCI_CALL_RETURN(errstatus, OCIStmtGetNextResult, (statement->stmt, statement->err, &result, &rtype, OCI_DEFAULT)); + if (errstatus == OCI_NO_DATA) { return NULL; } @@ -182,19 +185,22 @@ php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement T Set prefetch buffer size for the statement */ int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch TSRMLS_DC) { + sword errstatus; + if (prefetch > 20000) { prefetch = 20000; /* keep it somewhat sane */ } - PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrSet, (statement->stmt, OCI_HTYPE_STMT, &prefetch, 0, OCI_ATTR_PREFETCH_ROWS, statement->err)); + PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, (statement->stmt, OCI_HTYPE_STMT, &prefetch, 0, OCI_ATTR_PREFETCH_ROWS, statement->err)); - if (statement->errcode != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); statement->prefetch_count = 0; return 1; } statement->prefetch_count = prefetch; + statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -242,16 +248,18 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) ub4 typep, iterp, idxp; ub1 in_outp, piecep; zend_bool piecewisecols = 0; - php_oci_out_column *column; + sword errstatus; + + statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ if (statement->has_descr && statement->columns) { zend_hash_apply(statement->columns, (apply_func_t) php_oci_cleanup_pre_fetch TSRMLS_CC); } - PHP_OCI_CALL_RETURN(statement->errcode, OCIStmtFetch, (statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, OCI_DEFAULT)); + PHP_OCI_CALL_RETURN(errstatus, OCIStmtFetch, (statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, OCI_DEFAULT)); - if ( statement->errcode == OCI_NO_DATA || nrows == 0 ) { + if (errstatus == OCI_NO_DATA || nrows == 0) { if (statement->last_query == NULL) { /* reset define-list for refcursors */ if (statement->columns) { @@ -263,7 +271,6 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) statement->executed = 0; } - statement->errcode = 0; /* OCI_NO_DATA is NO error for us!!! */ statement->has_data = 0; if (nrows == 0) { @@ -282,9 +289,9 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) } } - while (statement->errcode == OCI_NEED_DATA) { + while (errstatus == OCI_NEED_DATA) { if (piecewisecols) { - PHP_OCI_CALL_RETURN(statement->errcode, + PHP_OCI_CALL_RETURN(errstatus, OCIStmtGetPieceInfo, ( statement->stmt, @@ -326,7 +333,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) } } - PHP_OCI_CALL_RETURN(statement->errcode, OCIStmtFetch, (statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, OCI_DEFAULT)); + PHP_OCI_CALL_RETURN(errstatus, OCIStmtFetch, (statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, OCI_DEFAULT)); if (piecewisecols) { for (i = 0; i < statement->ncolumns; i++) { @@ -338,7 +345,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) } } - if (statement->errcode == OCI_SUCCESS_WITH_INFO || statement->errcode == OCI_SUCCESS) { + if (errstatus == OCI_SUCCESS_WITH_INFO || errstatus == OCI_SUCCESS) { statement->has_data = 1; /* do the stuff needed for OCIDefineByName */ @@ -359,7 +366,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) return 0; } - statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); statement->has_data = 0; @@ -482,17 +489,18 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) ub4 colcount; ub2 dynamic; dvoid *buf; + sword errstatus; switch (mode) { case OCI_COMMIT_ON_SUCCESS: case OCI_DESCRIBE_ONLY: case OCI_DEFAULT: /* only these are allowed */ -#ifdef HAVE_DTRACE +#ifdef HAVE_OCI8_DTRACE if (DTRACE_OCI8_EXECUTE_MODE_ENABLED()) { - DTRACE_OCI8_EXECUTE_MODE(mode); + DTRACE_OCI8_EXECUTE_MODE(statement->connection, statement->connection->client_id, statement, mode); } -#endif /* HAVE_DTRACE */ +#endif /* HAVE_OCI8_DTRACE */ break; default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid execute mode given: %d", mode); @@ -502,12 +510,14 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) if (!statement->stmttype) { /* get statement type */ - PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement->stmttype, (ub4 *)0, OCI_ATTR_STMT_TYPE, statement->err)); + PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement->stmttype, (ub4 *)0, OCI_ATTR_STMT_TYPE, statement->err)); - if (statement->errcode != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; + } else { + statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ } } @@ -528,10 +538,10 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) } /* execute statement */ - PHP_OCI_CALL_RETURN(statement->errcode, OCIStmtExecute, (statement->connection->svc, statement->stmt, statement->err, iters, 0, NULL, NULL, mode)); + PHP_OCI_CALL_RETURN(errstatus, OCIStmtExecute, (statement->connection->svc, statement->stmt, statement->err, iters, 0, NULL, NULL, mode)); - if (statement->errcode != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -553,6 +563,8 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) * invoked PL/SQL must explicitly rollback/commit else the * SELECT fails). */ + + statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ } if (statement->stmttype == OCI_STMT_SELECT && statement->executed == 0) { @@ -565,10 +577,10 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) counter = 1; /* get number of columns */ - PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *)&colcount, (ub4 *)0, OCI_ATTR_PARAM_COUNT, statement->err)); + PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *)&colcount, (ub4 *)0, OCI_ATTR_PARAM_COUNT, statement->err)); - if (statement->errcode != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -585,50 +597,50 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) } /* get column */ - PHP_OCI_CALL_RETURN(statement->errcode, OCIParamGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, statement->err, (dvoid**)¶m, counter)); + PHP_OCI_CALL_RETURN(errstatus, OCIParamGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, statement->err, (dvoid**)¶m, counter)); - if (statement->errcode != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } /* get column datatype */ - PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->data_type, (ub4 *)0, OCI_ATTR_DATA_TYPE, statement->err)); + PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->data_type, (ub4 *)0, OCI_ATTR_DATA_TYPE, statement->err)); - if (statement->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } /* get character set form */ - PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->charset_form, (ub4 *)0, OCI_ATTR_CHARSET_FORM, statement->err)); + PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->charset_form, (ub4 *)0, OCI_ATTR_CHARSET_FORM, statement->err)); - if (statement->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } /* get character set id */ - PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->charset_id, (ub4 *)0, OCI_ATTR_CHARSET_ID, statement->err)); + PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->charset_id, (ub4 *)0, OCI_ATTR_CHARSET_ID, statement->err)); - if (statement->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } /* get size of the column */ - PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->data_size, (dvoid *)0, OCI_ATTR_DATA_SIZE, statement->err)); + PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->data_size, (dvoid *)0, OCI_ATTR_DATA_SIZE, statement->err)); - if (statement->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -637,31 +649,31 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) outcol->retlen = outcol->data_size; /* get scale of the column */ - PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->scale, (dvoid *)0, OCI_ATTR_SCALE, statement->err)); + PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->scale, (dvoid *)0, OCI_ATTR_SCALE, statement->err)); - if (statement->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } /* get precision of the column */ - PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->precision, (dvoid *)0, OCI_ATTR_PRECISION, statement->err)); + PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->precision, (dvoid *)0, OCI_ATTR_PRECISION, statement->err)); - if (statement->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } /* get name of the column */ - PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid **)&colname, (ub4 *)&outcol->name_len, (ub4)OCI_ATTR_NAME, statement->err)); + PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid **)&colname, (ub4 *)&outcol->name_len, (ub4)OCI_ATTR_NAME, statement->err)); - if (statement->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -757,7 +769,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) } if (dynamic == OCI_DYNAMIC_FETCH) { - PHP_OCI_CALL_RETURN(statement->errcode, + PHP_OCI_CALL_RETURN(errstatus, OCIDefineByPos, ( statement->stmt, /* IN/OUT handle to the requested SQL query */ @@ -775,7 +787,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) ); } else { - PHP_OCI_CALL_RETURN(statement->errcode, + PHP_OCI_CALL_RETURN(errstatus, OCIDefineByPos, ( statement->stmt, /* IN/OUT handle to the requested SQL query */ @@ -794,10 +806,10 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) } - if (statement->errcode != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 0; + return 1; } /* additional OCIDefineDynamic() call */ @@ -807,7 +819,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) case SQLT_BLOB: case SQLT_CLOB: case SQLT_BFILE: - PHP_OCI_CALL_RETURN(statement->errcode, + PHP_OCI_CALL_RETURN(errstatus, OCIDefineDynamic, ( outcol->oci_define, @@ -817,9 +829,15 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) ) ); + if (errstatus != OCI_SUCCESS) { + statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); + return 1; + } break; } } + statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ } return 0; @@ -950,6 +968,7 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC) { php_oci_bind *bind = (php_oci_bind *) data; php_oci_connection *connection = bind->parent_statement->connection; + sword errstatus; if (bind->indicator == -1) { /* NULL */ zval *val = bind->zval; @@ -1009,24 +1028,26 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC) memset((void*)buff,0,sizeof(buff)); if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) { - PHP_OCI_CALL_RETURN(connection->errcode, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff)); + PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff)); zval_dtor(*entry); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); ZVAL_NULL(*entry); } else { + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ ZVAL_STRINGL(*entry, (char *)buff, buff_len, 1); } zend_hash_move_forward(hash); } else { - PHP_OCI_CALL_RETURN(connection->errcode, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff)); - if (connection->errcode != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff)); + if (errstatus != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); add_next_index_null(bind->zval); } else { + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ add_next_index_stringl(bind->zval, (char *)buff, buff_len, 1); } } @@ -1072,6 +1093,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, php_oci_bind bind, *old_bind, *bindp; int mode = OCI_DATA_AT_EXEC; sb4 value_sz = -1; + sword errstatus; switch (type) { case SQLT_NTY: @@ -1195,7 +1217,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, bindp->type = type; zval_add_ref(&var); - PHP_OCI_CALL_RETURN(statement->errcode, + PHP_OCI_CALL_RETURN(errstatus, OCIBindByName, ( statement->stmt, /* statement handle */ @@ -1215,14 +1237,14 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, ) ); - if (statement->errcode != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } if (mode == OCI_DATA_AT_EXEC) { - PHP_OCI_CALL_RETURN(statement->errcode, OCIBindDynamic, + PHP_OCI_CALL_RETURN(errstatus, OCIBindDynamic, ( bindp->bind, statement->err, @@ -1233,8 +1255,8 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, ) ); - if (statement->errcode != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -1242,7 +1264,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, if (type == SQLT_NTY) { /* Bind object */ - PHP_OCI_CALL_RETURN(statement->errcode, OCIBindObject, + PHP_OCI_CALL_RETURN(errstatus, OCIBindObject, ( bindp->bind, statement->err, @@ -1254,13 +1276,14 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, ) ); - if (statement->errcode) { - statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); + if (errstatus) { + statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } } + statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; } /* }}} */ @@ -1446,17 +1469,18 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type TSRMLS_DC) { ub2 statement_type; + sword errstatus; *type = 0; - PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement_type, (ub4 *)0, OCI_ATTR_STMT_TYPE, statement->err)); + PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement_type, (ub4 *)0, OCI_ATTR_STMT_TYPE, statement->err)); - if (statement->errcode != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } - + statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ *type = statement_type; return 0; @@ -1468,17 +1492,18 @@ int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type TSRMLS_DC int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows TSRMLS_DC) { ub4 statement_numrows; + sword errstatus; *numrows = 0; - PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub4 *)&statement_numrows, (ub4 *)0, OCI_ATTR_ROW_COUNT, statement->err)); + PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub4 *)&statement_numrows, (ub4 *)0, OCI_ATTR_ROW_COUNT, statement->err)); - if (statement->errcode != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); + if (errstatus != OCI_SUCCESS) { + statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } - + statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ *numrows = statement_numrows; return 0; @@ -1490,6 +1515,7 @@ int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows TSR int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, long max_table_length, long maxlength, long type TSRMLS_DC) { php_oci_bind *bind, *bindp; + sword errstatus; convert_to_array(var); @@ -1553,7 +1579,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam zval_add_ref(&var); - PHP_OCI_CALL_RETURN(statement->errcode, + PHP_OCI_CALL_RETURN(errstatus, OCIBindByName, ( statement->stmt, @@ -1574,12 +1600,13 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam ); - if (statement->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { efree(bind); - statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } + statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ efree(bind); return 0; } @@ -1741,6 +1768,7 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, long max_table_length, p ub4 i; HashTable *hash; zval **entry; + sword errstatus; hash = HASH_OF(var); @@ -1762,14 +1790,14 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, long max_table_length, p if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) { convert_to_string_ex(entry); - PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (CONST text *)Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), NULL, 0, NULL, 0, &oci_date)); + PHP_OCI_CALL_RETURN(errstatus, OCIDateFromText, (connection->err, (CONST text *)Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), NULL, 0, NULL, 0, &oci_date)); - if (connection->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { /* failed to convert string to date */ efree(bind->array.element_lengths); efree(bind->array.elements); efree(bind); - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return NULL; } @@ -1777,20 +1805,21 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, long max_table_length, p ((OCIDate *)bind->array.elements)[i] = oci_date; zend_hash_move_forward(hash); } else { - PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (CONST text *)"01-JAN-00", sizeof("01-JAN-00")-1, NULL, 0, NULL, 0, &oci_date)); + PHP_OCI_CALL_RETURN(errstatus, OCIDateFromText, (connection->err, (CONST text *)"01-JAN-00", sizeof("01-JAN-00")-1, NULL, 0, NULL, 0, &oci_date)); - if (connection->errcode != OCI_SUCCESS) { + if (errstatus != OCI_SUCCESS) { /* failed to convert string to date */ efree(bind->array.element_lengths); efree(bind->array.elements); efree(bind); - connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return NULL; } ((OCIDate *)bind->array.elements)[i] = oci_date; } + connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ } zend_hash_internal_pointer_reset(hash); diff --git a/ext/oci8/package.xml b/ext/oci8/package.xml index 4dc78d4983774..b180b0d5f0bdc 100644 --- a/ext/oci8/package.xml +++ b/ext/oci8/package.xml @@ -8,12 +8,17 @@ http://pear.php.net/dtd/package-2.0.xsd"> Extension for Oracle Database - This extension allows you to access Oracle Database. OCI8 2.0 can - be built with PHP 4.3.9 onwards. OCI8 can be linked with Oracle - Database 9.2, 10, 11, or 12.1 client libraries. Oracle's standard - cross-version connectivity applies. For example PHP linked with - Oracle Database 11.2 client libraries can connect to Oracle - Database 9.2 onwards. +Use the OCI8 extension to access Oracle Database. The extension can +be linked with Oracle client libraries from Oracle Database 10.2, 11, +or 12.1. These libraries are found in the database installation, or +in the free Oracle Instant Client available from Oracle. Oracle's +standard cross-version connectivity applies. For example, PHP OCI8 +linked with Instant Client 11.2 can connect to Oracle Database 9.2 +onward. See Oracle's note "Oracle Client / Server Interoperability +Support" (ID 207303.1) for details. PHP OCI8 2.0 can be built with +PHP 5.2 onward. Use the older PHP OCI8 1.4.10 when using PHP 4.3.9 +through to PHP 5.1.x, or when only Oracle Database 9.2 client +libraries are available. Christopher Jones @@ -40,21 +45,25 @@ http://pear.php.net/dtd/package-2.0.xsd"> no - 2013-07-24 + 2013-10-17 - 2.0.1 - 2.0.1 + 2.0.5 + 2.0.5 - devel - devel + stable + stable PHP - - Fixed --enable-maintainer-zts mode - Allow Implicit Result Set statement resources to inherit the parent's current prefetch count + +Bump PHP OCI8 2.0 mininum requirements to PHP 5.2 and Oracle client +library 10.2. (Use OCI8 1.4 for older PHP version support or if only +Oracle 9.2 client libraries are available.) + +Re-enable php_oci8.dll and php_oci8_11g.dll for Windows builds so URL +links work in the new Windows PECL infrastructure. @@ -140,7 +149,6 @@ http://pear.php.net/dtd/package-2.0.xsd"> - @@ -153,7 +161,6 @@ http://pear.php.net/dtd/package-2.0.xsd"> - @@ -222,6 +229,8 @@ http://pear.php.net/dtd/package-2.0.xsd"> + + @@ -267,6 +276,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> + @@ -439,8 +449,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> - 4.3.9 - 6.0.0 + 5.2.0 1.4.0b1 @@ -453,6 +462,74 @@ http://pear.php.net/dtd/package-2.0.xsd"> + + + 2.0.4 + 2.0.4 + + + devel + devel + + PHP + +Fix persistent memory usage with --enable-dtrace +Export get_module() for Windows php_oci8_12c.dll + + + + + + 2.0.3 + 2.0.3 + + + devel + devel + + PHP + +Add the oci_set_client_identifier() value and statement structure pointer to several DTrace probes. +Use 'phpoci' as the DTrace provider name since uniqueness is required by the Linux fasttrap module. +Update Windows builds to create only php_oci8_12c.dll. + + + + + + 2.0.2 + 2.0.2 + + + devel + devel + + PHP + +Review and improve error handling code and data types. +Fix oci_set_*($connection, ...) error handling so oci_error($connection) works. +Add DTrace oci8-connection-close probe +Add the connection handle to several DTrace probes. + + + + + + 2.0.1 + 2.0.1 + + + devel + devel + + PHP + +Fixed --enable-maintainer-zts mode. +Allow Implicit Result Set statement resources to inherit the parent's current prefetch count. +Allow OCI8 to be DTrace-enabled independently from core PHP. +Require OCI8 to be configured 'shared' when enabling DTrace support. + + @@ -465,69 +542,69 @@ http://pear.php.net/dtd/package-2.0.xsd"> PHP - - NEW FUNCTIONALITY: - - - Added Implicit Result Set support for Oracle Database 12c. - Streaming of all IRS's returned from a PL/SQL block is available - via oci_fetch_array, oci_fetch_assoc, oci_fetch_object and - oci_fetch_row (but not oci_fetch or oci_fetch_all). - Alternatively individual IRS statement resources can be obtained - with the new function 'oci_get_implicit_resultset' and passed to - any oci_fetch_* function. - - - Added DTrace probes enabled with PHP's generic --enable-dtrace - - - IMPROVED FUNCTIONALITY: - - - Using 'oci_execute($s, OCI_NO_AUTO_COMMIT)' for a SELECT no - longer unnecessarily initiates an internal ROLLBACK during - connection close. This can improve overall scalability by - reducing "round trips" between PHP and the database. - - - CHANGED FUNCTIONALITY: - - - PHPINFO() CHANGES: - - - The oci8.event and oci8.connection_class values are now shown - only when the Oracle client libraries support the respective - functionality. - - - Connection statistics are now in a separate phpinfo() table. - - - Temporary LOB and Collection support status lines in - phpinfo() were removed. These features have always been - enabled since 2007. - - - OCI_INTERNAL_DEBUG() CHANGES: - - - The oci_internal_debug() function is now a no-op. Use PHP's - --enable-dtrace functionality with DTrace or SystemTap instead. - - - INTERNAL CHANGES: - - - Fixed a potential NULL pointer dereference flagged by Parfait - static code analysis. - - - Extended testing of existing OCI8 functionality. - - - Improved test output portability when using the PHP development - web server to run tests. - - - Removed no-longer necessary Unicode patterns from tests - (vestiges of PHP's previous PHP 6 project) - - - Improved build portability by removing compilation type cast - warnings with some compilers. - - - Fixed compilation warnings when building with Oracle 9.2 - client libraries. - - - Updated code to use internal macro PHP_OCI_REGISTER_RESOURCE. - - - Regularized code prototypes and fixed some in-line documentation - prototypes. - - - Fixed code folding. +- NEW FUNCTIONALITY: + + - Added Implicit Result Set support for Oracle Database 12c. + Streaming of all IRS's returned from a PL/SQL block is available + via oci_fetch_array, oci_fetch_assoc, oci_fetch_object and + oci_fetch_row (but not oci_fetch or oci_fetch_all). + Alternatively individual IRS statement resources can be obtained + with the new function 'oci_get_implicit_resultset' and passed to + any oci_fetch_* function. + + - Added DTrace probes enabled with PHP's generic --enable-dtrace + +- IMPROVED FUNCTIONALITY: + + - Using 'oci_execute($s, OCI_NO_AUTO_COMMIT)' for a SELECT no + longer unnecessarily initiates an internal ROLLBACK during + connection close. This can improve overall scalability by + reducing "round trips" between PHP and the database. + +- CHANGED FUNCTIONALITY: + + - PHPINFO() CHANGES: + + - The oci8.event and oci8.connection_class values are now shown + only when the Oracle client libraries support the respective + functionality. + + - Connection statistics are now in a separate phpinfo() table. + + - Temporary LOB and Collection support status lines in + phpinfo() were removed. These features have always been + enabled since 2007. + + - OCI_INTERNAL_DEBUG() CHANGES: + + - The oci_internal_debug() function is now a no-op. Use PHP's + --enable-dtrace functionality with DTrace or SystemTap instead. + +- INTERNAL CHANGES: + + - Fixed a potential NULL pointer dereference flagged by Parfait + static code analysis. + + - Extended testing of existing OCI8 functionality. + + - Improved test output portability when using the PHP development + web server to run tests. + + - Removed no-longer necessary Unicode patterns from tests + (vestiges of PHP's previous PHP 6 project) + + - Improved build portability by removing compilation type cast + warnings with some compilers. + + - Fixed compilation warnings when building with Oracle 9.2 + client libraries. + + - Updated code to use internal macro PHP_OCI_REGISTER_RESOURCE. + + - Regularized code prototypes and fixed some in-line documentation + prototypes. + + - Fixed code folding. diff --git a/ext/oci8/php_oci8.h b/ext/oci8/php_oci8.h index f10f01db52d42..ee8d83122114f 100644 --- a/ext/oci8/php_oci8.h +++ b/ext/oci8/php_oci8.h @@ -41,12 +41,11 @@ */ #ifdef PHP_OCI8_VERSION /* The definition of PHP_OCI8_VERSION changed in PHP 5.3 and building - * this code with PHP 5.2 and earlier (e.g. when using OCI8 from PECL) - * will conflict. + * this code with PHP 5.2 (e.g. when using OCI8 from PECL) will conflict. */ #undef PHP_OCI8_VERSION #endif -#define PHP_OCI8_VERSION "2.0.1-dev" +#define PHP_OCI8_VERSION "2.0.5" extern zend_module_entry oci8_module_entry; #define phpext_oci8_ptr &oci8_module_entry diff --git a/ext/oci8/php_oci8_int.h b/ext/oci8/php_oci8_int.h index ac58145f44957..e50983d75eb53 100644 --- a/ext/oci8/php_oci8_int.h +++ b/ext/oci8/php_oci8_int.h @@ -44,7 +44,7 @@ # endif # endif /* osf alpha */ -#ifdef HAVE_DTRACE +#ifdef HAVE_OCI8_DTRACE #include "oci8_dtrace_gen.h" #endif @@ -141,7 +141,7 @@ typedef struct { OCIAuthInfo *authinfo; /* Cached authinfo handle for OCISessionGet */ OCIError *err; /* private error handle */ php_oci_spool *private_spool; /* private session pool (for persistent) */ - sword errcode; /* last errcode */ + sb4 errcode; /* last ORA- error number */ HashTable *descriptors; /* descriptors hash, used to flush all the LOBs using this connection on commit */ ulong descriptor_count; /* used to index the descriptors hash table. Not an accurate count */ @@ -156,6 +156,9 @@ typedef struct { time_t idle_expiry; /* time when the connection will be considered as expired */ time_t *next_pingp; /* (pointer to) time of the next ping */ char *hash_key; /* hashed details of the connection */ +#ifdef HAVE_OCI8_DTRACE + char *client_id; /* The oci_set_client_identifier() value */ +#endif } php_oci_connection; /* }}} */ @@ -213,7 +216,7 @@ typedef struct { struct php_oci_statement *impres_child_stmt;/* child of current Implicit Result Set statement handle */ ub4 impres_count; /* count of remaining Implicit Result children on parent statement handle */ php_oci_connection *connection; /* parent connection handle */ - sword errcode; /* last errcode*/ + sb4 errcode; /* last ORA- error number */ OCIError *err; /* private error handle */ OCIStmt *stmt; /* statement handle */ char *last_query; /* last query issued. also used to determine if this is a statement or a refcursor recieved from Oracle */ @@ -412,7 +415,7 @@ void php_oci_client_get_version(char **version TSRMLS_DC); int php_oci_server_get_version(php_oci_connection *connection, char **version TSRMLS_DC); void php_oci_fetch_row(INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_args); int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSRMLS_DC); -void php_oci_dtrace_check_connection(php_oci_connection *connection, sword errcode, ub4 serverStatus); +void php_oci_dtrace_check_connection(php_oci_connection *connection, sb4 errcode, ub4 serverStatus); /* }}} */ @@ -435,11 +438,7 @@ int php_oci_lob_append(php_oci_descriptor *descriptor_dest, php_oci_descriptor * int php_oci_lob_truncate(php_oci_descriptor *descriptor, long new_lob_length TSRMLS_DC); int php_oci_lob_erase(php_oci_descriptor *descriptor, long offset, ub4 length, ub4 *bytes_erased TSRMLS_DC); int php_oci_lob_is_equal(php_oci_descriptor *descriptor_first, php_oci_descriptor *descriptor_second, boolean *result TSRMLS_DC); -#if defined(HAVE_OCI_LOB_READ2) sb4 php_oci_lob_callback(dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece, dvoid **changed_bufpp, oraub8 *changed_lenp); -#else -sb4 php_oci_lob_callback(dvoid *ctxp, CONST dvoid *bufxp, ub4 len, ub1 piece); -#endif /* }}} */ /* {{{ collection related prototypes */ @@ -493,11 +492,9 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, long max_table_length, p /* }}} */ ZEND_BEGIN_MODULE_GLOBALS(oci) /* {{{ Module globals */ - sword errcode; /* global last error code (used when connect fails, for example) */ + sb4 errcode; /* global last ORA- error number. Used when connect fails, for example */ OCIError *err; /* global error handle */ - zend_bool debug_mode; /* debug mode flag */ - long max_persistent; /* maximum number of persistent connections per process */ long num_persistent; /* number of existing persistent connections */ long num_links; /* non-persistent + persistent connections */ diff --git a/ext/oci8/tests/bind_char_1.phpt b/ext/oci8/tests/bind_char_1.phpt index d68991a7f2baf..dc162ff943182 100644 --- a/ext/oci8/tests/bind_char_1.phpt +++ b/ext/oci8/tests/bind_char_1.phpt @@ -6,15 +6,8 @@ if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 10 && $matches[2] >= 2) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 2) - ))) { - die("skip expected output only valid when using Oracle 10gR2 or 11.2.0.2 databases"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 11) { - die("skip test expected to work only with Oracle 11g or greater version of client"); +if (!(isset($matches[0]) && $matches[1] >= 12)) { + die("skip expected output only valid when using Oracle 12c database"); } ?> --ENV-- diff --git a/ext/oci8/tests/bind_char_1_11gR1.phpt b/ext/oci8/tests/bind_char_1_11gR1.phpt index 2a7c713aa7f15..bdc29f766dab3 100644 --- a/ext/oci8/tests/bind_char_1_11gR1.phpt +++ b/ext/oci8/tests/bind_char_1_11gR1.phpt @@ -6,11 +6,8 @@ if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 11 && $matches[2] == 1) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 3) - ))) { - die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases"); +if (!(isset($matches[0]) && $matches[1] < 12)) { + die("skip expected output only valid when using pre-Oracle 12c database"); } ?> --ENV-- diff --git a/ext/oci8/tests/bind_char_2.phpt b/ext/oci8/tests/bind_char_2.phpt index 3695c85854904..9c61a858c8e71 100644 --- a/ext/oci8/tests/bind_char_2.phpt +++ b/ext/oci8/tests/bind_char_2.phpt @@ -6,15 +6,8 @@ if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 10 && $matches[2] >= 2) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 2) - ))) { - die("skip expected output only valid when using Oracle 10gR2 or 11.2.0.2 databases"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 11) { - die("skip test expected to work only with Oracle 11g or greater version of client"); +if (!(isset($matches[0]) && $matches[1] >= 12)) { + die("skip expected output only valid when using Oracle 12c database"); } ?> --ENV-- diff --git a/ext/oci8/tests/bind_char_2_11gR1.phpt b/ext/oci8/tests/bind_char_2_11gR1.phpt index b9afd6940bcca..06c37afc93e20 100644 --- a/ext/oci8/tests/bind_char_2_11gR1.phpt +++ b/ext/oci8/tests/bind_char_2_11gR1.phpt @@ -6,11 +6,8 @@ if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 11 && $matches[2] == 1) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 3) - ))) { - die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases"); +if (!(isset($matches[0]) && $matches[1] < 12)) { + die("skip expected output only valid when using pre-Oracle 12c database"); } ?> --ENV-- diff --git a/ext/oci8/tests/bind_char_3.phpt b/ext/oci8/tests/bind_char_3.phpt index 009e60a542b6a..177676e25ca3b 100644 --- a/ext/oci8/tests/bind_char_3.phpt +++ b/ext/oci8/tests/bind_char_3.phpt @@ -6,15 +6,8 @@ if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 10 && $matches[2] >= 2) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 2) - ))) { - die("skip expected output only valid when using Oracle 10gR2 or 11.2.0.2 databases"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 11) { - die("skip test expected to work only with Oracle 11g or greater version of client"); +if (!(isset($matches[0]) && $matches[1] >= 12)) { + die("skip expected output only valid when using Oracle 12c database"); } ?> --ENV-- diff --git a/ext/oci8/tests/bind_char_3_11gR1.phpt b/ext/oci8/tests/bind_char_3_11gR1.phpt index a894de00c075f..c3ec999d0f10d 100644 --- a/ext/oci8/tests/bind_char_3_11gR1.phpt +++ b/ext/oci8/tests/bind_char_3_11gR1.phpt @@ -6,11 +6,8 @@ if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 11 && $matches[2] == 1) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 3) - ))) { - die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases"); +if (!(isset($matches[0]) && $matches[1] < 12)) { + die("skip expected output only valid when using pre-Oracle 12c database"); } ?> --ENV-- diff --git a/ext/oci8/tests/bind_char_4.phpt b/ext/oci8/tests/bind_char_4.phpt index 0ac60e503de87..b4d3e089b136f 100644 --- a/ext/oci8/tests/bind_char_4.phpt +++ b/ext/oci8/tests/bind_char_4.phpt @@ -6,15 +6,8 @@ if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 10 && $matches[2] >= 2) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 2) - ))) { - die("skip expected output only valid when using Oracle 10gR2 or 11.2.0.2 databases"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 11) { - die("skip test expected to work only with Oracle 11g or greater version of client"); +if (!(isset($matches[0]) && $matches[1] >= 12)) { + die("skip expected output only valid when using Oracle 12c database"); } ?> --ENV-- diff --git a/ext/oci8/tests/bind_char_4_11gR1.phpt b/ext/oci8/tests/bind_char_4_11gR1.phpt index d5ce116afb65a..ccad2cb7894c1 100644 --- a/ext/oci8/tests/bind_char_4_11gR1.phpt +++ b/ext/oci8/tests/bind_char_4_11gR1.phpt @@ -6,11 +6,8 @@ if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 11 && $matches[2] == 1) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 3) - ))) { - die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases"); +if (!(isset($matches[0]) && $matches[1] < 12)) { + die("skip expected output only valid when using pre-Oracle 12c database"); } ?> --ENV-- diff --git a/ext/oci8/tests/bind_misccoltypes.phpt b/ext/oci8/tests/bind_misccoltypes.phpt index 0da8c8bf8803a..9e55b3b1ff74b 100644 --- a/ext/oci8/tests/bind_misccoltypes.phpt +++ b/ext/oci8/tests/bind_misccoltypes.phpt @@ -4,9 +4,6 @@ Bind miscellaneous column types using default types true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); -if (preg_match('/^1[012]\./', oci_client_version()) != 1) { - die("skip test expected to work only with Oracle 10g or greater version of client"); -} ?> --FILE-- --INI-- precision = 14 diff --git a/ext/oci8/tests/bind_sqltnum.phpt b/ext/oci8/tests/bind_sqltnum.phpt index d3828b73eea95..93fc4809ec10d 100644 --- a/ext/oci8/tests/bind_sqltnum.phpt +++ b/ext/oci8/tests/bind_sqltnum.phpt @@ -3,9 +3,6 @@ Bind with SQLT_NUM --SKIPIF-- --FILE-- --FILE-- = 2) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 2) - ))) { - die("skip expected output only valid when using Oracle 10gR2 or 11.2.0.2 databases"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 11) { - die("skip test expected to work only with Oracle 11g or greater version of client"); +if (!(isset($matches[0]) && $matches[1] >= 12)) { + die("skip expected output only valid when using Oracle 12c database"); } ?> --ENV-- diff --git a/ext/oci8/tests/bug27303_1_11gR1.phpt b/ext/oci8/tests/bug27303_1_11gR1.phpt index 7b4c158561959..d2018783bc925 100644 --- a/ext/oci8/tests/bug27303_1_11gR1.phpt +++ b/ext/oci8/tests/bug27303_1_11gR1.phpt @@ -6,12 +6,8 @@ if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 10 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 3) || - ($matches[1] == 11 && $matches[2] == 1 && $matches[3] == 0 && $matches[4] == 6) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 3) - ))) { - die("skip expected output only valid when using Oracle 10gR2 or 11.2.0.2 databases"); +if (!(isset($matches[0]) && $matches[1] < 12)) { + die("skip expected output only valid when using pre-Oracle 12c database"); } ?> --FILE-- diff --git a/ext/oci8/tests/bug27303_2.phpt b/ext/oci8/tests/bug27303_2.phpt index 72d4e5a7ddbcf..ee2f7b52aa5e6 100644 --- a/ext/oci8/tests/bug27303_2.phpt +++ b/ext/oci8/tests/bug27303_2.phpt @@ -6,15 +6,8 @@ if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 10 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 2) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 2) - ))) { - die("skip expected output only valid when using Oracle 10.2.0.2 or 11.2.0.2 databases"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 11) { - die("skip test expected to work only with Oracle 11g or greater version of client"); +if (!(isset($matches[0]) && $matches[1] >= 12)) { + die("skip expected output only valid when using Oracle 12c database"); } ?> --ENV-- diff --git a/ext/oci8/tests/bug27303_2_11gR1.phpt b/ext/oci8/tests/bug27303_2_11gR1.phpt index 27d8a585bd452..06133e0115723 100644 --- a/ext/oci8/tests/bug27303_2_11gR1.phpt +++ b/ext/oci8/tests/bug27303_2_11gR1.phpt @@ -6,12 +6,8 @@ if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 10 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 3) || - ($matches[1] == 11 && $matches[2] == 1 && $matches[3] == 0 && $matches[4] == 6) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 3) - ))) { - die("skip expected output only valid when using specific Oracle database versions"); +if (!(isset($matches[0]) && $matches[1] < 12)) { + die("skip expected output only valid when using pre-Oracle 12c database"); } ?> --FILE-- diff --git a/ext/oci8/tests/bug27303_4.phpt b/ext/oci8/tests/bug27303_4.phpt index a24ae705aba57..ed9d5a1fe6d43 100644 --- a/ext/oci8/tests/bug27303_4.phpt +++ b/ext/oci8/tests/bug27303_4.phpt @@ -6,16 +6,8 @@ if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 10 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 2) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 2) - ))) { - die("skip expected output only valid when using Oracle 10.2.0.2 or 11.2.0.2 databases"); - // Other point releases may also work -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 11) { - die("skip test expected to work only with Oracle 11g or greater version of client"); +if (!(isset($matches[0]) && $matches[1] >= 12)) { + die("skip expected output only valid when using Oracle 12c database"); } ?> --ENV-- diff --git a/ext/oci8/tests/bug27303_4_11gR1.phpt b/ext/oci8/tests/bug27303_4_11gR1.phpt index 01db1dc5a0bef..550d89fdcc52f 100644 --- a/ext/oci8/tests/bug27303_4_11gR1.phpt +++ b/ext/oci8/tests/bug27303_4_11gR1.phpt @@ -6,12 +6,8 @@ if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 10 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 3) || - ($matches[1] == 11 && $matches[2] == 1 && $matches[3] == 0 && $matches[4] == 6) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 3) - ))) { - die("skip expected output only valid when using specific Oracle database versions"); +if (!(isset($matches[0]) && $matches[1] < 12)) { + die("skip expected output only valid when using pre-Oracle 12c database"); } ?> --FILE-- diff --git a/ext/oci8/tests/bug36403.phpt b/ext/oci8/tests/bug36403.phpt index 4ac32c4b069a5..122b06bbfa2b0 100644 --- a/ext/oci8/tests/bug36403.phpt +++ b/ext/oci8/tests/bug36403.phpt @@ -3,10 +3,6 @@ Bug #36403 (oci_execute no longer supports OCI_DESCRIBE_ONLY) --SKIPIF-- --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 10) { - die("skip test expected to work only with Oracle 10g or greater version of client"); -} ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); -ob_start(); -phpinfo(INFO_MODULES); -$phpinfo = ob_get_clean(); -$iv = preg_match('/Oracle .*Version => (9\.2)/', $phpinfo); -if ($iv != 1) { - die ("skip tests a feature that works only with Oracle 9iR2 client"); -} -?> ---FILE-- -free(); // cleanup properly - ++$cntchk; - } - } - echo "Loop count check = $cntchk\n"; -} - -// Read all XML data using explicit LOB locator but without freeing the temp lobs -function readxmltab_ex_nofree($c) -{ - $stmt = oci_parse($c, "select extract(xml, '/').getclobval() from bug43497_tab"); - - $cntchk = 0; - if (oci_execute($stmt)) { - while ($result = oci_fetch_array($stmt, OCI_NUM)) { - ++$cntchk; - } - } - echo "Loop count check = $cntchk\n"; -} - -// Read all XML data using implicit LOB locator -function readxmltab_im($c) -{ - $stmt = oci_parse($c, "select extract(xml, '/').getclobval() from bug43497_tab"); - - $cntchk = 0; - if (oci_execute($stmt)) { - while ($result = oci_fetch_array($stmt, OCI_NUM+OCI_RETURN_LOBS)) { - ++$cntchk; - } - } - echo "Loop count check = $cntchk\n"; -} - -function createxmltab($c) // create table w/ field of XML type -{ - @dropxmltab($c); - $stmt = oci_parse($c, "create table bug43497_tab (id number primary key, xml xmltype)"); - oci_execute($stmt); -} - -function dropxmltab($c) // delete table -{ - $stmt = oci_parse($c, "drop table bug43497_tab"); - oci_execute($stmt); -} - - -function fillxmltab($c) -{ - for ($id = 1; $id <= 100; $id++) { - - // create an XML element string with random data - $s = ""; - for ($j = 0; $j < 128; $j++) { - $s .= rand(); - } - $s .= "\n"; - for ($j = 0; $j < 4; $j++) { - $s .= $s; - } - $data = "" . $s . ""; - - // insert XML data into database - - $stmt = oci_parse($c, "insert into bug43497_tab(id, xml) values (:id, sys.xmltype.createxml(:xml))"); - oci_bind_by_name($stmt, ":id", $id); - $clob = oci_new_descriptor($c, OCI_D_LOB); - oci_bind_by_name($stmt, ":xml", $clob, -1, OCI_B_CLOB); - $clob->writetemporary($data); - oci_execute($stmt); - - $clob->close(); - $clob->free(); - } -} - - -// Initialize - -createxmltab($c); -fillxmltab($c); - -// Run Test - -$sid = sessionid($c); - -echo "Explicit LOB use\n"; -for ($i = 1; $i <= 10; $i++) { - echo "\nRun = " . $i . "\n"; - echo "Temporary LOBs = " . templobs($c, $sid) . "\n"; - readxmltab_ex($c); -} - -echo "\nImplicit LOB use\n"; -for ($i = 1; $i <= 10; $i++) { - echo "\nRun = " . $i . "\n"; - echo "Temporary LOBs = " . templobs($c, $sid) . "\n"; - readxmltab_im($c); -} - -echo "\nExplicit LOB with no free (i.e. a temp lob leak)\n"; -for ($i = 1; $i <= 10; $i++) { - echo "\nRun = " . $i . "\n"; - echo "Temporary LOBs = " . templobs($c, $sid) . "\n"; - readxmltab_ex_nofree($c); -} - - - -// Cleanup - -dropxmltab($c); - -oci_close($c); - -echo "Done\n"; -?> ---EXPECT-- -Explicit LOB use - -Run = 1 -Temporary LOBs = 0 -Loop count check = 100 - -Run = 2 -Temporary LOBs = 100 -Loop count check = 100 - -Run = 3 -Temporary LOBs = 200 -Loop count check = 100 - -Run = 4 -Temporary LOBs = 300 -Loop count check = 100 - -Run = 5 -Temporary LOBs = 400 -Loop count check = 100 - -Run = 6 -Temporary LOBs = 500 -Loop count check = 100 - -Run = 7 -Temporary LOBs = 600 -Loop count check = 100 - -Run = 8 -Temporary LOBs = 700 -Loop count check = 100 - -Run = 9 -Temporary LOBs = 800 -Loop count check = 100 - -Run = 10 -Temporary LOBs = 900 -Loop count check = 100 - -Implicit LOB use - -Run = 1 -Temporary LOBs = 1000 -Loop count check = 100 - -Run = 2 -Temporary LOBs = 1100 -Loop count check = 100 - -Run = 3 -Temporary LOBs = 1200 -Loop count check = 100 - -Run = 4 -Temporary LOBs = 1300 -Loop count check = 100 - -Run = 5 -Temporary LOBs = 1400 -Loop count check = 100 - -Run = 6 -Temporary LOBs = 1500 -Loop count check = 100 - -Run = 7 -Temporary LOBs = 1600 -Loop count check = 100 - -Run = 8 -Temporary LOBs = 1700 -Loop count check = 100 - -Run = 9 -Temporary LOBs = 1800 -Loop count check = 100 - -Run = 10 -Temporary LOBs = 1900 -Loop count check = 100 - -Explicit LOB with no free (i.e. a temp lob leak) - -Run = 1 -Temporary LOBs = 2000 -Loop count check = 100 - -Run = 2 -Temporary LOBs = 2100 -Loop count check = 100 - -Run = 3 -Temporary LOBs = 2200 -Loop count check = 100 - -Run = 4 -Temporary LOBs = 2300 -Loop count check = 100 - -Run = 5 -Temporary LOBs = 2400 -Loop count check = 100 - -Run = 6 -Temporary LOBs = 2500 -Loop count check = 100 - -Run = 7 -Temporary LOBs = 2600 -Loop count check = 100 - -Run = 8 -Temporary LOBs = 2700 -Loop count check = 100 - -Run = 9 -Temporary LOBs = 2800 -Loop count check = 100 - -Run = 10 -Temporary LOBs = 2900 -Loop count check = 100 -Done \ No newline at end of file diff --git a/ext/oci8/tests/bug47281.phpt b/ext/oci8/tests/bug47281.phpt index 0098ec5ebb772..00c43c22dac7c 100644 --- a/ext/oci8/tests/bug47281.phpt +++ b/ext/oci8/tests/bug47281.phpt @@ -6,9 +6,9 @@ $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on t require(dirname(__FILE__).'/skipif.inc'); // error3.phpt obsoletes this test for newer Oracle client versions // Assume runtime client version is >= compile time client version -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); +preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); if (!isset($matches[0]) || - ($matches[0] > 11 || ($matches[0] == 11 && $matches[1] > 2) || ($matches[0] == 11 && $matches[1] == 2 && $matches[3] >= 3) + ($matches[1] > 11 || ($matches[1] == 11 && $matches[2] > 2) || ($matches[1] == 11 && $matches[2] == 2 && $matches[4] >= 3) )) { die("skip test works only with Oracle 11.2.0.2 or earlier Oracle client libraries"); } diff --git a/ext/oci8/tests/clientversion.phpt b/ext/oci8/tests/clientversion.phpt index db70b5affcea4..262ded462f9d9 100644 --- a/ext/oci8/tests/clientversion.phpt +++ b/ext/oci8/tests/clientversion.phpt @@ -3,9 +3,6 @@ oci_client_version() --SKIPIF-- --FILE-- ---FILE-- - -===DONE=== - ---EXPECTF-- -Unknown -===DONE=== diff --git a/ext/oci8/tests/conn_attr_1.phpt b/ext/oci8/tests/conn_attr_1.phpt index 631bc19c1d416..745b1cd93f906 100644 --- a/ext/oci8/tests/conn_attr_1.phpt +++ b/ext/oci8/tests/conn_attr_1.phpt @@ -13,10 +13,6 @@ preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit if (!(isset($matches[0]) && $matches[1] >= 10)) { die("skip expected output only valid when using Oracle 10g or greater database server"); } -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 10) { - die("skip test expected to work only with Oracle 10g or greater version of client"); -} ?> --FILE-- = 10)) { die("skip expected output only valid when using Oracle 10g or greater database server"); } -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 10) { - die("skip test expected to work only with Oracle 10g or greater version of client"); -} ?> --INI-- oci8.privileged_connect = On diff --git a/ext/oci8/tests/conn_attr_3.phpt b/ext/oci8/tests/conn_attr_3.phpt index 921487c9a00e1..1b00ac5a4ff45 100644 --- a/ext/oci8/tests/conn_attr_3.phpt +++ b/ext/oci8/tests/conn_attr_3.phpt @@ -12,10 +12,6 @@ preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit if (!(isset($matches[0]) && $matches[1] >= 10)) { die("skip expected output only valid when using Oracle 10g or greater database server"); } -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 10) { - die("skip test expected to work only with Oracle 10g or greater version of client"); -} ?> --FILE-- --FILE-- = 10)) { die("skip expected output only valid when using Oracle 10g or greater database server"); } -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 10) { - die("skip test expected to work only with Oracle 10g or greater version of client"); -} ?> --FILE-- --ENV-- diff --git a/ext/oci8/tests/connect_without_oracle_home_11.phpt b/ext/oci8/tests/connect_without_oracle_home_11.phpt index 40dc5a98fc7e3..42c45644567c4 100644 --- a/ext/oci8/tests/connect_without_oracle_home_11.phpt +++ b/ext/oci8/tests/connect_without_oracle_home_11.phpt @@ -10,10 +10,10 @@ $ov = preg_match('/Compile-time ORACLE_HOME/', $phpinfo); if ($ov != 1) { die ("skip Test only valid when OCI8 is built with an ORACLE_HOME"); } -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); +preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); if (!(isset($matches[0]) && - (($matches[0] == 11 && $matches[1] >= 2) || - ($matches[0] >= 12) + (($matches[1] == 11 && $matches[2] >= 2) || + ($matches[1] >= 12) ))) { die("skip test expected to work only with Oracle 11gR2 or greater version of client"); } diff --git a/ext/oci8/tests/connect_without_oracle_home_old.phpt b/ext/oci8/tests/connect_without_oracle_home_old.phpt index 5a731337af13c..d6d12b47ba338 100644 --- a/ext/oci8/tests/connect_without_oracle_home_old.phpt +++ b/ext/oci8/tests/connect_without_oracle_home_old.phpt @@ -10,9 +10,6 @@ $ov = preg_match('/Compile-time ORACLE_HOME/', $phpinfo); if ($ov !== 1) { die ("skip Test only valid when OCI8 is built with an ORACLE_HOME"); } -if (preg_match('/^10\.2\./', oci_client_version()) != 1) { - die("skip test expected to work only with Oracle 10gR2 client libraries"); -} ?> --ENV-- ORACLE_HOME="" @@ -33,5 +30,8 @@ else { --EXPECTF-- Warning: ocilogon(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and %s are set and point to the right directories in %s on line %d + +Warning: ocilogon(): %s ORA-01804 + in %s on line %d bool(false) ===DONE=== diff --git a/ext/oci8/tests/connect_without_oracle_home_old_11.phpt b/ext/oci8/tests/connect_without_oracle_home_old_11.phpt index e04016f41a766..eb5fb0cc4d333 100644 --- a/ext/oci8/tests/connect_without_oracle_home_old_11.phpt +++ b/ext/oci8/tests/connect_without_oracle_home_old_11.phpt @@ -10,10 +10,10 @@ $ov = preg_match('/Compile-time ORACLE_HOME/', $phpinfo); if ($ov !== 1) { die ("skip Test only valid when OCI8 is built with an ORACLE_HOME"); } -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); +preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); if (!(isset($matches[0]) && - (($matches[0] == 11 && $matches[1] >= 2) || - ($matches[0] >= 12) + (($matches[1] == 11 && $matches[2] >= 2) || + ($matches[1] >= 12) ))) { die("skip test expected to work only with Oracle 11gR2 or greater version of client"); } diff --git a/ext/oci8/tests/db_op_1.phpt b/ext/oci8/tests/db_op_1.phpt new file mode 100644 index 0000000000000..f645cf80ff3b2 --- /dev/null +++ b/ext/oci8/tests/db_op_1.phpt @@ -0,0 +1,61 @@ +--TEST-- +oci_set_db_operation: basic test for end-to-end tracing +--SKIPIF-- + true, 'timesten' => false); // test runs on these DBs +require(dirname(__FILE__).'/skipif.inc'); +if (strcasecmp($user, "system") && strcasecmp($user, "sys")) { + die("skip needs to be run as a DBA user"); +} +preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); +if (!(isset($matches[0]) && $matches[1] >= 12)) { + die("skip expected output only valid when using Oracle Database 12c or greater"); +} +preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); +if (!(isset($matches[0]) && $matches[0] >= 12)) { + die("skip works only with Oracle 12c or greater version of Oracle client libraries"); +} +if (!function_exists('oci_set_db_operation')) +{ + die("skip function oci_set_db_operation() does not exist"); +} +?> +--FILE-- + +===DONE=== + +--EXPECTF-- +Test 1 +array(1) { + ["DUMMY"]=> + string(1) "X" +} +array(1) { + ["DBOP_NAME"]=> + string(7) "db_op_1" +} +===DONE=== + diff --git a/ext/oci8/tests/db_op_2.phpt b/ext/oci8/tests/db_op_2.phpt new file mode 100644 index 0000000000000..05c2269ae0bfd --- /dev/null +++ b/ext/oci8/tests/db_op_2.phpt @@ -0,0 +1,69 @@ +--TEST-- +oci_set_db_operation: basic test for end-to-end tracing +--SKIPIF-- + true, 'timesten' => false); // test runs on these DBs +require(dirname(__FILE__).'/skipif.inc'); +if (strcasecmp($user, "system") && strcasecmp($user, "sys")) { + die("skip needs to be run as a DBA user"); +} +preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); +if (!(isset($matches[0]) && $matches[1] >= 12)) { + die("skip expected output only valid when using Oracle Database 12c or greater"); +} +preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); +if (!(isset($matches[0]) && $matches[0] >= 12)) { + die("skip works only with Oracle 12c or greater version of Oracle client libraries"); +} +if (!function_exists('oci_set_db_operation')) +{ + die("skip function oci_set_db_operation() does not exist"); +} +?> +--FILE-- + +===DONE=== + +--XFAIL-- +Fails due to Oracle Bug 16695981 +--EXPECTF-- +Test 1 +array(1) { + ["DUMMY"]=> + string(1) "X" +} +Test 2 +array(1) { + ["DUMMY"]=> + string(1) "X" +} +Test 3 +array(2) { + ["DBOP_NAME"]=> + string(7) "db_op_2a" +} +===DONE=== + diff --git a/ext/oci8/tests/drcp_cclass1.phpt b/ext/oci8/tests/drcp_cclass1.phpt index 068331e5a95ae..5c78a2943e94e 100644 --- a/ext/oci8/tests/drcp_cclass1.phpt +++ b/ext/oci8/tests/drcp_cclass1.phpt @@ -3,9 +3,21 @@ DRCP: Test setting connection class inline --SKIPIF-- = 12) { + $s = oci_parse($c, "select nvl(sys_context('userenv', 'con_name'), 'notacdb') as dbtype from dual"); + $r = @oci_execute($s); + if (!$r) + die('skip could not identify container type'); + $r = oci_fetch_array($s); + if ($r['DBTYPE'] !== 'CDB$ROOT') + die('skip cannot run test using a PDB'); +} ?> --FILE-- += 11)) { + die("skip works only with Oracle 11g or greater version of Oracle client libraries"); +} +?> --INI-- oci8.connection_class=test --FILE-- diff --git a/ext/oci8/tests/drcp_privileged.phpt b/ext/oci8/tests/drcp_privileged.phpt index da8702e3c9204..3871341bc50cc 100644 --- a/ext/oci8/tests/drcp_privileged.phpt +++ b/ext/oci8/tests/drcp_privileged.phpt @@ -3,7 +3,8 @@ DRCP: privileged connect --SKIPIF-- = 12) { + $s = oci_parse($c, "select nvl(sys_context('userenv', 'con_name'), 'notacdb') as dbtype from dual"); + $r = @oci_execute($s); + if (!$r) + die('skip could not identify container type'); + $r = oci_fetch_array($s); + if ($r['DBTYPE'] !== 'CDB$ROOT') + die('skip cannot run test using a PDB'); +} ?> --INI-- oci8.privileged_connect=1 diff --git a/ext/oci8/tests/driver_name.phpt b/ext/oci8/tests/driver_name.phpt index bf86e66e7b64f..f63979d6b54c0 100644 --- a/ext/oci8/tests/driver_name.phpt +++ b/ext/oci8/tests/driver_name.phpt @@ -7,10 +7,19 @@ require(dirname(__FILE__)."/connect.inc"); if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user"); if ($test_drcp) die("skip as Output might vary with DRCP"); -if (preg_match('/Release (11\.2|12)/', oci_server_version($c), $matches) !== 1) { - die("skip expected output only valid when using Oracle 11gR2 or greater databases"); -} else if (preg_match('/^(11\.2|12\.)/', oci_client_version()) != 1) { - die("skip test expected to work only with Oracle 11g or greater version of client"); +preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); +if (!(isset($matches[0]) && + (($matches[1] == 11 && $matches[2] >= 2) || + ($matches[1] >= 12) + ))) { + die("skip expected output only valid when using Oracle 11gR2 or greater database server"); +} +preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); +if (!(isset($matches[0]) && + (($matches[1] == 11 && $matches[2] >= 2) || + ($matches[1] >= 12) + ))) { + die("skip test expected to work only with Oracle 11gR2 or greater version of client"); } ?> diff --git a/ext/oci8/tests/edition_1.phpt b/ext/oci8/tests/edition_1.phpt index d8ca53cddf061..3e55ee902c970 100644 --- a/ext/oci8/tests/edition_1.phpt +++ b/ext/oci8/tests/edition_1.phpt @@ -10,9 +10,18 @@ if (strcasecmp($user, "system") && strcasecmp($user, "sys")) { if ($test_drcp) { die("skip as Output might vary with DRCP"); } -if (preg_match('/Release (1[1]\.2|12)\./', oci_server_version($c), $matches) !== 1) { - die("skip expected output only valid when using Oracle 11gR2 or greater databases"); -} else if (preg_match('/^(11\.2|12)\./', oci_client_version()) != 1) { +preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); +if (!(isset($matches[0]) && + (($matches[1] == 11 && $matches[2] >= 2) || + ($matches[1] >= 12) + ))) { + die("skip expected output only valid when using Oracle 11gR2 or greater database server"); +} +preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); +if (!(isset($matches[0]) && + (($matches[1] == 11 && $matches[2] >= 2) || + ($matches[1] >= 12) + ))) { die("skip test expected to work only with Oracle 11gR2 or greater version of client"); } ?> diff --git a/ext/oci8/tests/edition_2.phpt b/ext/oci8/tests/edition_2.phpt index 0ffb62dc32633..12e902667e621 100644 --- a/ext/oci8/tests/edition_2.phpt +++ b/ext/oci8/tests/edition_2.phpt @@ -8,10 +8,18 @@ if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user"); if ($test_drcp) die("skip as Output might vary with DRCP"); - -if (preg_match('/Release (1[1]\.2|12)\./', oci_server_version($c), $matches) !== 1) { - die("skip expected output only valid when using Oracle 11gR2 or greater databases"); -} else if (preg_match('/^(11\.2|12)\./', oci_client_version()) != 1) { +preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); +if (!(isset($matches[0]) && + (($matches[1] == 11 && $matches[2] >= 2) || + ($matches[1] >= 12) + ))) { + die("skip expected output only valid when using Oracle 11gR2 or greater database server"); +} +preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); +if (!(isset($matches[0]) && + (($matches[1] == 11 && $matches[2] >= 2) || + ($matches[1] >= 12) + ))) { die("skip test expected to work only with Oracle 11gR2 or greater version of client"); } diff --git a/ext/oci8/tests/error_set.phpt b/ext/oci8/tests/error_set.phpt new file mode 100644 index 0000000000000..ad56e8aefadb1 --- /dev/null +++ b/ext/oci8/tests/error_set.phpt @@ -0,0 +1,72 @@ +--TEST-- +Check oci_set_{action,client_identifier,module_name,client_info} error handling +--SKIPIF-- + +--FILE-- + +===DONE=== + +--EXPECTF-- +Test 1 +bool(false) +24960 +bool(false) +24960 +bool(false) +24960 +bool(false) +24960 + +Test 2 +bool(true) +bool(true) +bool(true) +bool(true) +===DONE=== diff --git a/ext/oci8/tests/function_aliases.phpt b/ext/oci8/tests/function_aliases.phpt index 4c6ce8375965c..2c890d6403ca2 100644 --- a/ext/oci8/tests/function_aliases.phpt +++ b/ext/oci8/tests/function_aliases.phpt @@ -104,8 +104,6 @@ NULL Warning: ocifreestatement() expects exactly 1 parameter, 0 given in %s on line %d NULL - -Warning: ociinternaldebug() expects exactly 1 parameter, 0 given in %s on line %d NULL Warning: ocinumcols() expects exactly 1 parameter, 0 given in %s on line %d diff --git a/ext/oci8/tests/ini_1.phpt b/ext/oci8/tests/ini_1.phpt index 4c23b72b41fdb..2fba79813e845 100644 --- a/ext/oci8/tests/ini_1.phpt +++ b/ext/oci8/tests/ini_1.phpt @@ -1,7 +1,13 @@ --TEST-- Test OCI8 php.ini settings --SKIPIF-- - += 11)) { + die("skip works only with Oracle 11g or greater version of Oracle client libraries"); +} +?> --INI-- oci8.privileged_connect = On oci8.max_persistent = 111 diff --git a/ext/oci8/tests/password_new.phpt b/ext/oci8/tests/password_new.phpt index 2c66dd94ab7dc..a29fb8f52ff2b 100644 --- a/ext/oci8/tests/password_new.phpt +++ b/ext/oci8/tests/password_new.phpt @@ -8,15 +8,18 @@ if (empty($dbase)) die ("skip requires database connection string be set"); if ($test_drcp) die("skip password change not supported in DRCP Mode"); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches_sv); -if (isset($matches_sv[1]) && $matches_sv[1] >= 11) { - preg_match('/([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); - if (isset($matches[0]) && $matches[1] == 10 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] < 5) { - die ("skip test known to fail using Oracle 10.2.0.4 client libs connecting to Oracle 11 (6277160)"); - } +preg_match('/([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); +if (!(isset($matches_sv[0]) && isset($matches[0]) + && $matches_sv[1] == $matches[1] + && $matches_sv[2] == $matches[2] + && $matches_sv[3] == $matches[3] + && $matches_sv[4] == $matches[4])) { + // Avoid diffs due to cross version protocol changes (e.g. like 11.2.0.2-11.2.0.3) and bugs like Oracle bug: 6277160 + die ("skip test only runs when database client libraries and database server are the same version"); } // This test in Oracle 12c needs a non-CDB or the root container -if (isset($matches_sv[1]) && $matches_sv[1] >= 12) { +if (isset($matches_sv[0]) && $matches_sv[1] >= 12) { $s = oci_parse($c, "select nvl(sys_context('userenv', 'con_name'), 'notacdb') as dbtype from dual"); $r = @oci_execute($s); if (!$r) @@ -29,22 +32,11 @@ if (isset($matches_sv[1]) && $matches_sv[1] >= 12) { --FILE-- = 11) { - preg_match('/([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); - if (isset($matches[0]) && $matches[1] == 10 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] < 5) { - die ("skip test known to fail using Oracle 10.2.0.4 client libs connecting to Oracle 11 (6277160)"); - } +preg_match('/([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); +if (!(isset($matches_sv[0]) && isset($matches[0]) + && $matches_sv[1] == $matches[1] + && $matches_sv[2] == $matches[2] + && $matches_sv[3] == $matches[3] + && $matches_sv[4] == $matches[4])) { + // Avoid diffs due to cross version protocol changes (e.g. like 11.2.0.2-11.2.0.3) and bugs like Oracle bug: 6277160 + die ("skip test only runs when database client libraries and database server are the same version"); } // This test in Oracle 12c needs a non-CDB or the root container -if (isset($matches_sv[1]) && $matches_sv[1] >= 12) { +if (isset($matches_sv[0]) && $matches_sv[1] >= 12) { $s = oci_parse($c, "select nvl(sys_context('userenv', 'con_name'), 'notacdb') as dbtype from dual"); $r = @oci_execute($s); if (!$r) @@ -29,25 +32,13 @@ if (isset($matches_sv[1]) && $matches_sv[1] >= 12) { --FILE-- diff --git a/ext/oci8/tests/pecl_bug16035.phpt b/ext/oci8/tests/pecl_bug16035.phpt index ddd0038de1524..29ff6439d1c8a 100644 --- a/ext/oci8/tests/pecl_bug16035.phpt +++ b/ext/oci8/tests/pecl_bug16035.phpt @@ -10,9 +10,6 @@ $ov = preg_match('/Compile-time ORACLE_HOME/', $phpinfo); if ($ov !== 1) { die ("skip Test only valid when OCI8 is built with an ORACLE_HOME"); } -if (preg_match('/Unknown/', oci_client_version()) == 1) { - die("skip expected output only valid with Oracle clients > 9gR2"); -} ?> --ENV-- ORACLE_HOME="" diff --git a/ext/oci8/tests/refcur_prefetch_1.phpt b/ext/oci8/tests/refcur_prefetch_1.phpt index ea09fbcd979cf..c7e200932aece 100644 --- a/ext/oci8/tests/refcur_prefetch_1.phpt +++ b/ext/oci8/tests/refcur_prefetch_1.phpt @@ -4,9 +4,16 @@ Prefetch with REF cursor. Test different values for prefetch with oci_set_prefet = 10))) { + die("skip expected output only valid when using Oracle 10g or greater database server"); +} +preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); +if (!(isset($matches[0]) && + (($matches[1] == 11 && $matches[2] >= 2) || + ($matches[1] >= 12) + ))) { die("skip test expected to work only with Oracle 11gR2 or greater version of client"); } ?> diff --git a/ext/oci8/tests/refcur_prefetch_2.phpt b/ext/oci8/tests/refcur_prefetch_2.phpt index 8d65251077ea3..9b2472db5df44 100644 --- a/ext/oci8/tests/refcur_prefetch_2.phpt +++ b/ext/oci8/tests/refcur_prefetch_2.phpt @@ -4,9 +4,16 @@ Prefetch with REF cursor. Test No 2 = 10))) { + die("skip expected output only valid when using Oracle 10g or greater database server"); +} +preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); +if (!(isset($matches[0]) && + (($matches[1] == 11 && $matches[2] >= 2) || + ($matches[1] >= 12) + ))) { die("skip test expected to work only with Oracle 11gR2 or greater version of client"); } ?> diff --git a/ext/oci8/tests/refcur_prefetch_3.phpt b/ext/oci8/tests/refcur_prefetch_3.phpt index 974864cbd90e7..f29345e515d47 100644 --- a/ext/oci8/tests/refcur_prefetch_3.phpt +++ b/ext/oci8/tests/refcur_prefetch_3.phpt @@ -6,12 +6,20 @@ oci8.default_prefetch=5 = 2) || + ($matches[1] >= 12) + ))) { + die("skip expected output only valid when using Oracle 11gR2 or greater database server"); +} +preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); +if (!(isset($matches[0]) && + (($matches[1] == 11 && $matches[2] >= 2) || + ($matches[1] >= 12) + ))) { die("skip test expected to work only with Oracle 11gR2 or greater version of client"); } - ?> --FILE-- = 10))) { + die("skip expected output only valid when using Oracle 10g or greater database server"); +} +preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); +if (!(isset($matches[0]) && + (($matches[1] == 11 && $matches[2] >= 2) || + ($matches[1] >= 12) + ))) { die("skip test expected to work only with Oracle 11gR2 or greater version of client"); } ?> diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c index 43ae30419fee9..a4e661e3f897a 100644 --- a/ext/opcache/Optimizer/block_pass.c +++ b/ext/opcache/Optimizer/block_pass.c @@ -1283,11 +1283,15 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array) /* adjust exception jump targets */ if (op_array->last_try_catch) { - int i; - for (i = 0; i< op_array->last_try_catch; i++) { - op_array->try_catch_array[i].try_op = cfg->try[i]->start_opline - new_opcodes; - op_array->try_catch_array[i].catch_op = cfg->catch[i]->start_opline - new_opcodes; + int i, j; + for (i = 0, j = 0; i< op_array->last_try_catch; i++) { + if (cfg->try[i]->access) { + op_array->try_catch_array[j].try_op = cfg->try[i]->start_opline - new_opcodes; + op_array->try_catch_array[j].catch_op = cfg->catch[i]->start_opline - new_opcodes; + j++; + } } + op_array->last_try_catch = j; efree(cfg->try); efree(cfg->catch); } @@ -1895,7 +1899,7 @@ static void zend_jmp_optimization(zend_code_block *block, zend_op_array *op_arra #endif /* Find a set of variables which are used outside of the block where they are - * defined. We won't apply some optimization patterns for sush variables. */ + * defined. We won't apply some optimization patterns for such variables. */ static void zend_t_usage(zend_code_block *block, zend_op_array *op_array, char *used_ext) { zend_code_block *next_block = block->next; @@ -1927,6 +1931,7 @@ static void zend_t_usage(zend_code_block *block, zend_op_array *op_array, char * if (RESULT_USED(opline)) { if (!defined_here[VAR_NUM(ZEND_RESULT(opline).var)] && !used_ext[VAR_NUM(ZEND_RESULT(opline).var)] && (opline->opcode == ZEND_RECV || opline->opcode == ZEND_RECV_INIT || + opline->opcode == ZEND_RECV_VARIADIC || (opline->opcode == ZEND_OP_DATA && ZEND_RESULT_TYPE(opline) == IS_TMP_VAR) || opline->opcode == ZEND_ADD_ARRAY_ELEMENT)) { /* these opcodes use the result as argument */ @@ -2011,6 +2016,7 @@ static void zend_t_usage(zend_code_block *block, zend_op_array *op_array, char * if (opline->opcode == ZEND_RECV || opline->opcode == ZEND_RECV_INIT || + opline->opcode == ZEND_RECV_VARIADIC || opline->opcode == ZEND_ADD_ARRAY_ELEMENT) { if (ZEND_OP1_TYPE(opline) == IS_VAR || ZEND_OP1_TYPE(opline) == IS_TMP_VAR) { usage[VAR_NUM(ZEND_RESULT(opline).var)] = 1; diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c index 9309d4b462094..2960e583aa35c 100644 --- a/ext/opcache/Optimizer/pass1_5.c +++ b/ext/opcache/Optimizer/pass1_5.c @@ -37,7 +37,6 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC) = get_binary_op(opline->opcode); zend_uint tv = ZEND_RESULT(opline).var; /* temporary variable */ zval result; - zend_op *tmp_opline; int er; if (opline->opcode == ZEND_DIV && @@ -61,95 +60,7 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { literal_dtor(&ZEND_OP2_LITERAL(opline)); MAKE_NOP(opline); - /* substitute the following TMP_VAR usage with constant */ - for (tmp_opline = opline + 1; tmp_opline < end; tmp_opline++) { - if (ZEND_OP1_TYPE(tmp_opline) == IS_TMP_VAR && - ZEND_OP1(tmp_opline).var == tv) { - if (tmp_opline->opcode == ZEND_FREE) { - MAKE_NOP(tmp_opline); - zval_dtor(&result); - } else { - ZEND_OP1_TYPE(tmp_opline) = IS_CONST; -#if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO - tmp_opline->op1.constant = zend_optimizer_add_literal(op_array, &result TSRMLS_CC); - if (Z_TYPE(result) == IS_STRING) { - Z_HASH_P(&ZEND_OP1_LITERAL(tmp_opline)) = zend_hash_func(Z_STRVAL(ZEND_OP1_LITERAL(tmp_opline)), Z_STRLEN(ZEND_OP1_LITERAL(tmp_opline)) + 1); - if (tmp_opline->opcode == ZEND_INIT_STATIC_METHOD_CALL || - tmp_opline->opcode == ZEND_DO_FCALL || - tmp_opline->opcode == ZEND_CATCH || - tmp_opline->opcode == ZEND_FETCH_CONSTANT) { - op_array->literals[tmp_opline->op1.constant].cache_slot = op_array->last_cache_slot++; - } - } -#else - ZEND_OP1_LITERAL(tmp_opline) = result; -#endif - } - /* TMP_VAR my be used only once */ - break; - } - if (ZEND_OP2_TYPE(tmp_opline) == IS_TMP_VAR && - ZEND_OP2(tmp_opline).var == tv) { - ZEND_OP2_TYPE(tmp_opline) = IS_CONST; -#if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO - tmp_opline->op2.constant = zend_optimizer_add_literal(op_array, &result TSRMLS_CC); - if (Z_TYPE(result) == IS_STRING) { - Z_HASH_P(&ZEND_OP2_LITERAL(tmp_opline)) = zend_hash_func(Z_STRVAL(ZEND_OP2_LITERAL(tmp_opline)), Z_STRLEN(ZEND_OP2_LITERAL(tmp_opline)) + 1); - if (tmp_opline->opcode == ZEND_FETCH_R || - tmp_opline->opcode == ZEND_FETCH_W || - tmp_opline->opcode == ZEND_FETCH_RW || - tmp_opline->opcode == ZEND_FETCH_IS || - tmp_opline->opcode == ZEND_FETCH_UNSET || - tmp_opline->opcode == ZEND_FETCH_FUNC_ARG || - tmp_opline->opcode == ZEND_FETCH_CLASS || - tmp_opline->opcode == ZEND_INIT_FCALL_BY_NAME || - tmp_opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME || - tmp_opline->opcode == ZEND_UNSET_VAR || - tmp_opline->opcode == ZEND_ISSET_ISEMPTY_VAR || - tmp_opline->opcode == ZEND_ADD_INTERFACE || - tmp_opline->opcode == ZEND_ADD_TRAIT) { - op_array->literals[tmp_opline->op2.constant].cache_slot = op_array->last_cache_slot++; - } else if (tmp_opline->opcode == ZEND_INIT_METHOD_CALL || - tmp_opline->opcode == ZEND_INIT_STATIC_METHOD_CALL || - tmp_opline->opcode == ZEND_FETCH_CONSTANT || - tmp_opline->opcode == ZEND_ASSIGN_OBJ || - tmp_opline->opcode == ZEND_FETCH_OBJ_R || - tmp_opline->opcode == ZEND_FETCH_OBJ_W || - tmp_opline->opcode == ZEND_FETCH_OBJ_RW || - tmp_opline->opcode == ZEND_FETCH_OBJ_IS || - tmp_opline->opcode == ZEND_FETCH_OBJ_UNSET || - tmp_opline->opcode == ZEND_FETCH_OBJ_FUNC_ARG || - tmp_opline->opcode == ZEND_UNSET_OBJ || - tmp_opline->opcode == ZEND_PRE_INC_OBJ || - tmp_opline->opcode == ZEND_PRE_DEC_OBJ || - tmp_opline->opcode == ZEND_POST_INC_OBJ || - tmp_opline->opcode == ZEND_POST_DEC_OBJ || - tmp_opline->opcode == ZEND_ISSET_ISEMPTY_PROP_OBJ) { - op_array->literals[tmp_opline->op2.constant].cache_slot = op_array->last_cache_slot; - op_array->last_cache_slot += 2; - } else if (tmp_opline->opcode == ZEND_ASSIGN_ADD || - tmp_opline->opcode == ZEND_ASSIGN_SUB || - tmp_opline->opcode == ZEND_ASSIGN_MUL || - tmp_opline->opcode == ZEND_ASSIGN_DIV || - tmp_opline->opcode == ZEND_ASSIGN_MOD || - tmp_opline->opcode == ZEND_ASSIGN_SL || - tmp_opline->opcode == ZEND_ASSIGN_SR || - tmp_opline->opcode == ZEND_ASSIGN_CONCAT || - tmp_opline->opcode == ZEND_ASSIGN_BW_OR || - tmp_opline->opcode == ZEND_ASSIGN_BW_AND || - tmp_opline->opcode == ZEND_ASSIGN_BW_XOR) { - if (tmp_opline->extended_value == ZEND_ASSIGN_OBJ) { - op_array->literals[tmp_opline->op2.constant].cache_slot = op_array->last_cache_slot; - op_array->last_cache_slot += 2; - } - } - } -#else - ZEND_OP2_LITERAL(tmp_opline) = result; -#endif - break; - } - } + replace_tmp_by_const(op_array, opline + 1, tv, &result TSRMLS_CC); } break; @@ -159,6 +70,7 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { opline->extended_value != IS_OBJECT && opline->extended_value != IS_RESOURCE) { /* cast of constant operand */ + zend_uint tv = ZEND_RESULT(opline).var; /* temporary variable */ zval res; res = ZEND_OP1_LITERAL(opline); zval_copy_ctor(&res); @@ -179,11 +91,11 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { convert_to_string(&res); break; } + literal_dtor(&ZEND_OP1_LITERAL(opline)); - opline->opcode = ZEND_QM_ASSIGN; - opline->extended_value = 0; - ZEND_OP1_LITERAL(opline) = res; - SET_UNUSED(opline->op2); + MAKE_NOP(opline); + + replace_tmp_by_const(op_array, opline + 1, tv, &res TSRMLS_CC); } else if (opline->extended_value == IS_BOOL) { /* T = CAST(X, IS_BOOL) => T = BOOL(X) */ opline->opcode = ZEND_BOOL; @@ -197,7 +109,6 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { /* unary operation on constant operand */ unary_op_type unary_op = get_unary_op(opline->opcode); zval result; - zend_op *tmp_opline; zend_uint tv = ZEND_RESULT(opline).var; /* temporary variable */ int er; @@ -218,34 +129,7 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { literal_dtor(&ZEND_OP1_LITERAL(opline)); MAKE_NOP(opline); - /* substitute the following TMP_VAR usage with constant */ - for (tmp_opline = opline + 1; tmp_opline < end; tmp_opline++) { - if (ZEND_OP1_TYPE(tmp_opline) == IS_TMP_VAR && - ZEND_OP1(tmp_opline).var == tv) { - if (tmp_opline->opcode == ZEND_FREE) { - MAKE_NOP(tmp_opline); - zval_dtor(&result); - } else { - ZEND_OP1_TYPE(tmp_opline) = IS_CONST; -#if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO - tmp_opline->op1.constant = zend_optimizer_add_literal(op_array, &result TSRMLS_CC); -#else - ZEND_OP1_LITERAL(tmp_opline) = result; -#endif - } - break; - } - if (ZEND_OP2_TYPE(tmp_opline) == IS_TMP_VAR && - ZEND_OP2(tmp_opline).var == tv) { - ZEND_OP2_TYPE(tmp_opline) = IS_CONST; -#if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO - tmp_opline->op2.constant = zend_optimizer_add_literal(op_array, &result TSRMLS_CC); -#else - ZEND_OP2_LITERAL(tmp_opline) = result; -#endif - break; - } - } + replace_tmp_by_const(op_array, opline + 1, tv, &result TSRMLS_CC); } break; diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c index a058bd73cbb14..ec36502f167b1 100644 --- a/ext/opcache/Optimizer/zend_optimizer.c +++ b/ext/opcache/Optimizer/zend_optimizer.c @@ -138,6 +138,137 @@ int zend_optimizer_add_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC #endif +static void replace_tmp_by_const(zend_op_array *op_array, + zend_op *opline, + zend_uint var, + zval *val + TSRMLS_DC) +{ + zend_op *end = op_array->opcodes + op_array->last; + + while (opline < end) { + if (ZEND_OP1_TYPE(opline) == IS_TMP_VAR && + ZEND_OP1(opline).var == var) { + + if (opline->opcode == ZEND_FREE) { + MAKE_NOP(opline); + zval_dtor(val); + } else { + ZEND_OP1_TYPE(opline) = IS_CONST; +#if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO + if (Z_TYPE_P(val) == IS_STRING) { + switch (opline->opcode) { + case ZEND_INIT_STATIC_METHOD_CALL: + case ZEND_CATCH: + case ZEND_FETCH_CONSTANT: + opline->op1.constant = zend_optimizer_add_literal(op_array, val TSRMLS_CC); + Z_HASH_P(&ZEND_OP1_LITERAL(opline)) = zend_hash_func(Z_STRVAL(ZEND_OP1_LITERAL(opline)), Z_STRLEN(ZEND_OP1_LITERAL(opline)) + 1); + op_array->literals[opline->op1.constant].cache_slot = op_array->last_cache_slot++; + zend_str_tolower(Z_STRVAL_P(val), Z_STRLEN_P(val)); + zend_optimizer_add_literal(op_array, val TSRMLS_CC); + op_array->literals[opline->op1.constant+1].hash_value = zend_hash_func(Z_STRVAL(op_array->literals[opline->op1.constant+1].constant), Z_STRLEN(op_array->literals[opline->op1.constant+1].constant) + 1); + break; + case ZEND_DO_FCALL: + zend_str_tolower(Z_STRVAL_P(val), Z_STRLEN_P(val)); + opline->op1.constant = zend_optimizer_add_literal(op_array, val TSRMLS_CC); + Z_HASH_P(&ZEND_OP1_LITERAL(opline)) = zend_hash_func(Z_STRVAL(ZEND_OP1_LITERAL(opline)), Z_STRLEN(ZEND_OP1_LITERAL(opline)) + 1); + op_array->literals[opline->op1.constant].cache_slot = op_array->last_cache_slot++; + break; + default: + opline->op1.constant = zend_optimizer_add_literal(op_array, val TSRMLS_CC); + Z_HASH_P(&ZEND_OP1_LITERAL(opline)) = zend_hash_func(Z_STRVAL(ZEND_OP1_LITERAL(opline)), Z_STRLEN(ZEND_OP1_LITERAL(opline)) + 1); + break; + } + } else { + opline->op1.constant = zend_optimizer_add_literal(op_array, val TSRMLS_CC); + } +#else + ZEND_OP1_LITERAL(opline) = *val; +#endif + } + /* TMP_VAR my be used only once */ + break; + } + + if (ZEND_OP2_TYPE(opline) == IS_TMP_VAR && + ZEND_OP2(opline).var == var) { + + ZEND_OP2_TYPE(opline) = IS_CONST; +#if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO + opline->op2.constant = zend_optimizer_add_literal(op_array, val TSRMLS_CC); + if (Z_TYPE_P(val) == IS_STRING) { + Z_HASH_P(&ZEND_OP2_LITERAL(opline)) = zend_hash_func(Z_STRVAL(ZEND_OP2_LITERAL(opline)), Z_STRLEN(ZEND_OP2_LITERAL(opline)) + 1); + switch (opline->opcode) { + case ZEND_FETCH_R: + case ZEND_FETCH_W: + case ZEND_FETCH_RW: + case ZEND_FETCH_IS: + case ZEND_FETCH_UNSET: + case ZEND_FETCH_FUNC_ARG: + case ZEND_FETCH_CLASS: + case ZEND_INIT_FCALL_BY_NAME: + /*case ZEND_INIT_NS_FCALL_BY_NAME:*/ + case ZEND_UNSET_VAR: + case ZEND_ISSET_ISEMPTY_VAR: + case ZEND_ADD_INTERFACE: + case ZEND_ADD_TRAIT: + op_array->literals[opline->op2.constant].cache_slot = op_array->last_cache_slot++; + zend_str_tolower(Z_STRVAL_P(val), Z_STRLEN_P(val)); + zend_optimizer_add_literal(op_array, val TSRMLS_CC); + op_array->literals[opline->op2.constant+1].hash_value = zend_hash_func(Z_STRVAL(op_array->literals[opline->op2.constant+1].constant), Z_STRLEN(op_array->literals[opline->op2.constant+1].constant) + 1); + break; + case ZEND_INIT_METHOD_CALL: + case ZEND_INIT_STATIC_METHOD_CALL: + zend_str_tolower(Z_STRVAL_P(val), Z_STRLEN_P(val)); + zend_optimizer_add_literal(op_array, val TSRMLS_CC); + op_array->literals[opline->op2.constant+1].hash_value = zend_hash_func(Z_STRVAL(op_array->literals[opline->op2.constant+1].constant), Z_STRLEN(op_array->literals[opline->op2.constant+1].constant) + 1); + /* break missing intentionally */ + /*case ZEND_FETCH_CONSTANT:*/ + case ZEND_ASSIGN_OBJ: + case ZEND_FETCH_OBJ_R: + case ZEND_FETCH_OBJ_W: + case ZEND_FETCH_OBJ_RW: + case ZEND_FETCH_OBJ_IS: + case ZEND_FETCH_OBJ_UNSET: + case ZEND_FETCH_OBJ_FUNC_ARG: + case ZEND_UNSET_OBJ: + case ZEND_PRE_INC_OBJ: + case ZEND_PRE_DEC_OBJ: + case ZEND_POST_INC_OBJ: + case ZEND_POST_DEC_OBJ: + case ZEND_ISSET_ISEMPTY_PROP_OBJ: + op_array->literals[opline->op2.constant].cache_slot = op_array->last_cache_slot; + op_array->last_cache_slot += 2; + break; + case ZEND_ASSIGN_ADD: + case ZEND_ASSIGN_SUB: + case ZEND_ASSIGN_MUL: + case ZEND_ASSIGN_DIV: + case ZEND_ASSIGN_MOD: + case ZEND_ASSIGN_SL: + case ZEND_ASSIGN_SR: + case ZEND_ASSIGN_CONCAT: + case ZEND_ASSIGN_BW_OR: + case ZEND_ASSIGN_BW_AND: + case ZEND_ASSIGN_BW_XOR: + if (opline->extended_value == ZEND_ASSIGN_OBJ) { + op_array->literals[opline->op2.constant].cache_slot = op_array->last_cache_slot; + op_array->last_cache_slot += 2; + } + break; + default: + break; + } + } +#else + ZEND_OP2_LITERAL(opline) = *val; +#endif + break; + } + opline++; + } +} + #include "Optimizer/nop_removal.c" #include "Optimizer/block_pass.c" #include "Optimizer/optimize_temp_vars_5.c" diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 2c765f1be7267..3835d8b9ab823 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -37,6 +37,7 @@ #include "zend_API.h" #include "zend_ini.h" #include "TSRM/tsrm_virtual_cwd.h" +#include "ext/phar/php_phar.h" #include "zend_accelerator_util_funcs.h" #include "zend_accelerator_hash.h" @@ -144,6 +145,21 @@ static inline int is_cacheable_stream_path(const char *filename) memcmp(filename, "phar://", sizeof("phar://") - 1) == 0; } +static inline int is_phar_relative_alias_path(const char *filename, char **alias, int *alias_len) +{ + if (memcmp(filename, "phar://", sizeof("phar://") - 1) == 0 + && filename[sizeof("phar://") - 1] != '\0' && filename[sizeof("phar://") - 1] != '/') { + char *slash; + *alias = (char*)filename + sizeof("phar://") - 1; + slash = strstr(*alias, "/"); + if (slash) { + *alias_len = slash - *alias; + return 1; + } + } + return 0; +} + /* O+ overrides PHP chdir() function and remembers the current working directory * in ZCG(cwd) and ZCG(cwd_len). Later accel_getcwd() can use stored value and * avoid getcwd() call. @@ -1028,15 +1044,33 @@ char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_lengt } memcpy(ZCG(key) + cur_len, include_path, include_path_len); ZCG(key)[key_length] = '\0'; - } else { - /* not use_cwd */ - key_length = path_length; + } else { + /* not use_cwd */ + key_length = path_length; if ((size_t)key_length >= sizeof(ZCG(key))) { ZCG(key_len) = 0; return NULL; + } else { + char *alias; + int alias_len; + if (is_phar_relative_alias_path(file_handle->filename, &alias, &alias_len)) { + char *phar_path; + int phar_path_len; + if (phar_resolve_alias(alias, alias_len, &phar_path, &phar_path_len TSRMLS_CC) == SUCCESS) { + int filename_len = strlen(file_handle->filename); + memcpy(ZCG(key), "phar://", sizeof("phar://") -1); + memcpy(ZCG(key) + sizeof("phar://") - 1, phar_path, phar_path_len); + memcpy(ZCG(key) + sizeof("phar://") - 1 + phar_path_len, + alias + alias_len, filename_len - alias_len - sizeof("phar://") + 2); + key_length = filename_len + (phar_path_len - alias_len); + } else { + memcpy(ZCG(key), file_handle->filename, key_length + 1); + } + } else { + memcpy(ZCG(key), file_handle->filename, key_length + 1); + } } - memcpy(ZCG(key), file_handle->filename, key_length + 1); - } + } *key_len = ZCG(key_len) = key_length; return ZCG(key); @@ -1062,6 +1096,10 @@ int zend_accel_invalidate(const char *filename, int filename_len, zend_bool forc realpath = accelerator_orig_zend_resolve_path(filename, filename_len TSRMLS_CC); #endif + if (!realpath) { + return FAILURE; + } + persistent_script = zend_accel_hash_find(&ZCSG(hash), realpath, strlen(realpath) + 1); if (persistent_script && !persistent_script->corrupted) { zend_file_handle file_handle; @@ -1446,7 +1484,7 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han } /* zend_compile() replacement */ -static zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC) +zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC) { zend_persistent_script *persistent_script = NULL; char *key = NULL; @@ -2407,14 +2445,14 @@ static inline int accel_find_sapi(TSRMLS_D) return FAILURE; } -static void zend_accel_init_shm(TSRMLS_D) +static int zend_accel_init_shm(TSRMLS_D) { zend_shared_alloc_lock(TSRMLS_C); accel_shared_globals = zend_shared_alloc(sizeof(zend_accel_shared_globals)); if (!accel_shared_globals) { zend_accel_error(ACCEL_LOG_FATAL, "Insufficient shared memory!"); - return; + return FAILURE; } ZSMMG(app_shared_globals) = accel_shared_globals; @@ -2429,7 +2467,8 @@ static void zend_accel_init_shm(TSRMLS_D) ZCSG(interned_strings).arBuckets = zend_shared_alloc(ZCSG(interned_strings).nTableSize * sizeof(Bucket *)); ZCSG(interned_strings_start) = zend_shared_alloc((ZCG(accel_directives).interned_strings_buffer * 1024 * 1024)); if (!ZCSG(interned_strings).arBuckets || !ZCSG(interned_strings_start)) { - zend_error(E_ERROR, ACCELERATOR_PRODUCT_NAME " cannot allocate buffer for interned strings"); + zend_accel_error(ACCEL_LOG_FATAL, ACCELERATOR_PRODUCT_NAME " cannot allocate buffer for interned strings"); + return FAILURE; } ZCSG(interned_strings_end) = ZCSG(interned_strings_start) + (ZCG(accel_directives).interned_strings_buffer * 1024 * 1024); ZCSG(interned_strings_top) = ZCSG(interned_strings_start); @@ -2468,6 +2507,8 @@ static void zend_accel_init_shm(TSRMLS_D) ZCSG(restart_in_progress) = 0; zend_shared_alloc_unlock(TSRMLS_C); + + return SUCCESS; } static void accel_globals_ctor(zend_accel_globals *accel_globals TSRMLS_DC) @@ -2525,7 +2566,10 @@ static int accel_startup(zend_extension *extension) /********************************************/ switch (zend_shared_alloc_startup(ZCG(accel_directives).memory_consumption)) { case ALLOC_SUCCESS: - zend_accel_init_shm(TSRMLS_C); + if (zend_accel_init_shm(TSRMLS_C) == FAILURE) { + accel_startup_ok = 0; + return FAILURE; + } break; case ALLOC_FAILURE: accel_startup_ok = 0; diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h index 38f2e060f6e2e..2f6ee068e8111 100644 --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@ -80,6 +80,9 @@ # endif # include #else +# ifndef MAXPATHLEN +# define MAXPATHLEN 4096 +# endif # include #endif @@ -100,7 +103,7 @@ extern int lock_file; # elif defined(__svr4__) # define FLOCK_STRUCTURE(name, type, whence, start, len) \ struct flock name = {type, whence, start, len} -# elif defined(__linux__) || defined(__hpux) +# elif defined(__linux__) || defined(__hpux) || defined(__GNU__) # define FLOCK_STRUCTURE(name, type, whence, start, len) \ struct flock name = {type, whence, start, len, 0} # elif defined(_AIX) @@ -111,6 +114,12 @@ extern int lock_file; # define FLOCK_STRUCTURE(name, type, whence, start, len) \ struct flock name = {type, whence, start, len} # endif +# elif defined(HAVE_FLOCK_BSD) +# define FLOCK_STRUCTURE(name, type, whence, start, len) \ + struct flock name = {start, len, -1, type, whence} +# elif defined(HAVE_FLOCK_LINUX) +# define FLOCK_STRUCTURE(name, type, whence, start, len) \ + struct flock name = {type, whence, start, len} # else # error "Don't know how to define struct flock" # endif @@ -326,6 +335,7 @@ int accelerator_shm_read_lock(TSRMLS_D); void accelerator_shm_read_unlock(TSRMLS_D); char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_length, int *key_len TSRMLS_DC); +zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC); #if !defined(ZEND_DECLARE_INHERITED_CLASS_DELAYED) # define ZEND_DECLARE_INHERITED_CLASS_DELAYED 145 diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4 index 1798fe13fa80d..60edeed966b36 100644 --- a/ext/opcache/config.m4 +++ b/ext/opcache/config.m4 @@ -326,40 +326,42 @@ int main() { msg=yes,msg=no,msg=no) AC_MSG_RESULT([$msg]) - AC_MSG_CHECKING(for known struct flock definition) - dnl Copied from ZendAccelerator.h - AC_TRY_RUN([ -#include -#include - -#ifndef ZEND_WIN32 -extern int lock_file; - -# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || (defined(__APPLE__) && defined(__MACH__)/* Darwin */) || defined(__OpenBSD__) || defined(__NetBSD__) -# define FLOCK_STRUCTURE(name, type, whence, start, len) \ - struct flock name = {start, len, -1, type, whence} -# elif defined(__svr4__) -# define FLOCK_STRUCTURE(name, type, whence, start, len) \ - struct flock name = {type, whence, start, len} -# elif defined(__linux__) || defined(__hpux) -# define FLOCK_STRUCTURE(name, type, whence, start, len) \ - struct flock name = {type, whence, start, len, 0} -# elif defined(_AIX) -# if defined(_LARGE_FILES) || defined(__64BIT__) -# define FLOCK_STRUCTURE(name, type, whence, start, len) \ - struct flock name = {type, whence, 0, 0, 0, start, len } -# else -# define FLOCK_STRUCTURE(name, type, whence, start, len) \ - struct flock name = {type, whence, start, len} -# endif -# else -# error "Don't know how to define struct flock" -# endif -#endif -int main() { return 0; } -], -[AC_MSG_RESULT([done])], -[AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no])], []) +flock_type=unknown +AC_MSG_CHECKING("whether flock struct is linux ordered") +AC_TRY_RUN([ + #include + struct flock lock = { 1, 2, 3, 4, 5 }; + int main() { + if(lock.l_type == 1 && lock.l_whence == 2 && lock.l_start == 3 && lock.l_len == 4) { + return 0; + } + return 1; + } +], [ + flock_type=linux + AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type]) + AC_MSG_RESULT("yes") +], AC_MSG_RESULT("no") ) + +AC_MSG_CHECKING("whether flock struct is BSD ordered") +AC_TRY_RUN([ + #include + struct flock lock = { 1, 2, 3, 4, 5 }; + int main() { + if(lock.l_start == 1 && lock.l_len == 2 && lock.l_type == 4 && lock.l_whence == 5) { + return 0; + } + return 1; + } +], [ + flock_type=bsd + AC_DEFINE([HAVE_FLOCK_BSD], [], [Struct flock is BSD-type]) + AC_MSG_RESULT("yes") +], AC_MSG_RESULT("no") ) + +if test "$flock_type" == "unknown"; then + AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no]) +fi PHP_NEW_EXTENSION(opcache, ZendAccelerator.c \ diff --git a/ext/opcache/tests/bug65665.phpt b/ext/opcache/tests/bug65665.phpt new file mode 100644 index 0000000000000..ac5c18dd83545 --- /dev/null +++ b/ext/opcache/tests/bug65665.phpt @@ -0,0 +1,118 @@ +--TEST-- +Bug #65665 (Exception not properly caught when opcache enabled) +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +--SKIPIF-- + +--FILE-- + +--FILE-- + +--EXPECT-- +string(4) "tutu" diff --git a/ext/opcache/tests/issue0128.phpt b/ext/opcache/tests/issue0128.phpt new file mode 100644 index 0000000000000..637f675ac2500 --- /dev/null +++ b/ext/opcache/tests/issue0128.phpt @@ -0,0 +1,16 @@ +--TEST-- +ISSUE #128 (opcache_invalidate segmentation fault) +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.optimization_level=-1 +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(false) +string(4) "okey" diff --git a/ext/opcache/zend_accelerator_blacklist.c b/ext/opcache/zend_accelerator_blacklist.c index da83cfd3119e1..eb0bc2146cd55 100644 --- a/ext/opcache/zend_accelerator_blacklist.c +++ b/ext/opcache/zend_accelerator_blacklist.c @@ -314,6 +314,7 @@ void zend_accel_blacklist_load(zend_blacklist *blacklist, char *filename) blacklist->entries[blacklist->pos].path = (char *)malloc(path_length + 1); if (!blacklist->entries[blacklist->pos].path) { zend_accel_error(ACCEL_LOG_ERROR, "malloc() failed\n"); + fclose(fp); return; } blacklist->entries[blacklist->pos].id = blacklist->pos; diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index f9ddaa98b8ba0..dedb7215c1df3 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -48,6 +48,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_opcache_get_status, 0, 0, 0) ZEND_ARG_INFO(0, fetch_scripts) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_opcache_compile_file, 0, 0, 1) + ZEND_ARG_INFO(0, file) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_opcache_invalidate, 0, 0, 1) ZEND_ARG_INFO(0, script) ZEND_ARG_INFO(0, force) @@ -59,12 +63,14 @@ static ZEND_FUNCTION(opcache_invalidate); /* Private functions */ static ZEND_FUNCTION(opcache_get_status); +static ZEND_FUNCTION(opcache_compile_file); static ZEND_FUNCTION(opcache_get_configuration); static zend_function_entry accel_functions[] = { /* User functions */ ZEND_FE(opcache_reset, arginfo_opcache_none) ZEND_FE(opcache_invalidate, arginfo_opcache_invalidate) + ZEND_FE(opcache_compile_file, arginfo_opcache_compile_file) /* Private functions */ ZEND_FE(opcache_get_configuration, arginfo_opcache_none) ZEND_FE(opcache_get_status, arginfo_opcache_get_status) @@ -709,3 +715,44 @@ static ZEND_FUNCTION(opcache_invalidate) RETURN_FALSE; } } + +static ZEND_FUNCTION(opcache_compile_file) +{ + char *script_name; + int script_name_len; + zend_file_handle handle; + zend_op_array *op_array = NULL; + zend_execute_data *orig_execute_data = NULL; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &script_name, &script_name_len) == FAILURE) { + return; + } + + if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled)) { + zend_error(E_NOTICE, ACCELERATOR_PRODUCT_NAME " seems to be disabled, can't compile file"); + RETURN_FALSE; + } + + handle.filename = script_name; + handle.free_filename = 0; + handle.opened_path = NULL; + handle.type = ZEND_HANDLE_FILENAME; + + orig_execute_data = EG(current_execute_data); + + zend_try { + op_array = persistent_compile_file(&handle, ZEND_INCLUDE TSRMLS_CC); + } zend_catch { + EG(current_execute_data) = orig_execute_data; + zend_error(E_WARNING, ACCELERATOR_PRODUCT_NAME " could not compile file %s" TSRMLS_CC, handle.filename); + } zend_end_try(); + + if(op_array != NULL) { + destroy_op_array(op_array TSRMLS_CC); + efree(op_array); + RETVAL_TRUE; + } else { + RETVAL_FALSE; + } + zend_destroy_file_handle(&handle TSRMLS_CC); +} diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index 39b4c1fc2558b..894da63aaa48e 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -478,7 +478,7 @@ static void zend_hash_clone_methods(HashTable *ht, HashTable *source, zend_class if (accel_xlat_get(new_entry->scope, new_ce) == SUCCESS) { new_entry->scope = *new_ce; } else { - zend_error(E_ERROR, ACCELERATOR_PRODUCT_NAME " class loading error, class %s, function %s. Please call Zend Support", ce->name, new_entry->function_name); + zend_error(E_ERROR, ACCELERATOR_PRODUCT_NAME " class loading error, class %s, function %s", ce->name, new_entry->function_name); } } @@ -487,7 +487,7 @@ static void zend_hash_clone_methods(HashTable *ht, HashTable *source, zend_class if (accel_xlat_get(new_entry->prototype, new_prototype) == SUCCESS) { new_entry->prototype = *new_prototype; } else { - zend_error(E_ERROR, ACCELERATOR_PRODUCT_NAME " class loading error, class %s, function %s. Please call Zend Support", ce->name, new_entry->function_name); + zend_error(E_ERROR, ACCELERATOR_PRODUCT_NAME " class loading error, class %s, function %s", ce->name, new_entry->function_name); } } @@ -589,7 +589,7 @@ static void zend_hash_clone_prop_info(HashTable *ht, HashTable *source, zend_cla } else if (accel_xlat_get(prop_info->ce, new_ce) == SUCCESS) { prop_info->ce = *new_ce; } else { - zend_error(E_ERROR, ACCELERATOR_PRODUCT_NAME" class loading error, class %s, property %s. Please call Zend Support", ce->name, prop_info->name); + zend_error(E_ERROR, ACCELERATOR_PRODUCT_NAME" class loading error, class %s, property %s", ce->name, prop_info->name); } p = p->pListNext; @@ -621,7 +621,7 @@ static int zend_prepare_function_for_execution(zend_op_array *op_array) if (accel_xlat_get(ce->handler, new_func) == SUCCESS) { \ ce->handler = *new_func; \ } else { \ - zend_error(E_ERROR, ACCELERATOR_PRODUCT_NAME " class loading error, class %s. Please call Zend Support", ce->name); \ + zend_error(E_ERROR, ACCELERATOR_PRODUCT_NAME " class loading error, class %s", ce->name); \ } \ } \ } @@ -710,7 +710,7 @@ static void zend_class_copy_ctor(zend_class_entry **pce) if (accel_xlat_get(ce->parent, new_ce) == SUCCESS) { ce->parent = *new_ce; } else { - zend_error(E_ERROR, ACCELERATOR_PRODUCT_NAME" class loading error, class %s. Please call Zend Support", ce->name); + zend_error(E_ERROR, ACCELERATOR_PRODUCT_NAME" class loading error, class %s", ce->name); } } diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 4aac4e3137cad..7cf637c7f6cbd 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -129,6 +129,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_x509_export, 0, 0, 2) ZEND_ARG_INFO(0, notext) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_x509_fingerprint, 0, 0, 1) + ZEND_ARG_INFO(0, x509) + ZEND_ARG_INFO(0, method) + ZEND_ARG_INFO(0, raw_output) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO(arginfo_openssl_x509_check_private_key, 0) ZEND_ARG_INFO(0, cert) ZEND_ARG_INFO(0, key) @@ -443,6 +449,7 @@ const zend_function_entry openssl_functions[] = { PHP_FE(openssl_x509_checkpurpose, arginfo_openssl_x509_checkpurpose) PHP_FE(openssl_x509_check_private_key, arginfo_openssl_x509_check_private_key) PHP_FE(openssl_x509_export, arginfo_openssl_x509_export) + PHP_FE(openssl_x509_fingerprint, arginfo_openssl_x509_fingerprint) PHP_FE(openssl_x509_export_to_file, arginfo_openssl_x509_export_to_file) /* PKCS12 funcs */ @@ -1176,6 +1183,10 @@ PHP_MINIT_FUNCTION(openssl) php_stream_xport_register("sslv2", php_openssl_ssl_socket_factory TSRMLS_CC); #endif php_stream_xport_register("tls", php_openssl_ssl_socket_factory TSRMLS_CC); +#if OPENSSL_VERSION_NUMBER >= 0x10001001L + php_stream_xport_register("tlsv1.1", php_openssl_ssl_socket_factory TSRMLS_CC); + php_stream_xport_register("tlsv1.2", php_openssl_ssl_socket_factory TSRMLS_CC); +#endif /* override the default tcp socket provider */ php_stream_xport_register("tcp", php_openssl_ssl_socket_factory TSRMLS_CC); @@ -1214,6 +1225,10 @@ PHP_MSHUTDOWN_FUNCTION(openssl) #endif php_stream_xport_unregister("sslv3" TSRMLS_CC); php_stream_xport_unregister("tls" TSRMLS_CC); +#if OPENSSL_VERSION_NUMBER >= 0x10001001L + php_stream_xport_unregister("tlsv1.1" TSRMLS_CC); + php_stream_xport_unregister("tlsv1.2" TSRMLS_CC); +#endif /* reinstate the default tcp handler */ php_stream_xport_register("tcp", php_stream_generic_socket_factory TSRMLS_CC); @@ -1595,7 +1610,7 @@ PHP_FUNCTION(openssl_spki_export_challenge) goto cleanup; } - RETVAL_STRING(ASN1_STRING_data(spki->spkac->challenge), 1); + RETVAL_STRING((char *) ASN1_STRING_data(spki->spkac->challenge), 1); goto cleanup; cleanup: @@ -1665,6 +1680,121 @@ PHP_FUNCTION(openssl_x509_export) } /* }}} */ +static int php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_bool raw, char **out, int *out_len TSRMLS_DC) +{ + unsigned char md[EVP_MAX_MD_SIZE]; + const EVP_MD *mdtype; + unsigned int n; + + if (!(mdtype = EVP_get_digestbyname(method))) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm"); + return FAILURE; + } else if (!X509_digest(peer, mdtype, md, &n)) { + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not generate signature"); + return FAILURE; + } + + if (raw) { + *out_len = n; + *out = estrndup((char *) md, n); + } else { + *out_len = n * 2; + *out = emalloc(*out_len + 1); + + make_digest_ex(*out, md, n); + } + + return SUCCESS; +} + +static int php_x509_fingerprint_cmp(X509 *peer, const char *method, const char *expected TSRMLS_DC) +{ + char *fingerprint; + int fingerprint_len; + int result = -1; + + if (php_openssl_x509_fingerprint(peer, method, 0, &fingerprint, &fingerprint_len TSRMLS_CC) == SUCCESS) { + result = strcmp(expected, fingerprint); + efree(fingerprint); + } + + return result; +} + +static zend_bool php_x509_fingerprint_match(X509 *peer, zval *val TSRMLS_DC) +{ + if (Z_TYPE_P(val) == IS_STRING) { + const char *method = NULL; + + switch (Z_STRLEN_P(val)) { + case 32: + method = "md5"; + break; + + case 40: + method = "sha1"; + break; + } + + return method && php_x509_fingerprint_cmp(peer, method, Z_STRVAL_P(val) TSRMLS_CC) == 0; + } else if (Z_TYPE_P(val) == IS_ARRAY) { + HashPosition pos; + zval **current; + char *key; + uint key_len; + ulong key_index; + + for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(val), &pos); + zend_hash_get_current_data_ex(Z_ARRVAL_P(val), (void **)¤t, &pos) == SUCCESS; + zend_hash_move_forward_ex(Z_ARRVAL_P(val), &pos) + ) { + int key_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(val), &key, &key_len, &key_index, 0, &pos); + + if (key_type == HASH_KEY_IS_STRING + && Z_TYPE_PP(current) == IS_STRING + && php_x509_fingerprint_cmp(peer, key, Z_STRVAL_PP(current) TSRMLS_CC) != 0 + ) { + return 0; + } + } + return 1; + } + return 0; +} + +PHP_FUNCTION(openssl_x509_fingerprint) +{ + X509 *cert; + zval **zcert; + long certresource; + zend_bool raw_output = 0; + char *method = "sha1"; + int method_len; + + char *fingerprint; + int fingerprint_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|sb", &zcert, &method, &method_len, &raw_output) == FAILURE) { + return; + } + + cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC); + if (cert == NULL) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 1"); + RETURN_FALSE; + } + + if (php_openssl_x509_fingerprint(cert, method, raw_output, &fingerprint, &fingerprint_len TSRMLS_CC) == SUCCESS) { + RETVAL_STRINGL(fingerprint, fingerprint_len, 0); + } else { + RETVAL_FALSE; + } + + if (certresource == -1 && cert) { + X509_free(cert); + } +} + /* {{{ proto bool openssl_x509_check_private_key(mixed cert, mixed key) Checks if a private key corresponds to a CERT */ PHP_FUNCTION(openssl_x509_check_private_key) @@ -4794,14 +4924,12 @@ static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) /* {{{ */ { php_stream *stream; SSL *ssl; - X509 *err_cert; int err, depth, ret; zval **val; ret = preverify_ok; /* determine the status for the current cert */ - err_cert = X509_STORE_CTX_get_current_cert(ctx); err = X509_STORE_CTX_get_error(ctx); depth = X509_STORE_CTX_get_error_depth(ctx); @@ -4829,12 +4957,91 @@ static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) /* {{{ */ } /* }}} */ +static zend_bool matches_wildcard_name(const char *subjectname, const char *certname) +{ + char *wildcard; + int prefix_len, suffix_len, subject_len; + + if (strcasecmp(subjectname, certname) == 0) { + return 1; + } + + if (!(wildcard = strchr(certname, '*'))) { + return 0; + } + + // 1) prefix, if not empty, must match subject + prefix_len = wildcard - certname; + if (prefix_len && strncasecmp(subjectname, certname, prefix_len) != 0) { + return 0; + } + + suffix_len = strlen(wildcard + 1); + subject_len = strlen(subjectname); + if (suffix_len <= subject_len) { + /* 2) suffix must match + * 3) no . between prefix and suffix + **/ + return strcasecmp(wildcard + 1, subjectname + subject_len - suffix_len) == 0 && + memchr(subjectname + prefix_len, '.', subject_len - suffix_len - prefix_len) == NULL; + } + + return 0; +} + +static zend_bool matches_san_list(X509 *peer, const char *subject_name) +{ + int i; + zend_bool is_match = 0; + unsigned char *cert_name; + + GENERAL_NAMES *alt_names = X509_get_ext_d2i(peer, NID_subject_alt_name, 0, 0); + int alt_name_count = sk_GENERAL_NAME_num(alt_names); + + for (i = 0; i < alt_name_count; i++) { + GENERAL_NAME *san = sk_GENERAL_NAME_value(alt_names, i); + + if (GEN_DNS == san->type) { + ASN1_STRING_to_UTF8(&cert_name, san->d.dNSName); + is_match = matches_wildcard_name(subject_name, (char *) cert_name); + OPENSSL_free(cert_name); + } + + if (is_match) { + break; + } + } + + return is_match; +} + +static zend_bool matches_common_name(X509 *peer, const char *subject_name TSRMLS_DC) +{ + char buf[1024]; + X509_NAME *cert_name; + zend_bool is_match = 0; + int cert_name_len; + + cert_name = X509_get_subject_name(peer); + cert_name_len = X509_NAME_get_text_by_NID(cert_name, NID_commonName, buf, sizeof(buf)); + + if (cert_name_len == -1) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate peer certificate CN"); + } else if (cert_name_len != strlen(buf)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Peer certificate CN=`%.*s' is malformed", cert_name_len, buf); + } else if (matches_wildcard_name(subject_name, buf)) { + is_match = 1; + } else { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Peer certificate CN=`%.*s' did not match expected CN=`%s'", cert_name_len, buf, subject_name); + } + + return is_match; +} + int php_openssl_apply_verification_policy(SSL *ssl, X509 *peer, php_stream *stream TSRMLS_DC) /* {{{ */ { zval **val = NULL; char *cnmatch = NULL; - X509_NAME *name; - char buf[1024]; int err; /* verification is turned off */ @@ -4865,36 +5072,25 @@ int php_openssl_apply_verification_policy(SSL *ssl, X509 *peer, php_stream *stre /* if the cert passed the usual checks, apply our own local policies now */ - name = X509_get_subject_name(peer); - - /* Does the common name match ? (used primarily for https://) */ - GET_VER_OPT_STRING("CN_match", cnmatch); - if (cnmatch) { - int match = 0; - int name_len = X509_NAME_get_text_by_NID(name, NID_commonName, buf, sizeof(buf)); - - if (name_len == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate peer certificate CN"); - return FAILURE; - } else if (name_len != strlen(buf)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Peer certificate CN=`%.*s' is malformed", name_len, buf); - return FAILURE; - } - - match = strcmp(cnmatch, buf) == 0; - if (!match && strlen(buf) > 3 && buf[0] == '*' && buf[1] == '.') { - /* Try wildcard */ - - if (strchr(buf+2, '.')) { - char *tmp = strstr(cnmatch, buf+1); - - match = tmp && strcmp(tmp, buf+2) && tmp == strchr(cnmatch, '.'); + if (GET_VER_OPT("peer_fingerprint")) { + if (Z_TYPE_PP(val) == IS_STRING || Z_TYPE_PP(val) == IS_ARRAY) { + if (!php_x509_fingerprint_match(peer, *val TSRMLS_CC)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Peer fingerprint doesn't match"); + return FAILURE; } + } else { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expected peer fingerprint must be a string or an array"); } + } + + GET_VER_OPT_STRING("CN_match", cnmatch); - if (!match) { - /* didn't match */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Peer certificate CN=`%.*s' did not match expected CN=`%s'", name_len, buf, cnmatch); + if (cnmatch) { + if (matches_san_list(peer, cnmatch)) { + return SUCCESS; + } else if (matches_common_name(peer, cnmatch TSRMLS_CC)) { + return SUCCESS; + } else { return FAILURE; } } @@ -4974,9 +5170,6 @@ SSL *php_SSL_new_from_context(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ GET_VER_OPT_STRING("local_cert", certfile); if (certfile) { - X509 *cert = NULL; - EVP_PKEY *key = NULL; - SSL *tmpssl; char resolved_path_buff[MAXPATHLEN]; const char * private_key = NULL; @@ -5003,16 +5196,22 @@ SSL *php_SSL_new_from_context(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ } } - tmpssl = SSL_new(ctx); - cert = SSL_get_certificate(tmpssl); - - if (cert) { - key = X509_get_pubkey(cert); - EVP_PKEY_copy_parameters(key, SSL_get_privatekey(tmpssl)); - EVP_PKEY_free(key); - } - SSL_free(tmpssl); - +#if OPENSSL_VERSION_NUMBER < 0x10001001L + do { + /* Unnecessary as of OpenSSLv1.0.1 (will segfault if used with >= 10001001 ) */ + X509 *cert = NULL; + EVP_PKEY *key = NULL; + SSL *tmpssl = SSL_new(ctx); + cert = SSL_get_certificate(tmpssl); + + if (cert) { + key = X509_get_pubkey(cert); + EVP_PKEY_copy_parameters(key, SSL_get_privatekey(tmpssl)); + EVP_PKEY_free(key); + } + SSL_free(tmpssl); + } while (0); +#endif if (!SSL_CTX_check_private_key(ctx)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Private key does not match certificate!"); } diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h index 8483bbf7626dd..a06e43db1ce5e 100644 --- a/ext/openssl/php_openssl.h +++ b/ext/openssl/php_openssl.h @@ -66,6 +66,7 @@ PHP_FUNCTION(openssl_x509_free); PHP_FUNCTION(openssl_x509_parse); PHP_FUNCTION(openssl_x509_checkpurpose); PHP_FUNCTION(openssl_x509_export); +PHP_FUNCTION(openssl_x509_fingerprint); PHP_FUNCTION(openssl_x509_export_to_file); PHP_FUNCTION(openssl_x509_check_private_key); diff --git a/ext/openssl/tests/bug65729.pem b/ext/openssl/tests/bug65729.pem new file mode 100644 index 0000000000000..dbeed6efd3011 --- /dev/null +++ b/ext/openssl/tests/bug65729.pem @@ -0,0 +1,28 @@ +-----BEGIN CERTIFICATE----- +MIICCTCCAXICCQDNMI29sowT7TANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJT +RzESMBAGA1UECBMJVGVzdHZpbGxlMREwDwYDVQQKEwhkYXRpYmJhdzETMBEGA1UE +AxQKKi50ZXN0LmNvbTAeFw0xMzA5MjEwNzUyMjRaFw0xNDA5MjEwNzUyMjRaMEkx +CzAJBgNVBAYTAlNHMRIwEAYDVQQIEwlUZXN0dmlsbGUxETAPBgNVBAoTCGRhdGli +YmF3MRMwEQYDVQQDFAoqLnRlc3QuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB +iQKBgQCdzVnic8K5W4SVbwVuqezcTjeqVLoQ91vVNZB0Jnsuz6q3DoK03oAd1jTe +Vd0k+MQDbXpHoc37lA4+8z/g5Bs0UXxNx+nkbFTE7Ba2/G24caI9/cOXZPG3UViD +rtqXKL6h5/umqRG9Dt5liF2MVP9XFAesVC7B8+Ca+PbPlQoYzwIDAQABMA0GCSqG +SIb3DQEBBQUAA4GBAAS07u/Ke+EhEHidz6CG3Qcr+zg483JKRgZFyGz+YUKyyKKy +fmLs7JieGJxYQjOmIpj/6X9Gnb2HjIPDnI6A+MV1emXDTnnmsgf2/lZGcthhpZn2 +rMbj9bI0iH6HwOVGtp4ZJA5fB7nj3J+gWNTCQzDDOxwX36d2LL9ua+UMnk/g +-----END CERTIFICATE----- +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQCdzVnic8K5W4SVbwVuqezcTjeqVLoQ91vVNZB0Jnsuz6q3DoK0 +3oAd1jTeVd0k+MQDbXpHoc37lA4+8z/g5Bs0UXxNx+nkbFTE7Ba2/G24caI9/cOX +ZPG3UViDrtqXKL6h5/umqRG9Dt5liF2MVP9XFAesVC7B8+Ca+PbPlQoYzwIDAQAB +AoGAeyzTwKPDl5QMRejHQL57GOwlH1vLcXrjv+VzwHZZKQ0IoKM++5fCQYf29KXp +XPahaluGW2u9sWa8R/7wGcd0Q4RtquGzsgT3+AQsIc5KfIamyOyDaRVM/ymX3fWg +gHIU7OOzB+ihOU8sHyRIwfbk01/kmrBXLRj8E31sy3i3PIECQQDQQYE+aN7Acrdt +yN5CaqvbkiCGjRvASlemiTzPosgOtndyp21w1gakJwKYhYDk1N6A6Qb8REMZqM/U +wFypldV/AkEAwfq6NFuhpGL6hDA7MvlyY1KiZ0cHetPUX+PgdNqy2DA+1Sv4i7gm +Wd/uA651K7aPXuUaf9dKtPCmZwI4M6SEsQJBALW89HTqP7niYoDEEnITdPaghxHk +gptERUln6lGo1L1CLus3gSI/JHyMLo+7scgAnEwTD62GRKhX0Ubwt+ymfTECQAY5 +fHYnppU20+EgBxZIqOIFCc8UmWnYmE0Ha/Fz/x8u1SVUBuK84wYpSGL32yyu7ATY +hzQo/W229zABAzqtAdECQQCUdB7IBFpPnsfv/EUBFX7X/7zAc9JpACmu9It5ju8C +KIsMuz/02D+TQoJNjdAngBM+4AJDIaGFgTMIfaDMh5L7 +-----END RSA PRIVATE KEY----- diff --git a/ext/openssl/tests/bug65729.phpt b/ext/openssl/tests/bug65729.phpt new file mode 100644 index 0000000000000..c0ee4443ebee5 --- /dev/null +++ b/ext/openssl/tests/bug65729.phpt @@ -0,0 +1,54 @@ +--TEST-- +Bug #65729: CN_match gives false positive when wildcard is used +--SKIPIF-- + array( + 'verify_peer' => true, + 'allow_self_signed' => true, + 'CN_match' => $expected_name, + ) + )); + var_dump(stream_socket_client("ssl://127.0.0.1:64321", $errno, $errstr, 1, + STREAM_CLIENT_CONNECT, $contextC)); + } +} else { + @pcntl_wait($status); + foreach ($expected_names as $name) { + @stream_socket_accept($server, 1); + } +} +--EXPECTF-- +Warning: stream_socket_client(): Peer certificate CN=`*.test.com' did not match expected CN=`foo.test.com.sg' in %s on line %d + +Warning: stream_socket_client(): Failed to enable crypto in %s on line %d + +Warning: stream_socket_client(): unable to connect to ssl://127.0.0.1:64321 (Unknown error) in %s on line %d +bool(false) +resource(%d) of type (stream) +resource(%d) of type (stream) + +Warning: stream_socket_client(): Peer certificate CN=`*.test.com' did not match expected CN=`foo.bar.test.com' in %s on line %d + +Warning: stream_socket_client(): Failed to enable crypto in %s on line %d + +Warning: stream_socket_client(): unable to connect to ssl://127.0.0.1:64321 (Unknown error) in %s on line %d +bool(false) diff --git a/ext/openssl/tests/openssl_peer_fingerprint.phpt b/ext/openssl/tests/openssl_peer_fingerprint.phpt new file mode 100644 index 0000000000000..2960dffae506e --- /dev/null +++ b/ext/openssl/tests/openssl_peer_fingerprint.phpt @@ -0,0 +1,62 @@ +--TEST-- +Testing peer fingerprint on connection +--SKIPIF-- + array( + 'verify_peer' => true, + 'cafile' => __DIR__ . '/bug54992-ca.pem', + 'capture_peer_cert' => true, + 'peer_fingerprint' => '81cafc260aa8d82956ebc6212a362ece', + ) + ) + ); + // should be: 81cafc260aa8d82956ebc6212a362ecc + var_dump(stream_socket_client("ssl://127.0.0.1:64321", $errno, $errstr, 1, + STREAM_CLIENT_CONNECT, $contextC)); + + $contextC = stream_context_create( + array( + 'ssl' => array( + 'verify_peer' => true, + 'cafile' => __DIR__ . '/bug54992-ca.pem', + 'capture_peer_cert' => true, + 'peer_fingerprint' => array( + 'sha256' => '78ea579f2c3b439359dec5dac9d445108772927427c4780037e87df3799a0aa0', + ), + ) + ) + ); + + var_dump(stream_socket_client("ssl://127.0.0.1:64321", $errno, $errstr, 1, + STREAM_CLIENT_CONNECT, $contextC)); +} else { + @pcntl_wait($status); + @stream_socket_accept($server, 1); + @stream_socket_accept($server, 1); +} +--EXPECTF-- +Warning: stream_socket_client(): Peer fingerprint doesn't match in %s on line %d + +Warning: stream_socket_client(): Failed to enable crypto in %s on line %d + +Warning: stream_socket_client(): unable to connect to ssl://127.0.0.1:64321 (Unknown error) in %s on line %d +bool(false) +resource(9) of type (stream) diff --git a/ext/openssl/tests/openssl_x509_fingerprint.phpt b/ext/openssl/tests/openssl_x509_fingerprint.phpt new file mode 100644 index 0000000000000..6cd464a894872 --- /dev/null +++ b/ext/openssl/tests/openssl_x509_fingerprint.phpt @@ -0,0 +1,47 @@ +--TEST-- +Testing openssl_x509_fingerprint() +--SKIPIF-- + +--FILE-- + array( + 'local_cert' => __DIR__ . '/san-cert.pem', + 'allow_self_signed' => true, + ), +)); + +$server = stream_socket_server('ssl://127.0.0.1:64321', $errno, $errstr, + STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context); + + +$pid = pcntl_fork(); +if ($pid == -1) { + die('could not fork'); +} else if ($pid) { + $contextC = stream_context_create( + array( + 'ssl' => array( + 'verify_peer' => true, + 'cafile' => __DIR__ . '/san-ca.pem', + 'CN_match' => 'example.org', + ) + ) + ); + var_dump(stream_socket_client("ssl://127.0.0.1:64321", $errno, $errstr, 1, + STREAM_CLIENT_CONNECT, $contextC)); + + $contextC = stream_context_create(array( + 'ssl' => array( + 'verify_peer' => true, + 'cafile' => __DIR__ . '/san-ca.pem', + 'CN_match' => 'moar.example.org', + ) + )); + + var_dump(stream_socket_client("ssl://127.0.0.1:64321", $errno, $errstr, 1, + STREAM_CLIENT_CONNECT, $contextC)); + +} else { + @pcntl_wait($status); + @stream_socket_accept($server, 1); + @stream_socket_accept($server, 1); +} +--EXPECTF-- +resource(%d) of type (stream) + +Warning: stream_socket_client(): Unable to locate peer certificate CN in %s on line %d + +Warning: stream_socket_client(): Failed to enable crypto in %s on line %d + +Warning: stream_socket_client(): unable to connect to ssl://127.0.0.1:64321 (Unknown error) in %s on line %d +bool(false) diff --git a/ext/openssl/tests/streams_crypto_method.pem b/ext/openssl/tests/streams_crypto_method.pem new file mode 100644 index 0000000000000..9d754d460d57c --- /dev/null +++ b/ext/openssl/tests/streams_crypto_method.pem @@ -0,0 +1,33 @@ +-----BEGIN CERTIFICATE----- +MIIC5jCCAk+gAwIBAgIBADANBgkqhkiG9w0BAQQFADBcMQswCQYDVQQGEwJBVTET +MBEGA1UECBMKUXVlZW5zbGFuZDEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQx +HDAaBgNVBAMTE1Rlc3QgUENBICgxMDI0IGJpdCkwHhcNOTkxMjAyMjEzNTQ4WhcN +MDUwNzExMjEzNTQ4WjBcMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFu +ZDEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxHDAaBgNVBAMTE1Rlc3QgUENB +ICgxMDI0IGJpdCkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAJ2haT/f5Zwy +V+MiuSDjSR62adBoSiBB7Usty44lXqsp9RICw+DCCxpsn/CfxPEDXLLd4olsWXc6 +JRcxGynbYmnzk+Z6aIPPJQhK3CTvaqGnWKZsA1m+WaUIUqJCuNTK4N+7hMAGaf6S +S3e9HVgEQ4a34gXJ7VQFVIBNV1EnZRWHAgMBAAGjgbcwgbQwHQYDVR0OBBYEFE0R +aEcrj18q1dw+G6nJbsTWR213MIGEBgNVHSMEfTB7gBRNEWhHK49fKtXcPhupyW7E +1kdtd6FgpF4wXDELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQxGjAY +BgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYDVQQDExNUZXN0IFBDQSAoMTAy +NCBiaXQpggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAUa8B3pho ++Mvxeq9HsEzJxHIFQla05S5J/e/V+DQTYoKiRFchKPrDAdrzYSEvP3h4QJEtsNqQ +JfOxg5M42uLFq7aPGWkF6ZZqZsYS+zA9IVT14g7gNA6Ne+5QtJqQtH9HA24st0T0 +Tga/lZ9M2ovImovaxSL/kRHbpCWcqWVxpOw= +-----END CERTIFICATE----- +-----BEGIN RSA PRIVATE KEY----- +MIICXAIBAAKBgQCdoWk/3+WcMlfjIrkg40ketmnQaEogQe1LLcuOJV6rKfUSAsPg +wgsabJ/wn8TxA1yy3eKJbFl3OiUXMRsp22Jp85PmemiDzyUIStwk72qhp1imbANZ +vlmlCFKiQrjUyuDfu4TABmn+kkt3vR1YBEOGt+IFye1UBVSATVdRJ2UVhwIDAQAB +AoGAba4fTtuap5l7/8ZsbE7Z1O32KJY4ZcOZukLOLUUhXxXduT+FTgGWujc0/rgc +z9qYCLlNZHOouMYTgtSfYvuMuLZ11VIt0GYH+nRioLShE59Yy+zCRyC+gPigS1kz +xvo14AsOIPYV14Tk/SsHyq6E0eTk7VzaIE197giiINUERPECQQDSKmtPTh/lRKw7 +HSZSM0I1mFWn/1zqrAbontRQY5w98QWIOe5qmzYyFbPXYT3d9BzlsMyhgiRNoBbD +yvohSHXJAkEAwAHx6ezAZeWWzD5yXD36nyjpkVCw7Tk7TSmOceLJMWt1QcrCfqlS +xA5jjpQ6Z8suU5DdtWAryM2sAir1WisYzwJAd6Zcx56jvAQ3xcPXsE6scBTVFzrj +7FqZ6E+cclPzfLQ+QQsyOBE7bpI6e/FJppY26XGZXo3YGzV8IGXrt40oOQJALETG +h86EFXo3qGOFbmsDy4pdP5nBERCu8X1xUCSfintiD4c2DInxgS5oGclnJeMcjTvL +QjQoJCX3UJCi/OUO1QJBAKgcDHWjMvt+l1pjJBsSEZ0HX9AAIIVx0RQmbFGS+F2Q +hhu5l77WnnZOQ9vvhV5u7NPCUF9nhU3jh60qWWO8mkc= +-----END RSA PRIVATE KEY----- diff --git a/ext/openssl/tests/streams_crypto_method.phpt b/ext/openssl/tests/streams_crypto_method.phpt new file mode 100644 index 0000000000000..97a6e9ee8ba85 --- /dev/null +++ b/ext/openssl/tests/streams_crypto_method.phpt @@ -0,0 +1,77 @@ +--TEST-- +Specific crypto method for ssl:// transports. +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Hello World! diff --git a/ext/openssl/tests/tlsv1.1_wrapper_001.phpt b/ext/openssl/tests/tlsv1.1_wrapper_001.phpt new file mode 100644 index 0000000000000..56211f0b965e0 --- /dev/null +++ b/ext/openssl/tests/tlsv1.1_wrapper_001.phpt @@ -0,0 +1,46 @@ +--TEST-- +tlsv1.1 stream wrapper +--SKIPIF-- + array( + 'local_cert' => __DIR__ . '/streams_crypto_method.pem', +))); + +$server = stream_socket_server('tlsv1.1://127.0.0.1:64321', $errno, $errstr, $flags, $ctx); +var_dump($server); + +$pid = pcntl_fork(); +if ($pid == -1) { + die('could not fork'); +} elseif ($pid) { + $flags = STREAM_CLIENT_CONNECT; + $ctx = stream_context_create(array('ssl' => array( + 'verify_peer' => false + ))); + + $client = stream_socket_client("tlsv1.1://127.0.0.1:64321", $errno, $errstr, 1, $flags, $ctx); + var_dump($client); + + $client = @stream_socket_client("sslv3://127.0.0.1:64321", $errno, $errstr, 1, $flags, $ctx); + var_dump($client); + + $client = @stream_socket_client("tlsv1.2://127.0.0.1:64321", $errno, $errstr, 1, $flags, $ctx); + var_dump($client); + +} else { + @pcntl_wait($status); + for ($i=0; $i < 3; $i++) { + @stream_socket_accept($server, 1); + } +} +--EXPECTF-- +resource(%d) of type (stream) +resource(%d) of type (stream) +bool(false) +bool(false) diff --git a/ext/openssl/tests/tlsv1.2_wrapper_002.phpt b/ext/openssl/tests/tlsv1.2_wrapper_002.phpt new file mode 100644 index 0000000000000..cb3f4106c727e --- /dev/null +++ b/ext/openssl/tests/tlsv1.2_wrapper_002.phpt @@ -0,0 +1,46 @@ +--TEST-- +tlsv1.2 stream wrapper +--SKIPIF-- + array( + 'local_cert' => __DIR__ . '/streams_crypto_method.pem', +))); + +$server = stream_socket_server('tlsv1.2://127.0.0.1:64321', $errno, $errstr, $flags, $ctx); +var_dump($server); + +$pid = pcntl_fork(); +if ($pid == -1) { + die('could not fork'); +} elseif ($pid) { + $flags = STREAM_CLIENT_CONNECT; + $ctx = stream_context_create(array('ssl' => array( + 'verify_peer' => false + ))); + + $client = stream_socket_client("tlsv1.2://127.0.0.1:64321", $errno, $errstr, 1, $flags, $ctx); + var_dump($client); + + $client = @stream_socket_client("sslv3://127.0.0.1:64321", $errno, $errstr, 1, $flags, $ctx); + var_dump($client); + + $client = @stream_socket_client("tlsv1.1://127.0.0.1:64321", $errno, $errstr, 1, $flags, $ctx); + var_dump($client); + +} else { + @pcntl_wait($status); + for ($i=0; $i < 3; $i++) { + @stream_socket_accept($server, 1); + } +} +--EXPECTF-- +resource(%d) of type (stream) +resource(%d) of type (stream) +bool(false) +bool(false) diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index d7ef42e0b1ddd..2e7f0cdc3f676 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -346,6 +346,24 @@ static inline int php_openssl_setup_crypto(php_stream *stream, sslsock->is_client = 1; method = TLSv1_client_method(); break; + case STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT: +#if OPENSSL_VERSION_NUMBER >= 0x10001001L + sslsock->is_client = 1; + method = TLSv1_1_client_method(); + break; +#else + php_error_docref(NULL TSRMLS_CC, E_WARNING, "TLSv1.1 support is not compiled into the OpenSSL library PHP is linked against"); + return -1; +#endif + case STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT: +#if OPENSSL_VERSION_NUMBER >= 0x10001001L + sslsock->is_client = 1; + method = TLSv1_2_client_method(); + break; +#else + php_error_docref(NULL TSRMLS_CC, E_WARNING, "TLSv1.2 support is not compiled into the OpenSSL library PHP is linked against"); + return -1; +#endif case STREAM_CRYPTO_METHOD_SSLv23_SERVER: sslsock->is_client = 0; method = SSLv23_server_method(); @@ -367,6 +385,24 @@ static inline int php_openssl_setup_crypto(php_stream *stream, sslsock->is_client = 0; method = TLSv1_server_method(); break; + case STREAM_CRYPTO_METHOD_TLSv1_1_SERVER: +#if OPENSSL_VERSION_NUMBER >= 0x10001001L + sslsock->is_client = 0; + method = TLSv1_1_server_method(); + break; +#else + php_error_docref(NULL TSRMLS_CC, E_WARNING, "TLSv1.1 support is not compiled into the OpenSSL library PHP is linked against"); + return -1; +#endif + case STREAM_CRYPTO_METHOD_TLSv1_2_SERVER: +#if OPENSSL_VERSION_NUMBER >= 0x10001001L + sslsock->is_client = 0; + method = TLSv1_2_server_method(); + break; +#else + php_error_docref(NULL TSRMLS_CC, E_WARNING, "TLSv1.2 support is not compiled into the OpenSSL library PHP is linked against"); + return -1; +#endif default: return -1; @@ -667,6 +703,12 @@ static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_ case STREAM_CRYPTO_METHOD_TLS_CLIENT: sock->method = STREAM_CRYPTO_METHOD_TLS_SERVER; break; + case STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT: + sock->method = STREAM_CRYPTO_METHOD_TLSv1_1_SERVER; + break; + case STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT: + sock->method = STREAM_CRYPTO_METHOD_TLSv1_2_SERVER; + break; default: break; } @@ -853,8 +895,32 @@ php_stream_ops php_openssl_socket_ops = { php_openssl_sockop_set_option, }; -static char * get_sni(php_stream_context *ctx, const char *resourcename, size_t resourcenamelen, int is_persistent TSRMLS_DC) { +static int get_crypto_method(php_stream_context *ctx) { + if (ctx) { + zval **val = NULL; + long crypto_method; + + if (php_stream_context_get_option(ctx, "ssl", "crypto_method", &val) == SUCCESS) { + convert_to_long_ex(val); + crypto_method = (long)Z_LVAL_PP(val); + + switch (crypto_method) { + case STREAM_CRYPTO_METHOD_SSLv2_CLIENT: + case STREAM_CRYPTO_METHOD_SSLv3_CLIENT: + case STREAM_CRYPTO_METHOD_SSLv23_CLIENT: + case STREAM_CRYPTO_METHOD_TLS_CLIENT: + case STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT: + case STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT: + return crypto_method; + } + + } + } + + return STREAM_CRYPTO_METHOD_SSLv23_CLIENT; +} +static char * get_sni(php_stream_context *ctx, const char *resourcename, size_t resourcenamelen, int is_persistent TSRMLS_DC) { php_url *url; if (ctx) { @@ -939,7 +1005,12 @@ php_stream *php_openssl_ssl_socket_factory(const char *proto, size_t protolen, if (strncmp(proto, "ssl", protolen) == 0) { sslsock->enable_on_connect = 1; - sslsock->method = STREAM_CRYPTO_METHOD_SSLv23_CLIENT; + + /* General ssl:// transports can use a number + * of crypto methods. The actual methhod can be + * provided in the streams context options. + */ + sslsock->method = get_crypto_method(context); } else if (strncmp(proto, "sslv2", protolen) == 0) { #ifdef OPENSSL_NO_SSL2 php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv2 support is not compiled into the OpenSSL library PHP is linked against"); @@ -954,8 +1025,24 @@ php_stream *php_openssl_ssl_socket_factory(const char *proto, size_t protolen, } else if (strncmp(proto, "tls", protolen) == 0) { sslsock->enable_on_connect = 1; sslsock->method = STREAM_CRYPTO_METHOD_TLS_CLIENT; + } else if (strncmp(proto, "tlsv1.1", protolen) == 0) { +#if OPENSSL_VERSION_NUMBER >= 0x10001001L + sslsock->enable_on_connect = 1; + sslsock->method = STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; +#else + php_error_docref(NULL TSRMLS_CC, E_WARNING, "TLSv1.1 support is not compiled into the OpenSSL library PHP is linked against"); + return NULL; +#endif + } else if (strncmp(proto, "tlsv1.2", protolen) == 0) { +#if OPENSSL_VERSION_NUMBER >= 0x10001001L + sslsock->enable_on_connect = 1; + sslsock->method = STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; +#else + php_error_docref(NULL TSRMLS_CC, E_WARNING, "TLSv1.2 support is not compiled into the OpenSSL library PHP is linked against"); + return NULL; +#endif } - + return stream; } diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index aec388c03f5d9..ee74e8592837e 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -1328,16 +1328,12 @@ int pdo_hash_methods(pdo_dbh_t *dbh, int kind TSRMLS_DC) } else { ifunc->required_num_args = info->required_num_args; } - if (info->pass_rest_by_reference) { - if (info->pass_rest_by_reference == ZEND_SEND_PREFER_REF) { - ifunc->fn_flags |= ZEND_ACC_PASS_REST_PREFER_REF; - } else { - ifunc->fn_flags |= ZEND_ACC_PASS_REST_BY_REFERENCE; - } - } if (info->return_reference) { ifunc->fn_flags |= ZEND_ACC_RETURN_REFERENCE; } + if (funcs->arg_info[funcs->num_args].is_variadic) { + ifunc->fn_flags |= ZEND_ACC_VARIADIC; + } } else { ifunc->arg_info = NULL; ifunc->num_args = 0; diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c index b49ad2691f645..daf5494d5839f 100644 --- a/ext/pdo_dblib/dblib_driver.c +++ b/ext/pdo_dblib/dblib_driver.c @@ -350,9 +350,10 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_ DBSETLAPP(H->login, vars[1].optval); +/* DBSETLDBNAME is only available in FreeTDS 0.92 or above */ #ifdef DBSETLDBNAME if (vars[3].optval) { - DBSETLDBNAME(H->login, vars[3].optval); + if(FAIL == DBSETLDBNAME(H->login, vars[3].optval)) goto cleanup; } #endif @@ -362,36 +363,31 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_ goto cleanup; } +/* + * FreeTDS < 0.92 does not support the DBSETLDBNAME option + * Send use database here after login (Will not work with SQL Azure) + */ +#ifndef DBSETLDBNAME + if (vars[3].optval) { + if(FAIL == dbuse(H->link, vars[3].optval)) goto cleanup; + } +#endif + +#if PHP_DBLIB_IS_MSSQL /* dblib do not return more than this length from text/image */ DBSETOPT(H->link, DBTEXTLIMIT, "2147483647"); +#endif /* limit text/image from network */ DBSETOPT(H->link, DBTEXTSIZE, "2147483647"); /* allow double quoted indentifiers */ - DBSETOPT(H->link, DBQUOTEDIDENT, NULL); + DBSETOPT(H->link, DBQUOTEDIDENT, "1"); ret = 1; dbh->max_escaped_char_length = 2; dbh->alloc_own_columns = 1; -#if 0 - /* Cache the supported data types from the servers systypes table */ - if(dbcmd(H->link, "select usertype, name from systypes order by usertype") != FAIL) { - if(dbsqlexec(H->link) != FAIL) { - dbresults(H->link); - while (dbnextrow(H->link) == SUCCESS) { - val = dbdata(H->link, 1); - add_index_string(pdo_dblib_datatypes, *val, dbdata(H->link, 2), 1); - } - } - /* Throw out any remaining resultsets */ - dbcancel(H-link); - } -#endif - - - cleanup: for (i = 0; i < nvars; i++) { if (vars[i].freeme) { diff --git a/ext/pdo_firebird/CREDITS b/ext/pdo_firebird/CREDITS index a33294b69c0e6..60b917415db69 100644 --- a/ext/pdo_firebird/CREDITS +++ b/ext/pdo_firebird/CREDITS @@ -1,2 +1,2 @@ -Firebird/InterBase driver for PDO +Firebird driver for PDO Ard Biesheuvel diff --git a/ext/pdo_firebird/package2.xml b/ext/pdo_firebird/package2.xml index 5b5984c80fa56..b744d388bc0d5 100644 --- a/ext/pdo_firebird/package2.xml +++ b/ext/pdo_firebird/package2.xml @@ -5,9 +5,9 @@ http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> PDO_FIREBIRD pecl.php.net - Firebird/InterBase 6 driver for PDO - This extension provides a Firebird/InterBase driver for PDO. It supports -all versions of Firebird and InterBase versions 6 and up. + Firebird driver for PDO + This extension provides a Firebird driver for PDO. It supports +all versions of Firebird 2.1 and up. Ard Biesheuvel @@ -15,18 +15,17 @@ all versions of Firebird and InterBase versions 6 and up. abies@php.net yes - 2006-05-01 + 2013-09-01 - 0.3 - 0.3 + 1.0 + 1.0 - beta - beta + stable + stable PHP - To compile and run this module, you will need to have the main PDO module and Firebird's -or InterBase's client library installed on your system. + To compile and run this module, you will need to have the main PDO module and Firebird's client library installed on your system. Hope it works! @@ -49,7 +48,7 @@ Hope it works! - 5.0.3 + 5.3.27 1.4.0 diff --git a/ext/phar/config.m4 b/ext/phar/config.m4 index d424060f2a247..614d672eabd9d 100644 --- a/ext/phar/config.m4 +++ b/ext/phar/config.m4 @@ -28,5 +28,7 @@ if test "$PHP_PHAR" != "no"; then PHP_ADD_EXTENSION_DEP(phar, spl, true) PHP_ADD_MAKEFILE_FRAGMENT + PHP_INSTALL_HEADERS([ext/phar], [php_phar.h]) + PHP_OUTPUT(ext/phar/phar.1 ext/phar/phar.phar.1) fi diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c index b090577306758..62b19a79d929d 100644 --- a/ext/phar/dirstream.c +++ b/ext/phar/dirstream.c @@ -94,31 +94,23 @@ static size_t phar_dir_read(php_stream *stream, char *buf, size_t count TSRMLS_D { size_t to_read; HashTable *data = (HashTable *)stream->abstract; - phar_zstr key; char *str_key; uint keylen; ulong unused; - if (FAILURE == zend_hash_has_more_elements(data)) { + if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(data, &str_key, &keylen, &unused, 0, NULL)) { return 0; } - if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(data, &key, &keylen, &unused, 0, NULL)) { - return 0; - } - - PHAR_STR(key, str_key); zend_hash_move_forward(data); to_read = MIN(keylen, count); if (to_read == 0 || count < keylen) { - PHAR_STR_FREE(str_key); return 0; } memset(buf, 0, sizeof(php_stream_dirent)); memcpy(((php_stream_dirent *) buf)->d_name, str_key, to_read); - PHAR_STR_FREE(str_key); ((php_stream_dirent *) buf)->d_name[to_read + 1] = '\0'; return sizeof(php_stream_dirent); @@ -193,13 +185,12 @@ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest TSRMLS_DC) { HashTable *data; int dirlen = strlen(dir); - phar_zstr key; char *entry, *found, *save, *str_key; uint keylen; ulong unused; ALLOC_HASHTABLE(data); - zend_hash_init(data, 64, zend_get_hash_value, NULL, 0); + zend_hash_init(data, 64, NULL, NULL, 0); if ((*dir == '/' && dirlen == 1 && (manifest->nNumOfElements == 0)) || (dirlen >= sizeof(".phar")-1 && !memcmp(dir, ".phar", sizeof(".phar")-1))) { /* make empty root directory for empty phar */ @@ -211,15 +202,12 @@ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest TSRMLS_DC) zend_hash_internal_pointer_reset(manifest); while (FAILURE != zend_hash_has_more_elements(manifest)) { - if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(manifest, &key, &keylen, &unused, 0, NULL)) { + if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(manifest, &str_key, &keylen, &unused, 0, NULL)) { break; } - PHAR_STR(key, str_key); - if (keylen <= (uint)dirlen) { if (keylen < (uint)dirlen || !strncmp(str_key, dir, dirlen)) { - PHAR_STR_FREE(str_key); if (SUCCESS != zend_hash_move_forward(manifest)) { break; } @@ -230,7 +218,6 @@ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest TSRMLS_DC) if (*dir == '/') { /* root directory */ if (keylen >= sizeof(".phar")-1 && !memcmp(str_key, ".phar", sizeof(".phar")-1)) { - PHAR_STR_FREE(str_key); /* do not add any magic entries to this directory */ if (SUCCESS != zend_hash_move_forward(manifest)) { break; @@ -250,19 +237,16 @@ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest TSRMLS_DC) entry[keylen] = '\0'; } - PHAR_STR_FREE(str_key); goto PHAR_ADD_ENTRY; } else { if (0 != memcmp(str_key, dir, dirlen)) { /* entry in directory not found */ - PHAR_STR_FREE(str_key); if (SUCCESS != zend_hash_move_forward(manifest)) { break; } continue; } else { if (str_key[dirlen] != '/') { - PHAR_STR_FREE(str_key); if (SUCCESS != zend_hash_move_forward(manifest)) { break; } @@ -289,7 +273,6 @@ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest TSRMLS_DC) entry[keylen - dirlen - 1] = '\0'; keylen = keylen - dirlen - 1; } - PHAR_STR_FREE(str_key); PHAR_ADD_ENTRY: if (keylen) { phar_add_empty(data, entry, keylen); @@ -324,7 +307,6 @@ php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path, php_url *resource = NULL; php_stream *ret; char *internal_file, *error, *str_key; - phar_zstr key; uint keylen; ulong unused; phar_archive_data *phar; @@ -405,17 +387,14 @@ php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path, while (FAILURE != zend_hash_has_more_elements(&phar->manifest)) { if (HASH_KEY_NON_EXISTENT != zend_hash_get_current_key_ex( - &phar->manifest, &key, &keylen, &unused, 0, NULL)) { - PHAR_STR(key, str_key); + &phar->manifest, &str_key, &keylen, &unused, 0, NULL)) { if (keylen > (uint)i_len && 0 == memcmp(str_key, internal_file, i_len)) { - PHAR_STR_FREE(str_key); /* directory found */ internal_file = estrndup(internal_file, i_len); php_url_free(resource); return phar_make_dirstream(internal_file, &phar->manifest TSRMLS_CC); } - PHAR_STR_FREE(str_key); } if (SUCCESS != zend_hash_move_forward(&phar->manifest)) { @@ -572,7 +551,6 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options int arch_len, entry_len; php_url *resource = NULL; uint host_len; - phar_zstr key; char *str_key; uint key_len; ulong unused; @@ -637,15 +615,12 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options if (!entry->is_deleted) { for (zend_hash_internal_pointer_reset(&phar->manifest); - HASH_KEY_NON_EXISTENT != zend_hash_get_current_key_ex(&phar->manifest, &key, &key_len, &unused, 0, NULL); - zend_hash_move_forward(&phar->manifest)) { - - PHAR_STR(key, str_key); - + HASH_KEY_NON_EXISTENT != zend_hash_get_current_key_ex(&phar->manifest, &str_key, &key_len, &unused, 0, NULL); + zend_hash_move_forward(&phar->manifest) + ) { if (key_len > path_len && memcmp(str_key, resource->path+1, path_len) == 0 && IS_SLASH(str_key[path_len])) { - PHAR_STR_FREE(str_key); php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: Directory not empty"); if (entry->is_temp_dir) { efree(entry->filename); @@ -654,19 +629,15 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options php_url_free(resource); return 0; } - PHAR_STR_FREE(str_key); } for (zend_hash_internal_pointer_reset(&phar->virtual_dirs); - HASH_KEY_NON_EXISTENT != zend_hash_get_current_key_ex(&phar->virtual_dirs, &key, &key_len, &unused, 0, NULL); + HASH_KEY_NON_EXISTENT != zend_hash_get_current_key_ex(&phar->virtual_dirs, &str_key, &key_len, &unused, 0, NULL); zend_hash_move_forward(&phar->virtual_dirs)) { - PHAR_STR(key, str_key); - if (key_len > path_len && memcmp(str_key, resource->path+1, path_len) == 0 && IS_SLASH(str_key[path_len])) { - PHAR_STR_FREE(str_key); php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: Directory not empty"); if (entry->is_temp_dir) { efree(entry->filename); @@ -675,7 +646,6 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options php_url_free(resource); return 0; } - PHAR_STR_FREE(str_key); } } diff --git a/ext/phar/phar.c b/ext/phar/phar.c index e8d1139cfa862..79f88b4362c0c 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -27,9 +27,7 @@ static void destroy_phar_data(void *pDest); ZEND_DECLARE_MODULE_GLOBALS(phar) -#if PHP_VERSION_ID >= 50300 char *(*phar_save_resolve_path)(const char *filename, int filename_len TSRMLS_DC); -#endif /** * set's phar->is_writeable based on the current INI value @@ -1641,7 +1639,7 @@ static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *a php_stream_filter_append(&temp->writefilters, filter); - if (SUCCESS != phar_stream_copy_to_stream(fp, temp, PHP_STREAM_COPY_ALL, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(fp, temp, PHP_STREAM_COPY_ALL, NULL)) { if (err) { php_stream_close(temp); MAPPHAR_ALLOC_FAIL("unable to decompress gzipped phar archive \"%s\", ext/zlib is buggy in PHP versions older than 5.2.6") @@ -1683,7 +1681,7 @@ static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *a php_stream_filter_append(&temp->writefilters, filter); - if (SUCCESS != phar_stream_copy_to_stream(fp, temp, PHP_STREAM_COPY_ALL, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(fp, temp, PHP_STREAM_COPY_ALL, NULL)) { php_stream_close(temp); MAPPHAR_ALLOC_FAIL("unable to decompress bzipped phar archive \"%s\" to temporary file") } @@ -1956,67 +1954,45 @@ int phar_detect_phar_fname_ext(const char *filename, int filename_len, const cha goto woohoo; } } else { - phar_zstr key; char *str_key; uint keylen; ulong unused; - zend_hash_internal_pointer_reset(&(PHAR_GLOBALS->phar_fname_map)); - - while (FAILURE != zend_hash_has_more_elements(&(PHAR_GLOBALS->phar_fname_map))) { - if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(&(PHAR_GLOBALS->phar_fname_map), &key, &keylen, &unused, 0, NULL)) { - break; - } - - PHAR_STR(key, str_key); - + for (zend_hash_internal_pointer_reset(&(PHAR_GLOBALS->phar_fname_map)); + HASH_KEY_NON_EXISTENT != zend_hash_get_current_key_ex(&(PHAR_GLOBALS->phar_fname_map), &str_key, &keylen, &unused, 0, NULL); + zend_hash_move_forward(&(PHAR_GLOBALS->phar_fname_map)) + ) { if (keylen > (uint) filename_len) { - zend_hash_move_forward(&(PHAR_GLOBALS->phar_fname_map)); - PHAR_STR_FREE(str_key); continue; } if (!memcmp(filename, str_key, keylen) && ((uint)filename_len == keylen || filename[keylen] == '/' || filename[keylen] == '\0')) { - PHAR_STR_FREE(str_key); if (FAILURE == zend_hash_get_current_data(&(PHAR_GLOBALS->phar_fname_map), (void **) &pphar)) { break; } *ext_str = filename + (keylen - (*pphar)->ext_len); goto woohoo; } - - PHAR_STR_FREE(str_key); - zend_hash_move_forward(&(PHAR_GLOBALS->phar_fname_map)); } if (PHAR_G(manifest_cached)) { - zend_hash_internal_pointer_reset(&cached_phars); - - while (FAILURE != zend_hash_has_more_elements(&cached_phars)) { - if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(&cached_phars, &key, &keylen, &unused, 0, NULL)) { - break; - } - - PHAR_STR(key, str_key); - + for (zend_hash_internal_pointer_reset(&cached_phars); + HASH_KEY_NON_EXISTENT != zend_hash_get_current_key_ex(&cached_phars, &str_key, &keylen, &unused, 0, NULL); + zend_hash_move_forward(&cached_phars) + ) { if (keylen > (uint) filename_len) { - zend_hash_move_forward(&cached_phars); - PHAR_STR_FREE(str_key); continue; } if (!memcmp(filename, str_key, keylen) && ((uint)filename_len == keylen || filename[keylen] == '/' || filename[keylen] == '\0')) { - PHAR_STR_FREE(str_key); if (FAILURE == zend_hash_get_current_data(&cached_phars, (void **) &pphar)) { break; } *ext_str = filename + (keylen - (*pphar)->ext_len); goto woohoo; } - PHAR_STR_FREE(str_key); - zend_hash_move_forward(&cached_phars); } } } @@ -2701,7 +2677,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, long len, int convert, size_t written; if (!user_stub && phar->halt_offset && oldfile && !phar->is_brandnew) { - phar_stream_copy_to_stream(oldfile, newfile, phar->halt_offset, &written); + php_stream_copy_to_stream_ex(oldfile, newfile, phar->halt_offset, &written); newstub = NULL; } else { /* this is either a brand new phar or a default stub overwrite */ @@ -2889,7 +2865,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, long len, int convert, return EOF; } php_stream_filter_append((&entry->cfp->writefilters), filter); - if (SUCCESS != phar_stream_copy_to_stream(file, entry->cfp, entry->uncompressed_filesize, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(file, entry->cfp, entry->uncompressed_filesize, NULL)) { if (closeoldfile) { php_stream_close(oldfile); } @@ -3121,7 +3097,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, long len, int convert, /* this will have changed for all files that have either changed compression or been modified */ entry->offset = entry->offset_abs = offset; offset += entry->compressed_filesize; - if (phar_stream_copy_to_stream(file, newfile, entry->compressed_filesize, &wrote) == FAILURE) { + if (php_stream_copy_to_stream_ex(file, newfile, entry->compressed_filesize, &wrote) == FAILURE) { if (closeoldfile) { php_stream_close(oldfile); } @@ -3267,7 +3243,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, long len, int convert, } php_stream_filter_append(&phar->fp->writefilters, filter); - phar_stream_copy_to_stream(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL); + php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL); php_stream_filter_flush(filter, 1); php_stream_filter_remove(filter, 1 TSRMLS_CC); php_stream_close(phar->fp); @@ -3276,14 +3252,14 @@ int phar_flush(phar_archive_data *phar, char *user_stub, long len, int convert, } else if (phar->flags & PHAR_FILE_COMPRESSED_BZ2) { filter = php_stream_filter_create("bzip2.compress", NULL, php_stream_is_persistent(phar->fp) TSRMLS_CC); php_stream_filter_append(&phar->fp->writefilters, filter); - phar_stream_copy_to_stream(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL); + php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL); php_stream_filter_flush(filter, 1); php_stream_filter_remove(filter, 1 TSRMLS_CC); php_stream_close(phar->fp); /* use the temp stream as our base */ phar->fp = newfile; } else { - phar_stream_copy_to_stream(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL); + php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL); /* we could also reopen the file in "rb" mode but there is no need for that */ php_stream_close(newfile); } @@ -3319,31 +3295,17 @@ static size_t phar_zend_stream_reader(void *handle, char *buf, size_t len TSRMLS } /* }}} */ -#if PHP_VERSION_ID >= 50300 static size_t phar_zend_stream_fsizer(void *handle TSRMLS_DC) /* {{{ */ { return ((phar_archive_data*)handle)->halt_offset + 32; } /* }}} */ -#else /* PHP_VERSION_ID */ - -static long phar_stream_fteller_for_zend(void *handle TSRMLS_DC) /* {{{ */ -{ - return (long)php_stream_tell(phar_get_pharfp((phar_archive_data*)handle TSRMLS_CC)); -} -/* }}} */ -#endif - zend_op_array *(*phar_orig_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC); -#if PHP_VERSION_ID >= 50300 #define phar_orig_zend_open zend_stream_open_function static char *phar_resolve_path(const char *filename, int filename_len TSRMLS_DC) { return phar_find_in_include_path((char *) filename, filename_len, NULL TSRMLS_CC); } -#else -int (*phar_orig_zend_open)(const char *filename, zend_file_handle *handle TSRMLS_DC); -#endif static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC) /* {{{ */ { @@ -3376,7 +3338,6 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type } } else if (phar->flags & PHAR_FILE_COMPRESSION_MASK) { /* compressed phar */ -#if PHP_VERSION_ID >= 50300 file_handle->type = ZEND_HANDLE_STREAM; /* we do our own reading directly from the phar, don't change the next line */ file_handle->handle.stream.handle = phar; @@ -3388,18 +3349,6 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type php_stream_rewind(PHAR_GLOBALS->cached_fp[phar->phar_pos].fp) : php_stream_rewind(phar->fp); memset(&file_handle->handle.stream.mmap, 0, sizeof(file_handle->handle.stream.mmap)); -#else /* PHP_VERSION_ID */ - file_handle->type = ZEND_HANDLE_STREAM; - /* we do our own reading directly from the phar, don't change the next line */ - file_handle->handle.stream.handle = phar; - file_handle->handle.stream.reader = phar_zend_stream_reader; - file_handle->handle.stream.closer = NULL; /* don't close - let phar handle this one */ - file_handle->handle.stream.fteller = phar_stream_fteller_for_zend; - file_handle->handle.stream.interactive = 0; - phar->is_persistent ? - php_stream_rewind(PHAR_GLOBALS->cached_fp[phar->phar_pos].fp) : - php_stream_rewind(phar->fp); -#endif } } } @@ -3424,60 +3373,6 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type } /* }}} */ -#if PHP_VERSION_ID < 50300 -int phar_zend_open(const char *filename, zend_file_handle *handle TSRMLS_DC) /* {{{ */ -{ - char *arch, *entry; - int arch_len, entry_len; - - /* this code is obsoleted in php 5.3 */ - entry = (char *) filename; - if (!IS_ABSOLUTE_PATH(entry, strlen(entry)) && !strstr(entry, "://")) { - phar_archive_data **pphar = NULL; - char *fname; - int fname_len; - - fname = (char*)zend_get_executed_filename(TSRMLS_C); - fname_len = strlen(fname); - - if (fname_len > 7 && !strncasecmp(fname, "phar://", 7)) { - if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 1, 0 TSRMLS_CC)) { - zend_hash_find(&(PHAR_GLOBALS->phar_fname_map), arch, arch_len, (void **) &pphar); - if (!pphar && PHAR_G(manifest_cached)) { - zend_hash_find(&cached_phars, arch, arch_len, (void **) &pphar); - } - efree(arch); - efree(entry); - } - } - - /* retrieving an include within the current directory, so use this if possible */ - if (!(entry = phar_find_in_include_path((char *) filename, strlen(filename), NULL TSRMLS_CC))) { - /* this file is not in the phar, use the original path */ - goto skip_phar; - } - - if (SUCCESS == phar_orig_zend_open(entry, handle TSRMLS_CC)) { - if (!handle->opened_path) { - handle->opened_path = entry; - } - if (entry != filename) { - handle->free_filename = 1; - } - return SUCCESS; - } - - if (entry != filename) { - efree(entry); - } - - return FAILURE; - } -skip_phar: - return phar_orig_zend_open(filename, handle TSRMLS_CC); -} -/* }}} */ -#endif typedef zend_op_array* (zend_compile_t)(zend_file_handle*, int TSRMLS_DC); typedef zend_compile_t* (compile_hook)(zend_compile_t *ptr); @@ -3554,13 +3449,8 @@ PHP_MINIT_FUNCTION(phar) /* {{{ */ phar_orig_compile_file = zend_compile_file; zend_compile_file = phar_compile_file; -#if PHP_VERSION_ID >= 50300 phar_save_resolve_path = zend_resolve_path; zend_resolve_path = phar_resolve_path; -#else - phar_orig_zend_open = zend_stream_open_function; - zend_stream_open_function = phar_zend_open; -#endif phar_object_init(TSRMLS_C); @@ -3581,11 +3471,6 @@ PHP_MSHUTDOWN_FUNCTION(phar) /* {{{ */ zend_compile_file = phar_orig_compile_file; } -#if PHP_VERSION_ID < 50300 - if (zend_stream_open_function == phar_zend_open) { - zend_stream_open_function = phar_orig_zend_open; - } -#endif if (PHAR_G(manifest_cached)) { zend_hash_destroy(&(cached_phars)); zend_hash_destroy(&(cached_alias)); diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index e0a9faf38fb2c..64953f66b72d3 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -68,19 +68,6 @@ #include "ext/hash/php_hash_sha.h" #endif -#ifndef E_RECOVERABLE_ERROR -# define E_RECOVERABLE_ERROR E_ERROR -#endif - -#ifndef pestrndup -# define pestrndup(s, length, persistent) ((persistent)?zend_strndup((s),(length)):estrndup((s),(length))) -#endif - -#ifndef ALLOC_PERMANENT_ZVAL -# define ALLOC_PERMANENT_ZVAL(z) \ - (z) = (zval*)malloc(sizeof(zval)) -#endif - /* PHP_ because this is public information via MINFO */ #define PHP_PHAR_API_VERSION "1.1.1" /* x.y.z maps to 0xyz0 */ @@ -513,75 +500,7 @@ union _phar_entry_object { #endif #ifndef PHAR_MAIN -# if PHP_VERSION_ID >= 50300 extern char *(*phar_save_resolve_path)(const char *filename, int filename_len TSRMLS_DC); -# endif -#endif - -#if PHP_VERSION_ID < 50209 -static inline size_t phar_stream_copy_to_stream(php_stream *src, php_stream *dest, size_t maxlen, size_t *len STREAMS_DC TSRMLS_DC) -{ - size_t ret = php_stream_copy_to_stream(src, dest, maxlen); - if (len) { - *len = ret; - } - if (ret) { - return SUCCESS; - } - return FAILURE; -} -#else -# define phar_stream_copy_to_stream(src, dest, maxlen, len) _php_stream_copy_to_stream_ex((src), (dest), (maxlen), (len) STREAMS_CC TSRMLS_CC) - -#endif - -#if PHP_VERSION_ID >= 60000 -typedef zstr phar_zstr; -#define PHAR_STR(a, b) \ - spprintf(&b, 0, "%s", a.s); -#define PHAR_ZSTR(a, b) \ - b = ZSTR(a); -#define PHAR_STR_FREE(a) \ - efree(a); -static inline int phar_make_unicode(zstr *c_var, char *arKey, uint nKeyLength TSRMLS_DC) -{ - int c_var_len; - UConverter *conv = ZEND_U_CONVERTER(UG(runtime_encoding_conv)); - - c_var->u = NULL; - if (zend_string_to_unicode(conv, &c_var->u, &c_var_len, arKey, nKeyLength TSRMLS_CC) == FAILURE) { - - if (c_var->u) { - efree(c_var->u); - } - return 0; - - } - return c_var_len; -} -static inline int phar_find_key(HashTable *_SERVER, char *key, int len, void **stuff TSRMLS_DC) -{ - if (SUCCESS == zend_hash_find(_SERVER, key, len, stuff)) { - return 1; - } else { - int s = len; - zstr var; - s = phar_make_unicode(&var, key, len TSRMLS_CC); - if (SUCCESS == zend_u_hash_find(_SERVER, IS_UNICODE, var, s, stuff)) { - efree(var.u); - return 1; - } - efree(var.u); - return 0; - } -} -#else -typedef char *phar_zstr; -#define PHAR_STR(a, b) \ - b = a; -#define PHAR_ZSTR(a, b) \ - b = a; -#define PHAR_STR_FREE(a) #endif BEGIN_EXTERN_C() diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index dcb67fe9fa6e4..7c11a48f9cc87 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -685,11 +685,7 @@ PHP_METHOD(Phar, webPhar) ZVAL_STRINGL(params, entry, entry_len, 1); zp[0] = ¶ms; -#if PHP_VERSION_ID < 50300 - if (FAILURE == zend_fcall_info_init(rewrite, &fci, &fcc TSRMLS_CC)) { -#else if (FAILURE == zend_fcall_info_init(rewrite, 0, &fci, &fcc, NULL, NULL TSRMLS_CC)) { -#endif zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar error: invalid rewrite callback"); if (free_pathinfo) { @@ -701,11 +697,7 @@ PHP_METHOD(Phar, webPhar) fci.param_count = 1; fci.params = zp; -#if PHP_VERSION_ID < 50300 - ++(params->refcount); -#else Z_ADDREF_P(params); -#endif fci.retval_ptr_ptr = &retval_ptr; if (FAILURE == zend_call_function(&fci, &fcc TSRMLS_CC)) { @@ -729,11 +721,6 @@ PHP_METHOD(Phar, webPhar) } switch (Z_TYPE_P(retval_ptr)) { -#if PHP_VERSION_ID >= 60000 - case IS_UNICODE: - zval_unicode_to_string(retval_ptr TSRMLS_CC); - /* break intentionally omitted */ -#endif case IS_STRING: efree(entry); @@ -1155,11 +1142,7 @@ PHP_METHOD(Phar, __construct) #else char *fname, *alias = NULL, *error, *arch = NULL, *entry = NULL, *save_fname; int fname_len, alias_len = 0, arch_len, entry_len, is_data; -#if PHP_VERSION_ID < 50300 - long flags = 0; -#else long flags = SPL_FILE_DIR_SKIPDOTS|SPL_FILE_DIR_UNIXPATHS; -#endif long format = 0; phar_archive_object *phar_obj; phar_archive_data *phar_data; @@ -1459,11 +1442,6 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ } switch (Z_TYPE_PP(value)) { -#if PHP_VERSION_ID >= 60000 - case IS_UNICODE: - zval_unicode_to_string(*(value) TSRMLS_CC); - /* break intentionally omitted */ -#endif case IS_STRING: break; case IS_RESOURCE: @@ -1514,13 +1492,7 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ switch (intern->type) { case SPL_FS_DIR: -#if PHP_VERSION_ID >= 60000 - test = spl_filesystem_object_get_path(intern, NULL, NULL TSRMLS_CC).s; -#elif PHP_VERSION_ID >= 50300 test = spl_filesystem_object_get_path(intern, NULL TSRMLS_CC); -#else - test = intern->path; -#endif fname_len = spprintf(&fname, 0, "%s%c%s", test, DEFAULT_SLASH, intern->u.dir.entry.d_name); php_stat(fname, fname_len, FS_IS_DIR, &dummy TSRMLS_CC); @@ -1545,25 +1517,7 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ goto phar_spl_fileinfo; case SPL_FS_INFO: case SPL_FS_FILE: -#if PHP_VERSION_ID >= 60000 - if (intern->file_name_type == IS_UNICODE) { - zval zv; - - INIT_ZVAL(zv); - Z_UNIVAL(zv) = intern->file_name; - Z_UNILEN(zv) = intern->file_name_len; - Z_TYPE(zv) = IS_UNICODE; - - zval_copy_ctor(&zv); - zval_unicode_to_string(&zv TSRMLS_CC); - fname = expand_filepath(Z_STRVAL(zv), NULL TSRMLS_CC); - ezfree(Z_UNIVAL(zv)); - } else { - fname = expand_filepath(intern->file_name.s, NULL TSRMLS_CC); - } -#else fname = expand_filepath(intern->file_name, NULL TSRMLS_CC); -#endif if (!fname) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Could not resolve file path"); return ZEND_HASH_APPLY_STOP; @@ -1753,7 +1707,7 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ data->internal_file->fp_type = PHAR_UFP; data->internal_file->offset_abs = data->internal_file->offset = php_stream_tell(p_obj->fp); data->fp = NULL; - phar_stream_copy_to_stream(fp, p_obj->fp, PHP_STREAM_COPY_ALL, &contents_len); + php_stream_copy_to_stream_ex(fp, p_obj->fp, PHP_STREAM_COPY_ALL, &contents_len); data->internal_file->uncompressed_filesize = data->internal_file->compressed_filesize = php_stream_tell(p_obj->fp) - data->internal_file->offset; } @@ -1816,11 +1770,7 @@ PHP_METHOD(Phar, buildFromDirectory) INIT_PZVAL(&arg); ZVAL_STRINGL(&arg, dir, dir_len, 0); INIT_PZVAL(&arg2); -#if PHP_VERSION_ID < 50300 - ZVAL_LONG(&arg2, 0); -#else ZVAL_LONG(&arg2, SPL_FILE_DIR_SKIPDOTS|SPL_FILE_DIR_UNIXPATHS); -#endif zend_call_method_with_2_params(&iter, spl_ce_RecursiveDirectoryIterator, &spl_ce_RecursiveDirectoryIterator->constructor, "__construct", NULL, &arg, &arg2); @@ -2047,7 +1997,7 @@ static int phar_copy_file_contents(phar_entry_info *entry, php_stream *fp TSRMLS link = entry; } - if (SUCCESS != phar_stream_copy_to_stream(phar_get_efp(link, 0 TSRMLS_CC), fp, link->uncompressed_filesize, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(link, 0 TSRMLS_CC), fp, link->uncompressed_filesize, NULL)) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Cannot convert phar archive \"%s\", unable to copy entry \"%s\" contents", entry->phar->fname, entry->filename); return FAILURE; @@ -2313,11 +2263,7 @@ static zval *phar_convert_to_other(phar_archive_data *source, int convert, char ALLOC_ZVAL(phar->metadata); *phar->metadata = *t; zval_copy_ctor(phar->metadata); -#if PHP_VERSION_ID < 50300 - phar->metadata->refcount = 1; -#else Z_SET_REFCOUNT_P(phar->metadata, 1); -#endif phar->metadata_len = 0; } @@ -2365,11 +2311,7 @@ static zval *phar_convert_to_other(phar_archive_data *source, int convert, char ALLOC_ZVAL(newentry.metadata); *newentry.metadata = *t; zval_copy_ctor(newentry.metadata); -#if PHP_VERSION_ID < 50300 - newentry.metadata->refcount = 1; -#else Z_SET_REFCOUNT_P(newentry.metadata, 1); -#endif newentry.metadata_str.c = NULL; newentry.metadata_str.len = 0; @@ -3552,11 +3494,7 @@ PHP_METHOD(Phar, copy) ALLOC_ZVAL(newentry.metadata); *newentry.metadata = *t; zval_copy_ctor(newentry.metadata); -#if PHP_VERSION_ID < 50300 - newentry.metadata->refcount = 1; -#else Z_SET_REFCOUNT_P(newentry.metadata, 1); -#endif newentry.metadata_str.c = NULL; newentry.metadata_str.len = 0; @@ -3713,7 +3651,7 @@ static void phar_add_file(phar_archive_data **pphar, char *filename, int filenam zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Entry %s could not be written to", filename); return; } - phar_stream_copy_to_stream(contents_file, data->fp, PHP_STREAM_COPY_ALL, &contents_len); + php_stream_copy_to_stream_ex(contents_file, data->fp, PHP_STREAM_COPY_ALL, &contents_len); } data->internal_file->compressed_filesize = data->internal_file->uncompressed_filesize = contents_len; @@ -4286,7 +4224,7 @@ static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char * return FAILURE; } - if (SUCCESS != phar_stream_copy_to_stream(phar_get_efp(entry, 0 TSRMLS_CC), fp, entry->uncompressed_filesize, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0 TSRMLS_CC), fp, entry->uncompressed_filesize, NULL)) { spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", copying contents failed", entry->filename, fullpath); efree(fullpath); php_stream_close(fp); @@ -4371,11 +4309,6 @@ PHP_METHOD(Phar, extractTo) switch (Z_TYPE_P(zval_files)) { case IS_NULL: goto all_files; -#if PHP_VERSION_ID >= 60000 - case IS_UNICODE: - zval_unicode_to_string(zval_files TSRMLS_CC); - /* break intentionally omitted */ -#endif case IS_STRING: filename = Z_STRVAL_P(zval_files); filename_len = Z_STRLEN_P(zval_files); @@ -4389,11 +4322,6 @@ PHP_METHOD(Phar, extractTo) zval **zval_file; if (zend_hash_index_find(Z_ARRVAL_P(zval_files), i, (void **) &zval_file) == SUCCESS) { switch (Z_TYPE_PP(zval_file)) { -#if PHP_VERSION_ID >= 60000 - case IS_UNICODE: - zval_unicode_to_string(*(zval_file) TSRMLS_CC); - /* break intentionally omitted */ -#endif case IS_STRING: break; default: @@ -5414,11 +5342,7 @@ zend_function_entry phar_exception_methods[] = { #define REGISTER_PHAR_CLASS_CONST_LONG(class_name, const_name, value) \ zend_declare_class_constant_long(class_name, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC); -#if PHP_VERSION_ID < 50200 -# define phar_exception_get_default() zend_exception_get_default() -#else -# define phar_exception_get_default() zend_exception_get_default(TSRMLS_C) -#endif +#define phar_exception_get_default() zend_exception_get_default(TSRMLS_C) void phar_object_init(TSRMLS_D) /* {{{ */ { diff --git a/ext/phar/php_phar.h b/ext/phar/php_phar.h index a6d7bff414b8c..f8325d0c635e3 100644 --- a/ext/phar/php_phar.h +++ b/ext/phar/php_phar.h @@ -22,7 +22,7 @@ #ifndef PHP_PHAR_H #define PHP_PHAR_H -#define PHP_PHAR_VERSION "2.0.1" +#define PHP_PHAR_VERSION "2.0.2" #include "ext/standard/basic_functions.h" extern zend_module_entry phar_module_entry; @@ -31,9 +31,11 @@ extern zend_module_entry phar_module_entry; #ifdef PHP_WIN32 #define PHP_PHAR_API __declspec(dllexport) #else -#define PHP_PHAR_API +#define PHP_PHAR_API PHPAPI #endif +PHP_PHAR_API int phar_resolve_alias(char *alias, int alias_len, char **filename, int *filename_len TSRMLS_DC); + #endif /* PHP_PHAR_H */ diff --git a/ext/phar/stream.c b/ext/phar/stream.c index d3d4cd655b33c..1b353e0d18c33 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -627,21 +627,16 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f } /* check for mounted directories */ if (phar->mounted_dirs.arBuckets && zend_hash_num_elements(&phar->mounted_dirs)) { - phar_zstr key; char *str_key; ulong unused; uint keylen; HashPosition pos; - zend_hash_internal_pointer_reset_ex(&phar->mounted_dirs, &pos); - while (FAILURE != zend_hash_has_more_elements_ex(&phar->mounted_dirs, &pos)) { - if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(&phar->mounted_dirs, &key, &keylen, &unused, 0, &pos)) { - break; - } - PHAR_STR(key, str_key); + for (zend_hash_internal_pointer_reset_ex(&phar->mounted_dirs, &pos); + HASH_KEY_NON_EXISTENT != zend_hash_get_current_key_ex(&phar->mounted_dirs, &str_key, &keylen, &unused, 0, &pos); + zend_hash_move_forward_ex(&phar->mounted_dirs, &pos) + ) { if ((int)keylen >= internal_file_len || strncmp(str_key, internal_file, keylen)) { - zend_hash_move_forward_ex(&phar->mounted_dirs, &pos); - PHAR_STR_FREE(str_key); continue; } else { char *test; @@ -649,17 +644,14 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f php_stream_statbuf ssbi; if (SUCCESS != zend_hash_find(&phar->manifest, str_key, keylen, (void **) &entry)) { - PHAR_STR_FREE(str_key); goto free_resource; } - PHAR_STR_FREE(str_key); if (!entry->tmp || !entry->is_mounted) { goto free_resource; } test_len = spprintf(&test, MAXPATHLEN, "%s%s", entry->tmp, internal_file + keylen); if (SUCCESS != php_stream_stat_path(test, &ssbi)) { efree(test); - zend_hash_move_forward_ex(&phar->mounted_dirs, &pos); continue; } /* mount the file/directory just in time */ @@ -910,7 +902,6 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from /* Rename directory. Update all nested paths */ if (is_dir) { int key_type; - phar_zstr key, new_key; char *str_key, *new_str_key; uint key_len, new_key_len; ulong unused; @@ -918,12 +909,10 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from uint to_len = strlen(resource_to->path+1); for (zend_hash_internal_pointer_reset(&phar->manifest); - HASH_KEY_NON_EXISTENT != (key_type = zend_hash_get_current_key_ex(&phar->manifest, &key, &key_len, &unused, 0, NULL)) && + HASH_KEY_NON_EXISTENT != (key_type = zend_hash_get_current_key_ex(&phar->manifest, &str_key, &key_len, &unused, 0, NULL)) && SUCCESS == zend_hash_get_current_data(&phar->manifest, (void **) &entry); - zend_hash_move_forward(&phar->manifest)) { - - PHAR_STR(key, str_key); - + zend_hash_move_forward(&phar->manifest) + ) { if (!entry->is_deleted && key_len > from_len && memcmp(str_key, resource_from->path+1, from_len) == 0 && @@ -941,22 +930,14 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from entry->filename = new_str_key; entry->filename_len = new_key_len; - PHAR_ZSTR(new_str_key, new_key); -#if PHP_VERSION_ID < 50300 - zend_hash_update_current_key_ex(&phar->manifest, key_type, new_key, new_key_len, 0, NULL); -#else - zend_hash_update_current_key_ex(&phar->manifest, key_type, new_key, new_key_len, 0, HASH_UPDATE_KEY_ANYWAY, NULL); -#endif + zend_hash_update_current_key_ex(&phar->manifest, key_type, new_str_key, new_key_len, 0, HASH_UPDATE_KEY_ANYWAY, NULL); } - PHAR_STR_FREE(str_key); } for (zend_hash_internal_pointer_reset(&phar->virtual_dirs); - HASH_KEY_NON_EXISTENT != (key_type = zend_hash_get_current_key_ex(&phar->virtual_dirs, &key, &key_len, &unused, 0, NULL)); - zend_hash_move_forward(&phar->virtual_dirs)) { - - PHAR_STR(key, str_key); - + HASH_KEY_NON_EXISTENT != (key_type = zend_hash_get_current_key_ex(&phar->virtual_dirs, &str_key, &key_len, &unused, 0, NULL)); + zend_hash_move_forward(&phar->virtual_dirs) + ) { if (key_len >= from_len && memcmp(str_key, resource_from->path+1, from_len) == 0 && (key_len == from_len || IS_SLASH(str_key[from_len]))) { @@ -967,24 +948,16 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from memcpy(new_str_key + to_len, str_key + from_len, key_len - from_len); new_str_key[new_key_len] = 0; - PHAR_ZSTR(new_str_key, new_key); -#if PHP_VERSION_ID < 50300 - zend_hash_update_current_key_ex(&phar->virtual_dirs, key_type, new_key, new_key_len, 0, NULL); -#else - zend_hash_update_current_key_ex(&phar->virtual_dirs, key_type, new_key, new_key_len, 0, HASH_UPDATE_KEY_ANYWAY, NULL); -#endif + zend_hash_update_current_key_ex(&phar->virtual_dirs, key_type, new_str_key, new_key_len, 0, HASH_UPDATE_KEY_ANYWAY, NULL); efree(new_str_key); } - PHAR_STR_FREE(str_key); } for (zend_hash_internal_pointer_reset(&phar->mounted_dirs); - HASH_KEY_NON_EXISTENT != (key_type = zend_hash_get_current_key_ex(&phar->mounted_dirs, &key, &key_len, &unused, 0, NULL)) && + HASH_KEY_NON_EXISTENT != (key_type = zend_hash_get_current_key_ex(&phar->mounted_dirs, &str_key, &key_len, &unused, 0, NULL)) && SUCCESS == zend_hash_get_current_data(&phar->mounted_dirs, (void **) &entry); - zend_hash_move_forward(&phar->mounted_dirs)) { - - PHAR_STR(key, str_key); - + zend_hash_move_forward(&phar->mounted_dirs) + ) { if (key_len >= from_len && memcmp(str_key, resource_from->path+1, from_len) == 0 && (key_len == from_len || IS_SLASH(str_key[from_len]))) { @@ -995,15 +968,9 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from memcpy(new_str_key + to_len, str_key + from_len, key_len - from_len); new_str_key[new_key_len] = 0; - PHAR_ZSTR(new_str_key, new_key); -#if PHP_VERSION_ID < 50300 - zend_hash_update_current_key_ex(&phar->mounted_dirs, key_type, new_key, new_key_len, 0, NULL); -#else - zend_hash_update_current_key_ex(&phar->mounted_dirs, key_type, new_key, new_key_len, 0, HASH_UPDATE_KEY_ANYWAY, NULL); -#endif + zend_hash_update_current_key_ex(&phar->mounted_dirs, key_type, new_str_key, new_key_len, 0, HASH_UPDATE_KEY_ANYWAY, NULL); efree(new_str_key); } - PHAR_STR_FREE(str_key); } } diff --git a/ext/phar/tar.c b/ext/phar/tar.c index 0e60e3db134b4..180675a9d23b8 100644 --- a/ext/phar/tar.c +++ b/ext/phar/tar.c @@ -783,7 +783,7 @@ static int phar_tar_writeheaders(void *pDest, void *argument TSRMLS_DC) /* {{{ * return ZEND_HASH_APPLY_STOP; } - if (SUCCESS != phar_stream_copy_to_stream(phar_get_efp(entry, 0 TSRMLS_CC), fp->new, entry->uncompressed_filesize, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0 TSRMLS_CC), fp->new, entry->uncompressed_filesize, NULL)) { if (fp->error) { spprintf(fp->error, 4096, "tar-based phar \"%s\" cannot be created, contents of file \"%s\" could not be written", entry->phar->fname, entry->filename); } @@ -1288,7 +1288,7 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, long len, int defau if (!filter) { /* copy contents uncompressed rather than lose them */ - phar_stream_copy_to_stream(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL); + php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL); php_stream_close(newfile); if (error) { spprintf(error, 4096, "unable to compress all contents of phar \"%s\" using zlib, PHP versions older than 5.2.6 have a buggy zlib", phar->fname); @@ -1297,7 +1297,7 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, long len, int defau } php_stream_filter_append(&phar->fp->writefilters, filter); - phar_stream_copy_to_stream(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL); + php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL); php_stream_filter_flush(filter, 1); php_stream_filter_remove(filter, 1 TSRMLS_CC); php_stream_close(phar->fp); @@ -1308,14 +1308,14 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, long len, int defau filter = php_stream_filter_create("bzip2.compress", NULL, php_stream_is_persistent(phar->fp) TSRMLS_CC); php_stream_filter_append(&phar->fp->writefilters, filter); - phar_stream_copy_to_stream(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL); + php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL); php_stream_filter_flush(filter, 1); php_stream_filter_remove(filter, 1 TSRMLS_CC); php_stream_close(phar->fp); /* use the temp stream as our base */ phar->fp = newfile; } else { - phar_stream_copy_to_stream(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL); + php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL); /* we could also reopen the file in "rb" mode but there is no need for that */ php_stream_close(newfile); } diff --git a/ext/phar/tests/031.phpt b/ext/phar/tests/031.phpt index 4d5988621de88..d458f068f5513 100644 --- a/ext/phar/tests/031.phpt +++ b/ext/phar/tests/031.phpt @@ -22,10 +22,10 @@ require $pname; ===DONE=== --CLEAN-- --EXPECTF-- string(25) "getMessage(); ===DONE=== --CLEAN-- --EXPECTF-- -phar "%sphar_oo_test.phar.php" does not have a signature===DONE=== \ No newline at end of file +phar "%s032.phar.php" does not have a signature===DONE=== \ No newline at end of file diff --git a/ext/phar/tests/files/phar_oo_test.inc b/ext/phar/tests/files/phar_oo_test.inc index e92b4444c1572..45421568dee10 100644 --- a/ext/phar/tests/files/phar_oo_test.inc +++ b/ext/phar/tests/files/phar_oo_test.inc @@ -2,7 +2,8 @@ ini_set('date.timezone', 'GMT'); -$fname = dirname(__FILE__) . '/phar_oo_test.phar.php'; +$tname = basename(current(get_included_files()), ".php"); +$fname = dirname(__FILE__) . "/$tname.phar.php"; $pname = 'phar://' . $fname; $file = (binary)''; diff --git a/ext/phar/tests/phar_buildfromdirectory1.phpt b/ext/phar/tests/phar_buildfromdirectory1.phpt index 63e06fa474de8..957f246664f67 100644 --- a/ext/phar/tests/phar_buildfromdirectory1.phpt +++ b/ext/phar/tests/phar_buildfromdirectory1.phpt @@ -7,7 +7,7 @@ phar.require_hash=0 phar.readonly=0 --FILE-- buildFromDirectory(1); @@ -19,7 +19,7 @@ try { ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_buildfromdirectory2-win.phpt b/ext/phar/tests/phar_buildfromdirectory2-win.phpt index 9dbcf965e32ba..5ed890a48bfb1 100644 --- a/ext/phar/tests/phar_buildfromdirectory2-win.phpt +++ b/ext/phar/tests/phar_buildfromdirectory2-win.phpt @@ -11,7 +11,7 @@ phar.readonly=0 --FILE-- buildFromDirectory(1); } catch (Exception $e) { var_dump(get_class($e)); @@ -21,7 +21,7 @@ try { ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_buildfromdirectory2.phpt b/ext/phar/tests/phar_buildfromdirectory2.phpt index 639ff0bd4b77f..a33e50abbb0b7 100644 --- a/ext/phar/tests/phar_buildfromdirectory2.phpt +++ b/ext/phar/tests/phar_buildfromdirectory2.phpt @@ -11,7 +11,7 @@ phar.readonly=0 --FILE-- buildFromDirectory(1); } catch (Exception $e) { var_dump(get_class($e)); @@ -21,7 +21,7 @@ try { ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_buildfromdirectory3.phpt b/ext/phar/tests/phar_buildfromdirectory3.phpt index 2134cbdb5397a..921e39593ddc8 100644 --- a/ext/phar/tests/phar_buildfromdirectory3.phpt +++ b/ext/phar/tests/phar_buildfromdirectory3.phpt @@ -9,7 +9,7 @@ phar.readonly=0 buildFromDirectory('files', new stdClass); } catch (Exception $e) { var_dump(get_class($e)); @@ -19,7 +19,7 @@ try { ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_buildfromdirectory4.phpt b/ext/phar/tests/phar_buildfromdirectory4.phpt index 683ac4bbc8365..5ee2c33871a51 100644 --- a/ext/phar/tests/phar_buildfromdirectory4.phpt +++ b/ext/phar/tests/phar_buildfromdirectory4.phpt @@ -9,14 +9,14 @@ open_basedir= --FILE-- buildFromDirectory(dirname(__FILE__) . '/testdir'); + $phar = new Phar(dirname(__FILE__) . '/buildfromdirectory4.phar'); + $a = $phar->buildFromDirectory(dirname(__FILE__) . '/testdir4'); asort($a); var_dump($a); } catch (Exception $e) { @@ -24,28 +24,28 @@ try { echo $e->getMessage() . "\n"; } -var_dump(file_exists(dirname(__FILE__) . '/buildfromdirectory.phar')); +var_dump(file_exists(dirname(__FILE__) . '/buildfromdirectory4.phar')); ?> ===DONE=== --CLEAN-- --EXPECTF-- array(4) { ["file1.txt"]=> - string(%d) "%stestdir%cfile1.txt" + string(%d) "%stestdir4%cfile1.txt" ["file2.txt"]=> - string(%d) "%stestdir%cfile2.txt" + string(%d) "%stestdir4%cfile2.txt" ["file3.txt"]=> - string(%d) "%stestdir%cfile3.txt" + string(%d) "%stestdir4%cfile3.txt" ["file4.txt"]=> - string(%d) "%stestdir%cfile4.txt" + string(%d) "%stestdir4%cfile4.txt" } bool(true) ===DONE=== diff --git a/ext/phar/tests/phar_buildfromdirectory5.phpt b/ext/phar/tests/phar_buildfromdirectory5.phpt index 51e5cec6911af..f20c52ab91f95 100644 --- a/ext/phar/tests/phar_buildfromdirectory5.phpt +++ b/ext/phar/tests/phar_buildfromdirectory5.phpt @@ -8,14 +8,14 @@ phar.readonly=0 --FILE-- buildFromDirectory(dirname(__FILE__) . '/testdir', '/\.txt/'); + $phar = new Phar(dirname(__FILE__) . '/buildfromdirectory5.phar'); + $a = $phar->buildFromDirectory(dirname(__FILE__) . '/testdir5', '/\.txt/'); asort($a); var_dump($a); } catch (Exception $e) { @@ -23,28 +23,28 @@ try { echo $e->getMessage() . "\n"; } -var_dump(file_exists(dirname(__FILE__) . '/buildfromdirectory.phar')); +var_dump(file_exists(dirname(__FILE__) . '/buildfromdirectory5.phar')); ?> ===DONE=== --CLEAN-- --EXPECTF-- array(4) { ["file1.txt"]=> - string(%d) "%stestdir%cfile1.txt" + string(%d) "%stestdir5%cfile1.txt" ["file2.txt"]=> - string(%d) "%stestdir%cfile2.txt" + string(%d) "%stestdir5%cfile2.txt" ["file3.txt"]=> - string(%d) "%stestdir%cfile3.txt" + string(%d) "%stestdir5%cfile3.txt" ["file4.txt"]=> - string(%d) "%stestdir%cfile4.txt" + string(%d) "%stestdir5%cfile4.txt" } bool(true) ===DONE=== diff --git a/ext/phar/tests/phar_buildfromdirectory6.phpt b/ext/phar/tests/phar_buildfromdirectory6.phpt index 99566c192669e..5537ebac2358b 100644 --- a/ext/phar/tests/phar_buildfromdirectory6.phpt +++ b/ext/phar/tests/phar_buildfromdirectory6.phpt @@ -8,30 +8,30 @@ phar.readonly=0 --FILE-- buildFromDirectory(dirname(__FILE__) . '/testdir', '/\.php$/')); + $phar = new Phar(dirname(__FILE__) . '/buildfromdirectory6.phar'); + var_dump($phar->buildFromDirectory(dirname(__FILE__) . '/testdir6', '/\.php$/')); } catch (Exception $e) { var_dump(get_class($e)); echo $e->getMessage() . "\n"; } -var_dump(file_exists(dirname(__FILE__) . '/buildfromdirectory.phar')); +var_dump(file_exists(dirname(__FILE__) . '/buildfromdirectory6.phar')); ?> ===DONE=== --CLEAN-- --EXPECT-- array(0) { diff --git a/ext/phar/tests/phar_buildfromiterator1.phpt b/ext/phar/tests/phar_buildfromiterator1.phpt index 238ede6cbe160..0f656b64f2053 100644 --- a/ext/phar/tests/phar_buildfromiterator1.phpt +++ b/ext/phar/tests/phar_buildfromiterator1.phpt @@ -7,7 +7,7 @@ phar.require_hash=0 phar.readonly=0 --FILE-- buildFromIterator(1); @@ -19,7 +19,7 @@ try { ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_buildfromiterator10.phpt b/ext/phar/tests/phar_buildfromiterator10.phpt index 024277ed0acc6..e6b9c025da8c8 100644 --- a/ext/phar/tests/phar_buildfromiterator10.phpt +++ b/ext/phar/tests/phar_buildfromiterator10.phpt @@ -11,7 +11,7 @@ phar.readonly=0 buildFromIterator(new RegexIterator($iter, '/_\d{3}\.phpt$/'), dirname(__FILE__) . DIRECTORY_SEPARATOR); @@ -25,7 +25,7 @@ try { ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_buildfromiterator2.phpt b/ext/phar/tests/phar_buildfromiterator2.phpt index cdc2df1050be0..e9dd26e9de074 100644 --- a/ext/phar/tests/phar_buildfromiterator2.phpt +++ b/ext/phar/tests/phar_buildfromiterator2.phpt @@ -8,7 +8,7 @@ phar.readonly=0 --FILE-- buildFromIterator(new stdClass); } catch (Exception $e) { var_dump(get_class($e)); @@ -18,7 +18,7 @@ try { ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_buildfromiterator3.phpt b/ext/phar/tests/phar_buildfromiterator3.phpt index 4a3bc7c0a52de..1603631278397 100644 --- a/ext/phar/tests/phar_buildfromiterator3.phpt +++ b/ext/phar/tests/phar_buildfromiterator3.phpt @@ -36,7 +36,7 @@ class myIterator implements Iterator } } try { - $phar = new Phar(dirname(__FILE__) . '/buildfromiterator.phar'); + $phar = new Phar(dirname(__FILE__) . '/buildfromiterator3.phar'); $phar->buildFromIterator(new myIterator(array()), new stdClass); } catch (Exception $e) { var_dump(get_class($e)); @@ -46,7 +46,7 @@ try { ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_buildfromiterator4.phpt b/ext/phar/tests/phar_buildfromiterator4.phpt index cd261386d5d73..9277db562b481 100644 --- a/ext/phar/tests/phar_buildfromiterator4.phpt +++ b/ext/phar/tests/phar_buildfromiterator4.phpt @@ -37,7 +37,7 @@ class myIterator implements Iterator } try { chdir(dirname(__FILE__)); - $phar = new Phar(dirname(__FILE__) . '/buildfromiterator.phar'); + $phar = new Phar(dirname(__FILE__) . '/buildfromiterator4.phar'); var_dump($phar->buildFromIterator(new myIterator( array( 'a' => basename(__FILE__, 'php') . 'phpt', @@ -54,7 +54,7 @@ try { ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_buildfromiterator5.phpt b/ext/phar/tests/phar_buildfromiterator5.phpt index 8431c12a7c64b..b6fafec6f4f92 100644 --- a/ext/phar/tests/phar_buildfromiterator5.phpt +++ b/ext/phar/tests/phar_buildfromiterator5.phpt @@ -37,7 +37,7 @@ class myIterator implements Iterator } try { chdir(dirname(__FILE__)); - $phar = new Phar(dirname(__FILE__) . '/buildfromiterator.phar'); + $phar = new Phar(dirname(__FILE__) . '/buildfromiterator5.phar'); var_dump($phar->buildFromIterator(new myIterator(array('a' => new stdClass)))); } catch (Exception $e) { var_dump(get_class($e)); @@ -47,7 +47,7 @@ try { ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_buildfromiterator6.phpt b/ext/phar/tests/phar_buildfromiterator6.phpt index 9c506c85283f8..3a315fae4dcb3 100644 --- a/ext/phar/tests/phar_buildfromiterator6.phpt +++ b/ext/phar/tests/phar_buildfromiterator6.phpt @@ -37,7 +37,7 @@ class myIterator implements Iterator } try { chdir(dirname(__FILE__)); - $phar = new Phar(dirname(__FILE__) . '/buildfromiterator.phar'); + $phar = new Phar(dirname(__FILE__) . '/buildfromiterator6.phar'); var_dump($phar->buildFromIterator(new myIterator(array(basename(__FILE__, 'php') . 'phpt')))); } catch (Exception $e) { var_dump(get_class($e)); @@ -47,7 +47,7 @@ try { ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_buildfromiterator7.phpt b/ext/phar/tests/phar_buildfromiterator7.phpt index 2bac4c8269a57..3dd8fc1b001d0 100644 --- a/ext/phar/tests/phar_buildfromiterator7.phpt +++ b/ext/phar/tests/phar_buildfromiterator7.phpt @@ -37,7 +37,7 @@ class myIterator implements Iterator } try { chdir(dirname(__FILE__)); - $phar = new Phar(dirname(__FILE__) . '/buildfromiterator.phar'); + $phar = new Phar(dirname(__FILE__) . '/buildfromiterator7.phar'); var_dump($phar->buildFromIterator(new myIterator(array('a' => basename(__FILE__, 'php') . '/oopsie/there.phpt')))); } catch (Exception $e) { var_dump(get_class($e)); @@ -47,7 +47,7 @@ try { ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_buildfromiterator8.phpt b/ext/phar/tests/phar_buildfromiterator8.phpt index bb1b780d759b7..de37ee868784d 100644 --- a/ext/phar/tests/phar_buildfromiterator8.phpt +++ b/ext/phar/tests/phar_buildfromiterator8.phpt @@ -8,7 +8,7 @@ phar.readonly=0 buildFromIterator(new RegexIterator(new DirectoryIterator('.'), '/^\d{0,3}\.phpt\\z|^\.\\z|^\.\.\\z/'), dirname(__FILE__) . DIRECTORY_SEPARATOR); asort($a); var_dump($a); @@ -20,7 +20,7 @@ try { ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_buildfromiterator9.phpt b/ext/phar/tests/phar_buildfromiterator9.phpt index 0b56307545677..2c9306b6cc86e 100644 --- a/ext/phar/tests/phar_buildfromiterator9.phpt +++ b/ext/phar/tests/phar_buildfromiterator9.phpt @@ -37,7 +37,7 @@ class myIterator implements Iterator } try { chdir(dirname(__FILE__)); - $phar = new Phar(dirname(__FILE__) . '/buildfromiterator.phar'); + $phar = new Phar(dirname(__FILE__) . '/buildfromiterator9.phar'); var_dump($phar->buildFromIterator(new myIterator(array('a' => $a = fopen(basename(__FILE__, 'php') . 'phpt', 'r'))))); fclose($a); } catch (Exception $e) { @@ -48,7 +48,7 @@ try { ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_extract.phpt b/ext/phar/tests/phar_extract.phpt index 01d65f9091de0..bc545236fd886 100644 --- a/ext/phar/tests/phar_extract.phpt +++ b/ext/phar/tests/phar_extract.phpt @@ -38,9 +38,9 @@ var_dump(file_get_contents(dirname(__FILE__) . '/extract1/file1.txt')); $a->extractTo(dirname(__FILE__) . '/extract1', 'subdir/ectory/file.txt'); var_dump(file_get_contents(dirname(__FILE__) . '/extract1/subdir/ectory/file.txt')); -$a->extractTo(dirname(__FILE__) . '/extract2', array('file2.txt', 'one/level')); -var_dump(file_get_contents(dirname(__FILE__) . '/extract2/file2.txt')); -var_dump(is_dir(dirname(__FILE__) . '/extract2/one/level')); +$a->extractTo(dirname(__FILE__) . '/extract1-2', array('file2.txt', 'one/level')); +var_dump(file_get_contents(dirname(__FILE__) . '/extract1-2/file2.txt')); +var_dump(is_dir(dirname(__FILE__) . '/extract1-2/one/level')); try { $a->extractTo(dirname(__FILE__) . '/whatever', 134); @@ -119,7 +119,7 @@ $e = dirname(__FILE__) . '/extract1/'; @rmdir($e . 'subdir/ectory'); @rmdir($e . 'subdir'); @rmdir($e); -$e = dirname(__FILE__) . '/extract2/'; +$e = dirname(__FILE__) . '/extract1-2/'; @unlink($e . 'file2.txt'); @rmdir($e . 'one/level'); @rmdir($e . 'one'); diff --git a/ext/phar/tests/phar_extract2.phpt b/ext/phar/tests/phar_extract2.phpt index cac509f9dc666..7de8cee5b0e90 100644 --- a/ext/phar/tests/phar_extract2.phpt +++ b/ext/phar/tests/phar_extract2.phpt @@ -16,14 +16,14 @@ $phar->setAlias('fred'); $phar['file1.txt'] = 'hi'; $phar['file2.txt'] = 'hi2'; $phar['subdir/ectory/file.txt'] = 'hi3'; -$phar->mount($pname . '/mount', __FILE__); +$phar->mount($pname . '/mount2', __FILE__); $phar->addEmptyDir('one/level'); -$phar->extractTo(dirname(__FILE__) . '/extract', 'mount'); -$phar->extractTo(dirname(__FILE__) . '/extract'); +$phar->extractTo(dirname(__FILE__) . '/extract2', 'mount2'); +$phar->extractTo(dirname(__FILE__) . '/extract2'); $out = array(); -foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(dirname(__FILE__) . '/extract', 0x00003000), RecursiveIteratorIterator::CHILD_FIRST) as $path => $file) { +foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(dirname(__FILE__) . '/extract2', 0x00003000), RecursiveIteratorIterator::CHILD_FIRST) as $path => $file) { $extracted[] = $path; } @@ -38,7 +38,7 @@ foreach ($extracted as $out) { --CLEAN-- --EXPECTF-- -%sextract%cfile1.txt -%sextract%cfile2.txt -%sextract%cone -%sextract%csubdir -%sextract%csubdir%cectory -%sextract%csubdir%cectory%cfile.txt +%sextract2%cfile1.txt +%sextract2%cfile2.txt +%sextract2%cone +%sextract2%csubdir +%sextract2%csubdir%cectory +%sextract2%csubdir%cectory%cfile.txt ===DONE=== diff --git a/ext/phar/tests/phar_extract3.phpt b/ext/phar/tests/phar_extract3.phpt index df85211a23920..475583938bb0d 100644 --- a/ext/phar/tests/phar_extract3.phpt +++ b/ext/phar/tests/phar_extract3.phpt @@ -9,7 +9,7 @@ phar.readonly=0 $fname = dirname(__FILE__) . '/files/bogus.zip'; $fname2 = dirname(__FILE__) . '/files/notbogus.zip'; -$extract = dirname(__FILE__) . '/test'; +$extract = dirname(__FILE__) . '/test-extract3'; $phar = new PharData($fname); @@ -34,7 +34,7 @@ try { ===DONE=== --CLEAN-- --EXPECT-- diff --git a/ext/phar/tests/phar_oo_001U.phpt b/ext/phar/tests/phar_oo_001U.phpt index f13ddd4b0b206..a21026a5b6947 100644 --- a/ext/phar/tests/phar_oo_001U.phpt +++ b/ext/phar/tests/phar_oo_001U.phpt @@ -46,7 +46,7 @@ try { ===DONE=== --CLEAN-- --EXPECT-- diff --git a/ext/phar/tests/phar_oo_002.phpt b/ext/phar/tests/phar_oo_002.phpt index 3754151d42f0a..476cd7d3c216f 100644 --- a/ext/phar/tests/phar_oo_002.phpt +++ b/ext/phar/tests/phar_oo_002.phpt @@ -50,11 +50,11 @@ foreach(new RecursiveIteratorIterator($phar) as $name => $ent) ===DONE=== --CLEAN-- --EXPECTF-- -string(42) "phar://*/files/phar_oo_test.phar.php%ca.php" +string(41) "phar://*/files/phar_oo_002.phar.php%ca.php" string(5) "a.php" int(32) string(4) "file" @@ -67,7 +67,7 @@ bool(false) int(%d) int(%d) int(%d) -string(38) "phar://*/files/phar_oo_test.phar.php%cb" +string(37) "phar://*/files/phar_oo_002.phar.php%cb" string(1) "b" int(0) string(3) "dir" @@ -80,7 +80,7 @@ bool(false) int(%d) int(%d) int(%d) -string(42) "phar://*/files/phar_oo_test.phar.php%cb.php" +string(41) "phar://*/files/phar_oo_002.phar.php%cb.php" string(5) "b.php" int(32) string(4) "file" @@ -93,7 +93,7 @@ bool(false) int(%d) int(%d) int(%d) -string(42) "phar://*/files/phar_oo_test.phar.php%ce.php" +string(41) "phar://*/files/phar_oo_002.phar.php%ce.php" string(5) "e.php" int(32) string(4) "file" @@ -107,31 +107,31 @@ int(%d) int(%d) int(%d) ==RECURSIVE== -string(42) "phar://*/files/phar_oo_test.phar.php%ca.php" +string(41) "phar://*/files/phar_oo_002.phar.php%ca.php" string(5) "a.php" int(32) bool(false) NULL int(0) -string(44) "phar://*/files/phar_oo_test.phar.php/b%cc.php" +string(43) "phar://*/files/phar_oo_002.phar.php/b%cc.php" string(5) "c.php" int(34) bool(false) NULL int(0) -string(44) "phar://*/files/phar_oo_test.phar.php/b%cd.php" +string(43) "phar://*/files/phar_oo_002.phar.php/b%cd.php" string(5) "d.php" int(34) bool(false) NULL int(0) -string(42) "phar://*/files/phar_oo_test.phar.php%cb.php" +string(41) "phar://*/files/phar_oo_002.phar.php%cb.php" string(5) "b.php" int(32) bool(false) NULL int(0) -string(42) "phar://*/files/phar_oo_test.phar.php%ce.php" +string(41) "phar://*/files/phar_oo_002.phar.php%ce.php" string(5) "e.php" int(32) bool(false) diff --git a/ext/phar/tests/phar_oo_002U.phpt b/ext/phar/tests/phar_oo_002U.phpt index 26d0d68d97474..da17152b3273f 100644 --- a/ext/phar/tests/phar_oo_002U.phpt +++ b/ext/phar/tests/phar_oo_002U.phpt @@ -50,11 +50,11 @@ foreach(new RecursiveIteratorIterator($phar) as $name => $ent) ===DONE=== --CLEAN-- --EXPECTF-- -unicode(42) "phar://*/files/phar_oo_test.phar.php%ca.php" +unicode(42) "phar://*/files/phar_oo_002.phar.php%ca.php" string(5) "a.php" int(32) unicode(4) "file" @@ -67,7 +67,7 @@ bool(false) int(%d) int(%d) int(%d) -unicode(38) "phar://*/files/phar_oo_test.phar.php%cb" +unicode(38) "phar://*/files/phar_oo_002.phar.php%cb" string(1) "b" int(0) unicode(3) "dir" @@ -80,7 +80,7 @@ bool(false) int(%d) int(%d) int(%d) -unicode(42) "phar://*/files/phar_oo_test.phar.php%cb.php" +unicode(42) "phar://*/files/phar_oo_002.phar.php%cb.php" string(5) "b.php" int(32) unicode(4) "file" @@ -93,7 +93,7 @@ bool(false) int(%d) int(%d) int(%d) -unicode(42) "phar://*/files/phar_oo_test.phar.php%ce.php" +unicode(42) "phar://*/files/phar_oo_002.phar.php%ce.php" string(5) "e.php" int(32) unicode(4) "file" @@ -107,31 +107,31 @@ int(%d) int(%d) int(%d) ==RECURSIVE== -unicode(42) "phar://*/files/phar_oo_test.phar.php%ca.php" +unicode(42) "phar://*/files/phar_oo_002.phar.php%ca.php" unicode(5) "a.php" int(32) bool(false) NULL int(0) -unicode(44) "phar://*/files/phar_oo_test.phar.php/b%cc.php" +unicode(44) "phar://*/files/phar_oo_002.phar.php/b%cc.php" unicode(5) "c.php" int(34) bool(false) NULL int(0) -unicode(44) "phar://*/files/phar_oo_test.phar.php/b%cd.php" +unicode(44) "phar://*/files/phar_oo_002.phar.php/b%cd.php" unicode(5) "d.php" int(34) bool(false) NULL int(0) -unicode(42) "phar://*/files/phar_oo_test.phar.php%cb.php" +unicode(42) "phar://*/files/phar_oo_002.phar.php%cb.php" unicode(5) "b.php" int(32) bool(false) NULL int(0) -unicode(42) "phar://*/files/phar_oo_test.phar.php%ce.php" +unicode(42) "phar://*/files/phar_oo_002.phar.php%ce.php" unicode(5) "e.php" int(32) bool(false) diff --git a/ext/phar/tests/phar_oo_003.phpt b/ext/phar/tests/phar_oo_003.phpt index ccaf7c65f80d7..4395792632433 100644 --- a/ext/phar/tests/phar_oo_003.phpt +++ b/ext/phar/tests/phar_oo_003.phpt @@ -27,7 +27,7 @@ foreach($phar as $name => $ent) ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_oo_004.phpt b/ext/phar/tests/phar_oo_004.phpt index ba67749843ab0..3e4581992eaab 100644 --- a/ext/phar/tests/phar_oo_004.phpt +++ b/ext/phar/tests/phar_oo_004.phpt @@ -78,7 +78,7 @@ foreach($it as $name => $ent) ===DONE=== --CLEAN-- --EXPECT-- diff --git a/ext/phar/tests/phar_oo_004U.phpt b/ext/phar/tests/phar_oo_004U.phpt index 2762ee3c3568f..51be9dab2e2bc 100644 --- a/ext/phar/tests/phar_oo_004U.phpt +++ b/ext/phar/tests/phar_oo_004U.phpt @@ -78,7 +78,7 @@ foreach($it as $name => $ent) ===DONE=== --CLEAN-- --EXPECT-- diff --git a/ext/phar/tests/phar_oo_005.phpt b/ext/phar/tests/phar_oo_005.phpt index cb3f2987280f0..b01231e9c2652 100644 --- a/ext/phar/tests/phar_oo_005.phpt +++ b/ext/phar/tests/phar_oo_005.phpt @@ -32,7 +32,7 @@ foreach($it as $name => $ent) ===DONE=== --CLEAN-- --EXPECT-- diff --git a/ext/phar/tests/phar_oo_005U.phpt b/ext/phar/tests/phar_oo_005U.phpt index bcdcb08b0dc9f..9c04b93cef33c 100644 --- a/ext/phar/tests/phar_oo_005U.phpt +++ b/ext/phar/tests/phar_oo_005U.phpt @@ -31,7 +31,7 @@ foreach($it as $name => $ent) ===DONE=== --CLEAN-- --EXPECT-- diff --git a/ext/phar/tests/phar_oo_005_5.2.phpt b/ext/phar/tests/phar_oo_005_5.2.phpt index 9e509d94b704c..399edb0dd37b1 100644 --- a/ext/phar/tests/phar_oo_005_5.2.phpt +++ b/ext/phar/tests/phar_oo_005_5.2.phpt @@ -31,7 +31,7 @@ foreach($it as $name => $ent) ===DONE=== --CLEAN-- --EXPECT-- diff --git a/ext/phar/tests/phar_oo_006.phpt b/ext/phar/tests/phar_oo_006.phpt index 556c98ce0b620..5d1d7052066c4 100644 --- a/ext/phar/tests/phar_oo_006.phpt +++ b/ext/phar/tests/phar_oo_006.phpt @@ -38,7 +38,7 @@ echo $phar['b.php']->getFilename() . "\n"; ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_oo_007.phpt b/ext/phar/tests/phar_oo_007.phpt index 788b11f1f81a4..d0b5aa5ecaec0 100644 --- a/ext/phar/tests/phar_oo_007.phpt +++ b/ext/phar/tests/phar_oo_007.phpt @@ -59,11 +59,11 @@ var_dump($f->eof()); ===DONE=== --CLEAN-- --EXPECTF-- -MyFile::__construct(phar://*/files/phar_oo_test.phar.php/a.php) +MyFile::__construct(phar://*/files/phar_oo_007.phar.php/a.php) int(%d) int(%d) int(%d) @@ -79,7 +79,7 @@ int(0) string(32) "" int(32) ===AGAIN=== -MyFile::__construct(phar://*/files/phar_oo_test.phar.php/a.php) +MyFile::__construct(phar://*/files/phar_oo_007.phar.php/a.php) int(0) bool(false) string(32) "" diff --git a/ext/phar/tests/phar_oo_008.phpt b/ext/phar/tests/phar_oo_008.phpt index 80d1ece0ca97d..d95af571b3c04 100644 --- a/ext/phar/tests/phar_oo_008.phpt +++ b/ext/phar/tests/phar_oo_008.phpt @@ -83,7 +83,7 @@ foreach($v as $k => $d) ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_oo_009.phpt b/ext/phar/tests/phar_oo_009.phpt index 6abd03ee30b52..3c842fabeda52 100644 --- a/ext/phar/tests/phar_oo_009.phpt +++ b/ext/phar/tests/phar_oo_009.phpt @@ -36,7 +36,7 @@ foreach($f as $k => $v) ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_oo_010.phpt b/ext/phar/tests/phar_oo_010.phpt index 1d3ff73242418..331d300a8c650 100644 --- a/ext/phar/tests/phar_oo_010.phpt +++ b/ext/phar/tests/phar_oo_010.phpt @@ -36,7 +36,7 @@ var_dump(isset($phar['b'])); ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_oo_011.phpt b/ext/phar/tests/phar_oo_011.phpt index cfbab702ad8c8..01fa9f01e6ec4 100644 --- a/ext/phar/tests/phar_oo_011.phpt +++ b/ext/phar/tests/phar_oo_011.phpt @@ -26,7 +26,7 @@ echo "\n"; ===DONE=== --CLEAN-- --EXPECT-- diff --git a/ext/phar/tests/phar_oo_011b.phpt b/ext/phar/tests/phar_oo_011b.phpt index 36d9963a2283d..34cae0e760b73 100644 --- a/ext/phar/tests/phar_oo_011b.phpt +++ b/ext/phar/tests/phar_oo_011b.phpt @@ -31,7 +31,7 @@ catch (BadMethodCallException $e) ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/tests/phar_oo_012.phpt b/ext/phar/tests/phar_oo_012.phpt index e79ac0960edc6..b6f9f44b1e153 100644 --- a/ext/phar/tests/phar_oo_012.phpt +++ b/ext/phar/tests/phar_oo_012.phpt @@ -27,7 +27,7 @@ var_dump(isset($phar['f.php'])); ===DONE=== --CLEAN-- --EXPECT-- diff --git a/ext/phar/tests/phar_oo_012_confirm.phpt b/ext/phar/tests/phar_oo_012_confirm.phpt index 58a3be87b323f..ce5a58f212d7e 100644 --- a/ext/phar/tests/phar_oo_012_confirm.phpt +++ b/ext/phar/tests/phar_oo_012_confirm.phpt @@ -30,7 +30,7 @@ var_dump(isset($phar['f.php'])); ===DONE=== --CLEAN-- --EXPECT-- diff --git a/ext/phar/tests/phar_oo_012b.phpt b/ext/phar/tests/phar_oo_012b.phpt index 80d8ed8dc4d7a..066d3bc0687b1 100644 --- a/ext/phar/tests/phar_oo_012b.phpt +++ b/ext/phar/tests/phar_oo_012b.phpt @@ -34,7 +34,7 @@ catch (BadMethodCallException $e) ===DONE=== --CLEAN-- --EXPECTF-- diff --git a/ext/phar/util.c b/ext/phar/util.c index 38aa549f00d57..327dfa4eb8d40 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -41,10 +41,6 @@ static int phar_call_openssl_signverify(int is_sign, php_stream *fp, off_t end, char *key, int key_len, char **signature, int *signature_len TSRMLS_DC); #endif -#if !defined(PHP_VERSION_ID) || PHP_VERSION_ID < 50300 -extern php_stream_wrapper php_stream_phar_wrapper; -#endif - /* for links to relative location, prepend cwd of the entry */ static char *phar_get_link_location(phar_entry_info *entry TSRMLS_DC) /* {{{ */ { @@ -256,7 +252,6 @@ int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len, char *phar_find_in_include_path(char *filename, int filename_len, phar_archive_data **pphar TSRMLS_DC) /* {{{ */ { -#if PHP_VERSION_ID >= 50300 char *path, *fname, *arch, *entry, *ret, *test; int arch_len, entry_len, fname_len, ret_len; phar_archive_data *phar; @@ -344,223 +339,6 @@ char *phar_find_in_include_path(char *filename, int filename_len, phar_archive_d } return ret; -#else /* PHP 5.2 */ - char resolved_path[MAXPATHLEN]; - char trypath[MAXPATHLEN]; - char *ptr, *end, *path = PG(include_path); - php_stream_wrapper *wrapper; - const char *p; - int n = 0; - char *fname, *arch, *entry, *ret, *test; - int arch_len, entry_len; - phar_archive_data *phar = NULL; - - if (!filename) { - return NULL; - } - - if (!zend_is_executing(TSRMLS_C) || !PHAR_G(cwd)) { - goto doit; - } - - fname = (char*)zend_get_executed_filename(TSRMLS_C); - - if (SUCCESS != phar_split_fname(fname, strlen(fname), &arch, &arch_len, &entry, &entry_len, 1, 0 TSRMLS_CC)) { - goto doit; - } - - efree(entry); - - if (*filename == '.') { - int try_len; - - if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) { - efree(arch); - goto doit; - } - - try_len = filename_len; - test = phar_fix_filepath(estrndup(filename, filename_len), &try_len, 1 TSRMLS_CC); - - if (*test == '/') { - if (zend_hash_exists(&(phar->manifest), test + 1, try_len - 1)) { - spprintf(&ret, 0, "phar://%s%s", arch, test); - efree(arch); - efree(test); - return ret; - } - } else { - if (zend_hash_exists(&(phar->manifest), test, try_len)) { - spprintf(&ret, 0, "phar://%s/%s", arch, test); - efree(arch); - efree(test); - return ret; - } - } - - efree(test); - } - - efree(arch); -doit: - if (*filename == '.' || IS_ABSOLUTE_PATH(filename, filename_len) || !path || !*path) { - if (tsrm_realpath(filename, resolved_path TSRMLS_CC)) { - return estrdup(resolved_path); - } else { - return NULL; - } - } - - /* test for stream wrappers and return */ - for (p = filename; p - filename < filename_len && (isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'); ++p, ++n); - - if (n < filename_len - 3 && (*p == ':') && (!strncmp("//", p+1, 2) || ( filename_len > 4 && !memcmp("data", filename, 4)))) { - /* found stream wrapper, this is an absolute path until stream wrappers implement realpath */ - return estrndup(filename, filename_len); - } - - ptr = (char *) path; - while (ptr && *ptr) { - int len, is_stream_wrapper = 0, maybe_stream = 1; - - end = strchr(ptr, DEFAULT_DIR_SEPARATOR); -#ifndef PHP_WIN32 - /* search for stream wrapper */ - if (end - ptr <= 1) { - maybe_stream = 0; - goto not_stream; - } - - for (p = ptr, n = 0; p < end && (isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'); ++p, ++n); - - if (n == end - ptr && *p && !strncmp("//", p+1, 2)) { - is_stream_wrapper = 1; - /* seek to real end of include_path portion */ - end = strchr(end + 1, DEFAULT_DIR_SEPARATOR); - } else { - maybe_stream = 0; - } -not_stream: -#endif - if (end) { - if ((end-ptr) + 1 + filename_len + 1 >= MAXPATHLEN) { - ptr = end + 1; - continue; - } - - memcpy(trypath, ptr, end-ptr); - len = end-ptr; - trypath[end-ptr] = '/'; - memcpy(trypath+(end-ptr)+1, filename, filename_len+1); - ptr = end+1; - } else { - len = strlen(ptr); - - if (len + 1 + filename_len + 1 >= MAXPATHLEN) { - break; - } - - memcpy(trypath, ptr, len); - trypath[len] = '/'; - memcpy(trypath+len+1, filename, filename_len+1); - ptr = NULL; - } - - if (!is_stream_wrapper && maybe_stream) { - /* search for stream wrapper */ - for (p = trypath, n = 0; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; ++p, ++n); - } - - if (is_stream_wrapper || (n < len - 3 && (*p == ':') && (n > 1) && (!strncmp("//", p+1, 2) || !memcmp("data", trypath, 4)))) { - char *actual; - - wrapper = php_stream_locate_url_wrapper(trypath, &actual, STREAM_OPEN_FOR_INCLUDE TSRMLS_CC); - if (wrapper == &php_plain_files_wrapper) { - strlcpy(trypath, actual, sizeof(trypath)); - } else if (!wrapper) { - /* if wrapper is NULL, there was a mal-formed include_path stream wrapper, so skip this ptr */ - continue; - } else { - if (wrapper->wops->url_stat) { - php_stream_statbuf ssb; - - if (SUCCESS == wrapper->wops->url_stat(wrapper, trypath, 0, &ssb, NULL TSRMLS_CC)) { - if (wrapper == &php_stream_phar_wrapper) { - char *arch, *entry; - int arch_len, entry_len, ret_len; - - ret_len = strlen(trypath); - /* found phar:// */ - - if (SUCCESS != phar_split_fname(trypath, ret_len, &arch, &arch_len, &entry, &entry_len, 1, 0 TSRMLS_CC)) { - return estrndup(trypath, ret_len); - } - - zend_hash_find(&(PHAR_GLOBALS->phar_fname_map), arch, arch_len, (void **) &pphar); - - if (!pphar && PHAR_G(manifest_cached)) { - zend_hash_find(&cached_phars, arch, arch_len, (void **) &pphar); - } - - efree(arch); - efree(entry); - - return estrndup(trypath, ret_len); - } - return estrdup(trypath); - } - } - continue; - } - } - - if (tsrm_realpath(trypath, resolved_path TSRMLS_CC)) { - return estrdup(resolved_path); - } - } /* end provided path */ - - /* check in calling scripts' current working directory as a fall back case */ - if (zend_is_executing(TSRMLS_C)) { - char *exec_fname = (char*)zend_get_executed_filename(TSRMLS_C); - int exec_fname_length = strlen(exec_fname); - const char *p; - int n = 0; - - while ((--exec_fname_length >= 0) && !IS_SLASH(exec_fname[exec_fname_length])); - if (exec_fname && exec_fname[0] != '[' && - exec_fname_length > 0 && - exec_fname_length + 1 + filename_len + 1 < MAXPATHLEN) { - memcpy(trypath, exec_fname, exec_fname_length + 1); - memcpy(trypath+exec_fname_length + 1, filename, filename_len+1); - - /* search for stream wrapper */ - for (p = trypath; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; ++p, ++n); - - if (n < exec_fname_length - 3 && (*p == ':') && (n > 1) && (!strncmp("//", p+1, 2) || !memcmp("data", trypath, 4))) { - char *actual; - - wrapper = php_stream_locate_url_wrapper(trypath, &actual, STREAM_OPEN_FOR_INCLUDE TSRMLS_CC); - - if (wrapper == &php_plain_files_wrapper) { - /* this should never technically happen, but we'll leave it here for completeness */ - strlcpy(trypath, actual, sizeof(trypath)); - } else if (!wrapper) { - /* if wrapper is NULL, there was a malformed include_path stream wrapper - this also should be impossible */ - return NULL; - } else { - return estrdup(trypath); - } - } - - if (tsrm_realpath(trypath, resolved_path TSRMLS_CC)) { - return estrdup(resolved_path); - } - } - } - - return NULL; -#endif /* PHP 5.2 */ } /* }}} */ @@ -900,7 +678,7 @@ int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **er link = source; } - if (SUCCESS != phar_stream_copy_to_stream(phar_get_efp(link, 0 TSRMLS_CC), dest->fp, link->uncompressed_filesize, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(link, 0 TSRMLS_CC), dest->fp, link->uncompressed_filesize, NULL)) { php_stream_close(dest->fp); dest->fp_type = PHAR_FP; if (error) { @@ -1002,7 +780,7 @@ int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links TS php_stream_seek(phar_get_entrypfp(entry TSRMLS_CC), phar_get_fp_offset(entry TSRMLS_CC), SEEK_SET); if (entry->uncompressed_filesize) { - if (SUCCESS != phar_stream_copy_to_stream(phar_get_entrypfp(entry TSRMLS_CC), ufp, entry->compressed_filesize, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_entrypfp(entry TSRMLS_CC), ufp, entry->compressed_filesize, NULL)) { spprintf(error, 4096, "phar error: internal corruption of phar \"%s\" (actual filesize mismatch on file \"%s\")", phar->fname, entry->filename); php_stream_filter_remove(filter, 1 TSRMLS_CC); return FAILURE; @@ -1031,47 +809,11 @@ int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links TS } /* }}} */ -#if defined(PHP_VERSION_ID) && PHP_VERSION_ID < 50202 -typedef struct { - char *data; - size_t fpos; - size_t fsize; - size_t smax; - int mode; - php_stream **owner_ptr; -} php_stream_memory_data; -#endif - int phar_create_writeable_entry(phar_archive_data *phar, phar_entry_info *entry, char **error TSRMLS_DC) /* {{{ */ { if (entry->fp_type == PHAR_MOD) { /* already newly created, truncate */ -#if PHP_VERSION_ID >= 50202 php_stream_truncate_set_size(entry->fp, 0); -#else - if (php_stream_is(entry->fp, PHP_STREAM_IS_TEMP)) { - if (php_stream_is(*(php_stream**)entry->fp->abstract, PHP_STREAM_IS_MEMORY)) { - php_stream *inner = *(php_stream**)entry->fp->abstract; - php_stream_memory_data *memfp = (php_stream_memory_data*)inner->abstract; - memfp->fpos = 0; - memfp->fsize = 0; - } else if (php_stream_is(*(php_stream**)entry->fp->abstract, PHP_STREAM_IS_STDIO)) { - php_stream_truncate_set_size(*(php_stream**)entry->fp->abstract, 0); - } else { - if (error) { - spprintf(error, 0, "phar error: file \"%s\" cannot be opened for writing, no truncate support", phar->fname); - } - return FAILURE; - } - } else if (php_stream_is(entry->fp, PHP_STREAM_IS_STDIO)) { - php_stream_truncate_set_size(entry->fp, 0); - } else { - if (error) { - spprintf(error, 0, "phar error: file \"%s\" cannot be opened for writing, no truncate support", phar->fname); - } - return FAILURE; - } -#endif entry->old_flags = entry->flags; entry->is_modified = 1; phar->is_modified = 1; @@ -1144,7 +886,7 @@ int phar_separate_entry_fp(phar_entry_info *entry, char **error TSRMLS_DC) /* {{ link = entry; } - if (SUCCESS != phar_stream_copy_to_stream(phar_get_efp(link, 0 TSRMLS_CC), fp, link->uncompressed_filesize, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(link, 0 TSRMLS_CC), fp, link->uncompressed_filesize, NULL)) { if (error) { spprintf(error, 4096, "phar error: cannot separate entry file \"%s\" contents in phar archive \"%s\" for write access", entry->filename, entry->phar->fname); } @@ -1185,6 +927,17 @@ phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, } /* }}} */ +PHP_PHAR_API int phar_resolve_alias(char *alias, int alias_len, char **filename, int *filename_len TSRMLS_DC) /* {{{ */ { + phar_archive_data **fd_ptr; + if (SUCCESS == zend_hash_find(&(PHAR_GLOBALS->phar_alias_map), alias, alias_len, (void**)&fd_ptr)) { + *filename = (*fd_ptr)->fname; + *filename_len = (*fd_ptr)->fname_len; + return SUCCESS; + } + return FAILURE; +} +/* }}} */ + int phar_free_alias(phar_archive_data *phar, char *alias, int alias_len TSRMLS_DC) /* {{{ */ { if (phar->refcount || phar->is_persistent) { @@ -1262,8 +1015,10 @@ int phar_get_archive(phar_archive_data **archive, char *fname, int fname_len, ch spprintf(error, 0, "alias \"%s\" is already used for archive \"%s\" cannot be overloaded with \"%s\"", alias, (*fd_ptr)->fname, fname); } if (SUCCESS == phar_free_alias(*fd_ptr, alias, alias_len TSRMLS_CC)) { - efree(*error); - *error = NULL; + if (error) { + efree(*error); + *error = NULL; + } } return FAILURE; } @@ -1547,21 +1302,17 @@ phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, in } if (phar->mounted_dirs.arBuckets && zend_hash_num_elements(&phar->mounted_dirs)) { - phar_zstr key; char *str_key; ulong unused; uint keylen; zend_hash_internal_pointer_reset(&phar->mounted_dirs); while (FAILURE != zend_hash_has_more_elements(&phar->mounted_dirs)) { - if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(&phar->mounted_dirs, &key, &keylen, &unused, 0, NULL)) { + if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(&phar->mounted_dirs, &str_key, &keylen, &unused, 0, NULL)) { break; } - PHAR_STR(key, str_key); - if ((int)keylen >= path_len || strncmp(str_key, path, keylen)) { - PHAR_STR_FREE(str_key); continue; } else { char *test; @@ -1572,7 +1323,6 @@ phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, in if (error) { spprintf(error, 4096, "phar internal error: mounted path \"%s\" could not be retrieved from manifest", str_key); } - PHAR_STR_FREE(str_key); return NULL; } @@ -1580,10 +1330,8 @@ phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, in if (error) { spprintf(error, 4096, "phar internal error: mounted path \"%s\" is not properly initialized as a mounted path", str_key); } - PHAR_STR_FREE(str_key); return NULL; } - PHAR_STR_FREE(str_key); test_len = spprintf(&test, MAXPATHLEN, "%s%s", entry->tmp, path + keylen); @@ -1691,11 +1439,7 @@ static int phar_call_openssl_signverify(int is_sign, php_stream *fp, off_t end, return FAILURE; } -#if PHP_VERSION_ID < 50300 - if (FAILURE == zend_fcall_info_init(openssl, &fci, &fcc TSRMLS_CC)) { -#else if (FAILURE == zend_fcall_info_init(openssl, 0, &fci, &fcc, NULL, NULL TSRMLS_CC)) { -#endif zval_dtor(zdata); zval_dtor(zsig); zval_dtor(zkey); @@ -1709,13 +1453,6 @@ static int phar_call_openssl_signverify(int is_sign, php_stream *fp, off_t end, fci.param_count = 3; fci.params = zp; -#if PHP_VERSION_ID < 50300 - ++(zdata->refcount); - if (!is_sign) { - ++(zsig->refcount); - } - ++(zkey->refcount); -#else Z_ADDREF_P(zdata); if (is_sign) { Z_SET_ISREF_P(zsig); @@ -1723,7 +1460,6 @@ static int phar_call_openssl_signverify(int is_sign, php_stream *fp, off_t end, Z_ADDREF_P(zsig); } Z_ADDREF_P(zkey); -#endif fci.retval_ptr_ptr = &retval_ptr; if (FAILURE == zend_call_function(&fci, &fcc TSRMLS_CC)) { @@ -1740,13 +1476,6 @@ static int phar_call_openssl_signverify(int is_sign, php_stream *fp, off_t end, zval_dtor(openssl); efree(openssl); -#if PHP_VERSION_ID < 50300 - --(zdata->refcount); - if (!is_sign) { - --(zsig->refcount); - } - --(zkey->refcount); -#else Z_DELREF_P(zdata); if (is_sign) { Z_UNSET_ISREF_P(zsig); @@ -1754,7 +1483,6 @@ static int phar_call_openssl_signverify(int is_sign, php_stream *fp, off_t end, Z_DELREF_P(zsig); } Z_DELREF_P(zkey); -#endif zval_dtor(zdata); efree(zdata); zval_dtor(zkey); @@ -2280,11 +2008,7 @@ static int phar_update_cached_entry(void *data, void *argument) /* {{{ */ ALLOC_ZVAL(entry->metadata); *entry->metadata = *t; zval_copy_ctor(entry->metadata); -#if PHP_VERSION_ID < 50300 - entry->metadata->refcount = 1; -#else Z_SET_REFCOUNT_P(entry->metadata, 1); -#endif entry->metadata_str.c = NULL; entry->metadata_str.len = 0; } @@ -2328,11 +2052,7 @@ static void phar_copy_cached_phar(phar_archive_data **pphar TSRMLS_DC) /* {{{ */ ALLOC_ZVAL(phar->metadata); *phar->metadata = *t; zval_copy_ctor(phar->metadata); -#if PHP_VERSION_ID < 50300 - phar->metadata->refcount = 1; -#else Z_SET_REFCOUNT_P(phar->metadata, 1); -#endif } } diff --git a/ext/phar/zip.c b/ext/phar/zip.c index 6ba745e9cbf74..2e977b8840fe1 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -417,11 +417,11 @@ int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias, php_stream_seek(fp, 0, SEEK_SET); /* copy file contents + local headers and zip comment, if any, to be hashed for signature */ - phar_stream_copy_to_stream(fp, sigfile, entry.header_offset, NULL); + php_stream_copy_to_stream_ex(fp, sigfile, entry.header_offset, NULL); /* seek to central directory */ php_stream_seek(fp, PHAR_GET_32(locator.cdir_offset), SEEK_SET); /* copy central directory header */ - phar_stream_copy_to_stream(fp, sigfile, beforeus - PHAR_GET_32(locator.cdir_offset), NULL); + php_stream_copy_to_stream_ex(fp, sigfile, beforeus - PHAR_GET_32(locator.cdir_offset), NULL); if (metadata) { php_stream_write(sigfile, metadata, PHAR_GET_16(locator.comment_len)); } @@ -578,10 +578,6 @@ int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias, /* construct actual offset to file start - local extra_len can be different from central extra_len */ entry.offset = entry.offset_abs = sizeof(local) + entry.header_offset + PHAR_GET_16(local.filename_len) + PHAR_GET_16(local.extra_len); -#if PHP_VERSION_ID < 50207 - /* work around Bug #46147 */ - fp->writepos = fp->readpos = 0; -#endif php_stream_seek(fp, entry.offset, SEEK_SET); /* these next lines should be for php < 5.2.6 after 5.3 filters are fixed */ fp->writepos = 0; @@ -605,9 +601,6 @@ int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias, if (!(entry.uncompressed_filesize = php_stream_copy_to_mem(fp, &actual_alias, entry.uncompressed_filesize, 0)) || !actual_alias) { pefree(entry.filename, entry.is_persistent); -#if PHP_VERSION_ID < 50207 - PHAR_ZIP_FAIL("unable to read in alias, truncated (PHP 5.2.7 and newer has a potential fix for this problem)"); -#endif PHAR_ZIP_FAIL("unable to read in alias, truncated"); } @@ -626,9 +619,6 @@ int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias, if (!(entry.uncompressed_filesize = php_stream_copy_to_mem(fp, &actual_alias, entry.uncompressed_filesize, 0)) || !actual_alias) { pefree(entry.filename, entry.is_persistent); -#if PHP_VERSION_ID < 50207 - PHAR_ZIP_FAIL("unable to read in alias, truncated (PHP 5.2.7 and newer has a potential fix for this problem)"); -#endif PHAR_ZIP_FAIL("unable to read in alias, truncated"); } @@ -915,7 +905,7 @@ static int phar_zip_changed_apply(void *data, void *arg TSRMLS_DC) /* {{{ */ php_stream_filter_append((&entry->cfp->writefilters), filter); - if (SUCCESS != phar_stream_copy_to_stream(efp, entry->cfp, entry->uncompressed_filesize, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(efp, entry->cfp, entry->uncompressed_filesize, NULL)) { spprintf(p->error, 0, "unable to copy compressed file contents of file \"%s\" while creating new phar \"%s\"", entry->filename, entry->phar->fname); return ZEND_HASH_APPLY_STOP; } @@ -1020,7 +1010,7 @@ static int phar_zip_changed_apply(void *data, void *arg TSRMLS_DC) /* {{{ */ if (!not_really_modified && entry->is_modified) { if (entry->cfp) { - if (SUCCESS != phar_stream_copy_to_stream(entry->cfp, p->filefp, entry->compressed_filesize, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(entry->cfp, p->filefp, entry->compressed_filesize, NULL)) { spprintf(p->error, 0, "unable to write compressed contents of file \"%s\" in zip-based phar \"%s\"", entry->filename, entry->phar->fname); return ZEND_HASH_APPLY_STOP; } @@ -1034,7 +1024,7 @@ static int phar_zip_changed_apply(void *data, void *arg TSRMLS_DC) /* {{{ */ phar_seek_efp(entry, 0, SEEK_SET, 0, 0 TSRMLS_CC); - if (SUCCESS != phar_stream_copy_to_stream(phar_get_efp(entry, 0 TSRMLS_CC), p->filefp, entry->uncompressed_filesize, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0 TSRMLS_CC), p->filefp, entry->uncompressed_filesize, NULL)) { spprintf(p->error, 0, "unable to write contents of file \"%s\" in zip-based phar \"%s\"", entry->filename, entry->phar->fname); return ZEND_HASH_APPLY_STOP; } @@ -1060,7 +1050,7 @@ static int phar_zip_changed_apply(void *data, void *arg TSRMLS_DC) /* {{{ */ } } - if (!entry->is_dir && entry->compressed_filesize && SUCCESS != phar_stream_copy_to_stream(p->old, p->filefp, entry->compressed_filesize, NULL)) { + if (!entry->is_dir && entry->compressed_filesize && SUCCESS != php_stream_copy_to_stream_ex(p->old, p->filefp, entry->compressed_filesize, NULL)) { spprintf(p->error, 0, "unable to copy contents of file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fname); return ZEND_HASH_APPLY_STOP; } @@ -1103,10 +1093,10 @@ static int phar_zip_applysignature(phar_archive_data *phar, struct _phar_zip_pas st = tell = php_stream_tell(pass->filefp); /* copy the local files, central directory, and the zip comment to generate the hash */ php_stream_seek(pass->filefp, 0, SEEK_SET); - phar_stream_copy_to_stream(pass->filefp, newfile, tell, NULL); + php_stream_copy_to_stream_ex(pass->filefp, newfile, tell, NULL); tell = php_stream_tell(pass->centralfp); php_stream_seek(pass->centralfp, 0, SEEK_SET); - phar_stream_copy_to_stream(pass->centralfp, newfile, tell, NULL); + php_stream_copy_to_stream_ex(pass->centralfp, newfile, tell, NULL); if (metadata->c) { php_stream_write(newfile, metadata->c, metadata->len); } @@ -1441,7 +1431,7 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, long len, int defau { size_t clen; - int ret = phar_stream_copy_to_stream(pass.centralfp, pass.filefp, PHP_STREAM_COPY_ALL, &clen); + int ret = php_stream_copy_to_stream_ex(pass.centralfp, pass.filefp, PHP_STREAM_COPY_ALL, &clen); if (SUCCESS != ret || clen != cdir_size) { if (error) { spprintf(error, 4096, "phar zip flush of \"%s\" failed: unable to write central-directory", phar->fname); @@ -1511,7 +1501,7 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, long len, int defau return EOF; } php_stream_rewind(pass.filefp); - phar_stream_copy_to_stream(pass.filefp, phar->fp, PHP_STREAM_COPY_ALL, NULL); + php_stream_copy_to_stream_ex(pass.filefp, phar->fp, PHP_STREAM_COPY_ALL, NULL); /* we could also reopen the file in "rb" mode but there is no need for that */ php_stream_close(pass.filefp); } diff --git a/ext/posix/tests/posix_getgrnam.phpt b/ext/posix/tests/posix_getgrnam.phpt deleted file mode 100644 index 854db4ac1614d..0000000000000 --- a/ext/posix/tests/posix_getgrnam.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -posix_getgrnam(): Basic tests ---SKIPIF-- - ---FILE-- - ---EXPECT-- -bool(false) -bool(false) -bool(false) diff --git a/ext/posix/tests/posix_getgrnam_basic.phpt b/ext/posix/tests/posix_getgrnam_basic.phpt deleted file mode 100644 index fd5bf23172d86..0000000000000 --- a/ext/posix/tests/posix_getgrnam_basic.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -posix_getgrnam(): Basic tests ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -Basic test of POSIX posix_getgrnam function -bool(false) -bool(false) -bool(false) -===DONE=== \ No newline at end of file diff --git a/ext/posix/tests/posix_getpwnam.phpt b/ext/posix/tests/posix_getpwnam.phpt deleted file mode 100644 index b5de1e4ce233d..0000000000000 --- a/ext/posix/tests/posix_getpwnam.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -posix_getpwnam(): Basic tests ---SKIPIF-- - ---FILE-- - ---EXPECT-- -bool(false) -bool(false) -bool(false) diff --git a/ext/posix/tests/posix_getpwnam_basic.phpt b/ext/posix/tests/posix_getpwnam_basic.phpt deleted file mode 100644 index d675d6c182382..0000000000000 --- a/ext/posix/tests/posix_getpwnam_basic.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -posix_getpwnam(): Basic tests ---SKIPIF-- - ---FILE-- - -===DONE==== ---EXPECT-- -Basic test of POSIX posix_getpwnam function -bool(false) -bool(false) -bool(false) -===DONE==== diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index b1f7484f243ca..cc148b39c5663 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -681,8 +681,8 @@ static zend_op* _get_recv_op(zend_op_array *op_array, zend_uint offset) ++offset; while (op < end) { - if ((op->opcode == ZEND_RECV || op->opcode == ZEND_RECV_INIT) - && op->op1.num == (long)offset) + if ((op->opcode == ZEND_RECV || op->opcode == ZEND_RECV_INIT + || op->opcode == ZEND_RECV_VARIADIC) && op->op1.num == (long)offset) { return op; } @@ -715,6 +715,9 @@ static void _parameter_string(string *str, zend_function *fptr, struct _zend_arg if (arg_info->pass_by_reference) { string_write(str, "&", sizeof("&")-1); } + if (arg_info->is_variadic) { + string_write(str, "...", sizeof("...")-1); + } if (arg_info->name) { string_printf(str, "$%s", arg_info->name); } else { @@ -2652,6 +2655,22 @@ ZEND_METHOD(reflection_parameter, getDefaultValueConstantName) } /* }}} */ +/* {{{ proto public bool ReflectionParameter::isVariadic() + Returns whether this parameter is a variadic parameter */ +ZEND_METHOD(reflection_parameter, isVariadic) +{ + reflection_object *intern; + parameter_reference *param; + + if (zend_parse_parameters_none() == FAILURE) { + return; + } + GET_REFLECTION_OBJECT_PTR(param); + + RETVAL_BOOL(param->arg_info->is_variadic); +} +/* }}} */ + /* {{{ proto public static mixed ReflectionMethod::export(mixed class, string name [, bool return]) throws ReflectionException Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ ZEND_METHOD(reflection_method, export) @@ -3095,6 +3114,14 @@ ZEND_METHOD(reflection_function, isGenerator) } /* }}} */ +/* {{{ proto public bool ReflectionFunction::isVariadic() + Returns whether this function is variadic */ +ZEND_METHOD(reflection_function, isVariadic) +{ + _function_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_VARIADIC); +} +/* }}} */ + /* {{{ proto public bool ReflectionFunction::inNamespace() Returns whether this function is defined in namespace */ ZEND_METHOD(reflection_function, inNamespace) @@ -5720,6 +5747,7 @@ static const zend_function_entry reflection_function_abstract_functions[] = { ZEND_ME(reflection_function, isInternal, arginfo_reflection__void, 0) ZEND_ME(reflection_function, isUserDefined, arginfo_reflection__void, 0) ZEND_ME(reflection_function, isGenerator, arginfo_reflection__void, 0) + ZEND_ME(reflection_function, isVariadic, arginfo_reflection__void, 0) ZEND_ME(reflection_function, getClosureThis, arginfo_reflection__void, 0) ZEND_ME(reflection_function, getClosureScopeClass, arginfo_reflection__void, 0) ZEND_ME(reflection_function, getDocComment, arginfo_reflection__void, 0) @@ -6022,6 +6050,7 @@ static const zend_function_entry reflection_parameter_functions[] = { ZEND_ME(reflection_parameter, getDefaultValue, arginfo_reflection__void, 0) ZEND_ME(reflection_parameter, isDefaultValueConstant, arginfo_reflection__void, 0) ZEND_ME(reflection_parameter, getDefaultValueConstantName, arginfo_reflection__void, 0) + ZEND_ME(reflection_parameter, isVariadic, arginfo_reflection__void, 0) PHP_FE_END }; diff --git a/ext/reflection/tests/ReflectionFunction_isVariadic_basic.phpt b/ext/reflection/tests/ReflectionFunction_isVariadic_basic.phpt new file mode 100644 index 0000000000000..50b6bb495e449 --- /dev/null +++ b/ext/reflection/tests/ReflectionFunction_isVariadic_basic.phpt @@ -0,0 +1,18 @@ +--TEST-- +ReflectionFunction::isVariadic() +--FILE-- +isVariadic()); +var_dump((new ReflectionFunction('test2'))->isVariadic()); +var_dump((new ReflectionFunction('test3'))->isVariadic()); + +?> +--EXPECT-- +bool(false) +bool(true) +bool(true) diff --git a/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt b/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt index 82c62001226b2..4772f6548dcae 100644 --- a/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt +++ b/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt @@ -61,6 +61,10 @@ Name: SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING Is passed by reference: yes Can be passed by value: yes +Name: more_array_and_sort_options +Is passed by reference: yes +Can be passed by value: yes + => sort: Name: arg diff --git a/ext/reflection/tests/ReflectionParameter_isVariadic_basic.phpt b/ext/reflection/tests/ReflectionParameter_isVariadic_basic.phpt new file mode 100644 index 0000000000000..370edc388df39 --- /dev/null +++ b/ext/reflection/tests/ReflectionParameter_isVariadic_basic.phpt @@ -0,0 +1,24 @@ +--TEST-- +ReflectionParameter::isVariadic() +--FILE-- +getParameters()[0]->isVariadic()); +var_dump($r2->getParameters()[0]->isVariadic()); +var_dump($r3->getParameters()[0]->isVariadic()); +var_dump($r3->getParameters()[1]->isVariadic()); + +?> +--EXPECT-- +bool(false) +bool(true) +bool(false) +bool(true) diff --git a/ext/reflection/tests/ReflectionParameter_toString_basic.phpt b/ext/reflection/tests/ReflectionParameter_toString_basic.phpt index 268ced15eca32..d1a23c758d3a3 100644 --- a/ext/reflection/tests/ReflectionParameter_toString_basic.phpt +++ b/ext/reflection/tests/ReflectionParameter_toString_basic.phpt @@ -4,7 +4,7 @@ ReflectionParameter::__toString() Stefan Koopmanschap --FILE-- $value) { --EXPECT-- Parameter #0 [ $test ] Parameter #1 [ $test2 = NULL ] +Parameter #2 [ ...$test3 ] ==DONE== diff --git a/ext/skeleton/php_skeleton.h b/ext/skeleton/php_skeleton.h index 86836c03e287a..d0ba6f04abea4 100644 --- a/ext/skeleton/php_skeleton.h +++ b/ext/skeleton/php_skeleton.h @@ -6,6 +6,8 @@ extern zend_module_entry extname_module_entry; #define phpext_extname_ptr &extname_module_entry +#define PHP_EXTNAME_VERSION "0.1.0" /* Replace with version number for your extension */ + #ifdef PHP_WIN32 # define PHP_EXTNAME_API __declspec(dllexport) #elif defined(__GNUC__) && __GNUC__ >= 4 diff --git a/ext/skeleton/skeleton.c b/ext/skeleton/skeleton.c index b9a918806c810..462e48756ff07 100644 --- a/ext/skeleton/skeleton.c +++ b/ext/skeleton/skeleton.c @@ -142,7 +142,7 @@ zend_module_entry extname_module_entry = { PHP_RINIT(extname), /* Replace with NULL if there's nothing to do at request start */ PHP_RSHUTDOWN(extname), /* Replace with NULL if there's nothing to do at request end */ PHP_MINFO(extname), - "0.1", /* Replace with version number for your extension */ + PHP_EXTNAME_VERSION, STANDARD_MODULE_PROPERTIES }; /* }}} */ diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index 0ac4c2ed7a9bf..a7a5071c08535 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -2644,16 +2644,17 @@ static sdlAttributePtr make_persistent_sdl_attribute(sdlAttributePtr attr, HashT zend_hash_internal_pointer_reset(pattr->extraAttributes); while (zend_hash_get_current_data(attr->extraAttributes, (void**)&tmp) == SUCCESS) { - pextra = malloc(sizeof(sdlExtraAttribute)); - memset(pextra, 0, sizeof(sdlExtraAttribute)); - if ((*tmp)->ns) { - pextra->ns = strdup((*tmp)->ns); - } - if ((*tmp)->val) { - pextra->val = strdup((*tmp)->val); - } + if (zend_hash_get_current_key_ex(attr->extraAttributes, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) { + pextra = malloc(sizeof(sdlExtraAttribute)); + memset(pextra, 0, sizeof(sdlExtraAttribute)); - if (zend_hash_get_current_key_ex(attr->extraAttributes, &key, &key_len, &index, 0, NULL) == HASH_KEY_IS_STRING) { + if ((*tmp)->ns) { + pextra->ns = strdup((*tmp)->ns); + } + if ((*tmp)->val) { + pextra->val = strdup((*tmp)->val); + } + zend_hash_add(pattr->extraAttributes, key, key_len, (void*)&pextra, sizeof(sdlExtraAttributePtr), NULL); } diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 00e80efbcbca4..c5900dc645af4 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -1560,48 +1560,45 @@ PHP_METHOD(SoapServer, handle) } if (ZEND_NUM_ARGS() == 0) { - if (SG(request_info).raw_post_data) { - char *post_data = SG(request_info).raw_post_data; - int post_data_length = SG(request_info).raw_post_data_length; + if (SG(request_info).request_body && 0 == php_stream_rewind(SG(request_info).request_body)) { zval **server_vars, **encoding; + php_stream_filter *zf = NULL; zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC); if (zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &server_vars) == SUCCESS && Z_TYPE_PP(server_vars) == IS_ARRAY && zend_hash_find(Z_ARRVAL_PP(server_vars), "HTTP_CONTENT_ENCODING", sizeof("HTTP_CONTENT_ENCODING"), (void **) &encoding)==SUCCESS && Z_TYPE_PP(encoding) == IS_STRING) { - zval func; - zval retval; - zval param; - zval *params[1]; - - if ((strcmp(Z_STRVAL_PP(encoding),"gzip") == 0 || - strcmp(Z_STRVAL_PP(encoding),"x-gzip") == 0) && - zend_hash_exists(EG(function_table), "gzinflate", sizeof("gzinflate"))) { - ZVAL_STRING(&func, "gzinflate", 0); - params[0] = ¶m; - ZVAL_STRINGL(params[0], post_data+10, post_data_length-10, 0); - INIT_PZVAL(params[0]); - } else if (strcmp(Z_STRVAL_PP(encoding),"deflate") == 0 && - zend_hash_exists(EG(function_table), "gzuncompress", sizeof("gzuncompress"))) { - ZVAL_STRING(&func, "gzuncompress", 0); - params[0] = ¶m; - ZVAL_STRINGL(params[0], post_data, post_data_length, 0); - INIT_PZVAL(params[0]); + + if (strcmp(Z_STRVAL_PP(encoding),"gzip") == 0 + || strcmp(Z_STRVAL_PP(encoding),"x-gzip") == 0 + || strcmp(Z_STRVAL_PP(encoding),"deflate") == 0 + ) { + zval filter_params; + + INIT_PZVAL(&filter_params); + array_init_size(&filter_params, 1); + add_assoc_long_ex(&filter_params, ZEND_STRS("window"), 0x2f); /* ANY WBITS */ + + zf = php_stream_filter_create("zlib.inflate", &filter_params, 0 TSRMLS_CC); + zval_dtor(&filter_params); + + if (zf) { + php_stream_filter_append(&SG(request_info).request_body->readfilters, zf); + } else { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Can't uncompress compressed request"); + return; + } } else { php_error_docref(NULL TSRMLS_CC, E_WARNING,"Request is compressed with unknown compression '%s'",Z_STRVAL_PP(encoding)); return; } - if (call_user_function(CG(function_table), (zval**)NULL, &func, &retval, 1, params TSRMLS_CC) == SUCCESS && - Z_TYPE(retval) == IS_STRING) { - doc_request = soap_xmlParseMemory(Z_STRVAL(retval),Z_STRLEN(retval)); - zval_dtor(&retval); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Can't uncompress compressed request"); - return; - } - } else { - doc_request = soap_xmlParseMemory(post_data, post_data_length); + } + + doc_request = soap_xmlParseFile("php://input" TSRMLS_CC); + + if (zf) { + php_stream_filter_remove(zf, 1 TSRMLS_CC); } } else { zval_ptr_dtor(&retval); diff --git a/ext/sockets/conversions.c b/ext/sockets/conversions.c index ed55ed52fa754..d81484521d8c0 100644 --- a/ext/sockets/conversions.c +++ b/ext/sockets/conversions.c @@ -1257,7 +1257,7 @@ void to_zval_read_msghdr(const char *msghdr_c, zval *zv, res_context *ctx) /* CONVERSIONS for if_index */ static void from_zval_write_ifindex(const zval *zv, char *uinteger, ser_context *ctx) { - unsigned ret; + unsigned ret = 0; zval lzval = zval_used_for_init; if (Z_TYPE_P(zv) == IS_LONG) { diff --git a/ext/sockets/multicast.c b/ext/sockets/multicast.c index 7466c6266e7f1..ecf3a65a325e6 100644 --- a/ext/sockets/multicast.c +++ b/ext/sockets/multicast.c @@ -63,6 +63,28 @@ static const char *_php_source_op_to_string(enum source_op sop); static int _php_source_op_to_ipv4_op(enum source_op sop); #endif +int php_string_to_if_index(const char *val, unsigned *out TSRMLS_DC) +{ +#if HAVE_IF_NAMETOINDEX + unsigned int ind; + + ind = if_nametoindex(val); + if (ind == 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, + "no interface with name \"%s\" could be found", val); + return FAILURE; + } else { + *out = ind; + return SUCCESS; + } +#else + php_error_docref(NULL TSRMLS_CC, E_WARNING, + "this platform does not support looking up an interface by " + "name, an integer interface index must be supplied instead"); + return FAILURE; +#endif +} + static int php_get_if_index_from_zval(zval *val, unsigned *out TSRMLS_DC) { int ret; @@ -78,31 +100,17 @@ static int php_get_if_index_from_zval(zval *val, unsigned *out TSRMLS_DC) ret = SUCCESS; } } else { -#if HAVE_IF_NAMETOINDEX - unsigned int ind; zval_add_ref(&val); convert_to_string_ex(&val); - ind = if_nametoindex(Z_STRVAL_P(val)); - if (ind == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "no interface with name \"%s\" could be found", Z_STRVAL_P(val)); - ret = FAILURE; - } else { - *out = ind; - ret = SUCCESS; - } + ret = php_string_to_if_index(Z_STRVAL_P(val), out TSRMLS_CC); zval_ptr_dtor(&val); -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "this platform does not support looking up an interface by " - "name, an integer interface index must be supplied instead"); - ret = FAILURE; -#endif } return ret; } + + static int php_get_if_index_from_array(const HashTable *ht, const char *key, php_socket *sock, unsigned int *if_index TSRMLS_DC) { diff --git a/ext/sockets/multicast.h b/ext/sockets/multicast.h index 3614306bbb219..81a1bca799322 100644 --- a/ext/sockets/multicast.h +++ b/ext/sockets/multicast.h @@ -65,6 +65,8 @@ int php_add4_to_if_index( php_socket *php_sock, unsigned *if_index TSRMLS_DC); +int php_string_to_if_index(const char *val, unsigned *out TSRMLS_DC); + int php_mcast_join( php_socket *sock, int level, diff --git a/ext/sockets/sockaddr_conv.c b/ext/sockets/sockaddr_conv.c index a40b6b4936cbb..64523c3191d0b 100644 --- a/ext/sockets/sockaddr_conv.c +++ b/ext/sockets/sockaddr_conv.c @@ -18,6 +18,7 @@ int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_ struct addrinfo hints; struct addrinfo *addrinfo = NULL; #endif + char *scope = strchr(string, '%'); if (inet_pton(AF_INET6, string, &tmp)) { memcpy(&(sin6->sin6_addr.s6_addr), &(tmp.s6_addr), sizeof(struct in6_addr)); @@ -53,6 +54,22 @@ int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_ } + if (scope++) { + long lval = 0; + double dval = 0; + unsigned scope_id = 0; + + if (IS_LONG == is_numeric_string(scope, strlen(scope), &lval, &dval, 0)) { + if (lval > 0 && lval <= UINT_MAX) { + scope_id = lval; + } + } else { + php_string_to_if_index(scope, &scope_id TSRMLS_CC); + } + + sin6->sin6_scope_id = scope_id; + } + return 1; } /* }}} */ diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 1a417d0f5850a..f73e8ee9f0db4 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -2290,7 +2290,7 @@ SPL_METHOD(SplFileObject, __construct) intern->u.file.open_mode = NULL; intern->u.file.open_mode_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|sbr", + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|sbr!", &intern->file_name, &intern->file_name_len, &intern->u.file.open_mode, &intern->u.file.open_mode_len, &use_include_path, &intern->u.file.zcontext) == FAILURE) { @@ -2938,8 +2938,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fgetss, 0, 0, 0) ZEND_ARG_INFO(0, allowable_tags) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fscanf, 1, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fscanf, 0, 0, 1) ZEND_ARG_INFO(0, format) + ZEND_ARG_VARIADIC_INFO(1, vars) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fwrite, 0, 0, 1) diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c index 273bc7506aa74..d5a9f83ae1411 100644 --- a/ext/spl/spl_dllist.c +++ b/ext/spl/spl_dllist.c @@ -603,7 +603,7 @@ SPL_METHOD(SplDoublyLinkedList, pop) zval *value; spl_dllist_object *intern; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { + if (zend_parse_parameters_none() == FAILURE) { return; } @@ -626,7 +626,7 @@ SPL_METHOD(SplDoublyLinkedList, shift) zval *value; spl_dllist_object *intern; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { + if (zend_parse_parameters_none() == FAILURE) { return; } @@ -649,7 +649,7 @@ SPL_METHOD(SplDoublyLinkedList, top) zval *value; spl_dllist_object *intern; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { + if (zend_parse_parameters_none() == FAILURE) { return; } @@ -672,7 +672,7 @@ SPL_METHOD(SplDoublyLinkedList, bottom) zval *value; spl_dllist_object *intern; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { + if (zend_parse_parameters_none() == FAILURE) { return; } @@ -695,7 +695,7 @@ SPL_METHOD(SplDoublyLinkedList, count) long count; spl_dllist_object *intern = (spl_dllist_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { + if (zend_parse_parameters_none() == FAILURE) { return; } @@ -710,7 +710,7 @@ SPL_METHOD(SplDoublyLinkedList, isEmpty) { long count; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { + if (zend_parse_parameters_none() == FAILURE) { return; } @@ -750,7 +750,7 @@ SPL_METHOD(SplDoublyLinkedList, getIteratorMode) { spl_dllist_object *intern; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { + if (zend_parse_parameters_none() == FAILURE) { return; } diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c index 86a5371ed30d3..8624b35a4b616 100644 --- a/ext/spl/spl_fixedarray.c +++ b/ext/spl/spl_fixedarray.c @@ -583,7 +583,7 @@ SPL_METHOD(SplFixedArray, __construct) spl_fixedarray_object *intern; long size = 0; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &size)) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &size) == FAILURE) { return; } @@ -613,7 +613,7 @@ SPL_METHOD(SplFixedArray, __wakeup) HashTable *intern_ht = zend_std_get_properties(getThis() TSRMLS_CC); zval **data; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "")) { + if (zend_parse_parameters_none() == FAILURE) { return; } @@ -643,7 +643,7 @@ SPL_METHOD(SplFixedArray, count) zval *object = getThis(); spl_fixedarray_object *intern; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "")) { + if (zend_parse_parameters_none() == FAILURE) { return; } @@ -661,7 +661,7 @@ SPL_METHOD(SplFixedArray, toArray) { spl_fixedarray_object *intern; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "")) { + if (zend_parse_parameters_none() == FAILURE) { return; } @@ -693,7 +693,7 @@ SPL_METHOD(SplFixedArray, fromArray) int num; zend_bool save_indexes = 1; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|b", &data, &save_indexes)) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|b", &data, &save_indexes) == FAILURE) { return; } @@ -777,7 +777,7 @@ SPL_METHOD(SplFixedArray, getSize) zval *object = getThis(); spl_fixedarray_object *intern; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "")) { + if (zend_parse_parameters_none() == FAILURE) { return; } @@ -797,7 +797,7 @@ SPL_METHOD(SplFixedArray, setSize) spl_fixedarray_object *intern; long size; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &size)) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &size) == FAILURE) { return; } diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c index cb1f68dcf1196..77b31c06dcdc7 100644 --- a/ext/spl/spl_heap.c +++ b/ext/spl/spl_heap.c @@ -587,7 +587,7 @@ SPL_METHOD(SplHeap, count) long count; spl_heap_object *intern = (spl_heap_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { + if (zend_parse_parameters_none() == FAILURE) { return; } @@ -602,7 +602,7 @@ SPL_METHOD(SplHeap, isEmpty) { spl_heap_object *intern = (spl_heap_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { + if (zend_parse_parameters_none() == FAILURE) { return; } @@ -643,7 +643,7 @@ SPL_METHOD(SplHeap, extract) zval *value; spl_heap_object *intern; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { + if (zend_parse_parameters_none() == FAILURE) { return; } @@ -705,7 +705,7 @@ SPL_METHOD(SplPriorityQueue, extract) zval *value, *value_out, **value_out_pp; spl_heap_object *intern; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { + if (zend_parse_parameters_none() == FAILURE) { return; } @@ -748,7 +748,7 @@ SPL_METHOD(SplPriorityQueue, top) zval *value, **value_out; spl_heap_object *intern; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { + if (zend_parse_parameters_none() == FAILURE) { return; } @@ -802,7 +802,7 @@ SPL_METHOD(SplHeap, recoverFromCorruption) { spl_heap_object *intern; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { + if (zend_parse_parameters_none() == FAILURE) { return; } @@ -835,7 +835,7 @@ SPL_METHOD(SplHeap, top) zval *value; spl_heap_object *intern; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { + if (zend_parse_parameters_none() == FAILURE) { return; } diff --git a/ext/spl/tests/DirectoryIterator_getBasename_basic_test.phpt b/ext/spl/tests/DirectoryIterator_getBasename_basic_test.phpt index ed1f473be9ed3..d4f22f68a1ba3 100644 --- a/ext/spl/tests/DirectoryIterator_getBasename_basic_test.phpt +++ b/ext/spl/tests/DirectoryIterator_getBasename_basic_test.phpt @@ -4,7 +4,7 @@ DirectoryIterator::getBasename() - Basic Test PHPNW Testfest 2009 - Adrian Hardy --FILE-- --CLEAN-- diff --git a/ext/spl/tests/DirectoryIterator_getBasename_pass_array.phpt b/ext/spl/tests/DirectoryIterator_getBasename_pass_array.phpt index b2df8a55c947d..ef1352023748c 100644 --- a/ext/spl/tests/DirectoryIterator_getBasename_pass_array.phpt +++ b/ext/spl/tests/DirectoryIterator_getBasename_pass_array.phpt @@ -4,7 +4,7 @@ DirectoryIterator::getBasename() - Pass unexpected array PHPNW Testfest 2009 - Adrian Hardy --FILE-- --CLEAN-- diff --git a/ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt b/ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt index f0b2b0182cc90..f6bc266cb1d2a 100644 --- a/ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt +++ b/ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt @@ -5,7 +5,7 @@ Pawel Krynicki #testfest AmsterdamPHP 2012-06-23 --FILE-- diff --git a/ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt b/ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt index 7b12672e14c50..6527d84bfe854 100644 --- a/ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt +++ b/ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt @@ -5,7 +5,7 @@ Pawel Krynicki #testfest AmsterdamPHP 2012-06-23 --FILE-- --EXPECTF-- diff --git a/ext/spl/tests/SplFileObject_fgetcsv_basic.phpt b/ext/spl/tests/SplFileObject_fgetcsv_basic.phpt index abfe5f235f334..84b540369865c 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_basic.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_basic.phpt @@ -2,7 +2,7 @@ SplFileObject::fgetcsv default path --FILE-- fgetcsv()); ?> --CLEAN-- --EXPECTF-- array(4) { diff --git a/ext/spl/tests/SplFileObject_fgetcsv_delimiter_basic.phpt b/ext/spl/tests/SplFileObject_fgetcsv_delimiter_basic.phpt index 4402d6ca4c32e..a8125a0257128 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_delimiter_basic.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_delimiter_basic.phpt @@ -2,7 +2,7 @@ SplFileObject::fgetcsv with alternative delimiter --FILE-- fgetcsv('|')); ?> --CLEAN-- --EXPECTF-- array(4) { diff --git a/ext/spl/tests/SplFileObject_fgetcsv_delimiter_error.phpt b/ext/spl/tests/SplFileObject_fgetcsv_delimiter_error.phpt index 64d6514a29a4a..169ded7dc3ccd 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_delimiter_error.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_delimiter_error.phpt @@ -2,7 +2,7 @@ SplFileObject::fgetcsv with alternative delimiter --FILE-- fgetcsv('invalid')); ?> --CLEAN-- --EXPECTF-- Warning: SplFileObject::fgetcsv(): delimiter must be a character in %s on line %d diff --git a/ext/spl/tests/SplFileObject_fgetcsv_enclosure_basic.phpt b/ext/spl/tests/SplFileObject_fgetcsv_enclosure_basic.phpt index efbb5fb68559f..efe765cbf84dd 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_enclosure_basic.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_enclosure_basic.phpt @@ -2,7 +2,7 @@ SplFileObject::fgetcsv with alternative delimiter --FILE-- fgetcsv(',', '"')); ?> --CLEAN-- --EXPECTF-- array(4) { diff --git a/ext/spl/tests/SplFileObject_fgetcsv_enclosure_error.phpt b/ext/spl/tests/SplFileObject_fgetcsv_enclosure_error.phpt index 7487b8353c96a..f8c14f0e35e41 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_enclosure_error.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_enclosure_error.phpt @@ -2,7 +2,7 @@ SplFileObject::fgetcsv with alternative delimiter --FILE-- fgetcsv(',', 'invalid')); ?> --CLEAN-- --EXPECTF-- Warning: SplFileObject::fgetcsv(): enclosure must be a character in %s on line %d diff --git a/ext/spl/tests/SplFileObject_fgetcsv_escape_basic.phpt b/ext/spl/tests/SplFileObject_fgetcsv_escape_basic.phpt index 1a94532b2b6b5..960f36d63f635 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_escape_basic.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_escape_basic.phpt @@ -2,16 +2,16 @@ SplFileObject::fgetcsv with alternative delimiter --FILE-- fgetcsv(',', '"', '"')); ?> --CLEAN-- --EXPECTF-- array(3) { diff --git a/ext/spl/tests/SplFileObject_fgetcsv_escape_default.phpt b/ext/spl/tests/SplFileObject_fgetcsv_escape_default.phpt index c628ac043d82c..69089636c1166 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_escape_default.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_escape_default.phpt @@ -2,16 +2,16 @@ SplFileObject::fgetcsv with default escape character --FILE-- fgetcsv()); ?> --CLEAN-- --EXPECTF-- array(3) { diff --git a/ext/spl/tests/SplFileObject_fgetcsv_escape_error.phpt b/ext/spl/tests/SplFileObject_fgetcsv_escape_error.phpt index fd90103bfa7ef..b49bcdd13c345 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_escape_error.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_escape_error.phpt @@ -2,16 +2,16 @@ SplFileObject::fgetcsv with alternative delimiter --FILE-- fgetcsv(',', '"', 'invalid')); ?> --CLEAN-- --EXPECTF-- Warning: SplFileObject::fgetcsv(): escape must be a character in %s on line %d diff --git a/ext/spl/tests/SplFileObject_fputcsv_002.phpt b/ext/spl/tests/SplFileObject_fputcsv_002.phpt index db174931f704b..fdd4112ee6dd5 100644 --- a/ext/spl/tests/SplFileObject_fputcsv_002.phpt +++ b/ext/spl/tests/SplFileObject_fputcsv_002.phpt @@ -2,7 +2,7 @@ SplFileObject::fputcsv(): Checking data after calling the function --FILE-- --CLEAN-- --EXPECTF-- diff --git a/ext/spl/tests/SplFileObject_fputcsv_error.phpt b/ext/spl/tests/SplFileObject_fputcsv_error.phpt index 8368e4211dedc..cdee48c874b7e 100644 --- a/ext/spl/tests/SplFileObject_fputcsv_error.phpt +++ b/ext/spl/tests/SplFileObject_fputcsv_error.phpt @@ -2,7 +2,7 @@ SplFileObject::fputcsv(): error conditions --FILE-- fputcsv($fields, $delim, $enclosure, $fo) ); echo "Done\n"; --CLEAN-- --EXPECTF-- diff --git a/ext/spl/tests/SplFileObject_getflags_basic.phpt b/ext/spl/tests/SplFileObject_getflags_basic.phpt index 5addadf38046e..88cf6861a2921 100644 --- a/ext/spl/tests/SplFileObject_getflags_basic.phpt +++ b/ext/spl/tests/SplFileObject_getflags_basic.phpt @@ -7,16 +7,16 @@ Erwin Poeze --FILE-- setFlags(SplFileObject::DROP_NEW_LINE); var_dump($fo->getFlags()); ?> --CLEAN-- --EXPECT-- int(1) diff --git a/ext/spl/tests/SplFileObject_getflags_error001.phpt b/ext/spl/tests/SplFileObject_getflags_error001.phpt index 1602f88885e11..ca53c857e7e6b 100644 --- a/ext/spl/tests/SplFileObject_getflags_error001.phpt +++ b/ext/spl/tests/SplFileObject_getflags_error001.phpt @@ -7,10 +7,10 @@ Erwin Poeze --FILE-- setFlags(SplFileObject::READ_CSV); $fo->setFlags(SplFileObject::DROP_NEW_LINE); @@ -20,7 +20,7 @@ var_dump($fo->getFlags()); ?> --CLEAN-- --EXPECT-- int(1) diff --git a/ext/spl/tests/SplFileObject_getflags_error002.phpt b/ext/spl/tests/SplFileObject_getflags_error002.phpt index e2c8255f44960..00fd351db8cca 100644 --- a/ext/spl/tests/SplFileObject_getflags_error002.phpt +++ b/ext/spl/tests/SplFileObject_getflags_error002.phpt @@ -5,9 +5,9 @@ Erwin Poeze --FILE-- setFlags(SplFileObject::READ_CSV); $fo->getFlags('fake'); @@ -15,7 +15,7 @@ $fo->getFlags('fake'); ?> --CLEAN-- --EXPECTF-- Warning: SplFileObject::getFlags() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/spl/tests/SplFileObject_rewind_error001.phpt b/ext/spl/tests/SplFileObject_rewind_error001.phpt index ac536a0a44af5..5f2379aa13911 100644 --- a/ext/spl/tests/SplFileObject_rewind_error001.phpt +++ b/ext/spl/tests/SplFileObject_rewind_error001.phpt @@ -7,16 +7,16 @@ Erwin Poeze --FILE-- rewind( "invalid" ); ?> --CLEAN-- --EXPECTF-- Warning: SplFileObject::rewind() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/spl/tests/bug51532.phpt b/ext/spl/tests/bug51532.phpt index 3a0722b2af68d..26eaa8f82f87d 100644 --- a/ext/spl/tests/bug51532.phpt +++ b/ext/spl/tests/bug51532.phpt @@ -4,7 +4,7 @@ SPL: Allow valid extension of SplFileObject::fscanf +--EXPECTF-- +object(SplFileObject)#1 (%d) { + ["pathName":"SplFileInfo":private]=> + string(%d) "%s/bug64782.php" + ["fileName":"SplFileInfo":private]=> + string(12) "bug64782.php" + ["openMode":"SplFileObject":private]=> + string(1) "r" + ["delimiter":"SplFileObject":private]=> + string(1) "," + ["enclosure":"SplFileObject":private]=> + string(1) """ +} diff --git a/ext/spl/tests/dit_006.phpt b/ext/spl/tests/dit_006.phpt index 1e627a20e0adc..9edbb9f15716e 100644 --- a/ext/spl/tests/dit_006.phpt +++ b/ext/spl/tests/dit_006.phpt @@ -2,7 +2,7 @@ SPL: DirectoryIterator and seek --FILE-- seek(2); $n = 0; diff --git a/ext/sqlite3/config.w32 b/ext/sqlite3/config.w32 index 01e4625feddd1..8ddb6b9ac8b4b 100644 --- a/ext/sqlite3/config.w32 +++ b/ext/sqlite3/config.w32 @@ -4,7 +4,7 @@ ARG_WITH("sqlite3", "SQLite 3 support", "no"); if (PHP_SQLITE3 != "no") { - ADD_FLAG("CFLAGS_SQLITE3", "/D SQLITE_THREADSAFE=" + (PHP_ZTS == "yes" ? "1" : "0") + " /D SQLITE_ENABLE_FTS3=1 /D SQLITE_ENABLE_COLUMN_METADATA=1 /D SQLITE_CORE=1 "); + ADD_FLAG("CFLAGS_SQLITE3", "/D SQLITE_THREADSAFE=" + (PHP_ZTS == "yes" ? "1" : "0") + " /D SQLITE_ENABLE_FTS3=1 /D SQLITE_ENABLE_COLUMN_METADATA=1 /D SQLITE_CORE=1 /D SQLITE_API=__declspec(dllexport) "); EXTENSION("sqlite3", "sqlite3.c", null, "/I" + configure_module_dirname + "/libsqlite /I" + configure_module_dirname); ADD_SOURCES(configure_module_dirname + "/libsqlite", "sqlite3.c", "sqlite3"); diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index 2aef0414aab69..19bf58deb8f19 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -1890,7 +1890,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_sqlite3stmt_bindvalue, 0, 0, 2) ZEND_ARG_INFO(0, type) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO(arginfo_sqlite3stmt_construct, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_sqlite3stmt_construct, 0, 0, 1) ZEND_ARG_INFO(0, sqlite3) ZEND_END_ARG_INFO() diff --git a/ext/standard/array.c b/ext/standard/array.c index 51972033ee711..ae6e5d266fa29 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -830,7 +830,7 @@ PHP_FUNCTION(end) RETURN_FALSE; } - RETURN_ZVAL(*entry, 1, 0); + RETURN_ZVAL_FAST(*entry); } } /* }}} */ @@ -853,7 +853,7 @@ PHP_FUNCTION(prev) RETURN_FALSE; } - RETURN_ZVAL(*entry, 1, 0); + RETURN_ZVAL_FAST(*entry); } } /* }}} */ @@ -876,7 +876,7 @@ PHP_FUNCTION(next) RETURN_FALSE; } - RETURN_ZVAL(*entry, 1, 0); + RETURN_ZVAL_FAST(*entry); } } /* }}} */ @@ -899,7 +899,7 @@ PHP_FUNCTION(reset) RETURN_FALSE; } - RETURN_ZVAL(*entry, 1, 0); + RETURN_ZVAL_FAST(*entry); } } /* }}} */ @@ -918,7 +918,8 @@ PHP_FUNCTION(current) if (zend_hash_get_current_data(array, (void **) &entry) == FAILURE) { RETURN_FALSE; } - RETURN_ZVAL(*entry, 1, 0); + + RETURN_ZVAL_FAST(*entry); } /* }}} */ @@ -958,7 +959,7 @@ PHP_FUNCTION(min) RETVAL_NULL(); } else { if (zend_hash_minmax(Z_ARRVAL_PP(args[0]), php_array_data_compare, 0, (void **) &result TSRMLS_CC) == SUCCESS) { - RETVAL_ZVAL(*result, 1, 0); + RETVAL_ZVAL_FAST(*result); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain at least one element"); RETVAL_FALSE; @@ -978,7 +979,7 @@ PHP_FUNCTION(min) } } - RETVAL_ZVAL(*min, 1, 0); + RETVAL_ZVAL_FAST(*min); } if (args) { @@ -1009,7 +1010,7 @@ PHP_FUNCTION(max) RETVAL_NULL(); } else { if (zend_hash_minmax(Z_ARRVAL_PP(args[0]), php_array_data_compare, 1, (void **) &result TSRMLS_CC) == SUCCESS) { - RETVAL_ZVAL(*result, 1, 0); + RETVAL_ZVAL_FAST(*result); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain at least one element"); RETVAL_FALSE; @@ -1029,7 +1030,7 @@ PHP_FUNCTION(max) } } - RETVAL_ZVAL(*max, 1, 0); + RETVAL_ZVAL_FAST(*max); } if (args) { @@ -1955,7 +1956,7 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end) zend_hash_internal_pointer_reset(Z_ARRVAL_P(stack)); } zend_hash_get_current_data(Z_ARRVAL_P(stack), (void **)&val); - RETVAL_ZVAL(*val, 1, 0); + RETVAL_ZVAL_FAST(*val); /* Delete the first or last value */ zend_hash_get_current_key_ex(Z_ARRVAL_P(stack), &key, &key_len, &index, 0, NULL); diff --git a/ext/standard/assert.c b/ext/standard/assert.c index 631834c97c0f3..1a24ade79e64f 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -200,7 +200,7 @@ PHP_FUNCTION(assert) } if (ASSERTG(callback)) { - zval **args = safe_emalloc(description_len == 0 ? 3 : 4, sizeof(zval **), 0); + zval **args = safe_emalloc(description_len == 0 ? 3 : 4, sizeof(zval *), 0); zval *retval; int i; uint lineno = zend_get_executed_lineno(TSRMLS_C); diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 3e5084e837642..5ce0d3c126d14 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -288,11 +288,11 @@ ZEND_BEGIN_ARG_INFO(arginfo_reset, 0) ZEND_ARG_INFO(1, arg) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO(arginfo_current, ZEND_SEND_PREFER_REF) +ZEND_BEGIN_ARG_INFO(arginfo_current, 0) ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO(arginfo_key, ZEND_SEND_PREFER_REF) +ZEND_BEGIN_ARG_INFO(arginfo_key, 0) ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg) ZEND_END_ARG_INFO() @@ -564,13 +564,14 @@ ZEND_BEGIN_ARG_INFO(arginfo_array_udiff_uassoc, 0) ZEND_ARG_INFO(0, callback_key_comp_func) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_array_multisort, ZEND_SEND_PREFER_REF, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_array_multisort, 0, 0, 1) ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arr1) /* ARRAY_INFO(0, arg1, 0) */ ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_ASC_or_SORT_DESC) ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING) ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arr2) ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_ASC_or_SORT_DESC) ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING) + ZEND_ARG_VARIADIC_INFO(ZEND_SEND_PREFER_REF, more_array_and_sort_options) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_array_rand, 0, 0, 1) @@ -1139,10 +1140,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_fgetss, 0, 0, 1) ZEND_ARG_INFO(0, allowable_tags) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_fscanf, 1, 0, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_fscanf, 0, 0, 2) ZEND_ARG_INFO(0, stream) ZEND_ARG_INFO(0, format) - ZEND_ARG_INFO(1, ...) + ZEND_ARG_VARIADIC_INFO(1, vars) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_fwrite, 0, 0, 2) @@ -2450,10 +2451,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_str_pad, 0, 0, 2) ZEND_ARG_INFO(0, pad_type) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_sscanf, 1, 0, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_sscanf, 0, 0, 2) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, format) - ZEND_ARG_INFO(1, ...) + ZEND_ARG_VARIADIC_INFO(1, vars) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_str_rot13, 0) @@ -3640,6 +3641,7 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */ BASIC_ADD_SUBMODULE(dl) BASIC_ADD_SUBMODULE(mail) + BASIC_ADD_SUBMODULE(streams) BASIC_MINIT_SUBMODULE(file) BASIC_MINIT_SUBMODULE(pack) BASIC_MINIT_SUBMODULE(browscap) diff --git a/ext/standard/config.m4 b/ext/standard/config.m4 index 2af2209f2bb54..3d00d88dda151 100644 --- a/ext/standard/config.m4 +++ b/ext/standard/config.m4 @@ -182,12 +182,12 @@ AC_TRY_RUN([ main() { #if HAVE_CRYPT - char salt[30], answer[80]; - - salt[0]='$'; salt[1]='6'; salt[2]='$'; salt[3]='$'; salt[4]='b'; salt[5]='a'; salt[6]='r'; salt[7]='\0'; + char salt[21], answer[21+86]; + + strcpy(salt,"\$6\$rasmuslerdorf\$"); strcpy(answer, salt); - strcpy(&answer[29],"$6$$QMXjqd7rHQZPQ1yHsXkQqC1FBzDiVfTHXL.LaeDAeVV.IzMaV9VU4MQ8kPuZa2SOP1A0RPm772EaFYjpEJtdu."); - exit (strcmp((char *)crypt("foo",salt),answer)); + strcat(answer, "EeHCRjm0bljalWuALHSTs1NB9ipEiLEXLhYeXdOpx22gmlmVejnVXFhd84cEKbYxCo.XuUTrW.RLraeEnsvWs/"); + exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer)); #else exit(0); #endif @@ -211,12 +211,13 @@ AC_TRY_RUN([ main() { #if HAVE_CRYPT - char salt[30], answer[80]; - salt[0]='$'; salt[1]='5'; salt[2]='$'; salt[3]='$'; salt[4]='s'; salt[5]='a'; salt[6]='l'; salt[7]='t'; salt[8]='s'; salt[9]='t'; salt[10]='r'; salt[11]='i'; salt[12]='n'; salt[13]='g'; salt[14]='\0'; - strcat(salt,""); + char salt[21], answer[21+43]; + + strcpy(salt,"\$5\$rasmuslerdorf\$"); strcpy(answer, salt); - strcpy(&answer[29], "$5$saltstring$5B8vYYiY.CVt1RlTTf8KbXBH3hsxY/GNooZaBBGWEc5"); - exit (strcmp((char *)crypt("foo",salt),answer)); + strcat(answer, "cFAm2puLCujQ9t.0CxiFIIvFi4JyQx5UncCt/xRIX23"); + exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer)); + #else exit(0); #endif diff --git a/ext/standard/file.c b/ext/standard/file.c index 1ec6a74f3f0b5..2bd35bf8941ae 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -223,10 +223,14 @@ PHP_MINIT_FUNCTION(file) REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv3_CLIENT", STREAM_CRYPTO_METHOD_SSLv3_CLIENT, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv23_CLIENT", STREAM_CRYPTO_METHOD_SSLv23_CLIENT, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLS_CLIENT", STREAM_CRYPTO_METHOD_TLS_CLIENT, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT", STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT", STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv2_SERVER", STREAM_CRYPTO_METHOD_SSLv2_SERVER, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv3_SERVER", STREAM_CRYPTO_METHOD_SSLv3_SERVER, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv23_SERVER", STREAM_CRYPTO_METHOD_SSLv23_SERVER, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLS_SERVER", STREAM_CRYPTO_METHOD_TLS_SERVER, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_1_SERVER", STREAM_CRYPTO_METHOD_TLSv1_1_SERVER, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_2_SERVER", STREAM_CRYPTO_METHOD_TLSv1_2_SERVER, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT("STREAM_SHUT_RD", STREAM_SHUT_RD, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT("STREAM_SHUT_WR", STREAM_SHUT_WR, CONST_CS|CONST_PERSISTENT); diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index ac6fdad4fef3a..f5184ceec6019 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -80,12 +80,38 @@ #define HTTP_HEADER_FROM 8 #define HTTP_HEADER_CONTENT_LENGTH 16 #define HTTP_HEADER_TYPE 32 +#define HTTP_HEADER_CONNECTION 64 #define HTTP_WRAPPER_HEADER_INIT 1 #define HTTP_WRAPPER_REDIRECTED 2 -php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, - char **opened_path, php_stream_context *context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */ +static inline void strip_header(char *header_bag, char *lc_header_bag, + const char *lc_header_name) +{ + char *lc_header_start = strstr(lc_header_bag, lc_header_name); + char *header_start = header_bag + (lc_header_start - lc_header_bag); + + if (lc_header_start + && (lc_header_start == lc_header_bag || *(lc_header_start-1) == '\n') + ) { + char *lc_eol = strchr(lc_header_start, '\n'); + char *eol = header_start + (lc_eol - lc_header_start); + + if (lc_eol) { + size_t eollen = strlen(lc_eol); + + memmove(lc_header_start, lc_eol+1, eollen); + memmove(header_start, eol+1, eollen); + } else { + *lc_header_start = '\0'; + *header_start = '\0'; + } + } +} + +php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, + const char *path, const char *mode, int options, char **opened_path, + php_stream_context *context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */ { php_stream *stream = NULL; php_url *resource = NULL; @@ -386,8 +412,6 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, const char strlcat(scratch, " HTTP/", scratch_len); strlcat(scratch, protocol_version, scratch_len); strlcat(scratch, "\r\n", scratch_len); - efree(protocol_version); - protocol_version = NULL; } else { strlcat(scratch, " HTTP/1.0\r\n", scratch_len); } @@ -426,40 +450,17 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, const char if (tmp && strlen(tmp) > 0) { char *s; - if (!header_init) { /* Remove post headers for redirects */ - int l = strlen(tmp); - char *s2, *tmp_c = estrdup(tmp); - - php_strtolower(tmp_c, l); - if ((s = strstr(tmp_c, "content-length:"))) { - if ((s2 = memchr(s, '\n', tmp_c + l - s))) { - int b = tmp_c + l - 1 - s2; - memmove(tmp, tmp + (s2 + 1 - tmp_c), b); - memmove(tmp_c, s2 + 1, b); - - } else { - tmp[s - tmp_c] = *s = '\0'; - } - l = strlen(tmp_c); - } - if ((s = strstr(tmp_c, "content-type:"))) { - if ((s2 = memchr(s, '\n', tmp_c + l - s))) { - memmove(tmp, tmp + (s2 + 1 - tmp_c), tmp_c + l - 1 - s2); - } else { - tmp[s - tmp_c] = '\0'; - } - } - - efree(tmp_c); - tmp_c = php_trim(tmp, strlen(tmp), NULL, 0, NULL, 3 TSRMLS_CC); - efree(tmp); - tmp = tmp_c; - } - user_headers = estrdup(tmp); /* Make lowercase for easy comparison against 'standard' headers */ php_strtolower(tmp, strlen(tmp)); + + if (!header_init) { + /* strip POST headers on redirect */ + strip_header(user_headers, tmp, "content-length:"); + strip_header(user_headers, tmp, "content-type:"); + } + if ((s = strstr(tmp, "user-agent:")) && (s == tmp || *(s-1) == '\r' || *(s-1) == '\n' || *(s-1) == '\t' || *(s-1) == ' ')) { @@ -490,6 +491,11 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, const char *(s-1) == '\t' || *(s-1) == ' ')) { have_header |= HTTP_HEADER_TYPE; } + if ((s = strstr(tmp, "connection:")) && + (s == tmp || *(s-1) == '\r' || *(s-1) == '\n' || + *(s-1) == '\t' || *(s-1) == ' ')) { + have_header |= HTTP_HEADER_CONNECTION; + } /* remove Proxy-Authorization header */ if (use_proxy && use_ssl && (s = strstr(tmp, "proxy-authorization:")) && (s == tmp || *(s-1) == '\r' || *(s-1) == '\n' || @@ -563,6 +569,16 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, const char } } + /* Send a Connection: close header when using HTTP 1.1 or later to avoid + * hanging when the server interprets the RFC literally and establishes a + * keep-alive connection, unless the user specifically requests something + * else by specifying a Connection header in the context options. */ + if (protocol_version && + ((have_header & HTTP_HEADER_CONNECTION) == 0) && + (strncmp(protocol_version, "1.0", MIN(protocol_version_len, 3)) > 0)) { + php_stream_write_string(stream, "Connection: close\r\n"); + } + if (context && php_stream_context_get_option(context, "http", "user_agent", &ua_zval) == SUCCESS && Z_TYPE_PP(ua_zval) == IS_STRING) { diff --git a/ext/standard/password.c b/ext/standard/password.c index ca852038a67ed..9c5280a4cb7c2 100644 --- a/ext/standard/password.c +++ b/ext/standard/password.c @@ -183,7 +183,7 @@ PHP_FUNCTION(password_get_info) return; } - if (hash_len < 0 || (size_t) hash_len < 0) { + if (hash_len < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Supplied password hash too long to safely identify"); RETURN_FALSE; } diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 0fb27baacd8e5..0adb1e05290a0 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -63,6 +63,12 @@ php_stream_ops php_stream_output_ops = { NULL /* set_option */ }; +typedef struct php_stream_input { /* {{{ */ + php_stream **body_ptr; + off_t position; +} php_stream_input_t; +/* }}} */ + static size_t php_stream_input_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */ { return -1; @@ -71,42 +77,36 @@ static size_t php_stream_input_write(php_stream *stream, const char *buf, size_t static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */ { - off_t *position = (off_t*)stream->abstract; - size_t read_bytes = 0; - - if (!stream->eof) { - if (SG(request_info).raw_post_data) { /* data has already been read by a post handler */ - read_bytes = SG(request_info).raw_post_data_length - *position; - if (read_bytes <= count) { - stream->eof = 1; - } else { - read_bytes = count; - } - if (read_bytes) { - memcpy(buf, SG(request_info).raw_post_data + *position, read_bytes); - } - } else if (sapi_module.read_post) { - read_bytes = sapi_module.read_post(buf, count TSRMLS_CC); - if (read_bytes <= 0) { - stream->eof = 1; - read_bytes = 0; - } - /* Increment SG(read_post_bytes) only when something was actually read. */ - SG(read_post_bytes) += read_bytes; - } else { - stream->eof = 1; + php_stream_input_t *input = stream->abstract; + size_t read; + + if (!SG(post_read) && SG(read_post_bytes) < input->position + count) { + /* read requested data from SAPI */ + int read_bytes = sapi_read_post_block(buf, count TSRMLS_CC); + + if (read_bytes > 0) { + php_stream_seek(*input->body_ptr, 0, SEEK_END); + php_stream_write(*input->body_ptr, buf, read_bytes); } } - *position += read_bytes; + php_stream_seek(*input->body_ptr, input->position, SEEK_SET); + read = php_stream_read(*input->body_ptr, buf, count); + + if (!read || read == (size_t) -1) { + stream->eof = 1; + } else { + input->position += read; + } - return read_bytes; + return read; } /* }}} */ static int php_stream_input_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */ { efree(stream->abstract); + stream->abstract = NULL; return 0; } @@ -118,13 +118,27 @@ static int php_stream_input_flush(php_stream *stream TSRMLS_DC) /* {{{ */ } /* }}} */ +static int php_stream_input_seek(php_stream *stream, off_t offset, int whence, off_t *newoffset TSRMLS_DC) /* {{{ */ +{ + php_stream_input_t *input = stream->abstract; + + if (*input->body_ptr) { + int sought = php_stream_seek(*input->body_ptr, offset, whence); + *newoffset = (*input->body_ptr)->position; + return sought; + } + + return -1; +} +/* }}} */ + php_stream_ops php_stream_input_ops = { php_stream_input_write, php_stream_input_read, php_stream_input_close, php_stream_input_flush, "Input", - NULL, /* seek */ + php_stream_input_seek, NULL, /* cast */ NULL, /* stat */ NULL /* set_option */ @@ -204,13 +218,23 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa } if (!strcasecmp(path, "input")) { + php_stream_input_t *input; + if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) { if (options & REPORT_ERRORS) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration"); } return NULL; } - return php_stream_alloc(&php_stream_input_ops, ecalloc(1, sizeof(off_t)), 0, "rb"); + + input = ecalloc(1, sizeof(*input)); + if (*(input->body_ptr = &SG(request_info).request_body)) { + php_stream_rewind(*input->body_ptr); + } else { + *input->body_ptr = php_stream_temp_create(TEMP_STREAM_DEFAULT, SAPI_POST_BLOCK_SIZE); + } + + return php_stream_alloc(&php_stream_input_ops, input, 0, "rb"); } if (!strcasecmp(path, "stdin")) { @@ -259,8 +283,8 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa fd = dup(STDERR_FILENO); } } else if (!strncasecmp(path, "fd/", 3)) { - char *start, - *end; + const char *start; + char *end; long fildes_ori; int dtablesize; diff --git a/ext/standard/tests/dir/chdir_basic.phpt b/ext/standard/tests/dir/chdir_basic.phpt index 5fc0e5b8867f0..81d3c7c9d1a1f 100644 --- a/ext/standard/tests/dir/chdir_basic.phpt +++ b/ext/standard/tests/dir/chdir_basic.phpt @@ -14,40 +14,40 @@ Test chdir() function : basic functionality echo "*** Testing chdir() : basic functionality ***\n"; $base_dir_path = dirname(__FILE__); -$level_one_dir_name = "level_one"; -$level_one_dir_path = "$base_dir_path/$level_one_dir_name"; +$level1_one_dir_name = "level1_one"; +$level1_one_dir_path = "$base_dir_path/$level1_one_dir_name"; -$level_two_dir_name = "level_two"; -$level_two_dir_path = "$base_dir_path/$level_one_dir_name/$level_two_dir_name"; +$level1_two_dir_name = "level1_two"; +$level1_two_dir_path = "$base_dir_path/$level1_one_dir_name/$level1_two_dir_name"; // create directories -mkdir($level_one_dir_path); -mkdir($level_two_dir_path); +mkdir($level1_one_dir_path); +mkdir($level1_two_dir_path); echo "\n-- Testing chdir() with absolute path: --\n"; chdir($base_dir_path); -var_dump(chdir($level_one_dir_path)); +var_dump(chdir($level1_one_dir_path)); var_dump(getcwd()); echo "\n-- Testing chdir() with relative paths: --\n"; -var_dump(chdir($level_two_dir_name)); +var_dump(chdir($level1_two_dir_name)); var_dump(getcwd()); ?> ===DONE=== --CLEAN-- --EXPECTF-- *** Testing chdir() : basic functionality *** -- Testing chdir() with absolute path: -- bool(true) -string(%d) "%slevel_one" +string(%d) "%slevel1_one" -- Testing chdir() with relative paths: -- bool(true) -string(%d) "%slevel_one%elevel_two" +string(%d) "%slevel1_one%elevel1_two" ===DONE=== diff --git a/ext/standard/tests/dir/chdir_variation2.phpt b/ext/standard/tests/dir/chdir_variation2.phpt index fa70f9e104f5d..9ca6a9774873d 100644 --- a/ext/standard/tests/dir/chdir_variation2.phpt +++ b/ext/standard/tests/dir/chdir_variation2.phpt @@ -15,32 +15,32 @@ echo "*** Testing chdir() : usage variations ***\n"; $base_dir_path = dirname(__FILE__); -$level_one_dir_name = "level_one"; -$level_one_dir_path = "$base_dir_path/$level_one_dir_name"; +$level2_one_dir_name = "level2_one"; +$level2_one_dir_path = "$base_dir_path/$level2_one_dir_name"; -$level_two_dir_name = "level_two"; -$level_two_dir_path = "$base_dir_path/$level_one_dir_name/$level_two_dir_name"; +$level2_two_dir_name = "level2_two"; +$level2_two_dir_path = "$base_dir_path/$level2_one_dir_name/$level2_two_dir_name"; // create directories -mkdir($level_one_dir_path); -mkdir($level_two_dir_path); +mkdir($level2_one_dir_path); +mkdir($level2_two_dir_path); -echo "\n-- \$directory = './level_one': --\n"; +echo "\n-- \$directory = './level2_one': --\n"; var_dump(chdir($base_dir_path)); -var_dump(chdir("./$level_one_dir_name")); +var_dump(chdir("./$level2_one_dir_name")); var_dump(getcwd()); -echo "\n-- \$directory = 'level_one/level_two': --\n"; +echo "\n-- \$directory = 'level2_one/level2_two': --\n"; var_dump(chdir($base_dir_path)); -var_dump(chdir("$level_one_dir_name/$level_two_dir_name")); +var_dump(chdir("$level2_one_dir_name/$level2_two_dir_name")); var_dump(getcwd()); echo "\n-- \$directory = '..': --\n"; var_dump(chdir('..')); var_dump(getcwd()); -echo "\n-- \$directory = 'level_two', '.': --\n"; -var_dump(chdir($level_two_dir_path)); +echo "\n-- \$directory = 'level2_two', '.': --\n"; +var_dump(chdir($level2_two_dir_path)); var_dump(chdir('.')); var_dump(getcwd()); @@ -49,13 +49,13 @@ var_dump(chdir('../')); var_dump(getcwd()); echo "\n-- \$directory = './': --\n"; -var_dump(chdir($level_two_dir_path)); +var_dump(chdir($level2_two_dir_path)); var_dump(chdir('./')); var_dump(getcwd()); -echo "\n-- \$directory = '../../'level_one': --\n"; -var_dump(chdir($level_two_dir_path)); -var_dump(chdir("../../$level_one_dir_name")); +echo "\n-- \$directory = '../../'level2_one': --\n"; +var_dump(chdir($level2_two_dir_path)); +var_dump(chdir("../../$level2_one_dir_name")); var_dump(getcwd()); ?> @@ -63,42 +63,42 @@ var_dump(getcwd()); --CLEAN-- --EXPECTF-- *** Testing chdir() : usage variations *** --- $directory = './level_one': -- +-- $directory = './level2_one': -- bool(true) bool(true) -string(%d) "%slevel_one" +string(%d) "%slevel2_one" --- $directory = 'level_one/level_two': -- +-- $directory = 'level2_one/level2_two': -- bool(true) bool(true) -string(%d) "%slevel_one%elevel_two" +string(%d) "%slevel2_one%elevel2_two" -- $directory = '..': -- bool(true) -string(%d) "%slevel_one" +string(%d) "%slevel2_one" --- $directory = 'level_two', '.': -- +-- $directory = 'level2_two', '.': -- bool(true) bool(true) -string(%d) "%slevel_one%elevel_two" +string(%d) "%slevel2_one%elevel2_two" -- $directory = '../': -- bool(true) -string(%d) "%slevel_one" +string(%d) "%slevel2_one" -- $directory = './': -- bool(true) bool(true) -string(%d) "%slevel_one%elevel_two" +string(%d) "%slevel2_one%elevel2_two" --- $directory = '../../'level_one': -- +-- $directory = '../../'level2_one': -- bool(true) bool(true) -string(%d) "%slevel_one" +string(%d) "%slevel2_one" ===DONE=== diff --git a/ext/standard/tests/file/bug41655_2.phpt b/ext/standard/tests/file/bug41655_2.phpt index d406f1ba0404b..96f5cc86f0e54 100644 --- a/ext/standard/tests/file/bug41655_2.phpt +++ b/ext/standard/tests/file/bug41655_2.phpt @@ -5,11 +5,13 @@ open_basedir=/ --FILE-- --EXPECTF-- Array ( [0] => %stest.csv + [1] => %stest2.csv + [2] => %stest3.csv ) diff --git a/ext/standard/tests/file/copy_variation16-win32.phpt b/ext/standard/tests/file/copy_variation16-win32.phpt index 7688f5eeabf86..d95d24adacb56 100644 --- a/ext/standard/tests/file/copy_variation16-win32.phpt +++ b/ext/standard/tests/file/copy_variation16-win32.phpt @@ -22,7 +22,7 @@ mkdir($base_dir); $sub_dir = $base_dir."/copy_variation16_sub"; mkdir($sub_dir); -$dirname_with_blank = $sub_dir."/copy variation6"; +$dirname_with_blank = $sub_dir."/copy variation16"; mkdir($dirname_with_blank); $src_file_name = dirname(__FILE__)."/copy_variation16.tmp"; @@ -139,6 +139,6 @@ Existence of destination file => bool(false) Size of source file => int(3500) Copy operation => bool(true) Existence of destination file => bool(true) -Destination file name is => %s/copy_variation16/copy_variation16_sub/copy variation6/copy_copy_variation16.tmp +Destination file name is => %s/copy_variation16/copy_variation16_sub/copy variation16/copy_copy_variation16.tmp Size of destination file => int(3500) *** Done *** diff --git a/ext/standard/tests/file/copy_variation16.phpt b/ext/standard/tests/file/copy_variation16.phpt index 9ad834bdb4192..e36fee1d666b7 100644 --- a/ext/standard/tests/file/copy_variation16.phpt +++ b/ext/standard/tests/file/copy_variation16.phpt @@ -22,7 +22,7 @@ mkdir($base_dir); $sub_dir = $base_dir."/copy_variation16_sub"; mkdir($sub_dir); -$dirname_with_blank = $sub_dir."/copy variation6"; +$dirname_with_blank = $sub_dir."/copy variation16"; mkdir($dirname_with_blank); $src_file_name = dirname(__FILE__)."/copy_variation16.tmp"; @@ -138,6 +138,6 @@ Size of destination file => int(3500) Size of source file => int(3500) Copy operation => bool(true) Existence of destination file => bool(true) -Destination file name is => %s/copy_variation16/copy_variation16_sub/copy variation6/copy_copy_variation16.tmp +Destination file name is => %s/copy_variation16/copy_variation16_sub/copy variation16/copy_copy_variation16.tmp Size of destination file => int(3500) *** Done *** diff --git a/ext/standard/tests/file/disk_free_space_basic.phpt b/ext/standard/tests/file/disk_free_space_basic.phpt index 7ea8d36153f06..2904ff9a5bfe0 100644 --- a/ext/standard/tests/file/disk_free_space_basic.phpt +++ b/ext/standard/tests/file/disk_free_space_basic.phpt @@ -1,5 +1,9 @@ --TEST-- Test disk_free_space and its alias diskfreespace() functions : basic functionality +--SKIPIF-- + --INI-- memory_limit=32M --FILE-- @@ -25,7 +29,7 @@ $space1 = disk_free_space($file_path.$dir); var_dump( $space1 ); $fh = fopen($file_path.$dir."/disk_free_space.tmp", "a"); -$data = str_repeat("x", 4096); +$data = str_repeat("x", 0xffff); fwrite($fh, (binary)$data); fclose($fh); @@ -33,10 +37,12 @@ echo "\n Free Space after writing to a file\n"; $space2 = disk_free_space($file_path.$dir); var_dump( $space2 ); -if( $space1 > $space2 ) +if($space1 > $space2 ) echo "\n Free Space Value Is Correct\n"; -else +else { echo "\n Free Space Value Is Incorrect\n"; + var_dump($space1, $space2); +} echo "*** Testing with Binary Input ***\n"; var_dump( disk_free_space(b"$file_path") ); diff --git a/ext/standard/tests/file/fgets_socket_variation1.phpt b/ext/standard/tests/file/fgets_socket_variation1.phpt index 57944d8b563c1..429ad67d69677 100644 --- a/ext/standard/tests/file/fgets_socket_variation1.phpt +++ b/ext/standard/tests/file/fgets_socket_variation1.phpt @@ -5,11 +5,17 @@ Dave Kelsey --FILE-- --EXPECT-- diff --git a/ext/standard/tests/file/fscanf_variation53.phpt b/ext/standard/tests/file/fscanf_variation53.phpt index b65bccf8fdddc..a553a966934df 100644 --- a/ext/standard/tests/file/fscanf_variation53.phpt +++ b/ext/standard/tests/file/fscanf_variation53.phpt @@ -30,7 +30,7 @@ $counter = 1; foreach($modes as $mode) { // create an empty file - $filename = "$file_path/fscanf_variation52.tmp"; + $filename = "$file_path/fscanf_variation53.tmp"; $file_handle = fopen($filename, "w"); if($file_handle == false) exit("Error:failed to open file $filename"); diff --git a/ext/standard/tests/file/rename_variation1.phpt b/ext/standard/tests/file/rename_variation1.phpt index 0f7321e20506c..54338d74601a7 100644 --- a/ext/standard/tests/file/rename_variation1.phpt +++ b/ext/standard/tests/file/rename_variation1.phpt @@ -16,16 +16,16 @@ $file_path = dirname(__FILE__); echo "\n*** Testing rename() : renaming directory across directories ***\n"; $src_dirs = array ( /* Testing simple directory tree */ - "$file_path/rename_variation/", + "$file_path/rename_variation1/", /* Testing a dir with trailing slash */ - "$file_path/rename_variation/", + "$file_path/rename_variation1/", /* Testing dir with double trailing slashes */ - "$file_path//rename_variation//", + "$file_path//rename_variation1//", ); -$dest_dir = "$file_path/rename_variation_dir"; +$dest_dir = "$file_path/rename_variation1_dir"; // create the $dest_dir mkdir($dest_dir); @@ -35,7 +35,7 @@ foreach($src_dirs as $src_dir) { echo "-- Iteration $counter --\n"; // create the src dir - mkdir("$file_path/rename_variation/"); + mkdir("$file_path/rename_variation1/"); // rename the src dir to a new dir in dest dir var_dump( rename($src_dir, $dest_dir."/new_dir") ); // ensure that dir was renamed @@ -52,7 +52,7 @@ echo "Done\n"; --CLEAN-- --EXPECTF-- *** Testing rename() : renaming directory across directories *** diff --git a/ext/standard/tests/file/rename_variation2-win32.phpt b/ext/standard/tests/file/rename_variation2-win32.phpt index 87f4e7ddb139c..9627a9fa53012 100644 --- a/ext/standard/tests/file/rename_variation2-win32.phpt +++ b/ext/standard/tests/file/rename_variation2-win32.phpt @@ -15,27 +15,27 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { require dirname(__FILE__).'/file.inc'; $file_path = dirname(__FILE__); -mkdir("$file_path/rename_variation_dir"); +mkdir("$file_path/rename_variation2_dir"); /* Renaming a file and directory to numeric name */ echo "\n*** Testing rename() by renaming a file and directory to numeric name ***\n"; -$fp = fopen($file_path."/rename_variation.tmp", "w"); +$fp = fopen($file_path."/rename_variation2.tmp", "w"); fclose($fp); // renaming existing file to numeric name -var_dump( rename($file_path."/rename_variation.tmp", $file_path."/12345") ); +var_dump( rename($file_path."/rename_variation2.tmp", $file_path."/12345") ); // ensure that rename worked fine -var_dump( file_exists($file_path."/rename_variation.tmp" ) ); // expecting false +var_dump( file_exists($file_path."/rename_variation2.tmp" ) ); // expecting false var_dump( file_exists($file_path."/12345" ) ); // expecting true unlink($file_path."/12345"); // renaming a directory to numeric name -var_dump( rename($file_path."/rename_variation_dir/", $file_path."/12345") ); +var_dump( rename($file_path."/rename_variation2_dir/", $file_path."/12345") ); // ensure that rename worked fine -var_dump( file_exists($file_path."/rename_variation_dir" ) ); // expecting false +var_dump( file_exists($file_path."/rename_variation2_dir" ) ); // expecting false var_dump( file_exists($file_path."/12345" ) ); // expecting true rmdir($file_path."/12345"); @@ -45,9 +45,9 @@ echo "Done\n"; --CLEAN-- --EXPECTF-- *** Testing rename() by renaming a file and directory to numeric name *** diff --git a/ext/standard/tests/file/rename_variation2.phpt b/ext/standard/tests/file/rename_variation2.phpt index fa3ee1e017f6b..1e0a5d9edd306 100644 --- a/ext/standard/tests/file/rename_variation2.phpt +++ b/ext/standard/tests/file/rename_variation2.phpt @@ -11,7 +11,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { $file_path = dirname(__FILE__); -$dest_dir = "$file_path/rename_variation_dir"; +$dest_dir = "$file_path/rename_variation2_dir"; // create the $dest_dir mkdir($dest_dir); @@ -23,11 +23,11 @@ $filename = $file_path."/rename_variation2.tmp"; var_dump(touch($filename)); // create the soft links to the file -$linkname = $file_path."/rename_variation_soft_link1.tmp"; +$linkname = $file_path."/rename_variation2_soft_link1.tmp"; var_dump(symlink($filename, $linkname)); //rename the link to a new name in the same dir -$dest_linkname = $file_path."/rename_variation_soft_link2.tmp"; +$dest_linkname = $file_path."/rename_variation2_soft_link2.tmp"; var_dump( rename( $linkname, $dest_linkname) ); //ensure that link was renamed clearstatcache(); @@ -35,14 +35,14 @@ var_dump( file_exists($linkname) ); // expecting false var_dump( file_exists($dest_linkname) ); // expecting true // rename a link across dir -var_dump( rename($dest_linkname, $dest_dir."/rename_variation_soft_link2.tmp")); +var_dump( rename($dest_linkname, $dest_dir."/rename_variation2_soft_link2.tmp")); //ensure that link got renamed clearstatcache(); var_dump( file_exists($dest_linkname) ); // expecting false -var_dump( file_exists($dest_dir."/rename_variation_soft_link2.tmp") ); // expecting true +var_dump( file_exists($dest_dir."/rename_variation2_soft_link2.tmp") ); // expecting true // delete the link file now -unlink($dest_dir."/rename_variation_soft_link2.tmp"); +unlink($dest_dir."/rename_variation2_soft_link2.tmp"); echo "Done\n"; ?> @@ -50,7 +50,7 @@ echo "Done\n"; --EXPECTF-- *** Testing rename() on soft links *** diff --git a/ext/standard/tests/file/rename_variation3.phpt b/ext/standard/tests/file/rename_variation3.phpt index ce8921630b73c..7c47040729c77 100644 --- a/ext/standard/tests/file/rename_variation3.phpt +++ b/ext/standard/tests/file/rename_variation3.phpt @@ -11,41 +11,41 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { $file_path = dirname(__FILE__); -$dest_dir = "$file_path/rename_variation_dir"; +$dest_dir = "$file_path/rename_variation3_dir"; // create the $dest_dir mkdir($dest_dir); echo "\n*** Testing rename() on hard links ***\n"; -$filename = $file_path."/rename_variation1.tmp"; +$filename = $file_path."/rename_variation31.tmp"; @unlink($filename); var_dump(touch($filename)); -$linkname = $file_path."/rename_variation_hard_link1.tmp"; +$linkname = $file_path."/rename_variation3_hard_link1.tmp"; var_dump(link($filename, $linkname)); //rename the link to a new name in the same dir -$dest_linkname = $file_path."/rename_variation_hard_link2.tmp"; +$dest_linkname = $file_path."/rename_variation3_hard_link2.tmp"; var_dump( rename( $filename, $dest_linkname) ); //ensure that link was renamed var_dump( file_exists($filename) ); // expecting false var_dump( file_exists($dest_linkname) ); // expecting true // rename a hard link across dir -var_dump( rename($dest_linkname, $dest_dir."/rename_variation_hard_link2.tmp") ); +var_dump( rename($dest_linkname, $dest_dir."/rename_variation3_hard_link2.tmp") ); //ensure that link got renamed var_dump( file_exists($dest_linkname) ); // expecting false -var_dump( file_exists($dest_dir."/rename_variation_hard_link2.tmp") ); // expecting true +var_dump( file_exists($dest_dir."/rename_variation3_hard_link2.tmp") ); // expecting true // delete the link file now -unlink($dest_dir."/rename_variation_hard_link2.tmp"); +unlink($dest_dir."/rename_variation3_hard_link2.tmp"); echo "Done\n"; ?> --CLEAN-- --EXPECTF-- *** Testing rename() on hard links *** diff --git a/ext/standard/tests/file/rename_variation4.phpt b/ext/standard/tests/file/rename_variation4.phpt index 2965f7534a64d..69753bc322fa7 100644 --- a/ext/standard/tests/file/rename_variation4.phpt +++ b/ext/standard/tests/file/rename_variation4.phpt @@ -15,22 +15,22 @@ require dirname(__FILE__).'/file.inc'; /* Renaming a file, link and directory to numeric name */ echo "\n*** Testing rename() by renaming a file, link and directory to numeric name ***\n"; -$fp = fopen($file_path."/rename_variation.tmp", "w"); +$fp = fopen($file_path."/rename_variation4.tmp", "w"); fclose($fp); // renaming existing file to numeric name -var_dump( rename($file_path."/rename_variation.tmp", $file_path."/12345") ); +var_dump( rename($file_path."/rename_variation4.tmp", $file_path."/12345") ); // ensure that rename worked fine -var_dump( file_exists($file_path."/rename_variation.tmp" ) ); // expecting false +var_dump( file_exists($file_path."/rename_variation4.tmp" ) ); // expecting false var_dump( file_exists($file_path."/12345" ) ); // expecting true // remove the file unlink($file_path."/12345"); -mkdir($file_path."/rename_variation_dir"); +mkdir($file_path."/rename_variation4_dir"); // renaming a directory to numeric name -var_dump( rename($file_path."/rename_variation_dir/", $file_path."/12345") ); +var_dump( rename($file_path."/rename_variation4_dir/", $file_path."/12345") ); // ensure that rename worked fine -var_dump( file_exists($file_path."/rename_variation_dir" ) ); // expecting false +var_dump( file_exists($file_path."/rename_variation4_dir" ) ); // expecting false var_dump( file_exists($file_path."/12345" ) ); // expecting true echo "Done\n"; diff --git a/ext/standard/tests/file/rename_variation5.phpt b/ext/standard/tests/file/rename_variation5.phpt index bf43e49510f3e..2518cf48ea8b8 100644 --- a/ext/standard/tests/file/rename_variation5.phpt +++ b/ext/standard/tests/file/rename_variation5.phpt @@ -13,14 +13,14 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { and one another */ // create a dir $file_path = dirname(__FILE__); -$dirname = "$file_path/rename_variation_dir"; +$dirname = "$file_path/rename_variation5_dir"; mkdir($dirname); //create a file -$filename = "$file_path/rename_variation.tmp"; +$filename = "$file_path/rename_variation5.tmp"; $fp = fopen($filename, "w"); fclose($fp); // create a link -$linkname = "$file_path/rename_variation_link.tmp"; +$linkname = "$file_path/rename_variation5_link.tmp"; symlink($filename, $linkname); echo "\n-- Renaming link to same link name --\n"; @@ -54,9 +54,9 @@ echo "Done\n"; --CLEAN-- --EXPECTF-- -- Renaming link to same link name -- diff --git a/ext/standard/tests/general_functions/bug41445_1.phpt b/ext/standard/tests/general_functions/bug41445_1.phpt index e65e7afcc8c2c..4698de436a04d 100644 --- a/ext/standard/tests/general_functions/bug41445_1.phpt +++ b/ext/standard/tests/general_functions/bug41445_1.phpt @@ -3,7 +3,7 @@ Bug #41445 (parse_ini_file() function parses octal numbers in section names) - 2 --FILE-- +--FILE-- + [ + 'method' => 'POST', + 'header' => $header, + 'follow_location' => true, + ], + ]; + + $ctx = stream_context_create($options); + + $responses = [ + "data://text/plain,HTTP/1.1 201\r\nLocation: /foo\r\n\r\n", + "data://text/plain,HTTP/1.1 200\r\nConnection: close\r\n\r\n", + ]; + $pid = http_server('tcp://127.0.0.1:12342', $responses, $output); + + $fd = fopen('http://127.0.0.1:12342/', 'rb', false, $ctx); + fseek($output, 0, SEEK_SET); + echo stream_get_contents($output); + + http_server_kill($pid); +} + +do_test("First:1\nSecond:2\nContent-type: text/plain"); +do_test("First:1\nSecond:2\nContent-type: text/plain\n"); +do_test("First:1\nSecond:2\nContent-type: text/plain\nThird:"); +do_test("First:1\nContent-type:text/plain\nSecond:2"); +do_test("First:1\nContent-type:text/plain\nSecond:2\n"); +do_test("First:1\nContent-type:text/plain\nSecond:2\nThird:"); + +?> +Done +--EXPECT-- +POST / HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Second:2 +Content-type: text/plain + +GET /foo HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Second:2 + + +POST / HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Second:2 +Content-type: text/plain + +GET /foo HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Second:2 + + +POST / HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Second:2 +Content-type: text/plain +Third: + +GET /foo HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Second:2 +Third: + +POST / HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Content-type:text/plain +Second:2 + +GET /foo HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Second:2 + +POST / HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Content-type:text/plain +Second:2 + +GET /foo HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Second:2 + +POST / HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Content-type:text/plain +Second:2 +Third: + +GET /foo HTTP/1.0 +Host: 127.0.0.1:12342 +First:1 +Second:2 +Third: + +Done + diff --git a/ext/standard/tests/http/bug65634.phpt b/ext/standard/tests/http/bug65634.phpt new file mode 100644 index 0000000000000..8f358cc6cfc84 --- /dev/null +++ b/ext/standard/tests/http/bug65634.phpt @@ -0,0 +1,81 @@ +--TEST-- +Bug #65634 (HTTP wrapper is very slow with protocol_version 1.1) +--INI-- +allow_url_fopen=1 +--SKIPIF-- + +--FILE-- + [ + 'protocol_version' => $version, + ], + ]; + + if ($connection) { + $options['http']['header'] = "Connection: $connection"; + } + + $ctx = stream_context_create($options); + + $responses = ["data://text/plain,HTTP/$version 204 No Content\r\n\r\n"]; + $pid = http_server('tcp://127.0.0.1:12342', $responses, $output); + + $fd = fopen('http://127.0.0.1:12342/', 'rb', false, $ctx); + fseek($output, 0, SEEK_SET); + echo stream_get_contents($output); + + http_server_kill($pid); +} + +echo "HTTP/1.0, default behaviour:\n"; +do_test('1.0', null); + +echo "HTTP/1.0, connection: close:\n"; +do_test('1.0', 'close'); + +echo "HTTP/1.0, connection: keep-alive:\n"; +do_test('1.0', 'keep-alive'); + +echo "HTTP/1.1, default behaviour:\n"; +do_test('1.1', null); + +echo "HTTP/1.1, connection: close:\n"; +do_test('1.1', 'close'); + +echo "HTTP/1.1, connection: keep-alive:\n"; +do_test('1.1', 'keep-alive'); +?> +--EXPECT-- +HTTP/1.0, default behaviour: +GET / HTTP/1.0 +Host: 127.0.0.1:12342 + +HTTP/1.0, connection: close: +GET / HTTP/1.0 +Host: 127.0.0.1:12342 +Connection: close + +HTTP/1.0, connection: keep-alive: +GET / HTTP/1.0 +Host: 127.0.0.1:12342 +Connection: keep-alive + +HTTP/1.1, default behaviour: +GET / HTTP/1.1 +Host: 127.0.0.1:12342 +Connection: close + +HTTP/1.1, connection: close: +GET / HTTP/1.1 +Host: 127.0.0.1:12342 +Connection: close + +HTTP/1.1, connection: keep-alive: +GET / HTTP/1.1 +Host: 127.0.0.1:12342 +Connection: keep-alive + diff --git a/ext/standard/tests/network/fsockopen_basic.phpt b/ext/standard/tests/network/fsockopen_basic.phpt index 3ec9366331eb1..227762f899d2b 100644 --- a/ext/standard/tests/network/fsockopen_basic.phpt +++ b/ext/standard/tests/network/fsockopen_basic.phpt @@ -11,12 +11,18 @@ Test fsockopen() function : basic functionality echo "*** Testing fsockopen() : basic functionality ***\n"; echo "Open a server socket\n"; -$server = stream_socket_server('tcp://127.0.0.1:31337'); +for ($i=0; $i<100; $i++) { + $port = rand(10000, 65000); + /* Setup socket server */ + $server = @stream_socket_server("tcp://127.0.0.1:$port"); + if ($server) { + break; + } +} // Initialise all required variables $hostname = 'tcp://127.0.0.1'; // loopback address -$port = 31337; $errno = null; $errstr = null; $timeout = 1.5; diff --git a/ext/standard/tests/network/fsockopen_variation1.phpt b/ext/standard/tests/network/fsockopen_variation1.phpt index 2e5f8d9ada706..bb1b0f15c7f48 100644 --- a/ext/standard/tests/network/fsockopen_variation1.phpt +++ b/ext/standard/tests/network/fsockopen_variation1.phpt @@ -4,11 +4,17 @@ testing fsockopen without a protocol string --FILE-- --EXPECTF-- diff --git a/ext/standard/tests/network/tcp4loop.phpt b/ext/standard/tests/network/tcp4loop.phpt index afd955918e8fb..a163cd9b35816 100644 --- a/ext/standard/tests/network/tcp4loop.phpt +++ b/ext/standard/tests/network/tcp4loop.phpt @@ -2,14 +2,21 @@ Streams Based IPv4 TCP Loopback test --FILE-- --FILE-- --FILE-- a[] = new B(1); + $this->a[] = new B(2); + } +} + +class B implements Serializable +{ + public $b; + + public function __construct($c) + { + $this->b = new C($c); + } + + public function serialize() + { + return serialize(clone $this->b); + } + + public function unserialize($data) + { + $this->b = unserialize($data); + } +} + +class C +{ + public $c; + + public function __construct($c) + { + $this->c = $c; + } +} + +$a = unserialize(serialize(new A())); + +print $a->a[0]->b->c . "\n"; +print $a->a[1]->b->c . "\n"; + +?> +Done +--EXPECT-- +Test +1 +2 +Done diff --git a/ext/standard/tests/serialize/bug65806.phpt b/ext/standard/tests/serialize/bug65806.phpt new file mode 100644 index 0000000000000..19fab95c6430d --- /dev/null +++ b/ext/standard/tests/serialize/bug65806.phpt @@ -0,0 +1,83 @@ +--TEST-- +Bug #65806 (unserialize fails with object which is referenced multiple times) +--FILE-- +_obj = $obj; + $this->_serialized = serialize($this->_obj); + } + public function get() + { + return $this->_obj; + } + public function __sleep() + { + $this->_serialized = serialize($this->_obj); + return array( + "\0" . __CLASS__ . "\0_serialized", + ); + } + public function __wakeup() + { + $this->_obj = unserialize($this->_serialized); + } +} + +echo "SCRIPT START" . PHP_EOL; + +$objA = new myObjA(); +$objB = new myObjB(); +$objC = new myObjC(); + +$objB->attrA = new ArrayIterator(); +$objB->attrB = $objA; + +$objC->attrC = $objB; +$objC->attrD = $objA; + +$list = new myList($objC); + +echo 'check ' . check($list->get()) . PHP_EOL; + +echo "start serialize/unserialize" . PHP_EOL; +$newList = unserialize(serialize($list)); +echo "finish serialize/unserialize" . PHP_EOL; + +//after unserialize the property myObjC::attrD is null instead of expected object +echo 'check ' . check($newList->get()) . PHP_EOL; + +echo "SCRIPT END" . PHP_EOL ; + +function check(myObjC $obj) { + + if (!is_object($obj->attrC)) { + return 'failed (myObjC::attrC => ' . var_export($obj->attrC, true) . ')'; + } + if (!is_object($obj->attrD)) { + return 'failed (myObjC::attrD => ' . var_export($obj->attrD, true) . ')'; + } + return 'successful'; +} +?> +--EXPECT-- +SCRIPT START +check successful +start serialize/unserialize +finish serialize/unserialize +check successful +SCRIPT END + diff --git a/ext/standard/tests/streams/stream_get_meta_data_socket_basic.phpt b/ext/standard/tests/streams/stream_get_meta_data_socket_basic.phpt index 86056114b877c..86c9cd77c8a4a 100644 --- a/ext/standard/tests/streams/stream_get_meta_data_socket_basic.phpt +++ b/ext/standard/tests/streams/stream_get_meta_data_socket_basic.phpt @@ -3,7 +3,7 @@ stream_get_meta_data() on a udp socket --FILE-- nApplyCount > 0){ + if (myht->nApplyCount > 0){ smart_str_appendl(buf, "NULL", 4); zend_error(E_WARNING, "var_export does not handle circular references"); return; @@ -549,11 +549,9 @@ static inline int php_add_var_hash(HashTable *var_hash, zval *var, void *var_old char id[32], *p; register int len; - /* relies on "(long)" being a perfect hash function for data pointers, - * however the actual identity of an object has had to be determined - * by its object handle since 5.0. */ if ((Z_TYPE_P(var) == IS_OBJECT) && Z_OBJ_HT_P(var)->get_class_entry) { - p = smart_str_print_long(id + sizeof(id) - 1, (long) Z_OBJ_HANDLE_P(var)); + p = smart_str_print_long(id + sizeof(id) - 1, + (long) zend_objects_get_address(var TSRMLS_CC)); *(--p) = 'O'; len = id + sizeof(id) - 1 - p; } else { diff --git a/ext/tokenizer/tokenizer_data.c b/ext/tokenizer/tokenizer_data.c index 57b29e1dd7006..8c4786575effc 100644 --- a/ext/tokenizer/tokenizer_data.c +++ b/ext/tokenizer/tokenizer_data.c @@ -38,6 +38,7 @@ void tokenizer_register_constants(INIT_FUNC_ARGS) { REGISTER_LONG_CONSTANT("T_LOGICAL_XOR", T_LOGICAL_XOR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_LOGICAL_AND", T_LOGICAL_AND, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_PRINT", T_PRINT, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_YIELD", T_YIELD, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_SR_EQUAL", T_SR_EQUAL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_SL_EQUAL", T_SL_EQUAL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_XOR_EQUAL", T_XOR_EQUAL, CONST_CS | CONST_PERSISTENT); @@ -108,7 +109,6 @@ void tokenizer_register_constants(INIT_FUNC_ARGS) { REGISTER_LONG_CONSTANT("T_FUNCTION", T_FUNCTION, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_CONST", T_CONST, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_RETURN", T_RETURN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_YIELD", T_YIELD, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_TRY", T_TRY, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_CATCH", T_CATCH, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_FINALLY", T_FINALLY, CONST_CS | CONST_PERSISTENT); @@ -158,6 +158,7 @@ void tokenizer_register_constants(INIT_FUNC_ARGS) { REGISTER_LONG_CONSTANT("T_NS_C", T_NS_C, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_DIR", T_DIR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_NS_SEPARATOR", T_NS_SEPARATOR, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_ELLIPSIS", T_ELLIPSIS, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_DOUBLE_COLON", T_PAAMAYIM_NEKUDOTAYIM, CONST_CS | CONST_PERSISTENT); } @@ -174,6 +175,7 @@ char *get_token_type_name(int token_type) case T_LOGICAL_XOR: return "T_LOGICAL_XOR"; case T_LOGICAL_AND: return "T_LOGICAL_AND"; case T_PRINT: return "T_PRINT"; + case T_YIELD: return "T_YIELD"; case T_SR_EQUAL: return "T_SR_EQUAL"; case T_SL_EQUAL: return "T_SL_EQUAL"; case T_XOR_EQUAL: return "T_XOR_EQUAL"; @@ -244,7 +246,6 @@ char *get_token_type_name(int token_type) case T_FUNCTION: return "T_FUNCTION"; case T_CONST: return "T_CONST"; case T_RETURN: return "T_RETURN"; - case T_YIELD: return "T_YIELD"; case T_TRY: return "T_TRY"; case T_CATCH: return "T_CATCH"; case T_FINALLY: return "T_FINALLY"; @@ -294,6 +295,7 @@ char *get_token_type_name(int token_type) case T_NS_C: return "T_NS_C"; case T_DIR: return "T_DIR"; case T_NS_SEPARATOR: return "T_NS_SEPARATOR"; + case T_ELLIPSIS: return "T_ELLIPSIS"; } return "UNKNOWN"; diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c index 02ebc7738ef8e..76cd56f144ed7 100644 --- a/ext/xmlreader/php_xmlreader.c +++ b/ext/xmlreader/php_xmlreader.c @@ -588,9 +588,6 @@ PHP_METHOD(xmlreader, getAttributeNo) if (retchar) { RETVAL_STRING(retchar, 1); xmlFree(retchar); - return; - } else { - RETURN_EMPTY_STRING(); } } /* }}} */ @@ -622,9 +619,6 @@ PHP_METHOD(xmlreader, getAttributeNs) if (retchar) { RETVAL_STRING(retchar, 1); xmlFree(retchar); - return; - } else { - RETURN_EMPTY_STRING(); } } /* }}} */ @@ -805,7 +799,6 @@ PHP_METHOD(xmlreader, read) if (intern != NULL && intern->ptr != NULL) { retval = xmlTextReaderRead(intern->ptr); if (retval == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occurred while reading"); RETURN_FALSE; } else { RETURN_BOOL(retval); @@ -847,7 +840,6 @@ PHP_METHOD(xmlreader, next) retval = xmlTextReaderNext(intern->ptr); } if (retval == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occurred while reading"); RETURN_FALSE; } else { RETURN_BOOL(retval); @@ -1320,6 +1312,7 @@ PHP_MINIT_FUNCTION(xmlreader) xmlreader_object_handlers.read_property = xmlreader_read_property; xmlreader_object_handlers.write_property = xmlreader_write_property; xmlreader_object_handlers.get_property_ptr_ptr = xmlreader_get_property_ptr_ptr; + xmlreader_object_handlers.clone_obj = NULL; INIT_CLASS_ENTRY(ce, "XMLReader", xmlreader_functions); ce.create_object = xmlreader_objects_new; diff --git a/ext/xmlreader/tests/bug51936.phpt b/ext/xmlreader/tests/bug51936.phpt new file mode 100644 index 0000000000000..4b5f1012e79c0 --- /dev/null +++ b/ext/xmlreader/tests/bug51936.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #51936 (Crash with clone XMLReader) +--SKIPIF-- + +--FILE-- +xml(""); + +$xmlreader->next(); +$xmlreader2 = clone $xmlreader; +$xmlreader2->next(); +?> +Done +--EXPECTF-- +Test + +Fatal error: Trying to clone an uncloneable object of class XMLReader in %s on line %d diff --git a/ext/xmlreader/tests/bug64230.phpt b/ext/xmlreader/tests/bug64230.phpt new file mode 100644 index 0000000000000..0b070925f30d3 --- /dev/null +++ b/ext/xmlreader/tests/bug64230.phpt @@ -0,0 +1,50 @@ +--TEST-- +Bug #64230 (XMLReader does not suppress errors) +--SKIPIF-- + +--FILE-- +message); + } + libxml_clear_errors(); +} + +echo "Internal errors TRUE\n"; +libxml_use_internal_errors(true); + +$x = new XMLReader; +$x->xml(""); +$x->read(); + +show_internal_errors(); + +echo "Internal errors FALSE\n"; +libxml_use_internal_errors(false); + +$x = new XMLReader; +$x->xml(""); +$x->read(); + +show_internal_errors(); + +?> +Done +--EXPECTF-- +Test +Internal errors TRUE +Internal: Specification mandate value for attribute att + +Internal errors FALSE + +Warning: XMLReader::read(): %s: parser error : Specification mandate value for attribute att in %s on line %d + +Warning: XMLReader::read(): in %s on line %d + +Warning: XMLReader::read(): ^ in %s on line %d +Done diff --git a/ext/zip/lib/zip_source_error.c b/ext/zip/lib/zip_source_error.c index ffb4652d33621..70ec8bc5d452f 100644 --- a/ext/zip/lib/zip_source_error.c +++ b/ext/zip/lib/zip_source_error.c @@ -40,7 +40,7 @@ ZIP_EXTERN(void) zip_source_error(struct zip_source *src, int *ze, int *se) { - int e[2]; + int e[2] = { 0, 0 }; if (src->src == NULL) { } diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 969bac1aa6b5d..0b8f3fcad3304 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -102,14 +102,14 @@ static char * php_zip_make_relative_path(char *path, int path_len) /* {{{ */ char *path_begin = path; size_t i; - if (IS_SLASH(path[0])) { - return path + 1; - } - if (path_len < 1 || path == NULL) { return NULL; } + if (IS_SLASH(path[0])) { + return path + 1; + } + i = path_len; while (1) { @@ -1856,15 +1856,16 @@ static ZIPARCHIVE_METHOD(addFromString) /* TODO: fix _zip_replace */ if (cur_idx >= 0) { if (zip_delete(intern, cur_idx) == -1) { - RETURN_FALSE; + goto fail; } } - if (zip_add(intern, name, zs) == -1) { - RETURN_FALSE; - } else { + if (zip_add(intern, name, zs) != -1) { RETURN_TRUE; } +fail: + zip_source_free(zs); + RETURN_FALSE; } /* }}} */ diff --git a/ext/zlib/tests/gzeof_variation1.phpt b/ext/zlib/tests/gzeof_variation1.phpt index 6d1e0401dff1c..77a1eccb66bb3 100644 --- a/ext/zlib/tests/gzeof_variation1.phpt +++ b/ext/zlib/tests/gzeof_variation1.phpt @@ -9,7 +9,7 @@ if (!extension_loaded("zlib")) { --FILE-- string(17) "for all languages" } -===DONE=== \ No newline at end of file +===DONE=== diff --git a/ext/zlib/tests/gzfile_basic2.phpt b/ext/zlib/tests/gzfile_basic2.phpt index 9f31eb0f87380..2bbf315a1ad71 100644 --- a/ext/zlib/tests/gzfile_basic2.phpt +++ b/ext/zlib/tests/gzfile_basic2.phpt @@ -12,7 +12,7 @@ is a very common test for all languages EOT; $dirname = 'gzfile_temp'; -$filename = $dirname.'/plainfile.txt'; +$filename = $dirname.'/gzfile_basic2.txt'; mkdir($dirname); $h = fopen($filename, 'w'); fwrite($h, $plaintxt); @@ -36,4 +36,4 @@ array(3) { [2]=> string(17) "for all languages" } -===DONE=== \ No newline at end of file +===DONE=== diff --git a/ext/zlib/tests/gzopen_basic2.phpt b/ext/zlib/tests/gzopen_basic2.phpt index 5cc02cd182267..90766b18170cf 100644 --- a/ext/zlib/tests/gzopen_basic2.phpt +++ b/ext/zlib/tests/gzopen_basic2.phpt @@ -18,7 +18,7 @@ echo "*** Testing gzopen() : basic functionality ***\n"; // Initialise all required variables -$filename = "temp.txt.gz"; +$filename = "gzopen_basic2.txt.gz"; $modes = array('w', 'w+'); $data = "This was the information that was written"; diff --git a/ext/zlib/tests/gzputs_basic.phpt b/ext/zlib/tests/gzputs_basic.phpt index 7566e74e72393..6456e4b55f96c 100644 --- a/ext/zlib/tests/gzputs_basic.phpt +++ b/ext/zlib/tests/gzputs_basic.phpt @@ -9,7 +9,7 @@ if (!extension_loaded("zlib")) { --FILE-- --FILE-- post_handler(SG(request_info).content_type_dup, arg TSRMLS_CC); - if (SG(request_info).post_data) { - efree(SG(request_info).post_data); - SG(request_info).post_data = NULL; - } efree(SG(request_info).content_type_dup); SG(request_info).content_type_dup = NULL; } @@ -249,39 +245,63 @@ static void sapi_read_post_data(TSRMLS_D) } } - -SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data) +SAPI_API int sapi_read_post_block(char *buffer, size_t buflen TSRMLS_DC) { int read_bytes; - int allocated_bytes=SAPI_POST_BLOCK_SIZE+1; + if (!sapi_module.read_post) { + return -1; + } + + read_bytes = sapi_module.read_post(buffer, buflen TSRMLS_CC); + + if (read_bytes > 0) { + /* gogo */ + SG(read_post_bytes) += read_bytes; + } + if (read_bytes < buflen) { + /* done */ + SG(post_read) = 1; + } + + return read_bytes; +} + +SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data) +{ if ((SG(post_max_size) > 0) && (SG(request_info).content_length > SG(post_max_size))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "POST Content-Length of %ld bytes exceeds the limit of %ld bytes", SG(request_info).content_length, SG(post_max_size)); return; } - SG(request_info).post_data = emalloc(allocated_bytes); - for (;;) { - read_bytes = sapi_module.read_post(SG(request_info).post_data+SG(read_post_bytes), SAPI_POST_BLOCK_SIZE TSRMLS_CC); - if (read_bytes<=0) { - break; - } - SG(read_post_bytes) += read_bytes; - if ((SG(post_max_size) > 0) && (SG(read_post_bytes) > SG(post_max_size))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Actual POST length does not match Content-Length, and exceeds %ld bytes", SG(post_max_size)); - break; - } - if (read_bytes < SAPI_POST_BLOCK_SIZE) { - break; - } - if (SG(read_post_bytes)+SAPI_POST_BLOCK_SIZE >= allocated_bytes) { - allocated_bytes = SG(read_post_bytes)+SAPI_POST_BLOCK_SIZE+1; - SG(request_info).post_data = erealloc(SG(request_info).post_data, allocated_bytes); + + SG(request_info).request_body = php_stream_temp_create(TEMP_STREAM_DEFAULT, SAPI_POST_BLOCK_SIZE); + + if (sapi_module.read_post) { + int read_bytes; + + for (;;) { + char buffer[SAPI_POST_BLOCK_SIZE]; + + read_bytes = sapi_read_post_block(buffer, SAPI_POST_BLOCK_SIZE TSRMLS_CC); + + if (read_bytes > 0) { + php_stream_write(SG(request_info).request_body, buffer, read_bytes); + } + + if ((SG(post_max_size) > 0) && (SG(read_post_bytes) > SG(post_max_size))) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Actual POST length does not match Content-Length, and exceeds %ld bytes", SG(post_max_size)); + break; + } + + if (read_bytes < SAPI_POST_BLOCK_SIZE) { + /* done */ + break; + } } + php_stream_rewind(SG(request_info).request_body); } - SG(request_info).post_data[SG(read_post_bytes)] = 0; /* terminating NULL */ - SG(request_info).post_data_length = SG(read_post_bytes); } @@ -387,8 +407,7 @@ SAPI_API void sapi_activate_headers_only(TSRMLS_D) SG(sapi_headers).http_status_line = NULL; SG(sapi_headers).mimetype = NULL; SG(read_post_bytes) = 0; - SG(request_info).post_data = NULL; - SG(request_info).raw_post_data = NULL; + SG(request_info).request_body = NULL; SG(request_info).current_user = NULL; SG(request_info).current_user_length = 0; SG(request_info).no_headers = 0; @@ -433,8 +452,7 @@ SAPI_API void sapi_activate(TSRMLS_D) SG(callback_run) = 0; SG(callback_func) = NULL; SG(read_post_bytes) = 0; - SG(request_info).post_data = NULL; - SG(request_info).raw_post_data = NULL; + SG(request_info).request_body = NULL; SG(request_info).current_user = NULL; SG(request_info).current_user_length = 0; SG(request_info).no_headers = 0; @@ -452,20 +470,13 @@ SAPI_API void sapi_activate(TSRMLS_D) /* Handle request method */ if (SG(server_context)) { - if (PG(enable_post_data_reading) && SG(request_info).request_method) { - if (SG(request_info).content_type && !strcmp(SG(request_info).request_method, "POST")) { - /* HTTP POST may contain form data to be processed into variables - * depending on given content type */ - sapi_read_post_data(TSRMLS_C); - } else { - /* Any other method with content payload will fill $HTTP_RAW_POST_DATA - * if it is enabled by always_populate_raw_post_data. - * It's up to the webserver to decide whether to allow a method or not. */ - SG(request_info).content_type_dup = NULL; - if (sapi_module.default_post_reader) { - sapi_module.default_post_reader(TSRMLS_C); - } - } + if (PG(enable_post_data_reading) + && SG(request_info).content_type + && SG(request_info).request_method + && !strcmp(SG(request_info).request_method, "POST")) { + /* HTTP POST may contain form data to be processed into variables + * depending on given content type */ + sapi_read_post_data(TSRMLS_C); } else { SG(request_info).content_type_dup = NULL; } @@ -494,22 +505,19 @@ static void sapi_send_headers_free(TSRMLS_D) SAPI_API void sapi_deactivate(TSRMLS_D) { zend_llist_destroy(&SG(sapi_headers).headers); - if (SG(request_info).post_data) { - efree(SG(request_info).post_data); - } else if (SG(server_context)) { - if(sapi_module.read_post) { + if (SG(request_info).request_body) { + SG(request_info).request_body = NULL; + } else if (SG(server_context)) { + if (!SG(post_read)) { /* make sure we've consumed all request input data */ char dummy[SAPI_POST_BLOCK_SIZE]; int read_bytes; - while((read_bytes = sapi_module.read_post(dummy, sizeof(dummy)-1 TSRMLS_CC)) > 0) { - SG(read_post_bytes) += read_bytes; - } + do { + read_bytes = sapi_read_post_block(dummy, SAPI_POST_BLOCK_SIZE TSRMLS_CC); + } while (SAPI_POST_BLOCK_SIZE == read_bytes); } } - if (SG(request_info).raw_post_data) { - efree(SG(request_info).raw_post_data); - } if (SG(request_info).auth_user) { efree(SG(request_info).auth_user); } diff --git a/main/SAPI.h b/main/SAPI.h index 6fc60c886513e..928fca95da72e 100644 --- a/main/SAPI.h +++ b/main/SAPI.h @@ -32,8 +32,7 @@ #include #define SAPI_OPTION_NO_CHDIR 1 - -#define SAPI_POST_BLOCK_SIZE 4000 +#define SAPI_POST_BLOCK_SIZE 0x4000 #ifdef PHP_WIN32 # ifdef SAPI_EXPORTS @@ -80,14 +79,15 @@ END_EXTERN_C() typedef struct { const char *request_method; char *query_string; - char *post_data, *raw_post_data; char *cookie_data; long content_length; - int64_t post_data_length, raw_post_data_length; char *path_translated; char *request_uri; + /* Do not use request_body directly, but the php://input stream wrapper instead */ + struct _php_stream *request_body; + const char *content_type; zend_bool headers_only; @@ -121,6 +121,7 @@ typedef struct _sapi_globals_struct { sapi_request_info request_info; sapi_headers_struct sapi_headers; int64_t read_post_bytes; + unsigned char post_read; unsigned char headers_sent; struct stat global_stat; char *default_mimetype; @@ -189,7 +190,7 @@ SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bo SAPI_API int sapi_send_headers(TSRMLS_D); SAPI_API void sapi_free_header(sapi_header_struct *sapi_header); SAPI_API void sapi_handle_post(void *arg TSRMLS_DC); - +SAPI_API int sapi_read_post_block(char *buffer, size_t buflen TSRMLS_DC); SAPI_API int sapi_register_post_entries(sapi_post_entry *post_entry TSRMLS_DC); SAPI_API int sapi_register_post_entry(sapi_post_entry *post_entry TSRMLS_DC); SAPI_API void sapi_unregister_post_entry(sapi_post_entry *post_entry TSRMLS_DC); diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index eb33ac7ba1264..1d99a4e20e93b 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -775,7 +775,12 @@ PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, co * we cannot cannot getcwd() and the requested, * relatively referenced file is accessible */ copy_len = strlen(filepath) > MAXPATHLEN - 1 ? MAXPATHLEN - 1 : strlen(filepath); - real_path = estrndup(filepath, copy_len); + if (real_path) { + memcpy(real_path, filepath, copy_len); + real_path[copy_len] = '\0'; + } else { + real_path = estrndup(filepath, copy_len); + } close(fdtest); return real_path; } else { diff --git a/main/main.c b/main/main.c index 2f56afa03a3fc..1cc842b212944 100644 --- a/main/main.c +++ b/main/main.c @@ -562,7 +562,6 @@ PHP_INI_BEGIN() STD_PHP_INI_BOOLEAN("allow_url_fopen", "1", PHP_INI_SYSTEM, OnUpdateBool, allow_url_fopen, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("allow_url_include", "0", PHP_INI_SYSTEM, OnUpdateBool, allow_url_include, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("enable_post_data_reading", "1", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, enable_post_data_reading, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("always_populate_raw_post_data", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, always_populate_raw_post_data, php_core_globals, core_globals) STD_PHP_INI_ENTRY("realpath_cache_size", "16K", PHP_INI_SYSTEM, OnUpdateLong, realpath_cache_size_limit, virtual_cwd_globals, cwd_globals) STD_PHP_INI_ENTRY("realpath_cache_ttl", "120", PHP_INI_SYSTEM, OnUpdateLong, realpath_cache_ttl, virtual_cwd_globals, cwd_globals) diff --git a/main/php_content_types.c b/main/php_content_types.c index c4433978ed2be..3346efc50ec6e 100644 --- a/main/php_content_types.c +++ b/main/php_content_types.c @@ -37,34 +37,11 @@ static sapi_post_entry php_post_entries[] = { */ SAPI_API SAPI_POST_READER_FUNC(php_default_post_reader) { - char *data; - int length; - - /* $HTTP_RAW_POST_DATA registration */ if (!strcmp(SG(request_info).request_method, "POST")) { if (NULL == SG(request_info).post_entry) { /* no post handler registered, so we just swallow the data */ sapi_read_standard_form_data(TSRMLS_C); } - - /* For unknown content types we create HTTP_RAW_POST_DATA even if always_populate_raw_post_data off, - * this is in-effecient, but we need to keep doing it for BC reasons (for now) */ - if ((PG(always_populate_raw_post_data) || NULL == SG(request_info).post_entry) && SG(request_info).post_data) { - length = SG(request_info).post_data_length; - data = estrndup(SG(request_info).post_data, length); - SET_VAR_STRINGL("HTTP_RAW_POST_DATA", data, length); - } - } - - /* for php://input stream: - some post handlers modify the content of request_info.post_data - so for now we need a copy for the php://input stream - in the long run post handlers should be changed to not touch - request_info.post_data for memory preservation reasons - */ - if (SG(request_info).post_data) { - SG(request_info).raw_post_data = estrndup(SG(request_info).post_data, SG(request_info).post_data_length); - SG(request_info).raw_post_data_length = SG(request_info).post_data_length; } } /* }}} */ diff --git a/main/php_globals.h b/main/php_globals.h index 256765d665a53..fa2fe3b232962 100644 --- a/main/php_globals.h +++ b/main/php_globals.h @@ -131,7 +131,6 @@ struct _php_core_globals { zend_bool during_request_startup; zend_bool allow_url_fopen; zend_bool enable_post_data_reading; - zend_bool always_populate_raw_post_data; zend_bool report_zend_debug; int last_error_type; diff --git a/main/php_streams.h b/main/php_streams.h index c56014c62e17f..c9732b484849a 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -242,7 +242,7 @@ PHPAPI php_stream *_php_stream_alloc(php_stream_ops *ops, void *abstract, END_EXTERN_C() #define php_stream_alloc(ops, thisptr, persistent_id, mode) _php_stream_alloc((ops), (thisptr), (persistent_id), (mode) STREAMS_CC TSRMLS_CC) -#define php_stream_get_resource_id(stream) (stream)->rsrc_id +#define php_stream_get_resource_id(stream) ((php_stream *)(stream))->rsrc_id #if ZEND_DEBUG /* use this to tell the stream that it is OK if we don't explicitly close it */ # define php_stream_auto_cleanup(stream) { (stream)->__exposed++; } diff --git a/main/php_variables.c b/main/php_variables.c index 7018eae57bbd8..ab9aee3ae3c42 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -23,11 +23,15 @@ #include "php.h" #include "ext/standard/php_standard.h" #include "ext/standard/credits.h" +#include "ext/standard/php_smart_str.h" #include "php_variables.h" #include "php_globals.h" #include "php_content_types.h" #include "SAPI.h" #include "zend_globals.h" +#ifdef PHP_WIN32 +# include "win32/php_inttypes.h" +#endif /* for systems that need to override reading of environment variables */ void _php_import_environment_variables(zval *array_ptr TSRMLS_DC); @@ -228,44 +232,115 @@ PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars free_alloca(var_orig, use_heap); } +typedef struct post_var_data { + smart_str str; + char *ptr; + char *end; + uint64_t cnt; +} post_var_data_t; + +static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof TSRMLS_DC) +{ + char *ksep, *vsep; + size_t klen, vlen; + /* FIXME: string-size_t */ + unsigned int new_vlen; + + if (var->ptr >= var->end) { + return 0; + } + + vsep = memchr(var->ptr, '&', var->end - var->ptr); + if (!vsep) { + if (!eof) { + return 0; + } else { + vsep = var->end; + } + } + + ksep = memchr(var->ptr, '=', vsep - var->ptr); + if (ksep) { + *ksep = '\0'; + /* "foo=bar&" or "foo=&" */ + klen = ksep - var->ptr; + vlen = vsep - ++ksep; + } else { + ksep = ""; + /* "foo&" */ + klen = vsep - var->ptr; + vlen = 0; + } + + + php_url_decode(var->ptr, klen); + if (vlen) { + vlen = php_url_decode(ksep, vlen); + } + + if (sapi_module.input_filter(PARSE_POST, var->ptr, &ksep, vlen, &new_vlen TSRMLS_CC)) { + php_register_variable_safe(var->ptr, ksep, new_vlen, arr TSRMLS_CC); + } + + var->ptr = vsep + (vsep != var->end); + return 1; +} + +static inline int add_post_vars(zval *arr, post_var_data_t *vars, zend_bool eof TSRMLS_DC) +{ + uint64_t max_vars = PG(max_input_vars); + + vars->ptr = vars->str.c; + vars->end = vars->str.c + vars->str.len; + while (add_post_var(arr, vars, eof TSRMLS_CC)) { + if (++vars->cnt > max_vars) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, + "Input variables exceeded %" PRIu64 ". " + "To increase the limit change max_input_vars in php.ini.", + max_vars); + return FAILURE; + } + } + + if (!eof) { + memmove(vars->str.c, vars->ptr, vars->str.len = vars->end - vars->ptr); + } + return SUCCESS; +} + SAPI_API SAPI_POST_HANDLER_FUNC(php_std_post_handler) { - char *var, *val, *e, *s, *p; - zval *array_ptr = (zval *) arg; - long count = 0; + zval *arr = (zval *) arg; + php_stream *s = SG(request_info).request_body; + post_var_data_t post_data; - if (SG(request_info).post_data == NULL) { - return; - } + if (s && SUCCESS == php_stream_rewind(s)) { + memset(&post_data, 0, sizeof(post_data)); - s = SG(request_info).post_data; - e = s + SG(request_info).post_data_length; + while (!php_stream_eof(s)) { + char buf[BUFSIZ] = {0}; + size_t len = php_stream_read(s, buf, BUFSIZ); - while (s < e && (p = memchr(s, '&', (e - s)))) { -last_value: - if ((val = memchr(s, '=', (p - s)))) { /* have a value */ - unsigned int val_len, new_val_len; + if (len && len != (size_t) -1) { + smart_str_appendl(&post_data.str, buf, len); - if (++count > PG(max_input_vars)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input variables exceeded %ld. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars)); - return; + if (SUCCESS != add_post_vars(arr, &post_data, 0 TSRMLS_CC)) { + if (post_data.str.c) { + efree(post_data.str.c); + } + return; + } } - var = s; - php_url_decode(var, (val - s)); - val++; - val_len = php_url_decode(val, (p - val)); - val = estrndup(val, val_len); - if (sapi_module.input_filter(PARSE_POST, var, &val, val_len, &new_val_len TSRMLS_CC)) { - php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC); + if (len != BUFSIZ){ + break; } - efree(val); } - s = p + 1; - } - if (s < e) { - p = e; - goto last_value; + + add_post_vars(arr, &post_data, 1 TSRMLS_CC); + if (post_data.str.c) { + efree(post_data.str.c); + } } } diff --git a/main/streams/php_stream_transport.h b/main/streams/php_stream_transport.h index 52df73d731a44..15ba09430f981 100644 --- a/main/streams/php_stream_transport.h +++ b/main/streams/php_stream_transport.h @@ -170,10 +170,14 @@ typedef enum { STREAM_CRYPTO_METHOD_SSLv3_CLIENT, STREAM_CRYPTO_METHOD_SSLv23_CLIENT, STREAM_CRYPTO_METHOD_TLS_CLIENT, + STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT, + STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT, STREAM_CRYPTO_METHOD_SSLv2_SERVER, STREAM_CRYPTO_METHOD_SSLv3_SERVER, STREAM_CRYPTO_METHOD_SSLv23_SERVER, - STREAM_CRYPTO_METHOD_TLS_SERVER + STREAM_CRYPTO_METHOD_TLS_SERVER, + STREAM_CRYPTO_METHOD_TLSv1_1_SERVER, + STREAM_CRYPTO_METHOD_TLSv1_2_SERVER } php_stream_xport_crypt_method_t; BEGIN_EXTERN_C() diff --git a/php.ini-development b/php.ini-development index 99532d20d9430..2a01555b7f6a7 100644 --- a/php.ini-development +++ b/php.ini-development @@ -199,13 +199,12 @@ engine = On ; This directive determines whether or not PHP will recognize code between -; tags as PHP source which should be processed as such. For several -; years we recommended that you not use the short tag shortcut and -; instead to use the full tag combination. With the widespread use -; of XML and use of these tags by other languages, the server can become easily -; confused and end up parsing the wrong code in the wrong context. -; This shortcut is still supported for backwards compatibility, but we -; recommend against its use. +; tags as PHP source which should be processed as such. It is +; generally recommended that should be used and that this feature +; should be disabled, as enabling it may result in issues when generating XML +; documents, however this remains supported for backward compatibility reasons. +; Note that this directive does not control the tags as PHP source which should be processed as such. For several -; years we recommended that you not use the short tag shortcut and -; instead to use the full tag combination. With the widespread use -; of XML and use of these tags by other languages, the server can become easily -; confused and end up parsing the wrong code in the wrong context. -; This shortcut is still supported for backwards compatibility, but we -; recommend against its use. -; Default Value: On +; tags as PHP source which should be processed as such. It is +; generally recommended that should be used and that this feature +; should be disabled, as enabling it may result in issues when generating XML +; documents, however this remains supported for backward compatibility reasons. +; Note that this directive does not control the "); + return 'SKIPPED'; + } if (@count($section_text['REDIRECTTEST']) == 1) { $test_files = array(); diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index cbe9c7bd66180..ab4ac4341b723 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -268,6 +268,7 @@ static php_cli_server_ext_mime_type_pair mime_type_map[] = { { "jpg", "image/jpeg" }, { "jpeg", "image/jpeg" }, { "jpe", "image/jpeg" }, + { "pdf", "application/pdf" }, { "png", "image/png" }, { "svg", "image/svg+xml" }, { "txt", "text/plain" }, @@ -412,7 +413,7 @@ static void append_essential_headers(smart_str* buffer, php_cli_server_client *c { { char **val; - if (SUCCESS == zend_hash_find(&client->request.headers, "Host", sizeof("Host"), (void**)&val)) { + if (SUCCESS == zend_hash_find(&client->request.headers, "host", sizeof("host"), (void**)&val)) { smart_str_appendl_ex(buffer, "Host", sizeof("Host") - 1, persistent); smart_str_appendl_ex(buffer, ": ", sizeof(": ") - 1, persistent); smart_str_appends_ex(buffer, *val, persistent); @@ -568,7 +569,7 @@ static char *sapi_cli_server_read_cookies(TSRMLS_D) /* {{{ */ { php_cli_server_client *client = SG(server_context); char **val; - if (FAILURE == zend_hash_find(&client->request.headers, "Cookie", sizeof("Cookie"), (void**)&val)) { + if (FAILURE == zend_hash_find(&client->request.headers, "cookie", sizeof("cookie"), (void**)&val)) { return NULL; } return *val; @@ -1566,12 +1567,9 @@ static int php_cli_server_client_read_request_on_header_value(php_http_parser *p return 1; } { - char *header_name = client->current_header_name; - size_t header_name_len = client->current_header_name_len; - char c = header_name[header_name_len]; - header_name[header_name_len] = '\0'; - zend_hash_add(&client->request.headers, header_name, header_name_len + 1, &value, sizeof(char *), NULL); - header_name[header_name_len] = c; + char *header_name = zend_str_tolower_dup(client->current_header_name, client->current_header_name_len); + zend_hash_add(&client->request.headers, header_name, client->current_header_name_len + 1, &value, sizeof(char *), NULL); + efree(header_name); } if (client->current_header_name_allocated) { @@ -1602,6 +1600,7 @@ static int php_cli_server_client_read_request_on_body(php_http_parser *parser, c } client->request.content_len = 0; } + client->request.content = perealloc(client->request.content, client->request.content_len + length, 1); memmove(client->request.content + client->request.content_len, at, length); client->request.content_len += length; return 0; @@ -1726,10 +1725,9 @@ static void php_cli_server_client_populate_request_info(const php_cli_server_cli request_info->request_uri = client->request.request_uri; request_info->path_translated = client->request.path_translated; request_info->query_string = client->request.query_string; - request_info->post_data = client->request.content; - request_info->content_length = request_info->post_data_length = client->request.content_len; + request_info->content_length = client->request.content_len; request_info->auth_user = request_info->auth_password = request_info->auth_digest = NULL; - if (SUCCESS == zend_hash_find(&client->request.headers, "Content-Type", sizeof("Content-Type"), (void**)&val)) { + if (SUCCESS == zend_hash_find(&client->request.headers, "content-type", sizeof("content-type"), (void**)&val)) { request_info->content_type = *val; } } /* }}} */ @@ -1967,7 +1965,7 @@ static int php_cli_server_begin_send_static(php_cli_server *server, php_cli_serv static int php_cli_server_request_startup(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) { /* {{{ */ char **auth; php_cli_server_client_populate_request_info(client, &SG(request_info)); - if (SUCCESS == zend_hash_find(&client->request.headers, "Authorization", sizeof("Authorization"), (void**)&auth)) { + if (SUCCESS == zend_hash_find(&client->request.headers, "authorization", sizeof("authorization"), (void**)&auth)) { php_handle_auth_data(*auth TSRMLS_CC); } SG(sapi_headers).http_response_code = 200; diff --git a/sapi/cli/tests/bug65633.phpt b/sapi/cli/tests/bug65633.phpt new file mode 100644 index 0000000000000..55834095b1877 --- /dev/null +++ b/sapi/cli/tests/bug65633.phpt @@ -0,0 +1,48 @@ +--TEST-- +Bug #65633 (built-in server treat some http headers as case-sensitive) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +HTTP/1.1 200 OK +Connection: close +X-Powered-By: %s +Content-type: text/html + +array(1) { + ["foo"]=> + string(3) "bar" +} +string(3) "bar" diff --git a/sapi/cli/tests/cli_process_title_windows.phpt b/sapi/cli/tests/cli_process_title_windows.phpt index 309c09c0e192e..472f9c10fed42 100644 --- a/sapi/cli/tests/cli_process_title_windows.phpt +++ b/sapi/cli/tests/cli_process_title_windows.phpt @@ -20,7 +20,7 @@ if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') // no warnings/errors. $is_windows8 = false; -$ps_output = shell_exec("PowerShell \"(Get-Host).UI.RawUI.WindowTitle\""); +$ps_output = shell_exec("PowerShell -NoProfile \"(Get-Host).UI.RawUI.WindowTitle\""); if ($ps_output === null) { echo "Get-Host failed\n"; @@ -28,7 +28,8 @@ if ($ps_output === null) } $ps_output = trim($ps_output); -if (($ps_output == "Windows PowerShell") || ($ps_output == "Administrator: Windows PowerShell")) +$end_title_windows8 = ": Windows PowerShell"; +if (($ps_output == "Windows PowerShell") || (strlen($ps_output) > strlen($end_title_windows8) && substr($ps_output,-strlen($end_title_windows8)) === $end_title_windows8)) $is_windows8 = true; echo "*** Testing setting the process title ***\n"; @@ -45,7 +46,7 @@ if ($is_windows8) } else { - $loaded_title = shell_exec("PowerShell \"get-process cmd*,powershell* | Select-Object mainWindowTitle | ft -hide\""); + $loaded_title = shell_exec("PowerShell -NoProfile \"get-process cmd*,powershell* | Select-Object mainWindowTitle | ft -hide\""); if ($loaded_title === null) { diff --git a/sapi/cli/tests/upload_2G.phpt b/sapi/cli/tests/upload_2G.phpt index fe13d90007036..b8416ea730972 100644 --- a/sapi/cli/tests/upload_2G.phpt +++ b/sapi/cli/tests/upload_2G.phpt @@ -89,7 +89,7 @@ array(1) { ["type"]=> string(10) "text/plain" ["tmp_name"]=> - string(14) "/tmp/php%s" + string(%d) "%s" ["error"]=> int(0) ["size"]=> diff --git a/sapi/fpm/fpm/fastcgi.c b/sapi/fpm/fpm/fastcgi.c index 99905c8b605a6..ec579eadf6ebf 100644 --- a/sapi/fpm/fpm/fastcgi.c +++ b/sapi/fpm/fpm/fastcgi.c @@ -426,8 +426,9 @@ static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *e char buf[128]; char *tmp = buf; size_t buf_size = sizeof(buf); - int name_len, val_len; - uint eff_name_len; + int name_len = 0; + int val_len = 0; + uint eff_name_len = 0; char *s; int ret = 1; size_t bytes_consumed; diff --git a/sapi/fpm/fpm/fpm_children.c b/sapi/fpm/fpm/fpm_children.c index 84a9474332215..45cc075b42a6c 100644 --- a/sapi/fpm/fpm/fpm_children.c +++ b/sapi/fpm/fpm/fpm_children.c @@ -251,7 +251,7 @@ void fpm_children_bury() /* {{{ */ } zlog(severity, "[pool %s] child %d exited %s after %ld.%06d seconds from start", child->wp->config->name, (int) pid, buf, tv2.tv_sec, (int) tv2.tv_usec); } else { - zlog(ZLOG_DEBUG, "[pool %s] child %d has been killed by the process managment after %ld.%06d seconds from start", child->wp->config->name, (int) pid, tv2.tv_sec, (int) tv2.tv_usec); + zlog(ZLOG_DEBUG, "[pool %s] child %d has been killed by the process management after %ld.%06d seconds from start", child->wp->config->name, (int) pid, tv2.tv_sec, (int) tv2.tv_usec); } fpm_child_close(child, 1 /* in event_loop */); diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index 043e0e00a47c0..4b20e632dd361 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -1982,8 +1982,9 @@ consult the installation file that came with this distribution, or visit \n\ out: SG(server_context) = NULL; + php_module_shutdown(TSRMLS_C); + if (parent) { - php_module_shutdown(TSRMLS_C); sapi_shutdown(); } diff --git a/sapi/fpm/fpm/fpm_php_trace.c b/sapi/fpm/fpm/fpm_php_trace.c index d95d66a754c3e..925f2de64e93f 100644 --- a/sapi/fpm/fpm/fpm_php_trace.c +++ b/sapi/fpm/fpm/fpm_php_trace.c @@ -138,7 +138,7 @@ static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog TSRMLS_DC void fpm_php_trace(struct fpm_child_s *child) /* {{{ */ { TSRMLS_FETCH(); - fpm_scoreboard_update(0, 0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_SET, child->wp->scoreboard); + fpm_scoreboard_update(0, 0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_INC, child->wp->scoreboard); FILE *slowlog; zlog(ZLOG_NOTICE, "about to trace %d", (int) child->pid); diff --git a/sapi/fpm/fpm/fpm_scoreboard.c b/sapi/fpm/fpm/fpm_scoreboard.c index 24463a90dddfd..8d0868182d763 100644 --- a/sapi/fpm/fpm/fpm_scoreboard.c +++ b/sapi/fpm/fpm/fpm_scoreboard.c @@ -111,7 +111,7 @@ void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int request scoreboard->max_children_reached = max_children_reached; } if (slow_rq > 0) { - scoreboard->slow_rq += slow_rq; + scoreboard->slow_rq = slow_rq; } } else { if (scoreboard->idle + idle > 0) { @@ -137,6 +137,12 @@ void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int request } else { scoreboard->max_children_reached = 0; } + + if (scoreboard->slow_rq + slow_rq > 0) { + scoreboard->slow_rq += slow_rq; + } else { + scoreboard->slow_rq = 0; + } } if (scoreboard->active > scoreboard->active_max) { diff --git a/sapi/fpm/php-fpm.8.in b/sapi/fpm/php-fpm.8.in index a4e7e74e208d8..b02aa25ba74d4 100644 --- a/sapi/fpm/php-fpm.8.in +++ b/sapi/fpm/php-fpm.8.in @@ -96,7 +96,7 @@ Specify alternative path to FastCGI process manager configuration file (the defa .PD 1 .B \-t Test FPM configuration file and exit -If called twice (-tt), the configuration is dumped before exiting. +If called twice (\-tt), the configuration is dumped before exiting. .TP .PD 0 .B \-\-daemonize diff --git a/tests/basic/024.phpt b/tests/basic/024.phpt deleted file mode 100644 index bf8a206b3ac9d..0000000000000 --- a/tests/basic/024.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Test HTTP_RAW_POST_DATA creation ---INI-- -always_populate_raw_post_data=1 -max_input_vars=1000 ---POST-- -a=ABC&y=XYZ&c[]=1&c[]=2&c[a]=3 ---FILE-- - ---EXPECT-- -array(3) { - ["a"]=> - string(3) "ABC" - ["y"]=> - string(3) "XYZ" - ["c"]=> - array(3) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - ["a"]=> - string(1) "3" - } -} -string(30) "a=ABC&y=XYZ&c[]=1&c[]=2&c[a]=3" diff --git a/tests/basic/026.phpt b/tests/basic/026.phpt deleted file mode 100644 index b98a31f430772..0000000000000 --- a/tests/basic/026.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Registration of HTTP_RAW_POST_DATA due to unknown content-type ---INI-- -always_populate_raw_post_data=0 ---POST_RAW-- -Content-Type: unknown/type -a=1&b=ZYX ---FILE-- - ---EXPECT-- -array(0) { -} -string(9) "a=1&b=ZYX" diff --git a/tests/basic/enable_post_data_reading_01.phpt b/tests/basic/enable_post_data_reading_01.phpt index 1a0e33f617480..19ee5d583f762 100644 --- a/tests/basic/enable_post_data_reading_01.phpt +++ b/tests/basic/enable_post_data_reading_01.phpt @@ -11,6 +11,7 @@ var_dump($_FILES); var_dump($_POST); var_dump($HTTP_RAW_POST_DATA); var_dump(file_get_contents("php://input")); +var_dump(file_get_contents("php://input")); --EXPECTF-- array(0) { } @@ -20,3 +21,4 @@ array(0) { Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d NULL string(9) "a=1&b=ZYX" +string(9) "a=1&b=ZYX" diff --git a/tests/basic/enable_post_data_reading_02.phpt b/tests/basic/enable_post_data_reading_02.phpt index dc7f6b127ad8e..4e1643ebd02d5 100644 --- a/tests/basic/enable_post_data_reading_02.phpt +++ b/tests/basic/enable_post_data_reading_02.phpt @@ -15,6 +15,7 @@ Content-Type: text/plain-file var_dump($_FILES); var_dump($_POST); var_dump(file_get_contents("php://input")); +var_dump(file_get_contents("php://input")); --EXPECTF-- array(0) { } @@ -26,3 +27,9 @@ Content-Type: text/plain-file 1 -----------------------------20896060251896012921717172737--" +string(%d) "-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" +Content-Type: text/plain-file + +1 +-----------------------------20896060251896012921717172737--" diff --git a/tests/basic/enable_post_data_reading_03.phpt b/tests/basic/enable_post_data_reading_03.phpt index cdabe910ca45c..6a62282ea2e56 100644 --- a/tests/basic/enable_post_data_reading_03.phpt +++ b/tests/basic/enable_post_data_reading_03.phpt @@ -12,6 +12,7 @@ var_dump($_FILES); var_dump($_POST); var_dump($HTTP_RAW_POST_DATA); var_dump(file_get_contents("php://input")); +var_dump(file_get_contents("php://input")); --EXPECTF-- array(0) { } @@ -21,3 +22,4 @@ array(0) { Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d NULL string(9) "a=1&b=ZYX" +string(9) "a=1&b=ZYX" diff --git a/tests/basic/enable_post_data_reading_04.phpt b/tests/basic/enable_post_data_reading_04.phpt index a1685040bb957..a7c7e496d8c16 100644 --- a/tests/basic/enable_post_data_reading_04.phpt +++ b/tests/basic/enable_post_data_reading_04.phpt @@ -12,6 +12,7 @@ var_dump($_FILES); var_dump($_POST); var_dump($HTTP_RAW_POST_DATA); var_dump(file_get_contents("php://input")); +var_dump(file_get_contents("php://input")); --EXPECTF-- array(0) { } @@ -21,3 +22,4 @@ array(0) { Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d NULL string(9) "a=1&b=ZYX" +string(9) "a=1&b=ZYX" diff --git a/tests/basic/enable_post_data_reading_05.phpt b/tests/basic/enable_post_data_reading_05.phpt new file mode 100644 index 0000000000000..d8efa0129eaae --- /dev/null +++ b/tests/basic/enable_post_data_reading_05.phpt @@ -0,0 +1,26 @@ +--TEST-- +enable_post_data_reading: using multiple input streams +--INI-- +enable_post_data_reading=0 +max_execution_time=2 +--POST_RAW-- +Content-Type: application/unknown +One line of data +--FILE-- + + +Done +--EXPECT-- +Test +OOnnee lliinnee ooff ddaattaa +Done diff --git a/tests/basic/enable_post_data_reading_06.phpt b/tests/basic/enable_post_data_reading_06.phpt new file mode 100644 index 0000000000000..fbed195c03d1e --- /dev/null +++ b/tests/basic/enable_post_data_reading_06.phpt @@ -0,0 +1,271 @@ +--TEST-- +enable_post_data_reading: using multiple input streams (more than 8k data) +--INI-- +enable_post_data_reading=0 +--POST_RAW-- +Content-Type: application/unknown +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +. +--FILE-- + + +Done +--EXPECT-- +Test +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +.. +Done diff --git a/tests/run-test/test011.phpt b/tests/run-test/test011.phpt new file mode 100644 index 0000000000000..17f1f7aee6c9e --- /dev/null +++ b/tests/run-test/test011.phpt @@ -0,0 +1,6 @@ +--TEST-- +EXPECT_EXTERNAL +--FILE-- +abc +--EXPECT_EXTERNAL-- +test011.txt diff --git a/tests/run-test/test011.txt b/tests/run-test/test011.txt new file mode 100644 index 0000000000000..8baef1b4abc47 --- /dev/null +++ b/tests/run-test/test011.txt @@ -0,0 +1 @@ +abc diff --git a/tests/run-test/test012.phpt b/tests/run-test/test012.phpt new file mode 100644 index 0000000000000..8213aa2a5610e --- /dev/null +++ b/tests/run-test/test012.phpt @@ -0,0 +1,12 @@ +--TEST-- +EXPECTF_EXTERNAL +--FILE-- +123 +-123 ++123 ++1.1 +abc +0abc +x +--EXPECTF_EXTERNAL-- +test012.txt diff --git a/tests/run-test/test012.txt b/tests/run-test/test012.txt new file mode 100644 index 0000000000000..bb293214b1da9 --- /dev/null +++ b/tests/run-test/test012.txt @@ -0,0 +1,7 @@ +%d +%i +%i +%f +%s +%x +%c diff --git a/tests/run-test/test013.phpt b/tests/run-test/test013.phpt new file mode 100644 index 0000000000000..79ccd20de218c --- /dev/null +++ b/tests/run-test/test013.phpt @@ -0,0 +1,6 @@ +--TEST-- +EXPECTREGEX_EXTERNAL +--FILE-- +abcde12314235xyz34264768286abcde +--EXPECTREGEX_EXTERNAL-- +test013.txt diff --git a/tests/run-test/test013.txt b/tests/run-test/test013.txt new file mode 100644 index 0000000000000..6c280ece4d44f --- /dev/null +++ b/tests/run-test/test013.txt @@ -0,0 +1 @@ +[abcde]+[0-5]*xyz[2-8]+abcde diff --git a/win32/php_inttypes.h b/win32/php_inttypes.h new file mode 100644 index 0000000000000..25542771f591c --- /dev/null +++ b/win32/php_inttypes.h @@ -0,0 +1,305 @@ +// ISO C9x compliant inttypes.h for Microsoft Visual Studio +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 +// +// Copyright (c) 2006 Alexander Chemeris +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. The name of the author may be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _MSC_VER // [ +#error "Use this header only with Microsoft Visual C++ compilers!" +#endif // _MSC_VER ] + +#ifndef _MSC_INTTYPES_H_ // [ +#define _MSC_INTTYPES_H_ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#include "stdint.h" + +// 7.8 Format conversion of integer types + +typedef struct { + intmax_t quot; + intmax_t rem; +} imaxdiv_t; + +// 7.8.1 Macros for format specifiers + +#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198 + +// The fprintf macros for signed integers are: +#define PRId8 "d" +#define PRIi8 "i" +#define PRIdLEAST8 "d" +#define PRIiLEAST8 "i" +#define PRIdFAST8 "d" +#define PRIiFAST8 "i" + +#define PRId16 "hd" +#define PRIi16 "hi" +#define PRIdLEAST16 "hd" +#define PRIiLEAST16 "hi" +#define PRIdFAST16 "hd" +#define PRIiFAST16 "hi" + +#define PRId32 "I32d" +#define PRIi32 "I32i" +#define PRIdLEAST32 "I32d" +#define PRIiLEAST32 "I32i" +#define PRIdFAST32 "I32d" +#define PRIiFAST32 "I32i" + +#define PRId64 "I64d" +#define PRIi64 "I64i" +#define PRIdLEAST64 "I64d" +#define PRIiLEAST64 "I64i" +#define PRIdFAST64 "I64d" +#define PRIiFAST64 "I64i" + +#define PRIdMAX "I64d" +#define PRIiMAX "I64i" + +#define PRIdPTR "Id" +#define PRIiPTR "Ii" + +// The fprintf macros for unsigned integers are: +#define PRIo8 "o" +#define PRIu8 "u" +#define PRIx8 "x" +#define PRIX8 "X" +#define PRIoLEAST8 "o" +#define PRIuLEAST8 "u" +#define PRIxLEAST8 "x" +#define PRIXLEAST8 "X" +#define PRIoFAST8 "o" +#define PRIuFAST8 "u" +#define PRIxFAST8 "x" +#define PRIXFAST8 "X" + +#define PRIo16 "ho" +#define PRIu16 "hu" +#define PRIx16 "hx" +#define PRIX16 "hX" +#define PRIoLEAST16 "ho" +#define PRIuLEAST16 "hu" +#define PRIxLEAST16 "hx" +#define PRIXLEAST16 "hX" +#define PRIoFAST16 "ho" +#define PRIuFAST16 "hu" +#define PRIxFAST16 "hx" +#define PRIXFAST16 "hX" + +#define PRIo32 "I32o" +#define PRIu32 "I32u" +#define PRIx32 "I32x" +#define PRIX32 "I32X" +#define PRIoLEAST32 "I32o" +#define PRIuLEAST32 "I32u" +#define PRIxLEAST32 "I32x" +#define PRIXLEAST32 "I32X" +#define PRIoFAST32 "I32o" +#define PRIuFAST32 "I32u" +#define PRIxFAST32 "I32x" +#define PRIXFAST32 "I32X" + +#define PRIo64 "I64o" +#define PRIu64 "I64u" +#define PRIx64 "I64x" +#define PRIX64 "I64X" +#define PRIoLEAST64 "I64o" +#define PRIuLEAST64 "I64u" +#define PRIxLEAST64 "I64x" +#define PRIXLEAST64 "I64X" +#define PRIoFAST64 "I64o" +#define PRIuFAST64 "I64u" +#define PRIxFAST64 "I64x" +#define PRIXFAST64 "I64X" + +#define PRIoMAX "I64o" +#define PRIuMAX "I64u" +#define PRIxMAX "I64x" +#define PRIXMAX "I64X" + +#define PRIoPTR "Io" +#define PRIuPTR "Iu" +#define PRIxPTR "Ix" +#define PRIXPTR "IX" + +// The fscanf macros for signed integers are: +#define SCNd8 "d" +#define SCNi8 "i" +#define SCNdLEAST8 "d" +#define SCNiLEAST8 "i" +#define SCNdFAST8 "d" +#define SCNiFAST8 "i" + +#define SCNd16 "hd" +#define SCNi16 "hi" +#define SCNdLEAST16 "hd" +#define SCNiLEAST16 "hi" +#define SCNdFAST16 "hd" +#define SCNiFAST16 "hi" + +#define SCNd32 "ld" +#define SCNi32 "li" +#define SCNdLEAST32 "ld" +#define SCNiLEAST32 "li" +#define SCNdFAST32 "ld" +#define SCNiFAST32 "li" + +#define SCNd64 "I64d" +#define SCNi64 "I64i" +#define SCNdLEAST64 "I64d" +#define SCNiLEAST64 "I64i" +#define SCNdFAST64 "I64d" +#define SCNiFAST64 "I64i" + +#define SCNdMAX "I64d" +#define SCNiMAX "I64i" + +#ifdef _WIN64 // [ +# define SCNdPTR "I64d" +# define SCNiPTR "I64i" +#else // _WIN64 ][ +# define SCNdPTR "ld" +# define SCNiPTR "li" +#endif // _WIN64 ] + +// The fscanf macros for unsigned integers are: +#define SCNo8 "o" +#define SCNu8 "u" +#define SCNx8 "x" +#define SCNX8 "X" +#define SCNoLEAST8 "o" +#define SCNuLEAST8 "u" +#define SCNxLEAST8 "x" +#define SCNXLEAST8 "X" +#define SCNoFAST8 "o" +#define SCNuFAST8 "u" +#define SCNxFAST8 "x" +#define SCNXFAST8 "X" + +#define SCNo16 "ho" +#define SCNu16 "hu" +#define SCNx16 "hx" +#define SCNX16 "hX" +#define SCNoLEAST16 "ho" +#define SCNuLEAST16 "hu" +#define SCNxLEAST16 "hx" +#define SCNXLEAST16 "hX" +#define SCNoFAST16 "ho" +#define SCNuFAST16 "hu" +#define SCNxFAST16 "hx" +#define SCNXFAST16 "hX" + +#define SCNo32 "lo" +#define SCNu32 "lu" +#define SCNx32 "lx" +#define SCNX32 "lX" +#define SCNoLEAST32 "lo" +#define SCNuLEAST32 "lu" +#define SCNxLEAST32 "lx" +#define SCNXLEAST32 "lX" +#define SCNoFAST32 "lo" +#define SCNuFAST32 "lu" +#define SCNxFAST32 "lx" +#define SCNXFAST32 "lX" + +#define SCNo64 "I64o" +#define SCNu64 "I64u" +#define SCNx64 "I64x" +#define SCNX64 "I64X" +#define SCNoLEAST64 "I64o" +#define SCNuLEAST64 "I64u" +#define SCNxLEAST64 "I64x" +#define SCNXLEAST64 "I64X" +#define SCNoFAST64 "I64o" +#define SCNuFAST64 "I64u" +#define SCNxFAST64 "I64x" +#define SCNXFAST64 "I64X" + +#define SCNoMAX "I64o" +#define SCNuMAX "I64u" +#define SCNxMAX "I64x" +#define SCNXMAX "I64X" + +#ifdef _WIN64 // [ +# define SCNoPTR "I64o" +# define SCNuPTR "I64u" +# define SCNxPTR "I64x" +# define SCNXPTR "I64X" +#else // _WIN64 ][ +# define SCNoPTR "lo" +# define SCNuPTR "lu" +# define SCNxPTR "lx" +# define SCNXPTR "lX" +#endif // _WIN64 ] + +#endif // __STDC_FORMAT_MACROS ] + +// 7.8.2 Functions for greatest-width integer types + +// 7.8.2.1 The imaxabs function +#define imaxabs _abs64 + +// 7.8.2.2 The imaxdiv function + +// This is modified version of div() function from Microsoft's div.c found +// in %MSVC.NET%\crt\src\div.c +#ifdef STATIC_IMAXDIV // [ +static +#else // STATIC_IMAXDIV ][ +_inline +#endif // STATIC_IMAXDIV ] +imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom) +{ + imaxdiv_t result; + + result.quot = numer / denom; + result.rem = numer % denom; + + if (numer < 0 && result.rem > 0) { + // did division wrong; must fix up + ++result.quot; + result.rem -= denom; + } + + return result; +} + +// 7.8.2.3 The strtoimax and strtoumax functions +#define strtoimax _strtoi64 +#define strtoumax _strtoui64 + +// 7.8.2.4 The wcstoimax and wcstoumax functions +#define wcstoimax _wcstoi64 +#define wcstoumax _wcstoui64 + + +#endif // _MSC_INTTYPES_H_ ] diff --git a/win32/readdir.c b/win32/readdir.c index 9525fc0d6b499..0edd5764d4988 100644 --- a/win32/readdir.c +++ b/win32/readdir.c @@ -45,6 +45,7 @@ DIR *opendir(const char *dir) dp = (DIR *) malloc(sizeof(DIR)); if (dp == NULL) { + free(filespec); return NULL; } dp->offset = 0;