summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CODING_STANDARDS2
-rw-r--r--INSTALL2
-rw-r--r--NEWS8
-rw-r--r--README.TESTING26
-rw-r--r--UPGRADING6
-rw-r--r--Zend/tests/bug68446.phpt36
-rw-r--r--Zend/zend_compile.c8
-rw-r--r--Zend/zend_constants.h12
-rw-r--r--Zend/zend_execute.c185
-rw-r--r--Zend/zend_execute.h71
-rw-r--r--Zend/zend_float.h4
-rw-r--r--Zend/zend_hash.c108
-rw-r--r--Zend/zend_hash.h2
-rw-r--r--Zend/zend_inheritance.c2
-rw-r--r--Zend/zend_object_handlers.c46
-rw-r--r--Zend/zend_objects.c9
-rw-r--r--Zend/zend_variables.c15
-rw-r--r--Zend/zend_variables.h13
-rw-r--r--Zend/zend_vm.h4
-rw-r--r--Zend/zend_vm_def.h100
-rw-r--r--Zend/zend_vm_execute.h341
-rw-r--r--Zend/zend_vm_gen.php2
-rw-r--r--Zend/zend_vm_opcodes.h4
-rw-r--r--ext/calendar/julian.c2
-rw-r--r--ext/calendar/tests/unixtojd.phpt4
-rw-r--r--ext/curl/tests/curl_multi_init_param.phpt27
-rw-r--r--ext/date/lib/parse_tz.c6
-rw-r--r--ext/date/tests/002.phpt2
-rw-r--r--ext/date/tests/bug13142.phpt2
-rw-r--r--ext/date/tests/bug26317.phpt2
-rw-r--r--ext/date/tests/bug26320.phpt2
-rw-r--r--ext/date/tests/date_interval_create_from_date_string.phpt34
-rw-r--r--ext/date/tests/date_interval_create_from_date_string_nullparam.phpt42
-rw-r--r--ext/date/tests/date_interval_create_from_date_string_wrongparam_001.phpt11
-rw-r--r--ext/date/tests/date_interval_create_from_date_string_wrongparam_002.phpt9
-rw-r--r--ext/date/tests/date_timestamp_set.phpt19
-rw-r--r--ext/date/tests/date_timestamp_set_nullparam.phpt17
-rw-r--r--ext/date/tests/date_timestamp_set_nullparam2.phpt24
-rw-r--r--ext/date/tests/date_timestamp_set_wrongparam_001.phpt17
-rw-r--r--ext/date/tests/date_timestamp_set_wrongparam_002.phpt15
-rw-r--r--ext/date/tests/date_timestamp_set_wrongparam_003.phpt19
-rw-r--r--ext/date/tests/date_timestamp_set_wrongparam_004.phpt17
-rw-r--r--ext/date/tests/timezone_version_get.phpt13
-rw-r--r--ext/date/tests/timezone_version_get_basic1.phpt12
-rw-r--r--ext/exif/tests/bug68113.phpt6
-rw-r--r--ext/fileinfo/fileinfo.php2
-rw-r--r--ext/fileinfo/libmagic/patchlevel.h2
-rw-r--r--ext/fileinfo/tests/magic14
-rw-r--r--ext/filter/filter.c2
-rw-r--r--ext/ftp/ftp.h4
-rw-r--r--ext/gd/libgd/gd.h2
-rw-r--r--ext/gd/libgd/gd_arc_f_buggy.c2
-rw-r--r--ext/gd/libgd/gdft.c2
-rw-r--r--ext/gd/libgd/webpimg.c4
-rw-r--r--ext/gd/libgd/webpimg.h2
-rw-r--r--ext/gd/tests/imagealphablending_error1.phpt19
-rw-r--r--ext/gd/tests/imagecolorresolvealpha_error3.phpt19
-rw-r--r--ext/gd/tests/imagesavealpha_error2.phpt19
-rw-r--r--ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mobin0 -> 458 bytes
-rw-r--r--ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po17
-rw-r--r--ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mobin0 -> 445 bytes
-rw-r--r--ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po17
-rw-r--r--ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mobin0 -> 458 bytes
-rw-r--r--ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po17
-rw-r--r--ext/gettext/tests/bug66267.phpt55
-rw-r--r--ext/iconv/tests/iconv_basic_001-win32.phpt19
-rw-r--r--ext/iconv/tests/iconv_basic_001.phpt19
-rw-r--r--ext/interbase/tests/002.phpt2
-rw-r--r--ext/interbase/tests/003.phpt2
-rw-r--r--ext/interbase/tests/004.phpt2
-rw-r--r--ext/interbase/tests/005.phpt4
-rw-r--r--ext/interbase/tests/006.phpt2
-rw-r--r--ext/interbase/tests/007.phpt2
-rw-r--r--ext/interbase/tests/008.phpt2
-rw-r--r--ext/intl/tests/bug67052-win32.phpt30
-rw-r--r--ext/intl/tests/bug67052.phpt5
-rw-r--r--ext/libxml/libxml.c2
-rw-r--r--ext/mbstring/README_PHP3-i18n-ja4
-rw-r--r--ext/mbstring/libmbfl/filters/unicode_prop.h2
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfl_consts.h2
-rw-r--r--ext/mbstring/tests/mb_strtolower_variation3.phpt2
-rw-r--r--ext/mbstring/tests/mb_strtoupper_variation3.phpt2
-rw-r--r--ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt2
-rw-r--r--ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt2
-rw-r--r--ext/mcrypt/tests/mcrypt_encrypt_3des_cbc.phpt4
-rw-r--r--ext/mcrypt/tests/mcrypt_encrypt_3des_ecb.phpt2
-rw-r--r--ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt2
-rw-r--r--ext/mysqli/tests/mysqli_ps_select_union.phpt4
-rw-r--r--ext/mysqli/tests/mysqli_result_references.phpt6
-rw-r--r--ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt2
-rw-r--r--ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt4
-rw-r--r--ext/opcache/zend_accelerator_module.c4
-rw-r--r--ext/openssl/tests/bug64802.phpt2
-rw-r--r--ext/pcntl/README2
-rw-r--r--ext/pcre/pcrelib/ChangeLog4
-rw-r--r--ext/pcre/pcrelib/HACKING2
-rw-r--r--ext/pcre/pcrelib/README2
-rw-r--r--ext/pcre/pcrelib/doc/pcre.txt2
-rw-r--r--ext/pcre/pcrelib/pcre_exec.c2
-rw-r--r--ext/pcre/pcrelib/pcre_printint.c2
-rw-r--r--ext/pcre/pcrelib/pcre_study.c2
-rw-r--r--ext/pcre/pcrelib/pcredemo.c4
-rw-r--r--ext/pcre/pcrelib/sljit/sljitLir.c2
-rw-r--r--ext/pcre/pcrelib/sljit/sljitLir.h4
-rw-r--r--ext/pcre/pcrelib/sljit/sljitNativeARM_32.c4
-rw-r--r--ext/pcre/pcrelib/sljit/sljitNativeTILEGX_64.c2
-rw-r--r--ext/pdo/pdo_dbh.c2
-rw-r--r--ext/pdo/pdo_stmt.c2
-rw-r--r--ext/pdo/tests/bug_39656.phpt2
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt4
-rw-r--r--ext/pgsql/README2
-rw-r--r--ext/pgsql/pgsql.c6
-rw-r--r--ext/phar/Makefile.frag2
-rw-r--r--ext/phar/func_interceptors.c2
-rw-r--r--ext/readline/tests/readline_read_history_error_001.phpt14
-rw-r--r--ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt16
-rw-r--r--ext/shmop/README2
-rw-r--r--ext/snmp/snmp.c8
-rw-r--r--ext/soap/TODO.old2
-rw-r--r--ext/soap/interop/client_round2_interop.php18
-rw-r--r--ext/soap/package.xml2
-rw-r--r--ext/soap/php_sdl.h2
-rw-r--r--ext/soap/php_soap.h2
-rw-r--r--ext/soap/soap.c16
-rw-r--r--ext/soap/tests/bugs/bug27742.wsdl4
-rw-r--r--ext/soap/tests/bugs/bug50698_2.phpt2
-rw-r--r--ext/sockets/php_sockets.h2
-rw-r--r--ext/sockets/sockets.c4
-rw-r--r--ext/spl/internal/recursivecachingiterator.inc2
-rwxr-xr-xext/spl/spl.php2
-rw-r--r--ext/spl/tests/SplFixedArray_fromarray_param_multiarray.phpt2
-rw-r--r--ext/spl/tests/bug53071.phpt2
-rw-r--r--ext/sqlite3/libsqlite/sqlite3.c126
-rw-r--r--ext/standard/basic_functions.c27
-rw-r--r--ext/standard/dir.c2
-rw-r--r--ext/standard/html_tables/ents_html401.txt2
-rw-r--r--ext/standard/image.c4
-rw-r--r--ext/standard/php_var.h1
-rw-r--r--ext/standard/scanf.h2
-rw-r--r--ext/standard/tests/serialize/serialization_error_001.phpt6
-rw-r--r--ext/standard/tests/serialize/unserialize_classes.phpt88
-rw-r--r--ext/standard/tests/strings/addcslashes_005.phpt12
-rw-r--r--ext/standard/tests/strings/bin2hex_001.phpt11
-rw-r--r--ext/standard/tests/strings/sprintf_variation34.phpt4
-rw-r--r--ext/standard/tests/strings/sprintf_variation40_64bit.phpt4
-rw-r--r--ext/standard/var.c36
-rw-r--r--ext/standard/var_unserializer.c111
-rw-r--r--ext/standard/var_unserializer.re44
-rw-r--r--ext/xmlrpc/libxmlrpc/xml_to_soap.c2
-rw-r--r--ext/xmlwriter/tests/011.phpt35
-rw-r--r--ext/xmlwriter/tests/012.phpt38
-rw-r--r--ext/xmlwriter/tests/OO_010.phpt36
-rw-r--r--ext/xmlwriter/tests/OO_011.phpt39
-rw-r--r--ext/xsl/tests/xsltprocessor_hasExsltSupport.phpt13
-rw-r--r--ext/xsl/tests/xsltprocessor_hasExsltSupport_not_available_extension.phpt13
-rw-r--r--ext/xsl/tests/xsltprocessor_hasExsltSupport_wrongparam_001.phpt13
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToDoc.phpt51
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToDoc_nullparam.phpt54
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_001.phpt56
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_002.phpt54
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_003.phpt56
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_004.phpt56
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToURI.phpt53
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToURI_nullparam.phpt54
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_001.phpt57
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_002.phpt57
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_003.phpt57
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_004.phpt56
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToXML.phpt61
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToXML_nullparam.phpt54
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_001.phpt55
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_002.phpt54
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_003.phpt55
-rw-r--r--ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_004.phpt55
-rw-r--r--ext/zip/php_zip.c2
-rw-r--r--ext/zlib/tests/gzfile_variation4.phpt2
-rw-r--r--ext/zlib/tests/readgzfile_variation4.phpt2
-rw-r--r--ext/zlib/zlib_filter.c2
-rw-r--r--ext/zlib/zlib_win32_howto.txt2
-rw-r--r--php.ini-development25
-rw-r--r--php.ini-production25
-rw-r--r--sapi/cgi/cgi_main.c2
-rw-r--r--sapi/cli/php_http_parser.c2
-rw-r--r--sapi/fpm/fpm/fpm_conf.c8
-rw-r--r--sapi/fpm/fpm/fpm_env.c2
-rw-r--r--sapi/fpm/fpm/fpm_log.c2
-rw-r--r--sapi/fpm/fpm/fpm_sockets.c18
-rw-r--r--sapi/fpm/php-fpm.conf.in5
-rw-r--r--sapi/fpm/tests/016.phpt87
-rw-r--r--sapi/fpm/tests/017.phpt67
-rw-r--r--sapi/fpm/tests/019.phpt80
-rw-r--r--sapi/fpm/tests/020.phpt76
-rw-r--r--sapi/litespeed/lsapi_main.c116
-rw-r--r--sapi/litespeed/lsapilib.c2
-rw-r--r--sapi/nsapi/nsapi-readme.txt2
-rw-r--r--sapi/phpdbg/phpdbg.c2
-rw-r--r--sapi/phpdbg/xml.md6
-rw-r--r--sapi/thttpd/thttpd_patch2
-rwxr-xr-xscripts/apache/apconf-conv.sh24
-rwxr-xr-xscripts/apache/aphtaccess-conv.sh24
-rw-r--r--scripts/apache/conffix.awk23
-rw-r--r--scripts/apache/htaccessfix.awk23
-rwxr-xr-xserver-tests.php2
203 files changed, 3231 insertions, 850 deletions
diff --git a/CODING_STANDARDS b/CODING_STANDARDS
index 27fff07f60..2664d12bd5 100644
--- a/CODING_STANDARDS
+++ b/CODING_STANDARDS
@@ -42,7 +42,7 @@ Exceptions:
4. When writing functions that deal with strings, be sure to remember
that PHP holds the length property of each string, and that it
- shouldn't be calculated with strlen(). Write your functions in a such
+ shouldn't be calculated with strlen(). Write your functions in such
a way so that they'll take advantage of the length property, both
for efficiency and in order for them to be binary-safe.
Functions that change strings and obtain their new lengths while
diff --git a/INSTALL b/INSTALL
index 3071f267ae..935877b9f9 100644
--- a/INSTALL
+++ b/INSTALL
@@ -155,7 +155,7 @@ Table of Contents
a list of all available options along with short explanations running
./configure --help. Our manual documents the different options
separately. You will find the core options in the appendix, while the
- different extension specific options are descibed on the reference
+ different extension specific options are described on the reference
pages.
When PHP is configured, you are ready to build the module and/or
diff --git a/NEWS b/NEWS
index 319623c922..1c0cf2f048 100644
--- a/NEWS
+++ b/NEWS
@@ -17,7 +17,10 @@ PHP NEWS
. Implemented FR #38409 (parse_ini_file() looses the type of booleans). (Tjerk)
. Fixed #67959 (Segfault when calling phpversion('spl')). (Florian)
. Implemented the RFC `Catchable "Call to a member function bar() on a
- non-object"` (Timm)
+ non-object"`. (Timm)
+ . Added options parameter for unserialize allowing to specify acceptable
+ classes (https://wiki.php.net/rfc/secure_unserialize). (Stas)
+ . Fixed bug #68185 ("Inconsistent insteadof definition."- incorrectly triggered). (Julien)
- DBA:
. Fixed bug #62490 (dba_delete returns true on missing item (inifile)). (Mike)
@@ -34,6 +37,9 @@ PHP NEWS
- FPM:
. Fixed bug #65933 (Cannot specify config lines longer than 1024 bytes). (Chris Wright)
+- LiteSpeed:
+ . Updated LiteSpeed SAPI code from V5.5 to V6.6. (George Wang)
+
- Reflection
. Fixed inheritance chain of Reflector interface (Tjerk)
diff --git a/README.TESTING2 b/README.TESTING2
index 3c4f1beb29..34f7e83327 100644
--- a/README.TESTING2
+++ b/README.TESTING2
@@ -8,7 +8,7 @@ the original run-tests.php script. server-tests is *not* used by
'make test'. server-tests was developed to provide support for
testing PHP under it's primary environment, HTTP, and can run the
PHP tests under any of the SAPI modules that are direct executables,
-or are accessable via HTTP.
+or are accessible via HTTP.
[New features]
----------------
@@ -95,7 +95,7 @@ include:
$filename full native path to file, will become PATH_TRANSLATED
$filepath =dirname($filename)
$scriptname this is what will become SCRIPT_NAME unless you override it
- $docroot the equivelant of DOCUMENT_ROOT under Apache
+ $docroot the equivalent of DOCUMENT_ROOT under Apache
$cwd the directory that the test is being initiated from
$this->conf all server-tests configuration vars
$this->env all environment variables that will get passed to the test
@@ -105,7 +105,7 @@ include:
This section is also eval'd, and is similar in nature to --ENV--. However,
this section is used to build the url used in an HTTP request. Valid values
to set in this section would include:
- SCRIPT_NAME The inital part of the request url
+ SCRIPT_NAME The initial part of the request url
PATH_INFO The pathinfo part of a request url
FRAGMENT The fragment section of a url (after #)
QUERY_STRING The query part of a url (after ?)
diff --git a/UPGRADING b/UPGRADING
index 61a512505b..9d5d8e7228 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -63,6 +63,7 @@ PHP X.Y UPGRADE NOTES
- FPM
. Fixed bug #65933 (Cannot specify config lines longer than 1024 bytes).
+ . Listen = port now listen on all addresses (IPv6 and IPv4-mapped).
========================================
4. Deprecated Functionality
@@ -76,6 +77,11 @@ PHP X.Y UPGRADE NOTES
- parse_ini_file():
- parse_ini_string():
Added scanner mode INI_SCANNER_TYPED to yield typed .ini values.
+- unserialize():
+ Added second parameter for unserialize function
+ (RFC: https://wiki.php.net/rfc/secure_unserialize) allowing to specify
+ acceptable classes:
+ unserialize($foo, ["allowed_classes" => ["MyClass", "MyClass2"]);
========================================
diff --git a/Zend/tests/bug68446.phpt b/Zend/tests/bug68446.phpt
new file mode 100644
index 0000000000..48e6f52f1c
--- /dev/null
+++ b/Zend/tests/bug68446.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Bug #68446 (Array constant not accepted for array parameter default)
+--FILE--
+<?php
+const FOO = [1];
+const BAR = null;
+
+function a(array $a = FOO) {
+ var_dump($a);
+}
+
+function b(array $b = BAR) {
+ var_dump($b);
+}
+
+b(null);
+b([]);
+b();
+a([]);
+a();
+a(null);
+?>
+--EXPECTF--
+NULL
+array(0) {
+}
+NULL
+array(0) {
+}
+array(1) {
+ [0]=>
+ int(1)
+}
+
+Catchable fatal error: Argument 1 passed to a() must be of the type array, null given, called in %s on line %d and defined in %s on line %d
+
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index b7ed0980b3..55be6176bf 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -3834,8 +3834,7 @@ void zend_compile_params(zend_ast *ast TSRMLS_DC) /* {{{ */
zend_bool has_null_default = default_ast
&& (Z_TYPE(default_node.u.constant) == IS_NULL
|| (Z_TYPE(default_node.u.constant) == IS_CONSTANT
- && strcasecmp(Z_STRVAL(default_node.u.constant), "NULL") == 0)
- || Z_TYPE(default_node.u.constant) == IS_CONSTANT_AST); // ???
+ && strcasecmp(Z_STRVAL(default_node.u.constant), "NULL") == 0));
op_array->fn_flags |= ZEND_ACC_HAS_TYPE_HINTS;
arg_info->allow_null = has_null_default;
@@ -3845,12 +3844,13 @@ void zend_compile_params(zend_ast *ast TSRMLS_DC) /* {{{ */
if (arg_info->type_hint == IS_ARRAY) {
if (default_ast && !has_null_default
&& Z_TYPE(default_node.u.constant) != IS_ARRAY
+ && !Z_CONSTANT(default_node.u.constant)
) {
zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters "
"with array type hint can only be an array or NULL");
}
} else if (arg_info->type_hint == IS_CALLABLE && default_ast) {
- if (!has_null_default) {
+ if (!has_null_default && !Z_CONSTANT(default_node.u.constant)) {
zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters "
"with callable type hint can only be NULL");
}
@@ -3870,7 +3870,7 @@ void zend_compile_params(zend_ast *ast TSRMLS_DC) /* {{{ */
zend_string_release(class_name);
- if (default_ast && !has_null_default) {
+ if (default_ast && !has_null_default && !Z_CONSTANT(default_node.u.constant)) {
zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters "
"with a class type hint can only be NULL");
}
diff --git a/Zend/zend_constants.h b/Zend/zend_constants.h
index 6d5542e1ec..058e0135c7 100644
--- a/Zend/zend_constants.h
+++ b/Zend/zend_constants.h
@@ -44,12 +44,12 @@ typedef struct _zend_constant {
#define REGISTER_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name)-1, (str), (flags), module_number TSRMLS_CC)
#define REGISTER_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name)-1, (str), (len), (flags), module_number TSRMLS_CC)
-#define REGISTER_NS_NULL_CONSTANT(ns, name, flags) zend_register_null_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (flags), module_number TSRMLS_CC)
-#define REGISTER_NS_BOOL_CONSTANT(ns, name, bval, flags) zend_register_bool_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (bval), (flags), module_number TSRMLS_CC)
-#define REGISTER_NS_LONG_CONSTANT(ns, name, lval, flags) zend_register_long_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (lval), (flags), module_number TSRMLS_CC)
-#define REGISTER_NS_DOUBLE_CONSTANT(ns, name, dval, flags) zend_register_double_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (dval), (flags), module_number TSRMLS_CC)
-#define REGISTER_NS_STRING_CONSTANT(ns, name, str, flags) zend_register_string_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (str), (flags), module_number TSRMLS_CC)
-#define REGISTER_NS_STRINGL_CONSTANT(ns, name, str, len, flags) zend_register_stringl_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (str), (len), (flags), module_number TSRMLS_CC)
+#define REGISTER_NS_NULL_CONSTANT(ns, name, flags) zend_register_null_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (flags), module_number TSRMLS_CC)
+#define REGISTER_NS_BOOL_CONSTANT(ns, name, bval, flags) zend_register_bool_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (bval), (flags), module_number TSRMLS_CC)
+#define REGISTER_NS_LONG_CONSTANT(ns, name, lval, flags) zend_register_long_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (lval), (flags), module_number TSRMLS_CC)
+#define REGISTER_NS_DOUBLE_CONSTANT(ns, name, dval, flags) zend_register_double_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (dval), (flags), module_number TSRMLS_CC)
+#define REGISTER_NS_STRING_CONSTANT(ns, name, str, flags) zend_register_string_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (str), (flags), module_number TSRMLS_CC)
+#define REGISTER_NS_STRINGL_CONSTANT(ns, name, str, len, flags) zend_register_stringl_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (str), (len), (flags), module_number TSRMLS_CC)
#define REGISTER_MAIN_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name)-1, (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name)-1, (bval), (flags), 0 TSRMLS_CC)
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 4fcd1de6b8..6c8ebca707 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -574,7 +574,22 @@ ZEND_API void zend_verify_arg_error(int error_type, const zend_function *zf, uin
}
}
-static void zend_verify_arg_type(zend_function *zf, uint32_t arg_num, zval *arg TSRMLS_DC)
+static int is_null_constant(zval *default_value TSRMLS_DC)
+{
+ if (Z_CONSTANT_P(default_value)) {
+ zval constant;
+
+ ZVAL_COPY_VALUE(&constant, default_value);
+ zval_update_constant(&constant, 0 TSRMLS_CC);
+ if (Z_TYPE(constant) == IS_NULL) {
+ return 1;
+ }
+ zval_dtor(&constant);
+ }
+ return 0;
+}
+
+static void zend_verify_arg_type(zend_function *zf, uint32_t arg_num, zval *arg, zval *default_value TSRMLS_DC)
{
zend_arg_info *cur_arg_info;
char *need_msg;
@@ -601,18 +616,18 @@ static void zend_verify_arg_type(zend_function *zf, uint32_t arg_num, zval *arg
if (!ce || !instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC)) {
zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, "instance of ", Z_OBJCE_P(arg)->name->val, arg TSRMLS_CC);
}
- } else if (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null) {
+ } else if (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC)))) {
need_msg = zend_verify_arg_class_kind(cur_arg_info, &class_name, &ce TSRMLS_CC);
zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, zend_zval_type_name(arg), "", arg TSRMLS_CC);
}
} else if (cur_arg_info->type_hint) {
if (cur_arg_info->type_hint == IS_ARRAY) {
ZVAL_DEREF(arg);
- if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
+ if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC))))) {
zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", zend_zval_type_name(arg), "", arg TSRMLS_CC);
}
} else if (cur_arg_info->type_hint == IS_CALLABLE) {
- if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL TSRMLS_CC) && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
+ if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL TSRMLS_CC) && (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC))))) {
zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", zend_zval_type_name(arg), "", arg TSRMLS_CC);
}
#if ZEND_DEBUG
@@ -682,7 +697,7 @@ static void zend_verify_missing_arg(zend_execute_data *execute_data, uint32_t ar
static zend_always_inline void zend_assign_to_object(zval *retval, zval *object, uint32_t object_op_type, zval *property_name, int value_type, const znode_op *value_op, const zend_execute_data *execute_data, int opcode, void **cache_slot TSRMLS_DC)
{
zend_free_op free_value;
- zval *value = get_zval_ptr(value_type, value_op, execute_data, &free_value, BP_VAR_R);
+ zval *value = get_zval_ptr_deref(value_type, value_op, execute_data, &free_value, BP_VAR_R);
zval tmp;
if (object_op_type != IS_UNUSED) {
@@ -726,38 +741,101 @@ static zend_always_inline void zend_assign_to_object(zval *retval, zval *object,
}
}
- /* separate our value if necessary */
- if (value_type == IS_TMP_VAR) {
- ZVAL_COPY_VALUE(&tmp, value);
- value = &tmp;
- } else if (value_type == IS_CONST) {
- if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
- ZVAL_COPY_VALUE(&tmp, value);
- zval_copy_ctor_func(&tmp);
- value = &tmp;
- }
- } else if (Z_REFCOUNTED_P(value)) {
- Z_ADDREF_P(value);
- }
-
if (opcode == ZEND_ASSIGN_OBJ) {
if (!Z_OBJ_HT_P(object)->write_property) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
if (retval) {
ZVAL_NULL(retval);
}
- if (value_type == IS_CONST) {
- zval_ptr_dtor(value);
- }
FREE_OP(free_value);
return;
}
+
+ if (cache_slot &&
+ EXPECTED(Z_OBJCE_P(object) == CACHED_PTR_EX(cache_slot))) {
+ zend_property_info *prop_info = CACHED_PTR_EX(cache_slot + 1);
+ zend_object *zobj = Z_OBJ_P(object);
+ zval *property;
+
+ if (EXPECTED(prop_info)) {
+ property = OBJ_PROP(zobj, prop_info->offset);
+ if (Z_TYPE_P(property) != IS_UNDEF) {
+fast_assign:
+ value = zend_assign_to_variable(property, value, value_type TSRMLS_CC);
+ if (retval && !EG(exception)) {
+ ZVAL_COPY(retval, value);
+ }
+ if (value_type == IS_VAR) {
+ FREE_OP(free_value);
+ }
+ return;
+ }
+ } else {
+ if (EXPECTED(zobj->properties != NULL)) {
+ property = zend_hash_find(zobj->properties, Z_STR_P(property_name));
+ if (property) {
+ goto fast_assign;
+ }
+ }
+
+ if (!zobj->ce->__set) {
+ if (EXPECTED(zobj->properties == NULL)) {
+ rebuild_object_properties(zobj);
+ }
+ /* separate our value if necessary */
+ if (value_type == IS_CONST) {
+ if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
+ ZVAL_COPY_VALUE(&tmp, value);
+ zval_copy_ctor_func(&tmp);
+ value = &tmp;
+ }
+ } else if (value_type != IS_TMP_VAR &&
+ Z_REFCOUNTED_P(value)) {
+ Z_ADDREF_P(value);
+ }
+ zend_hash_add_new(zobj->properties, Z_STR_P(property_name), value);
+ if (retval && !EG(exception)) {
+ ZVAL_COPY(retval, value);
+ }
+ if (value_type == IS_VAR) {
+ FREE_OP(free_value);
+ }
+ return;
+ }
+ }
+ }
+
+ /* separate our value if necessary */
+ if (value_type == IS_CONST) {
+ if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
+ ZVAL_COPY_VALUE(&tmp, value);
+ zval_copy_ctor_func(&tmp);
+ value = &tmp;
+ }
+ } else if (value_type != IS_TMP_VAR &&
+ Z_REFCOUNTED_P(value)) {
+ Z_ADDREF_P(value);
+ }
+
Z_OBJ_HT_P(object)->write_property(object, property_name, value, cache_slot TSRMLS_CC);
} else {
/* Note: property_name in this case is really the array index! */
if (!Z_OBJ_HT_P(object)->write_dimension) {
zend_error_noreturn(E_ERROR, "Cannot use object as array");
}
+
+ /* separate our value if necessary */
+ if (value_type == IS_CONST) {
+ if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
+ ZVAL_COPY_VALUE(&tmp, value);
+ zval_copy_ctor_func(&tmp);
+ value = &tmp;
+ }
+ } else if (value_type != IS_TMP_VAR &&
+ Z_REFCOUNTED_P(value)) {
+ Z_ADDREF_P(value);
+ }
+
Z_OBJ_HT_P(object)->write_dimension(object, property_name, value TSRMLS_CC);
}
@@ -820,65 +898,6 @@ static void zend_assign_to_string_offset(zval *str, zend_long offset, zval *valu
}
}
-static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type TSRMLS_DC)
-{
- do {
- if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) {
- zend_refcounted *garbage;
-
- if (Z_ISREF_P(variable_ptr)) {
- variable_ptr = Z_REFVAL_P(variable_ptr);
- if (EXPECTED(!Z_REFCOUNTED_P(variable_ptr))) {
- break;
- }
- }
- if (Z_TYPE_P(variable_ptr) == IS_OBJECT &&
- UNEXPECTED(Z_OBJ_HANDLER_P(variable_ptr, set) != NULL)) {
- Z_OBJ_HANDLER_P(variable_ptr, set)(variable_ptr, value TSRMLS_CC);
- return variable_ptr;
- }
- if ((value_type & (IS_VAR|IS_CV)) && variable_ptr == value) {
- return variable_ptr;
- }
- garbage = Z_COUNTED_P(variable_ptr);
- if (--GC_REFCOUNT(garbage) == 0) {
- ZVAL_COPY_VALUE(variable_ptr, value);
- if (value_type == IS_CONST) {
- /* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */
- if (UNEXPECTED(Z_OPT_COPYABLE_P(variable_ptr))) {
- zval_copy_ctor_func(variable_ptr);
- }
- } else if (value_type != IS_TMP_VAR) {
- if (UNEXPECTED(Z_OPT_REFCOUNTED_P(variable_ptr))) {
- Z_ADDREF_P(variable_ptr);
- }
- }
- _zval_dtor_func_for_ptr(garbage ZEND_FILE_LINE_CC);
- return variable_ptr;
- } else { /* we need to split */
- /* optimized version of GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr) */
- if ((Z_COLLECTABLE_P(variable_ptr)) &&
- UNEXPECTED(!GC_INFO(garbage))) {
- gc_possible_root(garbage TSRMLS_CC);
- }
- }
- }
- } while (0);
-
- ZVAL_COPY_VALUE(variable_ptr, value);
- if (value_type == IS_CONST) {
- /* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */
- if (UNEXPECTED(Z_OPT_COPYABLE_P(variable_ptr))) {
- zval_copy_ctor_func(variable_ptr);
- }
- } else if (value_type != IS_TMP_VAR) {
- if (UNEXPECTED(Z_OPT_REFCOUNTED_P(variable_ptr))) {
- Z_ADDREF_P(variable_ptr);
- }
- }
- return variable_ptr;
-}
-
/* Utility Functions for Extensions */
static void zend_extension_statement_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
{
@@ -1407,12 +1426,12 @@ ZEND_API void execute_internal(zend_execute_data *execute_data, zval *return_val
ZEND_API void zend_clean_and_cache_symbol_table(zend_array *symbol_table TSRMLS_DC) /* {{{ */
{
if (EG(symtable_cache_ptr) >= EG(symtable_cache_limit)) {
- zend_hash_destroy(&symbol_table->ht);
+ zend_array_destroy(&symbol_table->ht TSRMLS_CC);
efree_size(symbol_table, sizeof(zend_array));
} else {
/* clean before putting into the cache, since clean
could call dtors, which could use cached hash */
- zend_hash_clean(&symbol_table->ht);
+ zend_symtable_clean(&symbol_table->ht TSRMLS_CC);
*(++EG(symtable_cache_ptr)) = symbol_table;
}
}
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h
index bfa3394e0d..8a621cf348 100644
--- a/Zend/zend_execute.h
+++ b/Zend/zend_execute.h
@@ -51,18 +51,6 @@ ZEND_API int zend_eval_stringl_ex(char *str, size_t str_len, zval *retval_ptr, c
ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, char **class_name, zend_class_entry **pce TSRMLS_DC);
ZEND_API void zend_verify_arg_error(int error_type, const zend_function *zf, uint32_t arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind, zval *arg TSRMLS_DC);
-static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC TSRMLS_DC)
-{
- if (Z_REFCOUNTED_P(zval_ptr)) {
- if (!Z_DELREF_P(zval_ptr)) {
- ZEND_ASSERT(zval_ptr != &EG(uninitialized_zval));
- _zval_dtor_func_for_ptr(Z_COUNTED_P(zval_ptr) ZEND_FILE_LINE_RELAY_CC);
- } else {
- GC_ZVAL_CHECK_POSSIBLE_ROOT(zval_ptr);
- }
- }
-}
-
static zend_always_inline int i_zend_is_true(zval *op TSRMLS_DC)
{
int result;
@@ -129,6 +117,65 @@ again:
return result;
}
+static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type TSRMLS_DC)
+{
+ do {
+ if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) {
+ zend_refcounted *garbage;
+
+ if (Z_ISREF_P(variable_ptr)) {
+ variable_ptr = Z_REFVAL_P(variable_ptr);
+ if (EXPECTED(!Z_REFCOUNTED_P(variable_ptr))) {
+ break;
+ }
+ }
+ if (Z_TYPE_P(variable_ptr) == IS_OBJECT &&
+ UNEXPECTED(Z_OBJ_HANDLER_P(variable_ptr, set) != NULL)) {
+ Z_OBJ_HANDLER_P(variable_ptr, set)(variable_ptr, value TSRMLS_CC);
+ return variable_ptr;
+ }
+ if ((value_type & (IS_VAR|IS_CV)) && variable_ptr == value) {
+ return variable_ptr;
+ }
+ garbage = Z_COUNTED_P(variable_ptr);
+ if (--GC_REFCOUNT(garbage) == 0) {
+ ZVAL_COPY_VALUE(variable_ptr, value);
+ if (value_type == IS_CONST) {
+ /* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */
+ if (UNEXPECTED(Z_OPT_COPYABLE_P(variable_ptr))) {
+ zval_copy_ctor_func(variable_ptr);
+ }
+ } else if (value_type != IS_TMP_VAR) {
+ if (UNEXPECTED(Z_OPT_REFCOUNTED_P(variable_ptr))) {
+ Z_ADDREF_P(variable_ptr);
+ }
+ }
+ _zval_dtor_func_for_ptr(garbage ZEND_FILE_LINE_CC);
+ return variable_ptr;
+ } else { /* we need to split */
+ /* optimized version of GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr) */
+ if ((Z_COLLECTABLE_P(variable_ptr)) &&
+ UNEXPECTED(!GC_INFO(garbage))) {
+ gc_possible_root(garbage TSRMLS_CC);
+ }
+ }
+ }
+ } while (0);
+
+ ZVAL_COPY_VALUE(variable_ptr, value);
+ if (value_type == IS_CONST) {
+ /* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */
+ if (UNEXPECTED(Z_OPT_COPYABLE_P(variable_ptr))) {
+ zval_copy_ctor_func(variable_ptr);
+ }
+ } else if (value_type != IS_TMP_VAR) {
+ if (UNEXPECTED(Z_OPT_REFCOUNTED_P(variable_ptr))) {
+ Z_ADDREF_P(variable_ptr);
+ }
+ }
+ return variable_ptr;
+}
+
ZEND_API int zval_update_constant(zval *pp, zend_bool inline_change TSRMLS_DC);
ZEND_API int zval_update_constant_inline_change(zval *pp, zend_class_entry *scope TSRMLS_DC);
ZEND_API int zval_update_constant_no_inline_change(zval *pp, zend_class_entry *scope TSRMLS_DC);
diff --git a/Zend/zend_float.h b/Zend/zend_float.h
index e3bb72e580..008bf07854 100644
--- a/Zend/zend_float.h
+++ b/Zend/zend_float.h
@@ -21,6 +21,8 @@
#ifndef ZEND_FLOAT_H
#define ZEND_FLOAT_H
+BEGIN_EXTERN_C()
+
/*
Define functions for FP initialization and de-initialization.
*/
@@ -28,6 +30,8 @@ extern ZEND_API void zend_init_fpu(TSRMLS_D);
extern ZEND_API void zend_shutdown_fpu(TSRMLS_D);
extern ZEND_API void zend_ensure_fpu_mode(TSRMLS_D);
+END_EXTERN_C()
+
/* Copy of the contents of xpfpa.h (which is under public domain)
See http://wiki.php.net/rfc/rounding for details.
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c
index 24be94f0d9..0f77ca6048 100644
--- a/Zend/zend_hash.c
+++ b/Zend/zend_hash.c
@@ -21,6 +21,7 @@
#include "zend.h"
#include "zend_globals.h"
+#include "zend_variables.h"
#if ZEND_DEBUG
/*
@@ -944,24 +945,115 @@ ZEND_API void zend_hash_destroy(HashTable *ht)
pefree(ht->arData, ht->u.flags & HASH_FLAG_PERSISTENT);
}
+ZEND_API void zend_array_destroy(HashTable *ht TSRMLS_DC)
+{
+ Bucket *p, *end;
+
+ IS_CONSISTENT(ht);
+
+ if (ht->nNumUsed) {
+
+ /* In some rare cases destructors of regular arrays may be changed */
+ if (UNEXPECTED(ht->pDestructor != ZVAL_PTR_DTOR)) {
+ zend_hash_destroy(ht);
+ return;
+ }
+
+ p = ht->arData;
+ end = p + ht->nNumUsed;
+ SET_INCONSISTENT(HT_IS_DESTROYING);
+
+ if (ht->u.flags & HASH_FLAG_PACKED) {
+ do {
+ if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) {
+ i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC TSRMLS_CC);
+ }
+ } while (++p != end);
+ } else {
+ do {
+ if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) {
+ i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC TSRMLS_CC);
+ if (EXPECTED(p->key)) {
+ zend_string_release(p->key);
+ }
+ }
+ } while (++p != end);
+ }
+
+ SET_INCONSISTENT(HT_DESTROYED);
+ } else if (EXPECTED(!ht->nTableMask)) {
+ return;
+ }
+ pefree(ht->arData, ht->u.flags & HASH_FLAG_PERSISTENT);
+}
ZEND_API void zend_hash_clean(HashTable *ht)
{
- uint32_t idx;
- Bucket *p;
+ Bucket *p, *end;
IS_CONSISTENT(ht);
- for (idx = 0; idx < ht->nNumUsed; idx++) {
- p = ht->arData + idx;
- if (Z_TYPE(p->val) == IS_UNDEF) continue;
+ if (ht->nNumUsed) {
+ p = ht->arData;
+ end = p + ht->nNumUsed;
if (ht->pDestructor) {
- ht->pDestructor(&p->val);
+ if (ht->u.flags & HASH_FLAG_PACKED) {
+ do {
+ if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) {
+ ht->pDestructor(&p->val);
+ }
+ } while (++p != end);
+ } else {
+ do {
+ if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) {
+ ht->pDestructor(&p->val);
+ if (EXPECTED(p->key)) {
+ zend_string_release(p->key);
+ }
+ }
+ } while (++p != end);
+ }
+ } else {
+ if (!(ht->u.flags & HASH_FLAG_PACKED)) {
+ do {
+ if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) {
+ if (EXPECTED(p->key)) {
+ zend_string_release(p->key);
+ }
+ }
+ } while (++p != end);
+ }
}
- if (p->key) {
- zend_string_release(p->key);
+ }
+ ht->nNumUsed = 0;
+ ht->nNumOfElements = 0;
+ ht->nNextFreeElement = 0;
+ ht->nInternalPointer = INVALID_IDX;
+ if (ht->nTableMask) {
+ if (!(ht->u.flags & HASH_FLAG_PACKED)) {
+ memset(ht->arHash, INVALID_IDX, ht->nTableSize * sizeof(uint32_t));
}
}
+}
+
+ZEND_API void zend_symtable_clean(HashTable *ht TSRMLS_DC)
+{
+ Bucket *p, *end;
+
+ IS_CONSISTENT(ht);
+
+ if (ht->nNumUsed) {
+ p = ht->arData;
+ end = p + ht->nNumUsed;
+ do {
+ if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) {
+ i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC TSRMLS_CC);
+ if (EXPECTED(p->key)) {
+ zend_string_release(p->key);
+ }
+ }
+ } while (++p != end);
+ }
ht->nNumUsed = 0;
ht->nNumOfElements = 0;
ht->nNextFreeElement = 0;
diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h
index 0ed47b424d..8f12b0e66e 100644
--- a/Zend/zend_hash.h
+++ b/Zend/zend_hash.h
@@ -216,6 +216,8 @@ ZEND_API zval *zend_hash_minmax(const HashTable *ht, compare_func_t compar, uint
ZEND_API int zend_hash_rehash(HashTable *ht);
ZEND_API void zend_array_dup(HashTable *target, HashTable *source);
+ZEND_API void zend_array_destroy(HashTable *ht TSRMLS_DC);
+ZEND_API void zend_symtable_clean(HashTable *ht TSRMLS_DC);
#if ZEND_DEBUG
/* debug */
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
index d577ba524c..43ef22074f 100644
--- a/Zend/zend_inheritance.c
+++ b/Zend/zend_inheritance.c
@@ -1238,7 +1238,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
/* 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].ce) {
+ if (cur_precedence->trait_method->ce == cur_precedence->exclude_from_classes[j].ce) {
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",
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index af2ba2d708..c474fa8662 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -545,51 +545,7 @@ ZEND_API void zend_std_write_property(zval *object, zval *member, zval *value, v
} else if (EXPECTED(zobj->properties != NULL)) {
if ((variable_ptr = zend_hash_find(zobj->properties, Z_STR_P(member))) != NULL) {
found:
- /* if we already have this value there, we don't actually need to do anything */
- if (EXPECTED(variable_ptr != value)) {
- /* if we are assigning reference, we shouldn't move it, but instead assign variable
- to the same pointer */
- if (Z_ISREF_P(variable_ptr)) {
- zval garbage;
-
- ZVAL_COPY_VALUE(&garbage, Z_REFVAL_P(variable_ptr)); /* old value should be destroyed */
-
- /* To check: can't *variable_ptr be some system variable like error_zval here? */
- if (UNEXPECTED(Z_REFCOUNTED_P(value))) {
- if (EXPECTED(!Z_ISREF_P(value))) {
- Z_ADDREF_P(value);
- } else {
- if (Z_REFCOUNT_P(value) == 1) {
- ZVAL_UNREF(value);
- } else {
- value = Z_REFVAL_P(value);
- }
- if (Z_REFCOUNTED_P(value)) {
- if (UNEXPECTED(Z_REFVAL_P(variable_ptr) == value)) {
- goto exit;
- }
- Z_ADDREF_P(value);
- }
- }
- }
- ZVAL_COPY_VALUE(Z_REFVAL_P(variable_ptr), value);
- zval_ptr_dtor(&garbage);
- } else {
- zval garbage;
-
- ZVAL_COPY_VALUE(&garbage, variable_ptr);
-
- /* if we assign referenced variable, we should separate it */
- ZVAL_COPY_VALUE(variable_ptr, value);
- if (Z_REFCOUNTED_P(variable_ptr)) {
- Z_ADDREF_P(variable_ptr);
- if (Z_ISREF_P(variable_ptr)) {
- SEPARATE_ZVAL(variable_ptr);
- }
- }
- zval_ptr_dtor(&garbage);
- }
- }
+ zend_assign_to_variable(variable_ptr, value, (IS_VAR|IS_TMP_VAR) TSRMLS_CC);
goto exit;
}
}
diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c
index 58c034163e..2778b168ee 100644
--- a/Zend/zend_objects.c
+++ b/Zend/zend_objects.c
@@ -47,18 +47,19 @@ ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSR
ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC)
{
- int i;
+ int i, count;
if (object->guards) {
zend_hash_destroy(object->guards);
FREE_HASHTABLE(object->guards);
}
if (object->properties) {
- zend_hash_destroy(object->properties);
+ zend_array_destroy(object->properties TSRMLS_CC);
FREE_HASHTABLE(object->properties);
}
- for (i = 0; i < object->ce->default_properties_count; i++) {
- zval_ptr_dtor(&object->properties_table[i]);
+ count = object->ce->default_properties_count;
+ for (i = 0; i < count; i++) {
+ i_zval_ptr_dtor(&object->properties_table[i] ZEND_FILE_LINE_CC TSRMLS_CC);
}
}
diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c
index aae8465791..548d191cfd 100644
--- a/Zend/zend_variables.c
+++ b/Zend/zend_variables.c
@@ -45,7 +45,7 @@ ZEND_API void _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC)
/* break possible cycles */
GC_TYPE(arr) = IS_NULL;
GC_REMOVE_FROM_BUFFER(arr);
- zend_hash_destroy(&arr->ht);
+ zend_array_destroy(&arr->ht TSRMLS_CC);
efree_size(arr, sizeof(zend_array));
}
break;
@@ -77,7 +77,9 @@ ZEND_API void _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC)
case IS_REFERENCE: {
zend_reference *ref = (zend_reference*)p;
if (--GC_REFCOUNT(ref) == 0) {
- zval_ptr_dtor(&ref->val);
+ TSRMLS_FETCH();
+
+ i_zval_ptr_dtor(&ref->val ZEND_FILE_LINE_RELAY_CC TSRMLS_CC);
efree_size(ref, sizeof(zend_reference));
}
break;
@@ -105,7 +107,7 @@ ZEND_API void _zval_dtor_func_for_ptr(zend_refcounted *p ZEND_FILE_LINE_DC)
/* break possible cycles */
GC_TYPE(arr) = IS_NULL;
GC_REMOVE_FROM_BUFFER(arr);
- zend_hash_destroy(&arr->ht);
+ zend_array_destroy(&arr->ht TSRMLS_CC);
efree_size(arr, sizeof(zend_array));
}
break;
@@ -134,8 +136,9 @@ ZEND_API void _zval_dtor_func_for_ptr(zend_refcounted *p ZEND_FILE_LINE_DC)
}
case IS_REFERENCE: {
zend_reference *ref = (zend_reference*)p;
+ TSRMLS_FETCH();
- zval_ptr_dtor(&ref->val);
+ i_zval_ptr_dtor(&ref->val ZEND_FILE_LINE_RELAY_CC TSRMLS_CC);
efree_size(ref, sizeof(zend_reference));
break;
}
@@ -293,7 +296,9 @@ ZEND_API void _zval_internal_dtor_wrapper(zval *zvalue)
ZEND_API void _zval_ptr_dtor_wrapper(zval *zval_ptr)
{
- zval_ptr_dtor(zval_ptr);
+ TSRMLS_FETCH();
+
+ i_zval_ptr_dtor(zval_ptr ZEND_FILE_LINE_CC TSRMLS_CC);
}
diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h
index 4f840bdd8a..ea0434dc0b 100644
--- a/Zend/zend_variables.h
+++ b/Zend/zend_variables.h
@@ -22,6 +22,8 @@
#ifndef ZEND_VARIABLES_H
#define ZEND_VARIABLES_H
+#include "zend_types.h"
+#include "zend_gc.h"
BEGIN_EXTERN_C()
@@ -43,6 +45,17 @@ static zend_always_inline void _zval_ptr_dtor_nogc(zval *zval_ptr ZEND_FILE_LINE
}
}
+static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC TSRMLS_DC)
+{
+ if (Z_REFCOUNTED_P(zval_ptr)) {
+ if (!Z_DELREF_P(zval_ptr)) {
+ _zval_dtor_func_for_ptr(Z_COUNTED_P(zval_ptr) ZEND_FILE_LINE_RELAY_CC);
+ } else {
+ GC_ZVAL_CHECK_POSSIBLE_ROOT(zval_ptr);
+ }
+ }
+}
+
ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC);
#define zval_copy_ctor_func(zv) _zval_copy_ctor_func(zv ZEND_FILE_LINE_CC)
diff --git a/Zend/zend_vm.h b/Zend/zend_vm.h
index 078be15b74..e403e7cc92 100644
--- a/Zend/zend_vm.h
+++ b/Zend/zend_vm.h
@@ -21,9 +21,13 @@
#ifndef ZEND_VM_H
#define ZEND_VM_H
+BEGIN_EXTERN_C()
+
ZEND_API void zend_vm_use_old_executor(void);
ZEND_API void zend_vm_set_opcode_handler(zend_op* opcode);
+END_EXTERN_C()
+
#define ZEND_VM_SET_OPCODE_HANDLER(opline) zend_vm_set_opcode_handler(opline)
#endif
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index eb181d9c27..223f43dda7 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -385,7 +385,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -711,7 +711,7 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -798,7 +798,7 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -2080,7 +2080,7 @@ ZEND_VM_HANDLER(56, ZEND_ADD_VAR, TMP|UNUSED, TMP|VAR|CV)
add_string_to_string(str, str, var);
if (use_copy) {
- zval_dtor(var);
+ zend_string_release(Z_STR_P(var));
}
/* original comment, possibly problematic:
* FREE_OP is missing intentionally here - we're always working on the same temporary variable
@@ -2675,7 +2675,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
zval *p = ZEND_CALL_ARG(call, 1);
for (i = 0; i < call->num_args; ++i) {
- zend_verify_arg_type(fbc, i + 1, p TSRMLS_CC);
+ zend_verify_arg_type(fbc, i + 1, p, NULL TSRMLS_CC);
p++;
}
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -2980,9 +2980,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV)
}
exception = EG(exception);
- if (Z_REFCOUNTED_P(EX_VAR(opline->op2.var))) {
- zval_ptr_dtor(EX_VAR(opline->op2.var));
- }
+ zval_ptr_dtor(EX_VAR(opline->op2.var));
ZVAL_OBJ(EX_VAR(opline->op2.var), EG(exception));
if (UNEXPECTED(EG(exception) != exception)) {
GC_REFCOUNT(EG(exception))++;
@@ -3269,7 +3267,7 @@ ZEND_VM_C_LABEL(send_again):
if (Z_TYPE(key) == IS_STRING) {
zend_error(E_RECOVERABLE_ERROR,
"Cannot unpack Traversable with string keys");
- zval_dtor(&key);
+ zend_string_release(Z_STR(key));
ZEND_VM_C_GOTO(unpack_iter_dtor);
}
@@ -3528,7 +3526,7 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
zval *param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
- zend_verify_arg_type(EX(func), arg_num, param TSRMLS_CC);
+ zend_verify_arg_type(EX(func), arg_num, param, NULL TSRMLS_CC);
CHECK_EXCEPTION();
}
@@ -3556,7 +3554,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
}
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
- zend_verify_arg_type(EX(func), arg_num, param TSRMLS_CC);
+ zend_verify_arg_type(EX(func), arg_num, param, opline->op2.zv TSRMLS_CC);
}
CHECK_EXCEPTION();
@@ -3581,7 +3579,7 @@ ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, ANY, ANY)
param = EX_VAR_NUM(EX(func)->op_array.last_var + EX(func)->op_array.T);
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
do {
- zend_verify_arg_type(EX(func), arg_num, param TSRMLS_CC);
+ zend_verify_arg_type(EX(func), arg_num, param, NULL TSRMLS_CC);
zend_hash_next_index_insert_new(Z_ARRVAL_P(params), param);
if (Z_REFCOUNTED_P(param)) Z_ADDREF_P(param);
param++;
@@ -3712,7 +3710,7 @@ ZEND_VM_HANDLER(68, ZEND_NEW, CONST|VAR, ANY)
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), &object_zval);
} else {
- zval_ptr_dtor(&object_zval);
+ OBJ_RELEASE(Z_OBJ(object_zval));
}
ZEND_VM_JMP(opline->op2.jmp_addr);
} else {
@@ -3790,7 +3788,7 @@ ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMP|VAR|UNUSED|CV, ANY)
if (EXPECTED(EG(exception) == NULL)) {
ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj TSRMLS_CC));
if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
- zval_ptr_dtor(EX_VAR(opline->result.var));
+ OBJ_RELEASE(Z_OBJ_P(EX_VAR(opline->result.var)));
}
}
FREE_OP1_IF_VAR();
@@ -4197,7 +4195,7 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
}
}
if (Z_TYPE(tmp_inc_filename) != IS_UNDEF) {
- zval_ptr_dtor(&tmp_inc_filename);
+ zend_string_release(Z_STR(tmp_inc_filename));
}
FREE_OP1();
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -4288,8 +4286,8 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
} else {
ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
- if (OP1_TYPE != IS_CONST) {
- zval_dtor(&tmp);
+ if (OP1_TYPE != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
FREE_OP1();
HANDLE_EXCEPTION();
@@ -4308,8 +4306,8 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
- if (OP1_TYPE != IS_CONST) {
- zval_dtor(&tmp);
+ if (OP1_TYPE != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
FREE_OP1();
CHECK_EXCEPTION();
@@ -4892,6 +4890,7 @@ ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
zend_free_op free_op1;
zval tmp, *varname = GET_OP1_ZVAL_PTR(BP_VAR_IS);
+ ZVAL_UNDEF(&tmp);
if (OP1_TYPE != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -4920,8 +4919,8 @@ ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (OP1_TYPE != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (OP1_TYPE != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
FREE_OP1();
@@ -5898,23 +5897,39 @@ ZEND_VM_HANDLER(168, ZEND_BIND_GLOBAL, CV, CONST)
zval *varname;
zval *value;
zval *variable_ptr;
- Bucket *p;
uint32_t idx;
SAVE_OPLINE();
varname = GET_OP2_ZVAL_PTR(BP_VAR_R);
- idx = (uint32_t)(uintptr_t)CACHED_PTR(Z_CACHE_SLOT_P(varname));
- /* index 0 can't be cached (NULL is a mark of uninitialized cache slot) */
- p = EG(symbol_table).ht.arData + idx;
- if (EXPECTED(idx > 0) &&
- EXPECTED(idx < EG(symbol_table).ht.nNumUsed) &&
- EXPECTED(Z_TYPE(p->val) != IS_UNDEF) &&
- (EXPECTED(p->key == Z_STR_P(varname)) ||
- (EXPECTED(p->h == Z_STR_P(varname)->h) &&
- EXPECTED(p->key != NULL) &&
- EXPECTED(p->key->len == Z_STRLEN_P(varname)) &&
- EXPECTED(memcmp(p->key->val, Z_STRVAL_P(varname), Z_STRLEN_P(varname)) == 0)))) {
- value = &EG(symbol_table).ht.arData[idx].val;
+
+ /* We store "hash slot index" + 1 (NULL is a mark of uninitialized cache slot) */
+ idx = (uint32_t)(uintptr_t)CACHED_PTR(Z_CACHE_SLOT_P(varname)) - 1;
+ if (EXPECTED(idx < EG(symbol_table).ht.nNumUsed)) {
+ Bucket *p = EG(symbol_table).ht.arData + idx;
+
+ if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF) &&
+ (EXPECTED(p->key == Z_STR_P(varname)) ||
+ (EXPECTED(p->h == Z_STR_P(varname)->h) &&
+ EXPECTED(p->key != NULL) &&
+ EXPECTED(p->key->len == Z_STRLEN_P(varname)) &&
+ EXPECTED(memcmp(p->key->val, Z_STRVAL_P(varname), Z_STRLEN_P(varname)) == 0)))) {
+
+ value = &EG(symbol_table).ht.arData[idx].val;
+ ZEND_VM_C_GOTO(check_indirect);
+ }
+ }
+
+ value = zend_hash_find(&EG(symbol_table).ht, Z_STR_P(varname));
+ if (UNEXPECTED(value == NULL)) {
+ value = zend_hash_add_new(&EG(symbol_table).ht, Z_STR_P(varname), &EG(uninitialized_zval));
+ idx = ((char*)value - (char*)EG(symbol_table).ht.arData) / sizeof(Bucket);
+ /* Store "hash slot index" + 1 (NULL is a mark of uninitialized cache slot) */
+ CACHE_PTR(Z_CACHE_SLOT_P(varname), (void*)(uintptr_t)(idx + 1));
+ } else {
+ idx = ((char*)value - (char*)EG(symbol_table).ht.arData) / sizeof(Bucket);
+ /* Store "hash slot index" + 1 (NULL is a mark of uninitialized cache slot) */
+ CACHE_PTR(Z_CACHE_SLOT_P(varname), (void*)(uintptr_t)(idx + 1));
+ZEND_VM_C_LABEL(check_indirect):
/* GLOBAL variable may be an INDIRECT pointer to CV */
if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) {
value = Z_INDIRECT_P(value);
@@ -5922,23 +5937,6 @@ ZEND_VM_HANDLER(168, ZEND_BIND_GLOBAL, CV, CONST)
ZVAL_NULL(value);
}
}
- } else {
- value = zend_hash_find(&EG(symbol_table).ht, Z_STR_P(varname));
- if (UNEXPECTED(value == NULL)) {
- value = zend_hash_add_new(&EG(symbol_table).ht, Z_STR_P(varname), &EG(uninitialized_zval));
- idx = ((char*)value - (char*)EG(symbol_table).ht.arData) / sizeof(Bucket);
- CACHE_PTR(Z_CACHE_SLOT_P(varname), (void*)(uintptr_t)idx);
- } else {
- idx = ((char*)value - (char*)EG(symbol_table).ht.arData) / sizeof(Bucket);
- CACHE_PTR(Z_CACHE_SLOT_P(varname), (void*)(uintptr_t)idx);
- /* GLOBAL variable may be an INDIRECT pointer to CV */
- if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) {
- value = Z_INDIRECT_P(value);
- if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) {
- ZVAL_NULL(value);
- }
- }
- }
}
variable_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_W);
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 2a8e901c57..5210484370 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -538,7 +538,7 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *p = ZEND_CALL_ARG(call, 1);
for (i = 0; i < call->num_args; ++i) {
- zend_verify_arg_type(fbc, i + 1, p TSRMLS_CC);
+ zend_verify_arg_type(fbc, i + 1, p, NULL TSRMLS_CC);
p++;
}
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -798,7 +798,7 @@ send_again:
if (Z_TYPE(key) == IS_STRING) {
zend_error(E_RECOVERABLE_ERROR,
"Cannot unpack Traversable with string keys");
- zval_dtor(&key);
+ zend_string_release(Z_STR(key));
goto unpack_iter_dtor;
}
@@ -978,7 +978,7 @@ static int ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
zval *param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
- zend_verify_arg_type(EX(func), arg_num, param TSRMLS_CC);
+ zend_verify_arg_type(EX(func), arg_num, param, NULL TSRMLS_CC);
CHECK_EXCEPTION();
}
@@ -1003,7 +1003,7 @@ static int ZEND_FASTCALL ZEND_RECV_VARIADIC_SPEC_HANDLER(ZEND_OPCODE_HANDLER_AR
param = EX_VAR_NUM(EX(func)->op_array.last_var + EX(func)->op_array.T);
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
do {
- zend_verify_arg_type(EX(func), arg_num, param TSRMLS_CC);
+ zend_verify_arg_type(EX(func), arg_num, param, NULL TSRMLS_CC);
zend_hash_next_index_insert_new(Z_ARRVAL_P(params), param);
if (Z_REFCOUNTED_P(param)) Z_ADDREF_P(param);
param++;
@@ -1662,7 +1662,7 @@ static int ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_
}
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
- zend_verify_arg_type(EX(func), arg_num, param TSRMLS_CC);
+ zend_verify_arg_type(EX(func), arg_num, param, opline->op2.zv TSRMLS_CC);
}
CHECK_EXCEPTION();
@@ -2757,7 +2757,7 @@ static int ZEND_FASTCALL ZEND_NEW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), &object_zval);
} else {
- zval_ptr_dtor(&object_zval);
+ OBJ_RELEASE(Z_OBJ(object_zval));
}
ZEND_VM_JMP(opline->op2.jmp_addr);
} else {
@@ -2835,7 +2835,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
if (EXPECTED(EG(exception) == NULL)) {
ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj TSRMLS_CC));
if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
- zval_ptr_dtor(EX_VAR(opline->result.var));
+ OBJ_RELEASE(Z_OBJ_P(EX_VAR(opline->result.var)));
}
}
@@ -3023,7 +3023,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
}
}
if (Z_TYPE(tmp_inc_filename) != IS_UNDEF) {
- zval_ptr_dtor(&tmp_inc_filename);
+ zend_string_release(Z_STR(tmp_inc_filename));
}
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -4593,8 +4593,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HA
} else {
ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
- if (IS_CONST != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
HANDLE_EXCEPTION();
@@ -4613,8 +4613,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HA
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_CONST != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
CHECK_EXCEPTION();
@@ -4645,6 +4645,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_CONST_HANDLER(ZEND_O
zval tmp, *varname = opline->op1.zv;
+ ZVAL_UNDEF(&tmp);
if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -4673,8 +4674,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_CONST_HANDLER(ZEND_O
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_CONST != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
if (opline->extended_value & ZEND_ISSET) {
@@ -7095,8 +7096,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAND
} else {
ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
- if (IS_CONST != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
HANDLE_EXCEPTION();
@@ -7115,8 +7116,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAND
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_CONST != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
CHECK_EXCEPTION();
@@ -7147,6 +7148,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPC
zval tmp, *varname = opline->op1.zv;
+ ZVAL_UNDEF(&tmp);
if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -7175,8 +7177,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPC
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_CONST != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
if (opline->extended_value & ZEND_ISSET) {
@@ -7960,8 +7962,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_H
} else {
ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
- if (IS_CONST != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
HANDLE_EXCEPTION();
@@ -7980,8 +7982,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_H
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_CONST != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
CHECK_EXCEPTION();
@@ -8012,6 +8014,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_
zval tmp, *varname = opline->op1.zv;
+ ZVAL_UNDEF(&tmp);
if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -8040,8 +8043,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_CONST != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
if (opline->extended_value & ZEND_ISSET) {
@@ -8912,9 +8915,7 @@ static int ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A
}
exception = EG(exception);
- if (Z_REFCOUNTED_P(EX_VAR(opline->op2.var))) {
- zval_ptr_dtor(EX_VAR(opline->op2.var));
- }
+ zval_ptr_dtor(EX_VAR(opline->op2.var));
ZVAL_OBJ(EX_VAR(opline->op2.var), EG(exception));
if (UNEXPECTED(EG(exception) != exception)) {
GC_REFCOUNT(EG(exception))++;
@@ -9798,7 +9799,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (EXPECTED(EG(exception) == NULL)) {
ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj TSRMLS_CC));
if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
- zval_ptr_dtor(EX_VAR(opline->result.var));
+ OBJ_RELEASE(Z_OBJ_P(EX_VAR(opline->result.var)));
}
}
@@ -9987,7 +9988,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
}
}
if (Z_TYPE(tmp_inc_filename) != IS_UNDEF) {
- zval_ptr_dtor(&tmp_inc_filename);
+ zend_string_release(Z_STR(tmp_inc_filename));
}
zval_ptr_dtor_nogc(free_op1);
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -11424,8 +11425,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAND
} else {
ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
- if (IS_TMP_VAR != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_TMP_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
@@ -11444,8 +11445,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAND
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_TMP_VAR != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_TMP_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -11476,6 +11477,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPC
zend_free_op free_op1;
zval tmp, *varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
+ ZVAL_UNDEF(&tmp);
if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -11504,8 +11506,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPC
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_TMP_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
zval_ptr_dtor_nogc(free_op1);
@@ -12366,7 +12368,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_
add_string_to_string(str, str, var);
if (use_copy) {
- zval_dtor(var);
+ zend_string_release(Z_STR_P(var));
}
/* original comment, possibly problematic:
* FREE_OP is missing intentionally here - we're always working on the same temporary variable
@@ -13576,7 +13578,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_
add_string_to_string(str, str, var);
if (use_copy) {
- zval_dtor(var);
+ zend_string_release(Z_STR_P(var));
}
/* original comment, possibly problematic:
* FREE_OP is missing intentionally here - we're always working on the same temporary variable
@@ -13879,8 +13881,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLE
} else {
ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
- if (IS_TMP_VAR != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_TMP_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
@@ -13899,8 +13901,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLE
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_TMP_VAR != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_TMP_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -13931,6 +13933,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD
zend_free_op free_op1;
zval tmp, *varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
+ ZVAL_UNDEF(&tmp);
if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -13959,8 +13962,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_TMP_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
zval_ptr_dtor_nogc(free_op1);
@@ -14660,8 +14663,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HAN
} else {
ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
- if (IS_TMP_VAR != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_TMP_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
@@ -14680,8 +14683,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HAN
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_TMP_VAR != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_TMP_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -14712,6 +14715,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OP
zend_free_op free_op1;
zval tmp, *varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
+ ZVAL_UNDEF(&tmp);
if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -14740,8 +14744,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OP
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_TMP_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
zval_ptr_dtor_nogc(free_op1);
@@ -15401,7 +15405,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_A
add_string_to_string(str, str, var);
if (use_copy) {
- zval_dtor(var);
+ zend_string_release(Z_STR_P(var));
}
/* original comment, possibly problematic:
* FREE_OP is missing intentionally here - we're always working on the same temporary variable
@@ -16706,7 +16710,7 @@ static int ZEND_FASTCALL ZEND_NEW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), &object_zval);
} else {
- zval_ptr_dtor(&object_zval);
+ OBJ_RELEASE(Z_OBJ(object_zval));
}
ZEND_VM_JMP(opline->op2.jmp_addr);
} else {
@@ -16784,7 +16788,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (EXPECTED(EG(exception) == NULL)) {
ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj TSRMLS_CC));
if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
- zval_ptr_dtor(EX_VAR(opline->result.var));
+ OBJ_RELEASE(Z_OBJ_P(EX_VAR(opline->result.var)));
}
}
zval_ptr_dtor_nogc(free_op1);
@@ -16974,7 +16978,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
}
}
if (Z_TYPE(tmp_inc_filename) != IS_UNDEF) {
- zval_ptr_dtor(&tmp_inc_filename);
+ zend_string_release(Z_STR(tmp_inc_filename));
}
zval_ptr_dtor_nogc(free_op1);
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -17994,7 +17998,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -18317,7 +18321,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -18403,7 +18407,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -19591,8 +19595,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
} else {
ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
- if (IS_VAR != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
@@ -19611,8 +19615,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_VAR != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -19756,6 +19760,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPC
zend_free_op free_op1;
zval tmp, *varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
+ ZVAL_UNDEF(&tmp);
if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -19784,8 +19789,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPC
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_VAR != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
zval_ptr_dtor_nogc(free_op1);
@@ -20473,7 +20478,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -20799,7 +20804,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t i
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -20886,7 +20891,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -22499,7 +22504,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -22825,7 +22830,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t i
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -22912,7 +22917,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -24040,8 +24045,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
} else {
ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
- if (IS_VAR != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
@@ -24060,8 +24065,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_VAR != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -24205,6 +24210,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD
zend_free_op free_op1;
zval tmp, *varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
+ ZVAL_UNDEF(&tmp);
if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -24233,8 +24239,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_VAR != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
zval_ptr_dtor_nogc(free_op1);
@@ -24649,7 +24655,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -25498,8 +25504,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAN
} else {
ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
- if (IS_VAR != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
@@ -25518,8 +25524,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAN
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_VAR != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -25550,6 +25556,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OP
zend_free_op free_op1;
zval tmp, *varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
+ ZVAL_UNDEF(&tmp);
if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -25578,8 +25585,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OP
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_VAR != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_VAR != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
zval_ptr_dtor_nogc(free_op1);
@@ -26086,7 +26093,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -26409,7 +26416,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -26495,7 +26502,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -27881,7 +27888,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (EXPECTED(EG(exception) == NULL)) {
ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj TSRMLS_CC));
if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
- zval_ptr_dtor(EX_VAR(opline->result.var));
+ OBJ_RELEASE(Z_OBJ_P(EX_VAR(opline->result.var)));
}
}
@@ -27970,7 +27977,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -28292,7 +28299,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incde
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -28378,7 +28385,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incd
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -29371,7 +29378,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -29696,7 +29703,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -29783,7 +29790,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -30083,7 +30090,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDL
add_string_to_string(str, str, var);
if (use_copy) {
- zval_dtor(var);
+ zend_string_release(Z_STR_P(var));
}
/* original comment, possibly problematic:
* FREE_OP is missing intentionally here - we're always working on the same temporary variable
@@ -30690,7 +30697,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -31015,7 +31022,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -31102,7 +31109,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -31402,7 +31409,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDL
add_string_to_string(str, str, var);
if (use_copy) {
- zval_dtor(var);
+ zend_string_release(Z_STR_P(var));
}
/* original comment, possibly problematic:
* FREE_OP is missing intentionally here - we're always working on the same temporary variable
@@ -32009,7 +32016,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -32501,7 +32508,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -32823,7 +32830,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -32909,7 +32916,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -33206,7 +33213,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLE
add_string_to_string(str, str, var);
if (use_copy) {
- zval_dtor(var);
+ zend_string_release(Z_STR_P(var));
}
/* original comment, possibly problematic:
* FREE_OP is missing intentionally here - we're always working on the same temporary variable
@@ -34503,7 +34510,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (EXPECTED(EG(exception) == NULL)) {
ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj TSRMLS_CC));
if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) {
- zval_ptr_dtor(EX_VAR(opline->result.var));
+ OBJ_RELEASE(Z_OBJ_P(EX_VAR(opline->result.var)));
}
}
@@ -34691,7 +34698,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
}
}
if (Z_TYPE(tmp_inc_filename) != IS_UNDEF) {
- zval_ptr_dtor(&tmp_inc_filename);
+ zend_string_release(Z_STR(tmp_inc_filename));
}
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -35459,7 +35466,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -35781,7 +35788,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -35867,7 +35874,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -36831,8 +36838,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
} else {
ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
- if (IS_CV != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
HANDLE_EXCEPTION();
@@ -36851,8 +36858,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_CV != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
CHECK_EXCEPTION();
@@ -36996,6 +37003,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCO
zval tmp, *varname = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
+ ZVAL_UNDEF(&tmp);
if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -37024,8 +37032,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCO
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_CV != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
if (opline->extended_value & ZEND_ISSET) {
@@ -37384,23 +37392,39 @@ static int ZEND_FASTCALL ZEND_BIND_GLOBAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN
zval *varname;
zval *value;
zval *variable_ptr;
- Bucket *p;
uint32_t idx;
SAVE_OPLINE();
varname = opline->op2.zv;
- idx = (uint32_t)(uintptr_t)CACHED_PTR(Z_CACHE_SLOT_P(varname));
- /* index 0 can't be cached (NULL is a mark of uninitialized cache slot) */
- p = EG(symbol_table).ht.arData + idx;
- if (EXPECTED(idx > 0) &&
- EXPECTED(idx < EG(symbol_table).ht.nNumUsed) &&
- EXPECTED(Z_TYPE(p->val) != IS_UNDEF) &&
- (EXPECTED(p->key == Z_STR_P(varname)) ||
- (EXPECTED(p->h == Z_STR_P(varname)->h) &&
- EXPECTED(p->key != NULL) &&
- EXPECTED(p->key->len == Z_STRLEN_P(varname)) &&
- EXPECTED(memcmp(p->key->val, Z_STRVAL_P(varname), Z_STRLEN_P(varname)) == 0)))) {
- value = &EG(symbol_table).ht.arData[idx].val;
+
+ /* We store "hash slot index" + 1 (NULL is a mark of uninitialized cache slot) */
+ idx = (uint32_t)(uintptr_t)CACHED_PTR(Z_CACHE_SLOT_P(varname)) - 1;
+ if (EXPECTED(idx < EG(symbol_table).ht.nNumUsed)) {
+ Bucket *p = EG(symbol_table).ht.arData + idx;
+
+ if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF) &&
+ (EXPECTED(p->key == Z_STR_P(varname)) ||
+ (EXPECTED(p->h == Z_STR_P(varname)->h) &&
+ EXPECTED(p->key != NULL) &&
+ EXPECTED(p->key->len == Z_STRLEN_P(varname)) &&
+ EXPECTED(memcmp(p->key->val, Z_STRVAL_P(varname), Z_STRLEN_P(varname)) == 0)))) {
+
+ value = &EG(symbol_table).ht.arData[idx].val;
+ goto check_indirect;
+ }
+ }
+
+ value = zend_hash_find(&EG(symbol_table).ht, Z_STR_P(varname));
+ if (UNEXPECTED(value == NULL)) {
+ value = zend_hash_add_new(&EG(symbol_table).ht, Z_STR_P(varname), &EG(uninitialized_zval));
+ idx = ((char*)value - (char*)EG(symbol_table).ht.arData) / sizeof(Bucket);
+ /* Store "hash slot index" + 1 (NULL is a mark of uninitialized cache slot) */
+ CACHE_PTR(Z_CACHE_SLOT_P(varname), (void*)(uintptr_t)(idx + 1));
+ } else {
+ idx = ((char*)value - (char*)EG(symbol_table).ht.arData) / sizeof(Bucket);
+ /* Store "hash slot index" + 1 (NULL is a mark of uninitialized cache slot) */
+ CACHE_PTR(Z_CACHE_SLOT_P(varname), (void*)(uintptr_t)(idx + 1));
+check_indirect:
/* GLOBAL variable may be an INDIRECT pointer to CV */
if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) {
value = Z_INDIRECT_P(value);
@@ -37408,23 +37432,6 @@ static int ZEND_FASTCALL ZEND_BIND_GLOBAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN
ZVAL_NULL(value);
}
}
- } else {
- value = zend_hash_find(&EG(symbol_table).ht, Z_STR_P(varname));
- if (UNEXPECTED(value == NULL)) {
- value = zend_hash_add_new(&EG(symbol_table).ht, Z_STR_P(varname), &EG(uninitialized_zval));
- idx = ((char*)value - (char*)EG(symbol_table).ht.arData) / sizeof(Bucket);
- CACHE_PTR(Z_CACHE_SLOT_P(varname), (void*)(uintptr_t)idx);
- } else {
- idx = ((char*)value - (char*)EG(symbol_table).ht.arData) / sizeof(Bucket);
- CACHE_PTR(Z_CACHE_SLOT_P(varname), (void*)(uintptr_t)idx);
- /* GLOBAL variable may be an INDIRECT pointer to CV */
- if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) {
- value = Z_INDIRECT_P(value);
- if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) {
- ZVAL_NULL(value);
- }
- }
- }
}
variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
@@ -37768,7 +37775,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -38093,7 +38100,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_TMP(incdec_t in
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -38180,7 +38187,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_TMP(incdec_t i
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -39666,7 +39673,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -39991,7 +39998,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t in
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -40078,7 +40085,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t i
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -41079,8 +41086,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER
} else {
ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
- if (IS_CV != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
HANDLE_EXCEPTION();
@@ -41099,8 +41106,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_CV != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
CHECK_EXCEPTION();
@@ -41244,6 +41251,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE
zval tmp, *varname = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
+ ZVAL_UNDEF(&tmp);
if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -41272,8 +41280,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_CV != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
if (opline->extended_value & ZEND_ISSET) {
@@ -41686,7 +41694,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*b
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -42410,8 +42418,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAND
} else {
ce = zend_fetch_class_by_name(Z_STR_P(opline->op2.zv), opline->op2.zv + 1, 0 TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
- if (IS_CV != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
HANDLE_EXCEPTION();
@@ -42430,8 +42438,8 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAND
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_CV != IS_CONST) {
- zval_dtor(&tmp);
+ if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
CHECK_EXCEPTION();
@@ -42462,6 +42470,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPC
zval tmp, *varname = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
+ ZVAL_UNDEF(&tmp);
if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
varname = &tmp;
@@ -42490,8 +42499,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPC
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
- if (IS_CV != IS_CONST && varname == &tmp) {
- zval_dtor(&tmp);
+ if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
+ zend_string_release(Z_STR(tmp));
}
if (opline->extended_value & ZEND_ISSET) {
@@ -42978,7 +42987,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -43300,7 +43309,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t inc
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
@@ -43386,7 +43395,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t in
zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
if (Z_REFCOUNT_P(z) == 0) {
- zval_dtor(z);
+ zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
}
ZVAL_COPY_VALUE(z, value);
}
diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php
index 9aaa73aaaf..5836adaefb 100644
--- a/Zend/zend_vm_gen.php
+++ b/Zend/zend_vm_gen.php
@@ -1217,7 +1217,9 @@ function gen_vm($def, $skel) {
out($f, $GLOBALS['header_text']);
fputs($f, "#ifndef ZEND_VM_OPCODES_H\n#define ZEND_VM_OPCODES_H\n\n");
+ fputs($f, "BEGIN_EXTERN_C()\n\n");
fputs($f, "ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);\n\n");
+ fputs($f, "END_EXTERN_C()\n\n");
foreach ($opcodes as $code => $dsc) {
$code = str_pad((string)$code,$code_len," ",STR_PAD_LEFT);
diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h
index c06fd84ff4..9d969877e0 100644
--- a/Zend/zend_vm_opcodes.h
+++ b/Zend/zend_vm_opcodes.h
@@ -21,8 +21,12 @@
#ifndef ZEND_VM_OPCODES_H
#define ZEND_VM_OPCODES_H
+BEGIN_EXTERN_C()
+
ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);
+END_EXTERN_C()
+
#define ZEND_NOP 0
#define ZEND_ADD 1
#define ZEND_SUB 2
diff --git a/ext/calendar/julian.c b/ext/calendar/julian.c
index 659ffc1740..904727ff04 100644
--- a/ext/calendar/julian.c
+++ b/ext/calendar/julian.c
@@ -47,7 +47,7 @@
*
* CALENDAR OVERVIEW
*
- * Julias Ceasar created the calendar in 46 B.C. as a modified form of
+ * Julius Caesar created the calendar in 46 B.C. as a modified form of
* the old Roman republican calendar which was based on lunar cycles.
* The new Julian calendar set fixed lengths for the months, abandoning
* the lunar cycle. It also specified that there would be exactly 12
diff --git a/ext/calendar/tests/unixtojd.phpt b/ext/calendar/tests/unixtojd.phpt
index 4eeb1ca93e..6183cae9ee 100644
--- a/ext/calendar/tests/unixtojd.phpt
+++ b/ext/calendar/tests/unixtojd.phpt
@@ -21,10 +21,10 @@ putenv('TZ=UTC');
// -uses --INI-- section with date.timezone=UTC
// -uses putenv('TZ=UTC')
// date.timezone=UTC
-// -if ommitted from easter_date.phpt, outputs DATE_TZ_ERRMSG warning
+// -if omitted from easter_date.phpt, outputs DATE_TZ_ERRMSG warning
// -easter_date() calls mktime() and localtime()
// -whereas unixtojd(1000000000) calls localtime(1000000000)
-// -if ommitted from unixtojd.phpt, does NOT output DATE_TZ_ERRMSG
+// -if omitted from unixtojd.phpt, does NOT output DATE_TZ_ERRMSG
//
// unixtojd() calls php_localtime_r() which for Pacific timezone systems, returns a time -8 hours
// -this incorrect localtime is passed to the julian date conversion (GregorianToSDN) function which works (probably correctly)
diff --git a/ext/curl/tests/curl_multi_init_param.phpt b/ext/curl/tests/curl_multi_init_param.phpt
new file mode 100644
index 0000000000..e7848976aa
--- /dev/null
+++ b/ext/curl/tests/curl_multi_init_param.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Test curl_multi_init() fail if any parameter is passed
+--CREDITS--
+Paulo Eduardo <pauloelr [at] gmail [dot] com>
+#testfest SP 2014
+--SKIPIF--
+<?php if (!extension_loaded("curl")) print "skip"; ?>
+--FILE--
+<?php
+/* Prototype : resource curl_multi_init(void)
+ * Description : Returns a new cURL multi handle
+ * Source code : ext/curl/multi.c
+ * Test documentation: http://wiki.php.net/qa/temp/ext/curl
+ */
+
+// start testing
+
+//create the multiple cURL handle
+$mh = curl_multi_init('test');
+var_dump($mh);
+
+?>
+===DONE===
+--EXPECTF--
+Warning: curl_multi_init() expects exactly 0 parameters, %d given in %s on line %d
+NULL
+===DONE===
diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c
index a503f9e01e..eb6d0af310 100644
--- a/ext/date/lib/parse_tz.c
+++ b/ext/date/lib/parse_tz.c
@@ -336,7 +336,7 @@ static ttinfo* fetch_timezone_offset(timelib_tzinfo *tz, timelib_sll ts, timelib
{
uint32_t i;
- /* If there is no transistion time, we pick the first one, if that doesn't
+ /* If there is no transition time, we pick the first one, if that doesn't
* exist we return NULL */
if (!tz->timecnt || !tz->trans) {
*transition_time = 0;
@@ -346,8 +346,8 @@ static ttinfo* fetch_timezone_offset(timelib_tzinfo *tz, timelib_sll ts, timelib
return NULL;
}
- /* If the TS is lower than the first transistion time, then we scan over
- * all the transistion times to find the first non-DST one, or the first
+ /* If the TS is lower than the first transition time, then we scan over
+ * all the transition times to find the first non-DST one, or the first
* one in case there are only DST entries. Not sure which smartass came up
* with this idea in the first though :) */
if (ts < tz->trans[0]) {
diff --git a/ext/date/tests/002.phpt b/ext/date/tests/002.phpt
index 92d0d5f105..adbea5e231 100644
--- a/ext/date/tests/002.phpt
+++ b/ext/date/tests/002.phpt
@@ -3,7 +3,7 @@ strtotime() function
--SKIPIF--
<?php
if (!@putenv("TZ=EST5") || getenv("TZ") != 'EST5') {
- die("skip unable to change TZ enviroment variable\n");
+ die("skip unable to change TZ environment variable\n");
}
?>
--FILE--
diff --git a/ext/date/tests/bug13142.phpt b/ext/date/tests/bug13142.phpt
index 5254142baa..5849a94427 100644
--- a/ext/date/tests/bug13142.phpt
+++ b/ext/date/tests/bug13142.phpt
@@ -8,7 +8,7 @@ if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
die("skip. set TZ env is not supported at runtime.");
}
if (!@putenv("TZ=US/Eastern") || getenv("TZ") != 'US/Eastern') {
- die("skip unable to change TZ enviroment variable\n");
+ die("skip unable to change TZ environment variable\n");
}
?>
--FILE--
diff --git a/ext/date/tests/bug26317.phpt b/ext/date/tests/bug26317.phpt
index 5b79bec525..27d6ff1250 100644
--- a/ext/date/tests/bug26317.phpt
+++ b/ext/date/tests/bug26317.phpt
@@ -4,7 +4,7 @@ Bug #26317 (military timezone offset signedness)
date.timezone=GMT0
--SKIPIF--
if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') {
- die("skip unable to change TZ enviroment variable\n");
+ die("skip unable to change TZ environment variable\n");
}
--FILE--
<?php
diff --git a/ext/date/tests/bug26320.phpt b/ext/date/tests/bug26320.phpt
index c8aeb00c9f..e742c39da5 100644
--- a/ext/date/tests/bug26320.phpt
+++ b/ext/date/tests/bug26320.phpt
@@ -4,7 +4,7 @@ Bug #26320 (strtotime handling of XML Schema/ISO 8601 format)
date.timezone=GMT0
--SKIPIF--
if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') {
- die("skip unable to change TZ enviroment variable\n");
+ die("skip unable to change TZ environment variable\n");
}
--FILE--
<?php
diff --git a/ext/date/tests/date_interval_create_from_date_string.phpt b/ext/date/tests/date_interval_create_from_date_string.phpt
new file mode 100644
index 0000000000..9a1745c9ac
--- /dev/null
+++ b/ext/date/tests/date_interval_create_from_date_string.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Test date_interval_create_from_date_string() function : basic functionality
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--FILE--
+<?php
+$string = '1 day'; //P1D
+$i = date_interval_create_from_date_string($string);
+var_dump($i->d);
+
+$string = '2 weeks'; //14 days
+$i = date_interval_create_from_date_string($string);
+var_dump($i->d);
+
+$string = '3 months';
+$i = date_interval_create_from_date_string($string);
+var_dump($i->m);
+
+$string = '4 years';
+$i = date_interval_create_from_date_string($string);
+var_dump($i->y);
+
+$string = '1 year + 1 day';
+$i = date_interval_create_from_date_string($string);
+var_dump($i->y);
+var_dump($i->d);
+?>
+--EXPECTF--
+int(1)
+int(14)
+int(3)
+int(4)
+int(1)
+int(1) \ No newline at end of file
diff --git a/ext/date/tests/date_interval_create_from_date_string_nullparam.phpt b/ext/date/tests/date_interval_create_from_date_string_nullparam.phpt
new file mode 100644
index 0000000000..369db5714a
--- /dev/null
+++ b/ext/date/tests/date_interval_create_from_date_string_nullparam.phpt
@@ -0,0 +1,42 @@
+--TEST--
+Test date_interval_create_from_date_string() function : null parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--FILE--
+<?php
+$i = date_interval_create_from_date_string(null); //returns a empty object
+var_dump($i);
+?>
+--EXPECTF--
+object(DateInterval)#1 (15) {
+ ["y"]=>
+ int(0)
+ ["m"]=>
+ int(0)
+ ["d"]=>
+ int(0)
+ ["h"]=>
+ int(0)
+ ["i"]=>
+ int(0)
+ ["s"]=>
+ int(0)
+ ["weekday"]=>
+ int(0)
+ ["weekday_behavior"]=>
+ int(0)
+ ["first_last_day_of"]=>
+ int(0)
+ ["invert"]=>
+ int(0)
+ ["days"]=>
+ int(0)
+ ["special_type"]=>
+ int(0)
+ ["special_amount"]=>
+ int(0)
+ ["have_weekday_relative"]=>
+ int(0)
+ ["have_special_relative"]=>
+ int(0)
+} \ No newline at end of file
diff --git a/ext/date/tests/date_interval_create_from_date_string_wrongparam_001.phpt b/ext/date/tests/date_interval_create_from_date_string_wrongparam_001.phpt
new file mode 100644
index 0000000000..15db956553
--- /dev/null
+++ b/ext/date/tests/date_interval_create_from_date_string_wrongparam_001.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Test date_interval_create_from_date_string() function : wrong parameter (array)
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--FILE--
+<?php
+$wrong_parameter = array();
+$i = date_interval_create_from_date_string($wrong_parameter);
+?>
+--EXPECTF--
+Warning: date_interval_create_from_date_string() expects parameter 1 to be string, array given in %s on line %d \ No newline at end of file
diff --git a/ext/date/tests/date_interval_create_from_date_string_wrongparam_002.phpt b/ext/date/tests/date_interval_create_from_date_string_wrongparam_002.phpt
new file mode 100644
index 0000000000..a3407c3967
--- /dev/null
+++ b/ext/date/tests/date_interval_create_from_date_string_wrongparam_002.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Test date_interval_create_from_date_string() function : with 2 parameters (wrong).
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--FILE--
+<?php
+$i = date_interval_create_from_date_string('1 year', 'wrong');
+?>
+--EXPECTF--
+Warning: date_interval_create_from_date_string() expects exactly 1 parameter, 2 given in %s on line %d \ No newline at end of file
diff --git a/ext/date/tests/date_timestamp_set.phpt b/ext/date/tests/date_timestamp_set.phpt
new file mode 100644
index 0000000000..e01660193f
--- /dev/null
+++ b/ext/date/tests/date_timestamp_set.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Test the basics to function date_timestamp_set().
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--INI--
+date.timezone = UTC;
+date_default_timezone_set("America/Sao_Paulo");
+--FILE--
+<?php
+$dftz021 = date_default_timezone_get(); //UTC
+
+$dtms021 = date_create();
+
+date_timestamp_set($dtms021, 1234567890);
+
+var_dump(date_format($dtms021, 'B => (U) => T Y-M-d H:i:s'));
+?>
+--EXPECTF--
+string(47) "021 => (1234567890) => UTC 2009-Feb-13 23:31:30" \ No newline at end of file
diff --git a/ext/date/tests/date_timestamp_set_nullparam.phpt b/ext/date/tests/date_timestamp_set_nullparam.phpt
new file mode 100644
index 0000000000..1bcb800242
--- /dev/null
+++ b/ext/date/tests/date_timestamp_set_nullparam.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Test the function date_timestamp_set() with first null parameter.
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--INI--
+date.timezone = UTC;
+date_default_timezone_set("America/Sao_Paulo");
+--FILE--
+<?php
+$dftz021 = date_default_timezone_get(); //UTC
+
+$dtms021 = date_create();
+
+date_timestamp_set(null, 1234567890);
+?>
+--EXPECTF--
+Warning: date_timestamp_set() expects parameter 1 to be DateTime, null given in %s on line %d \ No newline at end of file
diff --git a/ext/date/tests/date_timestamp_set_nullparam2.phpt b/ext/date/tests/date_timestamp_set_nullparam2.phpt
new file mode 100644
index 0000000000..1442da4426
--- /dev/null
+++ b/ext/date/tests/date_timestamp_set_nullparam2.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Test the function date_timestamp_set() with second null parameter.
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--INI--
+date.timezone = UTC;
+date_default_timezone_set("America/Sao_Paulo");
+--FILE--
+<?php
+$dftz021 = date_default_timezone_get(); //UTC
+
+$dtms021 = date_create();
+
+var_dump(date_timestamp_set($dtms021, null));
+?>
+--EXPECTF--
+object(DateTime)#1 (3) {
+ ["date"]=>
+ string(26) "1970-01-01 00:00:00.000000"
+ ["timezone_type"]=>
+ int(3)
+ ["timezone"]=>
+ string(3) "UTC"
+} \ No newline at end of file
diff --git a/ext/date/tests/date_timestamp_set_wrongparam_001.phpt b/ext/date/tests/date_timestamp_set_wrongparam_001.phpt
new file mode 100644
index 0000000000..9a0fca99c1
--- /dev/null
+++ b/ext/date/tests/date_timestamp_set_wrongparam_001.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Check the function date_timestamp_set() with first parameter wrong (array).
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--INI--
+date.timezone = UTC;
+date_default_timezone_set("America/Sao_Paulo");
+--FILE--
+<?php
+$dftz021 = date_default_timezone_get(); //UTC
+
+$dtms021 = array();
+
+date_timestamp_set($dtms021, 123456789);
+?>
+--EXPECTF--
+Warning: date_timestamp_set() expects parameter 1 to be DateTime, array given in %s on line %d \ No newline at end of file
diff --git a/ext/date/tests/date_timestamp_set_wrongparam_002.phpt b/ext/date/tests/date_timestamp_set_wrongparam_002.phpt
new file mode 100644
index 0000000000..ed31cb217d
--- /dev/null
+++ b/ext/date/tests/date_timestamp_set_wrongparam_002.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Check the function date_timestamp_set() with first parameter wrong (integer).
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--INI--
+date.timezone = UTC;
+date_default_timezone_set("America/Sao_Paulo");
+--FILE--
+<?php
+$dftz021 = date_default_timezone_get(); //UTC
+
+date_timestamp_set(987654321, 123456789);
+?>
+--EXPECTF--
+Warning: date_timestamp_set() expects parameter 1 to be DateTime, integer given in %s on line %d \ No newline at end of file
diff --git a/ext/date/tests/date_timestamp_set_wrongparam_003.phpt b/ext/date/tests/date_timestamp_set_wrongparam_003.phpt
new file mode 100644
index 0000000000..f965334d9d
--- /dev/null
+++ b/ext/date/tests/date_timestamp_set_wrongparam_003.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Check the function date_timestamp_set() with second parameter wrong (array).
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--INI--
+date.timezone = UTC;
+date_default_timezone_set("America/Sao_Paulo");
+--FILE--
+<?php
+$dftz021 = date_default_timezone_get(); //UTC
+
+$dtms021 = new DateTime();
+
+$wrong_parameter = array();
+
+date_timestamp_set($dtms021, $wrong_parameter);
+?>
+--EXPECTF--
+Warning: date_timestamp_set() expects parameter 2 to be long, array given in %s on line %d \ No newline at end of file
diff --git a/ext/date/tests/date_timestamp_set_wrongparam_004.phpt b/ext/date/tests/date_timestamp_set_wrongparam_004.phpt
new file mode 100644
index 0000000000..b171e98bd4
--- /dev/null
+++ b/ext/date/tests/date_timestamp_set_wrongparam_004.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Check the function date_timestamp_set() with 3 parameters.
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--INI--
+date.timezone = UTC;
+date_default_timezone_set("America/Sao_Paulo");
+--FILE--
+<?php
+$dftz021 = date_default_timezone_get(); //UTC
+
+$dtms021 = new DateTime();
+
+date_timestamp_set($dtms021, 123456789, 'error');
+?>
+--EXPECTF--
+Warning: date_timestamp_set() expects exactly 2 parameters, 3 given in %s on line %d \ No newline at end of file
diff --git a/ext/date/tests/timezone_version_get.phpt b/ext/date/tests/timezone_version_get.phpt
new file mode 100644
index 0000000000..e076004289
--- /dev/null
+++ b/ext/date/tests/timezone_version_get.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Test the basics to function timezone_version_get().
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--INI--
+date.timezone = UTC;
+date_default_timezone_set("America/Sao_Paulo");
+--FILE--
+<?php
+var_dump(timezone_version_get());
+?>
+--EXPECTREGEX--
+string\([6-7]\) \"20[0-9][0-9]\.[1-9][0-9]?\" \ No newline at end of file
diff --git a/ext/date/tests/timezone_version_get_basic1.phpt b/ext/date/tests/timezone_version_get_basic1.phpt
new file mode 100644
index 0000000000..27224e3d44
--- /dev/null
+++ b/ext/date/tests/timezone_version_get_basic1.phpt
@@ -0,0 +1,12 @@
+--TEST--
+timezone_version_get: Test that timezone_location_get returns a date concatenated with a dot and a version number
+--CREDITS--
+Rodrigo Wanderley de Melo Cardoso <rodrigogepem@gmail.com>
+#PHPTestFest2014 São Paulo 2014-07-05
+--INI--
+date.timezone=UTC
+--FILE--
+<?php $versionTimezone = timezone_version_get();
+echo $versionTimezone; ?>
+--EXPECTREGEX--
+^[12][0-9]{3}.[0-9]+$ \ No newline at end of file
diff --git a/ext/exif/tests/bug68113.phpt b/ext/exif/tests/bug68113.phpt
index 0fa4c4aca8..e4a1cbf53b 100644
--- a/ext/exif/tests/bug68113.phpt
+++ b/ext/exif/tests/bug68113.phpt
@@ -10,8 +10,8 @@ var_dump(exif_thumbnail(__DIR__."/bug68113.jpg"));
?>
Done
--EXPECTF--
-Warning: exif_thumbnail(bug68113.jpg): File structure corrupted in %s/bug68113.php on line 2
+Warning: exif_thumbnail(bug68113.jpg): File structure corrupted in %s%ebug68113.php on line 2
-Warning: exif_thumbnail(bug68113.jpg): Invalid JPEG file in %s/bug68113.php on line 2
+Warning: exif_thumbnail(bug68113.jpg): Invalid JPEG file in %s%ebug68113.php on line 2
bool(false)
-Done \ No newline at end of file
+Done
diff --git a/ext/fileinfo/fileinfo.php b/ext/fileinfo/fileinfo.php
index 1ee9efbeb8..791d03a213 100644
--- a/ext/fileinfo/fileinfo.php
+++ b/ext/fileinfo/fileinfo.php
@@ -3,7 +3,7 @@ if(!extension_loaded('fileinfo')) {
dl('fileinfo.' . PHP_SHLIB_SUFFIX);
}
if(!extension_loaded('fileinfo')) {
- die("fileinfo extension is not avaliable, please compile it.\n");
+ die("fileinfo extension is not available, please compile it.\n");
}
// normal operation
diff --git a/ext/fileinfo/libmagic/patchlevel.h b/ext/fileinfo/libmagic/patchlevel.h
index a53c6830d8..65551b402e 100644
--- a/ext/fileinfo/libmagic/patchlevel.h
+++ b/ext/fileinfo/libmagic/patchlevel.h
@@ -351,7 +351,7 @@
*
* Revision 1.8 93/02/19 15:01:26 ian
* Numerous changes from Guy Harris too numerous to mention but including
- * byte-order independance, fixing "old-style masking", etc. etc. A bugfix
+ * byte-order independence, fixing "old-style masking", etc. etc. A bugfix
* for broken symlinks from martin@@d255s004.zfe.siemens.de.
*
* Revision 1.7 93/01/05 14:57:27 ian
diff --git a/ext/fileinfo/tests/magic b/ext/fileinfo/tests/magic
index 4e1ce98ed2..938ac5f73a 100644
--- a/ext/fileinfo/tests/magic
+++ b/ext/fileinfo/tests/magic
@@ -3918,7 +3918,7 @@
>7 string x version %.2s
# We skip the path here, because it is often long (so file will
# truncate it) and mostly redundant.
-# The inverted index functionality was added some time betwen
+# The inverted index functionality was added some time between
# versions 11 and 15, so look for -q if version is above 14:
>7 string >14
>>10 search/100 \ -q\ with inverted index
@@ -3972,7 +3972,7 @@
# .cwk
0 string \002\000\210\003\102\117\102\117\000\001\206 Claris works document
# .plt
-0 string \020\341\000\000\010\010 Claris Works pallete files .plt
+0 string \020\341\000\000\010\010 Claris Works palette files .plt
# .msp a dictionary file I am not sure about this I have only one .msp file
0 string \002\271\262\000\040\002\000\164 Claris works dictionary
@@ -4443,9 +4443,9 @@
>6 byte&0x04 =0x8 \b, [4-Scr]
#------------------------------------------------------------------------------
-# gameboy: file(1) magic for the Nintendo (Color) Gameboy raw ROM format
+# game boy: file(1) magic for the Nintendo (Color) Game Boy raw ROM format
#
-0x104 belong 0xCEED6666 Gameboy ROM:
+0x104 belong 0xCEED6666 Game Boy ROM:
>0x134 string >\0 "%.16s"
>0x146 byte 0x03 \b,[SGB]
>0x147 byte 0x00 \b, [ROM ONLY]
@@ -4605,8 +4605,8 @@
0 string \x01ZZZZZ\x01 3DO "Opera" file system
# From Gurkan Sengun <gurkan@linuks.mine.nu>, www.linuks.mine.nu
-0 string GBS Nintendo Gameboy Music/Audio Data
-12 string GameBoy\ Music\ Module Nintendo Gameboy Music Module
+0 string GBS Nintendo Game Boy Music/Audio Data
+12 string GameBoy\ Music\ Module Nintendo Game Boy Music Module
# Playstations Patch Files from: From: Thomas Klausner <tk@giga.or.at>
0 string PPF30 Playstation Patch File version 3.0
@@ -15279,7 +15279,7 @@
# $File: oasis,v 1.1 2011/03/15 02:09:38 christos Exp $
# OASIS
# Summary: OASIS stream file
-# Long descripton: Open Artwork System Interchange Standard
+# Long description: Open Artwork System Interchange Standard
# File extension: .oas
# Full name: Ben Cowley (bcowley@broadcom.com)
# Philip Dixon (pdixon@broadcom.com)
diff --git a/ext/filter/filter.c b/ext/filter/filter.c
index fcea5a803a..a8602a9f32 100644
--- a/ext/filter/filter.c
+++ b/ext/filter/filter.c
@@ -766,7 +766,7 @@ PHP_FUNCTION(filter_input)
/* }}} */
/* {{{ proto mixed filter_var(mixed variable [, long filter [, mixed options]])
- * Returns the filtered version of the vriable.
+ * Returns the filtered version of the variable.
*/
PHP_FUNCTION(filter_var)
{
diff --git a/ext/ftp/ftp.h b/ext/ftp/ftp.h
index f2051fe195..e54eda0790 100644
--- a/ext/ftp/ftp.h
+++ b/ext/ftp/ftp.h
@@ -69,8 +69,8 @@ typedef struct ftpbuf
ftptype_t type; /* current transfer type */
int pasv; /* 0=off; 1=pasv; 2=ready */
php_sockaddr_storage pasvaddr; /* passive mode address */
- zend_long timeout_sec; /* User configureable timeout (seconds) */
- int autoseek; /* User configureable autoseek flag */
+ zend_long timeout_sec; /* User configurable timeout (seconds) */
+ int autoseek; /* User configurable autoseek flag */
int nb; /* "nonblocking" transfer in progress */
databuf_t *data; /* Data connection for "nonblocking" transfers */
diff --git a/ext/gd/libgd/gd.h b/ext/gd/libgd/gd.h
index b61d972e80..0ace31ba03 100644
--- a/ext/gd/libgd/gd.h
+++ b/ext/gd/libgd/gd.h
@@ -782,7 +782,7 @@ int gdImageBrightness(gdImagePtr src, int brightness);
/* Set the contrast level <contrast> for the image <src> */
int gdImageContrast(gdImagePtr src, double contrast);
-/* Simply adds or substracts respectively red, green or blue to a pixel */
+/* Simply adds or subtracts respectively red, green or blue to a pixel */
int gdImageColor(gdImagePtr src, const int red, const int green, const int blue, const int alpha);
/* Image convolution by a 3x3 custom matrix */
diff --git a/ext/gd/libgd/gd_arc_f_buggy.c b/ext/gd/libgd/gd_arc_f_buggy.c
index c26e42171a..ffab551230 100644
--- a/ext/gd/libgd/gd_arc_f_buggy.c
+++ b/ext/gd/libgd/gd_arc_f_buggy.c
@@ -1,6 +1,6 @@
/* This is potentially great stuff, but fails against the test
program at the end. This would probably be much more
- efficent than the implementation currently in gd.c if the
+ efficient than the implementation currently in gd.c if the
errors in the output were corrected. TBB */
#if 0
diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c
index 4148cf47bb..763efcf68c 100644
--- a/ext/gd/libgd/gdft.c
+++ b/ext/gd/libgd/gdft.c
@@ -464,7 +464,7 @@ static void *fontFetch (char **error, void *key)
return NULL;
}
- /* FIXME - This mapping stuff is imcomplete - where is the spec? */
+ /* FIXME - This mapping stuff is incomplete - where is the spec? */
/* EAM - It's worse than that. It's pointless to match character encodings here.
* As currently written, the stored a->face->charmap only matches one of
* the actual charmaps and we cannot know at this stage if it is the right
diff --git a/ext/gd/libgd/webpimg.c b/ext/gd/libgd/webpimg.c
index 01bef93c48..95a8081e05 100644
--- a/ext/gd/libgd/webpimg.c
+++ b/ext/gd/libgd/webpimg.c
@@ -169,7 +169,7 @@ static inline uint32 get_le32(const uint8* const data) {
* Y2/U2/V2: The Y/U/V data of the second image
*
* Returns the PSNR (http://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio)
- * value computed bewteen the two images
+ * value computed between the two images
*/
double GetPSNRYuv(const uint8* Y1,
const uint8* U1,
@@ -210,7 +210,7 @@ double GetPSNRYuv(const uint8* Y1,
* imgdata: data buffer containing webp image
* imgdata_size: size of the imgdata buffer
*
- * Returns the PSNR value computed bewteen the two images
+ * Returns the PSNR value computed between the two images
*/
double WebPGetPSNR(const uint8* Y1,
const uint8* U1,
diff --git a/ext/gd/libgd/webpimg.h b/ext/gd/libgd/webpimg.h
index db23de5bb2..bc0f9722bd 100644
--- a/ext/gd/libgd/webpimg.h
+++ b/ext/gd/libgd/webpimg.h
@@ -57,7 +57,7 @@ typedef enum WebPResultType {
* 3. p_Y/p_U/p_V : pointer to the Y/U/V data buffer (this routine will
* allocate memory for the buffer, fill the buffer with
* appropriate data and transfer owner ship of the buffer
- * to caller. Caller is reponsible for freeing the memory).
+ * to caller. Caller is responsible for freeing the memory).
* Note that the memory for Y, U, V buffers is alloacted
* in one chunk, hence one should call free(*p_Y) only.
* Do not try to free the U and V buffers.
diff --git a/ext/gd/tests/imagealphablending_error1.phpt b/ext/gd/tests/imagealphablending_error1.phpt
new file mode 100644
index 0000000000..6d49f32b07
--- /dev/null
+++ b/ext/gd/tests/imagealphablending_error1.phpt
@@ -0,0 +1,19 @@
+--TEST--
+test imagealphablending without arguments
+
+--CREDITS--
+Marcelo Diniz <marcelo.leo27 [at] gmail [dot] com
+‪#‎phpspMaisTestFest PHPSP on 2014-07-05
+
+--SKIPIF--
+<?php
+ if (!extension_loaded('gd')) die("skip gd extension not available.");
+?>
+
+--FILE--
+<?php
+imagealphablending();
+?>
+
+--EXPECTF--
+Warning: imagealphablending() expects exactly 2 parameters, 0 given in %s on line %d \ No newline at end of file
diff --git a/ext/gd/tests/imagecolorresolvealpha_error3.phpt b/ext/gd/tests/imagecolorresolvealpha_error3.phpt
new file mode 100644
index 0000000000..735b4c97db
--- /dev/null
+++ b/ext/gd/tests/imagecolorresolvealpha_error3.phpt
@@ -0,0 +1,19 @@
+--TEST--
+test imagecolorresolvealpha without arguments
+
+--CREDITS--
+Marcelo Diniz <marcelo.leo27 [at] gmail [dot] com
+‪#‎phpspMaisTestFest PHPSP on 2014-07-05
+
+--SKIPIF--
+<?php
+ if (!extension_loaded('gd')) die("skip gd extension not available.");
+?>
+
+--FILE--
+<?php
+imagecolorresolvealpha();
+?>
+
+--EXPECTF--
+Warning: imagecolorresolvealpha() expects exactly 5 parameters, 0 given in %s on line %d \ No newline at end of file
diff --git a/ext/gd/tests/imagesavealpha_error2.phpt b/ext/gd/tests/imagesavealpha_error2.phpt
new file mode 100644
index 0000000000..1a7083d526
--- /dev/null
+++ b/ext/gd/tests/imagesavealpha_error2.phpt
@@ -0,0 +1,19 @@
+--TEST--
+test imagesavealpha without arguments
+
+--CREDITS--
+Marcelo Diniz <marcelo.leo27 [at] gmail [dot] com
+‪#‎phpspMaisTestFest PHPSP on 2014-07-05
+
+--SKIPIF--
+<?php
+ if (!extension_loaded('gd')) die("skip gd extension not available.");
+?>
+
+--FILE--
+<?php
+imagesavealpha();
+?>
+
+--EXPECTF--
+Warning: imagesavealpha() expects exactly 2 parameters, 0 given in %s on line %d \ No newline at end of file
diff --git a/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mo b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mo
new file mode 100644
index 0000000000..1aaba7b27b
--- /dev/null
+++ b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mo
Binary files differ
diff --git a/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po
new file mode 100644
index 0000000000..d2496d78fc
--- /dev/null
+++ b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po
@@ -0,0 +1,17 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: bugs.php.net/66265\n"
+"POT-Creation-Date: 2014-11-20 16:33+0100\n"
+"PO-Revision-Date: 2014-11-20 16:40+0100\n"
+"Last-Translator: <ab@php.net>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.6.10\n"
+"X-Poedit-Basepath: .\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"Language: de_DE\n"
+
+msgid "hello"
+msgstr "hallo"
diff --git a/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mo b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mo
new file mode 100644
index 0000000000..79d02c1732
--- /dev/null
+++ b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mo
Binary files differ
diff --git a/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po
new file mode 100644
index 0000000000..670d7ddadf
--- /dev/null
+++ b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po
@@ -0,0 +1,17 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: bugs.php.net/66265\n"
+"POT-Creation-Date: 2014-11-20 16:33+0100\n"
+"PO-Revision-Date: 2014-11-20 16:40+0100\n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.6.10\n"
+"X-Poedit-Basepath: .\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"Language: en_US\n"
+
+msgid "hello"
+msgstr "hello"
diff --git a/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mo b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mo
new file mode 100644
index 0000000000..c2f3cdd6b7
--- /dev/null
+++ b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mo
Binary files differ
diff --git a/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po
new file mode 100644
index 0000000000..c2f708c526
--- /dev/null
+++ b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po
@@ -0,0 +1,17 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: bugs.php.net/66265\n"
+"POT-Creation-Date: 2014-11-20 16:33+0100\n"
+"PO-Revision-Date: 2014-11-20 16:59+0100\n"
+"Last-Translator: <ab@php.net>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.6.10\n"
+"X-Poedit-Basepath: .\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"Language: fr_FR\n"
+
+msgid "hello"
+msgstr "salut"
diff --git a/ext/gettext/tests/bug66267.phpt b/ext/gettext/tests/bug66267.phpt
new file mode 100644
index 0000000000..26963acb7e
--- /dev/null
+++ b/ext/gettext/tests/bug66267.phpt
@@ -0,0 +1,55 @@
+--TEST--
+#66265: gettext doesn't switch locales within the same script
+--SKIPIF--
+<?php
+if (!extension_loaded("gettext")) {
+ die("skip\n");
+}
+if (PHP_ZTS) {
+ /* this is supposed to fail on the TS build at least on Windows,
+ should be even XFAIL till it's fixed there */
+ die("skip NTS only");
+}
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+ $loc = ["de_DE", "fr_FR", "en_US"];
+ foreach($loc as $l) {
+ if (!setlocale(LC_ALL, $l)) {
+ die("SKIP '$l' locale not supported.");
+ }
+ }
+}
+?>
+--FILE--
+<?php
+
+$domain = 'domain';
+
+$loc = ["de_DE", "fr_FR", "en_US"];
+
+foreach ($loc as $l) {
+ putenv("LC_ALL=$l");
+
+ $path = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . "66265");
+ bindtextdomain($domain, $path);
+ bind_textdomain_codeset($domain, "UTF-8");
+ textdomain($domain);
+
+ echo 'LC_ALL=', getenv('LC_ALL'), "\n";
+ echo 'hello=', _('hello'), "\n";
+ echo "\n";
+}
+
+?>
+==DONE==
+--EXPECTF--
+LC_ALL=de_DE
+hello=hallo
+
+LC_ALL=fr_FR
+hello=salut
+
+LC_ALL=en_US
+hello=hello
+
+==DONE==
+
diff --git a/ext/iconv/tests/iconv_basic_001-win32.phpt b/ext/iconv/tests/iconv_basic_001-win32.phpt
new file mode 100644
index 0000000000..59a3dbd863
--- /dev/null
+++ b/ext/iconv/tests/iconv_basic_001-win32.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Test the basics to function iconv.
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?>
+<?php if(substr(PHP_OS, 0, 3) != 'WIN' ) {die('skip windows only test');} ?>
+--FILE--
+<?php
+$in_charset = 'UTF-8';
+$out_charset = 'ASCII//TRANSLIT';
+$string_to_translate = 'Žluťoučký kůň\n';
+
+$string_out = iconv($in_charset, $out_charset, $string_to_translate);
+
+var_dump($string_out);
+?>
+--EXPECT--
+string(16) "Zlutouck'y kun\n"
diff --git a/ext/iconv/tests/iconv_basic_001.phpt b/ext/iconv/tests/iconv_basic_001.phpt
new file mode 100644
index 0000000000..6fcb5dbe8a
--- /dev/null
+++ b/ext/iconv/tests/iconv_basic_001.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Test the basics to function iconv.
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?>
+<?php if(substr(PHP_OS, 0, 3) == 'WIN' ) {die('skip not for windows');} ?>
+--FILE--
+<?php
+$in_charset = 'UTF-8';
+$out_charset = 'ASCII//TRANSLIT';
+$string_to_translate = 'Žluťoučký kůň\n';
+
+$string_out = iconv($in_charset, $out_charset, $string_to_translate);
+
+var_dump($string_out);
+?>
+--EXPECT--
+string(15) "Zlutoucky kun\n"
diff --git a/ext/interbase/tests/002.phpt b/ext/interbase/tests/002.phpt
index 070a6f0069..37b0a4f344 100644
--- a/ext/interbase/tests/002.phpt
+++ b/ext/interbase/tests/002.phpt
@@ -3,7 +3,7 @@ InterBase: connect, close and pconnect
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
-<?php /* $Id$ */
+<?php
require("interbase.inc");
diff --git a/ext/interbase/tests/003.phpt b/ext/interbase/tests/003.phpt
index 652e3bdc52..8ee86d3e9e 100644
--- a/ext/interbase/tests/003.phpt
+++ b/ext/interbase/tests/003.phpt
@@ -3,7 +3,7 @@ InterBase: misc sql types (may take a while)
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
-<?php /* $Id$ */
+<?php
require("interbase.inc");
ibase_connect($test_base);
diff --git a/ext/interbase/tests/004.phpt b/ext/interbase/tests/004.phpt
index 579445dbdd..e81474a4c4 100644
--- a/ext/interbase/tests/004.phpt
+++ b/ext/interbase/tests/004.phpt
@@ -3,7 +3,7 @@ InterBase: BLOB test
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
-<?php /* $Id$ */
+<?php
require("interbase.inc");
diff --git a/ext/interbase/tests/005.phpt b/ext/interbase/tests/005.phpt
index c5167c132e..cb68b0a1d5 100644
--- a/ext/interbase/tests/005.phpt
+++ b/ext/interbase/tests/005.phpt
@@ -3,7 +3,7 @@ InterBase: transactions
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
-<?php /* $Id$ */
+<?php
require("interbase.inc");
@@ -63,7 +63,7 @@ simple default transaction test without ibase_trans()
/*
default transaction on default link
First open transaction on link will be default.
-$tr_def_l1 may be ommited. All queryes without link and trans
+$tr_def_l1 may be omitted. All queryes without link and trans
parameters run in this context
*/
diff --git a/ext/interbase/tests/006.phpt b/ext/interbase/tests/006.phpt
index ad6120f393..a32807eec0 100644
--- a/ext/interbase/tests/006.phpt
+++ b/ext/interbase/tests/006.phpt
@@ -3,7 +3,7 @@ InterBase: binding (may take a while)
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
-<?php /* $Id$ */
+<?php
require("interbase.inc");
diff --git a/ext/interbase/tests/007.phpt b/ext/interbase/tests/007.phpt
index 069b7eda26..92e7c73984 100644
--- a/ext/interbase/tests/007.phpt
+++ b/ext/interbase/tests/007.phpt
@@ -3,7 +3,7 @@ InterBase: array handling
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
-<?php /* $Id$ */
+<?php
require("interbase.inc");
diff --git a/ext/interbase/tests/008.phpt b/ext/interbase/tests/008.phpt
index 8292fc38c5..6728b9d7d3 100644
--- a/ext/interbase/tests/008.phpt
+++ b/ext/interbase/tests/008.phpt
@@ -6,7 +6,7 @@ if (PHP_OS == "WINNT") echo "skip";
include("skipif.inc");
?>
--FILE--
-<?php /* $Id$ */
+<?php
require("interbase.inc");
diff --git a/ext/intl/tests/bug67052-win32.phpt b/ext/intl/tests/bug67052-win32.phpt
new file mode 100644
index 0000000000..5bc6497bea
--- /dev/null
+++ b/ext/intl/tests/bug67052-win32.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Bug #67052 - NumberFormatter::parse() resets LC_NUMERIC setting
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+ die("skip Valid only on Windows");
+}
+?>
+--FILE--
+<?php
+
+function ut_main()
+{
+ setlocale(LC_ALL, 'de-de');
+ $fmt = new NumberFormatter( 'sl_SI.UTF-8', NumberFormatter::DECIMAL);
+ $num = "1.234.567,891";
+ $res_str = $fmt->parse($num)."\n";
+ $res_str .= setlocale(LC_NUMERIC, 0);
+ return $res_str;
+}
+
+include_once( 'ut_common.inc' );
+ut_run();
+
+?>
+--EXPECT--
+1234567,891
+de-de
+
diff --git a/ext/intl/tests/bug67052.phpt b/ext/intl/tests/bug67052.phpt
index c8363b9c7a..8edd65de71 100644
--- a/ext/intl/tests/bug67052.phpt
+++ b/ext/intl/tests/bug67052.phpt
@@ -2,6 +2,11 @@
Bug #67052 - NumberFormatter::parse() resets LC_NUMERIC setting
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ die("skip Valid only on non Windows");
+}
+?>
--FILE--
<?php
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index b95757a215..ad12e3464d 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -1149,7 +1149,7 @@ zval *php_libxml_register_export(zend_class_entry *ce, php_libxml_export_node ex
{
php_libxml_func_handler export_hnd;
- /* Initialize in case this module hasnt been loaded yet */
+ /* Initialize in case this module hasn't been loaded yet */
php_libxml_initialize();
export_hnd.export_func = export_function;
diff --git a/ext/mbstring/README_PHP3-i18n-ja b/ext/mbstring/README_PHP3-i18n-ja
index 869fe3e495..eabe9e90f2 100644
--- a/ext/mbstring/README_PHP3-i18n-ja
+++ b/ext/mbstring/README_PHP3-i18n-ja
@@ -371,7 +371,7 @@ o i18n.internal_encoding - internal encoding
encodings, following conditions have to be satisfied in order
to use them:
- per byte encoding
- - single byte charactor in range of 00h-7fh which is compatible
+ - single byte character in range of 00h-7fh which is compatible
with ASCII
- multibyte without 00h-7fh
In case of Japanese, EUC-JP and UTF-8 are the only encoding that
@@ -408,7 +408,7 @@ o i18n.script_encoding - script encoding
entering the script parser.
Be aware that auto detection may fail under some conditions.
- For best auto detection, add multibyte charactor at beginning of
+ For best auto detection, add multibyte character at beginning of
script.
diff --git a/ext/mbstring/libmbfl/filters/unicode_prop.h b/ext/mbstring/libmbfl/filters/unicode_prop.h
index d21ec61dfb..4feb5756e3 100644
--- a/ext/mbstring/libmbfl/filters/unicode_prop.h
+++ b/ext/mbstring/libmbfl/filters/unicode_prop.h
@@ -22,7 +22,7 @@
*
*/
-/* charactor property table */
+/* character property table */
#define MBFL_CHP_CTL 0x01
#define MBFL_CHP_DIGIT 0x02
#define MBFL_CHP_UALPHA 0x04
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_consts.h b/ext/mbstring/libmbfl/mbfl/mbfl_consts.h
index 6a630c8fcd..b11119a80b 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_consts.h
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_consts.h
@@ -45,7 +45,7 @@
#define MBFL_ENCTYPE_ENC_STRM 0x00002000
#define MBFL_ENCTYPE_GL_UNSAFE 0x00004000
-/* wchar plane, special charactor */
+/* wchar plane, special character */
#define MBFL_WCSPLANE_MASK 0xffff
#define MBFL_WCSPLANE_UCS2MAX 0x00010000
#define MBFL_WCSPLANE_UTF32MAX 0x00110000
diff --git a/ext/mbstring/tests/mb_strtolower_variation3.phpt b/ext/mbstring/tests/mb_strtolower_variation3.phpt
index 08b3467853..99256e1ec4 100644
--- a/ext/mbstring/tests/mb_strtolower_variation3.phpt
+++ b/ext/mbstring/tests/mb_strtolower_variation3.phpt
@@ -14,7 +14,7 @@ function_exists('mb_strtolower') or die("skip mb_strtolower() is not available i
/*
* Pass a Japanese string and a mixed Japanese and ASCII string to mb_strtolower
- * to check correct conversion is occuring (Japanese characters should not be converted).
+ * to check correct conversion is occurring (Japanese characters should not be converted).
*/
echo "*** Testing mb_strtolower() : usage variations ***\n";
diff --git a/ext/mbstring/tests/mb_strtoupper_variation3.phpt b/ext/mbstring/tests/mb_strtoupper_variation3.phpt
index a4bf3b128f..f0cb0fa47c 100644
--- a/ext/mbstring/tests/mb_strtoupper_variation3.phpt
+++ b/ext/mbstring/tests/mb_strtoupper_variation3.phpt
@@ -14,7 +14,7 @@ function_exists('mb_strtoupper') or die("skip mb_strtoupper() is not available i
/*
* Pass a Japanese string and a mixed Japanese and ASCII string to mb_strtolower
- * to check correct conversion is occuring (Japanese characters should not be converted).
+ * to check correct conversion is occurring (Japanese characters should not be converted).
*/
echo "*** Testing mb_strtoupper() : usage variations ***\n";
diff --git a/ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt b/ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt
index e718107b9b..ace9f829d8 100644
--- a/ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt
+++ b/ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt
@@ -23,7 +23,7 @@ $cipher = MCRYPT_TRIPLEDES;
$data = b"This is the secret message which must be encrypted";
$mode = MCRYPT_DECRYPT;
-// tripledes uses keys upto 192 bits (24 bytes)
+// tripledes uses keys up to 192 bits (24 bytes)
$keys = array(
b'12345678',
b'12345678901234567890',
diff --git a/ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt b/ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt
index 7e29579779..65ef3ad8e2 100644
--- a/ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt
+++ b/ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt
@@ -23,7 +23,7 @@ $cipher = MCRYPT_TRIPLEDES;
$data = b"This is the secret message which must be encrypted";
$mode = MCRYPT_ENCRYPT;
-// tripledes uses keys upto 192 bits (24 bytes)
+// tripledes uses keys up to 192 bits (24 bytes)
$keys = array(
b'12345678',
b'12345678901234567890',
diff --git a/ext/mcrypt/tests/mcrypt_encrypt_3des_cbc.phpt b/ext/mcrypt/tests/mcrypt_encrypt_3des_cbc.phpt
index 51a64943b2..8b3cbd8366 100644
--- a/ext/mcrypt/tests/mcrypt_encrypt_3des_cbc.phpt
+++ b/ext/mcrypt/tests/mcrypt_encrypt_3des_cbc.phpt
@@ -21,13 +21,13 @@ echo "*** Testing mcrypt_encrypt() : TripleDES functionality ***\n";
//test tripledes, aes
//test different lengths of key, iv
//test no iv being passed on CBC, ECB
-//test upto 32 bytes with unlimited strength
+//test up to 32 bytes with unlimited strength
$cipher = MCRYPT_TRIPLEDES;
$mode = MCRYPT_MODE_CBC;
$data = b'This is the secret message which must be encrypted';
-// tripledes uses keys upto 192 bits (24 bytes)
+// tripledes uses keys up to 192 bits (24 bytes)
$keys = array(
b'12345678',
b'12345678901234567890',
diff --git a/ext/mcrypt/tests/mcrypt_encrypt_3des_ecb.phpt b/ext/mcrypt/tests/mcrypt_encrypt_3des_ecb.phpt
index 941eb7935f..ea6b2c2160 100644
--- a/ext/mcrypt/tests/mcrypt_encrypt_3des_ecb.phpt
+++ b/ext/mcrypt/tests/mcrypt_encrypt_3des_ecb.phpt
@@ -20,7 +20,7 @@ $cipher = MCRYPT_TRIPLEDES;
$mode = MCRYPT_MODE_ECB;
$data = b'This is the secret message which must be encrypted';
-// tripledes uses keys upto 192 bits (24 bytes)
+// tripledes uses keys up to 192 bits (24 bytes)
$keys = array(
b'12345678',
b'12345678901234567890',
diff --git a/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt b/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt
index 621f7b1dbd..5f5a4bea56 100644
--- a/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt
+++ b/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt
@@ -30,7 +30,7 @@ $cipher = MCRYPT_RIJNDAEL_128;
$mode = MCRYPT_MODE_CBC;
$data = b'This is the secret message which must be encrypted';
-// keys upto 128 bits (16 bytes)
+// keys up to 128 bits (16 bytes)
$keys = array(
null,
'',
diff --git a/ext/mysqli/tests/mysqli_ps_select_union.phpt b/ext/mysqli/tests/mysqli_ps_select_union.phpt
index fed81b309d..a4659c4267 100644
--- a/ext/mysqli/tests/mysqli_ps_select_union.phpt
+++ b/ext/mysqli/tests/mysqli_ps_select_union.phpt
@@ -44,8 +44,8 @@ require_once('skipifconnectfailure.inc');
if ($IS_MYSQLND) {
/*
Advantage mysqlnd -
- The metadata mysqlnd has availabe after prepare is better than
- the one made availabe by the MySQL Client Library (libmysql).
+ The metadata mysqlnd has available after prepare is better than
+ the one made available by the MySQL Client Library (libmysql).
"libmysql" will give wrong results and that is OK -
http://bugs.mysql.com/bug.php?id=47483
*/
diff --git a/ext/mysqli/tests/mysqli_result_references.phpt b/ext/mysqli/tests/mysqli_result_references.phpt
index 9b5d476ac4..e009267754 100644
--- a/ext/mysqli/tests/mysqli_result_references.phpt
+++ b/ext/mysqli/tests/mysqli_result_references.phpt
@@ -19,7 +19,7 @@ require_once('skipifconnectfailure.inc');
$idx = 0;
while ($row = mysqli_fetch_assoc($res)) {
- /* mysqlnd: force seperation - create copies */
+ /* mysqlnd: force separation - create copies */
$references[$idx] = array(
'id' => &$row['id'],
'label' => $row['label'] . '');
@@ -30,7 +30,7 @@ require_once('skipifconnectfailure.inc');
mysqli_data_seek($res, 0);
while ($row = mysqli_fetch_assoc($res)) {
- /* mysqlnd: force seperation - create copies */
+ /* mysqlnd: force separation - create copies */
$references[$idx] = array(
'id' => &$row['id'],
'label' => $row['label'] . '');
@@ -48,7 +48,7 @@ require_once('skipifconnectfailure.inc');
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
while ($row = mysqli_fetch_assoc($res)) {
- /* mysqlnd: force seperation - create copies*/
+ /* mysqlnd: force separation - create copies*/
$references[$idx] = array(
'id' => &$row['id'],
'label' => $row['label'] . '');
diff --git a/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt b/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt
index 3935365257..60c5491b54 100644
--- a/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt
+++ b/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt
@@ -48,7 +48,7 @@ if ((version_compare(PHP_VERSION, '6.0', '==') == 1))
$references[$idx]['row_copy'] = $rows[$i];
$references[$idx]['id_ref'] = &$rows[$i]['id'];
$references[$idx]['id_copy'] = $rows[$i]['id'];
- /* enforce seperation */
+ /* enforce separation */
$references[$idx]['id_copy_mod']= $rows[$i]['id'] + 0;
}
mysqli_free_result($res);
diff --git a/ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt b/ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt
index 03d15902af..e7bce112af 100644
--- a/ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt
+++ b/ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt
@@ -21,9 +21,9 @@ require_once('skipifconnectfailure.inc');
echo "Test 1:\n";
$stmt = $link->prepare("SELECT ? FOO");
- var_dump($foo); // here you can see the bar member var beeing a string
+ var_dump($foo); // here you can see the bar member var being a string
$stmt->bind_param("s", $foo->bar);
- var_dump($foo); // this will show $foo->bar beeing a reference string
+ var_dump($foo); // this will show $foo->bar being a reference string
$stmt->bind_result($one);
$stmt->execute();
$stmt->fetch();
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index fcaf96408c..3cde5188ca 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -242,7 +242,7 @@ static ZEND_INI_MH(OnEnable)
}
ZEND_INI_BEGIN()
- STD_PHP_INI_BOOLEAN("opcache.enable" , "1", PHP_INI_ALL, OnEnable, enabled , zend_accel_globals, accel_globals)
+ STD_PHP_INI_BOOLEAN("opcache.enable" , "1", PHP_INI_ALL, OnEnable, enabled , zend_accel_globals, accel_globals)
STD_PHP_INI_BOOLEAN("opcache.use_cwd" , "1", PHP_INI_SYSTEM, OnUpdateBool, accel_directives.use_cwd , zend_accel_globals, accel_globals)
STD_PHP_INI_BOOLEAN("opcache.validate_timestamps", "1", PHP_INI_ALL , OnUpdateBool, accel_directives.validate_timestamps, zend_accel_globals, accel_globals)
STD_PHP_INI_BOOLEAN("opcache.inherited_hack" , "1", PHP_INI_SYSTEM, OnUpdateBool, accel_directives.inherited_hack , zend_accel_globals, accel_globals)
@@ -448,7 +448,7 @@ static zend_module_entry accel_module_entry = {
NULL,
NULL,
zend_accel_info,
- ACCELERATOR_VERSION "FE",
+ ACCELERATOR_VERSION "FE",
STANDARD_MODULE_PROPERTIES
};
diff --git a/ext/openssl/tests/bug64802.phpt b/ext/openssl/tests/bug64802.phpt
index be0b5f9b5b..3a1e4fb03c 100644
--- a/ext/openssl/tests/bug64802.phpt
+++ b/ext/openssl/tests/bug64802.phpt
@@ -3,7 +3,7 @@ Bug #64802: openssl_x509_parse fails to parse subject properly in some cases
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip");
-if (!defined(OPENSSL_KEYTYPE_EC)) die("skip no EC available);
+if (!defined('OPENSSL_KEYTYPE_EC')) die("skip no EC available");
?>
--FILE--
<?php
diff --git a/ext/pcntl/README b/ext/pcntl/README
index cadd11121c..7b80924e49 100644
--- a/ext/pcntl/README
+++ b/ext/pcntl/README
@@ -1,7 +1,7 @@
Process Control Module for PHP (pcntl)
This module will attempt to implement all features related to process spawning and
-control (fork(), waitpid(), signal(), WIF's, etc). This is extremly experimental,
+control (fork(), waitpid(), signal(), WIF's, etc). This is extremely experimental,
with hope to become stable on most UNIX's. I greatly apreciate any feedback, fixes,
and or suggestions on how to improve/better implement
this functionality.
diff --git a/ext/pcre/pcrelib/ChangeLog b/ext/pcre/pcrelib/ChangeLog
index 279398ef40..f07c59787b 100644
--- a/ext/pcre/pcrelib/ChangeLog
+++ b/ext/pcre/pcrelib/ChangeLog
@@ -1544,7 +1544,7 @@ Version 8.10 25-Jun-2010
7. Minor change to pcretest.c to avoid a compiler warning.
-8. Added four artifical Unicode properties to help with an option to make
+8. Added four artificial Unicode properties to help with an option to make
\s etc use properties (see next item). The new properties are: Xan
(alphanumeric), Xsp (Perl space), Xps (POSIX space), and Xwd (word).
@@ -4169,7 +4169,7 @@ Version 4.3 21-May-03
(i) The utf8_table... variables are now declared "const".
(ii) The code for \cx, which used the "case flipping" table to upper case
- lower case letters, now just substracts 32. This is ASCII-specific,
+ lower case letters, now just subtracts 32. This is ASCII-specific,
but the whole concept of \cx is ASCII-specific, so it seems
reasonable.
diff --git a/ext/pcre/pcrelib/HACKING b/ext/pcre/pcrelib/HACKING
index 691b7a14e5..8395504212 100644
--- a/ext/pcre/pcrelib/HACKING
+++ b/ext/pcre/pcrelib/HACKING
@@ -360,7 +360,7 @@ reference number if the reference is to a unique capturing group (either by
number or by name). When named groups are used, there may be more than one
group with the same name. In this case, a reference by name generates OP_DNREF
or OP_DNREFI. These are followed by two counts: the index (not the byte offset)
-in the group name table of the first entry for the requred name, followed by
+in the group name table of the first entry for the required name, followed by
the number of groups with the same name.
diff --git a/ext/pcre/pcrelib/README b/ext/pcre/pcrelib/README
index 88f2dfd4ef..5a1d553fff 100644
--- a/ext/pcre/pcrelib/README
+++ b/ext/pcre/pcrelib/README
@@ -392,7 +392,7 @@ library. They are also documented in the pcrebuild man page.
avoided by linking with libedit (which has a BSD licence) instead.
Enabling libreadline causes the -lreadline option to be added to the pcretest
- build. In many operating environments with a sytem-installed readline
+ build. In many operating environments with a system-installed readline
library this is sufficient. However, in some environments (e.g. if an
unmodified distribution version of readline is in use), it may be necessary
to specify something like LIBS="-lncurses" as well. This is because, to quote
diff --git a/ext/pcre/pcrelib/doc/pcre.txt b/ext/pcre/pcrelib/doc/pcre.txt
index 14cbb8bf2b..548d80b90f 100644
--- a/ext/pcre/pcrelib/doc/pcre.txt
+++ b/ext/pcre/pcrelib/doc/pcre.txt
@@ -1242,7 +1242,7 @@ PCRETEST OPTION FOR LIBREADLINE SUPPORT
pcretest linked in this way, there may be licensing issues.
Setting this option causes the -lreadline option to be added to the
- pcretest build. In many operating environments with a sytem-installed
+ pcretest build. In many operating environments with a system-installed
libreadline this is sufficient. However, in some environments (e.g. if
an unmodified distribution version of readline is in use), some extra
configuration may be necessary. The INSTALL file for libreadline says
diff --git a/ext/pcre/pcrelib/pcre_exec.c b/ext/pcre/pcrelib/pcre_exec.c
index ab58735d5c..be0af11633 100644
--- a/ext/pcre/pcrelib/pcre_exec.c
+++ b/ext/pcre/pcrelib/pcre_exec.c
@@ -1038,7 +1038,7 @@ for (;;)
the result of a recursive call to match() whatever happened so it was
possible to reduce stack usage by turning this into a tail recursion,
except in the case of a possibly empty group. However, now that there is
- the possiblity of (*THEN) occurring in the final alternative, this
+ the possibility of (*THEN) occurring in the final alternative, this
optimization is no longer always possible.
We can optimize if we know there are no (*THEN)s in the pattern; at present
diff --git a/ext/pcre/pcrelib/pcre_printint.c b/ext/pcre/pcrelib/pcre_printint.c
index 8cbb161395..1a91c50046 100644
--- a/ext/pcre/pcrelib/pcre_printint.c
+++ b/ext/pcre/pcrelib/pcre_printint.c
@@ -68,7 +68,7 @@ appropriately for an application, not for building PCRE. */
#include "pcre.h"
#include "pcre_internal.h"
-/* These are the funtions that are contained within. It doesn't seem worth
+/* These are the functions that are contained within. It doesn't seem worth
having a separate .h file just for this. */
#endif /* PCRE_INCLUDED */
diff --git a/ext/pcre/pcrelib/pcre_study.c b/ext/pcre/pcrelib/pcre_study.c
index 2fe43c6920..0e26db9d6c 100644
--- a/ext/pcre/pcrelib/pcre_study.c
+++ b/ext/pcre/pcrelib/pcre_study.c
@@ -988,7 +988,7 @@ do
tcode = set_table_bit(start_bits, tcode + 1, TRUE, cd, utf);
break;
- /* Single-char upto sets the bit and tries the next */
+ /* Single-char up to sets the bit and tries the next */
case OP_UPTO:
case OP_MINUPTO:
diff --git a/ext/pcre/pcrelib/pcredemo.c b/ext/pcre/pcrelib/pcredemo.c
index 946aba45cd..1ca77f1537 100644
--- a/ext/pcre/pcrelib/pcredemo.c
+++ b/ext/pcre/pcrelib/pcredemo.c
@@ -144,7 +144,7 @@ if (rc < 0)
return 1;
}
-/* Match succeded */
+/* Match succeeded */
printf("\nMatch succeeded at offset %d\n", ovector[0]);
@@ -362,7 +362,7 @@ for (;;)
return 1;
}
- /* Match succeded */
+ /* Match succeeded */
printf("\nMatch succeeded again at offset %d\n", ovector[0]);
diff --git a/ext/pcre/pcrelib/sljit/sljitLir.c b/ext/pcre/pcrelib/sljit/sljitLir.c
index 1acecba8b4..0afce2524a 100644
--- a/ext/pcre/pcrelib/sljit/sljitLir.c
+++ b/ext/pcre/pcrelib/sljit/sljitLir.c
@@ -1428,7 +1428,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_cmp(struct sljit_compiler
#endif
if (SLJIT_UNLIKELY((src1 & SLJIT_IMM) && !(src2 & SLJIT_IMM))) {
- /* Immediate is prefered as second argument by most architectures. */
+ /* Immediate is preferred as second argument by most architectures. */
switch (condition) {
case SLJIT_C_LESS:
condition = SLJIT_C_GREATER;
diff --git a/ext/pcre/pcrelib/sljit/sljitLir.h b/ext/pcre/pcrelib/sljit/sljitLir.h
index e2cd21846d..9c9acdfe21 100644
--- a/ext/pcre/pcrelib/sljit/sljitLir.h
+++ b/ext/pcre/pcrelib/sljit/sljitLir.h
@@ -90,7 +90,7 @@ of sljitConfigInternal.h */
#define SLJIT_SUCCESS 0
/* After the call of sljit_generate_code(), the error code of the compiler
is set to this value to avoid future sljit calls (in debug mode at least).
- The complier should be freed after sljit_generate_code(). */
+ The compiler should be freed after sljit_generate_code(). */
#define SLJIT_ERR_COMPILED 1
/* Cannot allocate non executable memory. */
#define SLJIT_ERR_ALLOC_FAILED 2
@@ -898,7 +898,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi
/* After the code generation the address for label, jump and const instructions
are computed. Since these structures are freed by sljit_free_compiler, the
- addresses must be preserved by the user program elsewere. */
+ addresses must be preserved by the user program elsewhere. */
static SLJIT_INLINE sljit_uw sljit_get_label_addr(struct sljit_label *label) { return label->addr; }
static SLJIT_INLINE sljit_uw sljit_get_jump_addr(struct sljit_jump *jump) { return jump->addr; }
static SLJIT_INLINE sljit_uw sljit_get_const_addr(struct sljit_const *const_) { return const_->addr; }
diff --git a/ext/pcre/pcrelib/sljit/sljitNativeARM_32.c b/ext/pcre/pcrelib/sljit/sljitNativeARM_32.c
index 6747c4f617..1342eaebf1 100644
--- a/ext/pcre/pcrelib/sljit/sljitNativeARM_32.c
+++ b/ext/pcre/pcrelib/sljit/sljitNativeARM_32.c
@@ -304,7 +304,7 @@ static sljit_uw patch_pc_relative_loads(sljit_uw *last_pc_patch, sljit_uw *code_
return counter;
}
-/* In some rare ocasions we may need future patches. The probability is close to 0 in practice. */
+/* In some rare occasions we may need future patches. The probability is close to 0 in practice. */
struct future_patch {
struct future_patch* next;
sljit_si index;
@@ -1205,7 +1205,7 @@ static sljit_si generate_int(struct sljit_compiler *compiler, sljit_si reg, slji
sljit_uw imm2;
sljit_si rol;
- /* Step1: Search a zero byte (8 continous zero bit). */
+ /* Step1: Search a zero byte (8 continuous zero bit). */
mask = 0xff000000;
rol = 8;
while(1) {
diff --git a/ext/pcre/pcrelib/sljit/sljitNativeTILEGX_64.c b/ext/pcre/pcrelib/sljit/sljitNativeTILEGX_64.c
index d0b392e7a4..548b6c446f 100644
--- a/ext/pcre/pcrelib/sljit/sljitNativeTILEGX_64.c
+++ b/ext/pcre/pcrelib/sljit/sljitNativeTILEGX_64.c
@@ -1843,7 +1843,7 @@ static SLJIT_INLINE sljit_si emit_single_op(struct sljit_compiler *compiler, slj
if (src1 != dst)
overflow_ra = reg_map[src1];
else {
- /* Rare ocasion. */
+ /* Rare occasion. */
FAIL_IF(ADD(TMP_EREG2, reg_map[src1], ZERO));
overflow_ra = TMP_EREG2;
}
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c
index aca52ebf20..8e35c1ee9a 100644
--- a/ext/pdo/pdo_dbh.c
+++ b/ext/pdo/pdo_dbh.c
@@ -472,7 +472,7 @@ static void pdo_stmt_construct(zend_execute_data *execute_data, pdo_stmt_t *stmt
}
/* }}} */
-/* {{{ proto object PDO::prepare(string statment [, array options])
+/* {{{ proto object PDO::prepare(string statement [, array options])
Prepares a statement for execution and returns a statement object */
static PHP_METHOD(PDO, prepare)
{
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index dbc98c6e5f..27cc157ed7 100644
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -2016,7 +2016,7 @@ static PHP_METHOD(PDOStatement, setFetchMode)
/* }}} */
/* {{{ proto bool PDOStatement::nextRowset()
- Advances to the next rowset in a multi-rowset statement handle. Returns true if it succeded, false otherwise */
+ Advances to the next rowset in a multi-rowset statement handle. Returns true if it succeeded, false otherwise */
static int pdo_stmt_do_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
{
diff --git a/ext/pdo/tests/bug_39656.phpt b/ext/pdo/tests/bug_39656.phpt
index 7d113ef4aa..9ee54916bb 100644
--- a/ext/pdo/tests/bug_39656.phpt
+++ b/ext/pdo/tests/bug_39656.phpt
@@ -1,5 +1,5 @@
--TEST--
-PDO Common: Bug #39656 (Crash when calling fetch() on a PDO statment object after closeCursor())
+PDO Common: Bug #39656 (Crash when calling fetch() on a PDO statement object after closeCursor())
--SKIPIF--
<?php
if (!extension_loaded('pdo')) die('skip');
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt
index 96489ef861..f809e02b11 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt
@@ -49,7 +49,7 @@ MySQLPDOTest::skip();
}
if ($label !== $value) {
- printf("[%03d + 3] Returned value seems to be wrong (%d vs. %d charachters). Check manually\n",
+ printf("[%03d + 3] Returned value seems to be wrong (%d vs. %d characters). Check manually\n",
$offset, strlen($label), strlen($value));
return false;
}
@@ -64,7 +64,7 @@ MySQLPDOTest::skip();
$ret = $stmt->fetch(PDO::FETCH_ASSOC);
if ($ret['label'] !== $value) {
- printf("[%03d + 3] Returned value seems to be wrong (%d vs. %d charachters). Check manually\n",
+ printf("[%03d + 3] Returned value seems to be wrong (%d vs. %d characters). Check manually\n",
$offset, strlen($ret['label']), strlen($value));
return false;
}
diff --git a/ext/pgsql/README b/ext/pgsql/README
index 785b4f034b..86df804fbd 100644
--- a/ext/pgsql/README
+++ b/ext/pgsql/README
@@ -43,7 +43,7 @@ module with specific version. You need to install PostgreSQL
somewhere in your system to build PHP with PostgreSQL support.
==== Note For PostgreSQL 7.2 ====
-I've tested upto 7.2.2.
+I've tested up to 7.2.2.
==== TODO List ===
Make pg_convert() smater.
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 63cca9fc1c..7916afc3fc 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -1379,7 +1379,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
/* ensure that the link did not die */
if (PGG(auto_reset_persistent) & 1) {
/* need to send & get something from backend to
- make sure we catch CONNECTION_BAD everytime */
+ make sure we catch CONNECTION_BAD every time */
PGresult *pg_result;
pg_result = PQexec(le->ptr, "select 1");
PQclear(pg_result);
@@ -1484,7 +1484,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
PGG(num_links)++;
}
- /* set notice processer */
+ /* set notice processor */
if (! PGG(ignore_notices) && Z_TYPE_P(return_value) == IS_RESOURCE) {
PQsetNoticeProcessor(pgsql, _php_pgsql_notice_handler, (void*)Z_RES_HANDLE_P(return_value));
}
@@ -4350,7 +4350,7 @@ PHP_FUNCTION(pg_escape_bytea)
#endif
to = (char *)PQescapeBytea((unsigned char*)from, from_len, &to_len);
- RETVAL_STRINGL(to, to_len-1); /* to_len includes addtional '\0' */
+ RETVAL_STRINGL(to, to_len-1); /* to_len includes additional '\0' */
}
/* }}} */
diff --git a/ext/phar/Makefile.frag b/ext/phar/Makefile.frag
index faa9db0c70..6516ddfabd 100644
--- a/ext/phar/Makefile.frag
+++ b/ext/phar/Makefile.frag
@@ -39,7 +39,7 @@ install-pharcmd: pharcmd
-@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
$(INSTALL) $(builddir)/phar.phar $(INSTALL_ROOT)$(bindir)
-@rm -f $(INSTALL_ROOT)$(bindir)/phar
- $(LN_S) -f $(bindir)/phar.phar $(INSTALL_ROOT)$(bindir)/phar
+ $(LN_S) -f $(INSTALL_ROOT)$(bindir)/phar.phar $(INSTALL_ROOT)$(bindir)/phar
@$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1
@$(INSTALL_DATA) $(builddir)/phar.1 $(INSTALL_ROOT)$(mandir)/man1/phar.1
@$(INSTALL_DATA) $(builddir)/phar.phar.1 $(INSTALL_ROOT)$(mandir)/man1/phar.phar.1
diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c
index 6d6cbc4918..bd7324c78e 100644
--- a/ext/phar/func_interceptors.c
+++ b/ext/phar/func_interceptors.c
@@ -564,7 +564,7 @@ static void phar_fancy_stat(zend_stat_t *stat_sb, int type, zval *return_value T
#else
ZVAL_LONG(&stat_blocks,-1);
#endif
- /* Store numeric indexes in propper order */
+ /* Store numeric indexes in proper order */
zend_hash_next_index_insert(HASH_OF(return_value), &stat_dev);
zend_hash_next_index_insert(HASH_OF(return_value), &stat_ino);
zend_hash_next_index_insert(HASH_OF(return_value), &stat_mode);
diff --git a/ext/readline/tests/readline_read_history_error_001.phpt b/ext/readline/tests/readline_read_history_error_001.phpt
new file mode 100644
index 0000000000..0a65a66d5c
--- /dev/null
+++ b/ext/readline/tests/readline_read_history_error_001.phpt
@@ -0,0 +1,14 @@
+--TEST--
+readline_read_history() function - Error cases
+--CREDITS--
+Pedro Manoel Evangelista <pedro.evangelista at gmail dot com>
+--SKIPIF--
+<?php if (!extension_loaded("readline") || !function_exists('readline_read_history')) die("skip"); ?>
+--FILE--
+<?php
+var_dump(readline_read_history());
+var_dump(readline_read_history('nofile'));
+?>
+--EXPECT--
+bool(false)
+bool(false)
diff --git a/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt b/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt
index 4772f6548d..5655d19972 100644
--- a/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt
+++ b/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt
@@ -41,11 +41,11 @@ Name: arr1
Is passed by reference: yes
Can be passed by value: yes
-Name: SORT_ASC_or_SORT_DESC
+Name: sort_order
Is passed by reference: yes
Can be passed by value: yes
-Name: SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING
+Name: sort_flags
Is passed by reference: yes
Can be passed by value: yes
@@ -53,18 +53,6 @@ Name: arr2
Is passed by reference: yes
Can be passed by value: yes
-Name: SORT_ASC_or_SORT_DESC
-Is passed by reference: yes
-Can be passed by value: yes
-
-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/shmop/README b/ext/shmop/README
index a8ea03af91..c4970376b0 100644
--- a/ext/shmop/README
+++ b/ext/shmop/README
@@ -6,7 +6,7 @@ Shared Memory Operations Extension to PHP
to communicate the deamon via SHM. PHP already had a shared memory
extension (sysvshm) written by Christian Cartus <cartus@atrior.de>,
unfortunately this extension was designed with PHP only in mind and
- offers high level features which are extremly bothersome for basic SHM
+ offers high level features which are extremely bothersome for basic SHM
we had in mind. After spending a day trying to reverse engineer and figure
out the format of sysvshm we decided that it would be much easier to
add our own extension to php for simple SHM operations, we were right :)).
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index 250b1f0ebe..90c1bff951 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -1588,7 +1588,7 @@ PHP_FUNCTION(snmpwalk)
/* }}} */
/* {{{ proto mixed snmprealwalk(string host, string community, mixed object_id [, int timeout [, int retries]])
- Return all objects including their respective object id withing the specified one */
+ Return all objects including their respective object id within the specified one */
PHP_FUNCTION(snmprealwalk)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_WALK, SNMP_VERSION_1);
@@ -1616,7 +1616,7 @@ PHP_FUNCTION(snmp_get_quick_print)
/* }}} */
/* {{{ proto bool snmp_set_quick_print(int quick_print)
- Return all objects including their respective object id withing the specified one */
+ Return all objects including their respective object id within the specified one */
PHP_FUNCTION(snmp_set_quick_print)
{
zend_long a1;
@@ -1698,7 +1698,7 @@ PHP_FUNCTION(snmp2_walk)
/* }}} */
/* {{{ proto mixed snmp2_real_walk(string host, string community, mixed object_id [, int timeout [, int retries]])
- Return all objects including their respective object id withing the specified one */
+ Return all objects including their respective object id within the specified one */
PHP_FUNCTION(snmp2_real_walk)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_WALK, SNMP_VERSION_2c);
@@ -1893,7 +1893,7 @@ PHP_METHOD(snmp, getnext)
/* }}} */
/* {{{ proto mixed SNMP::walk(mixed object_id [, bool $suffix_as_key = FALSE [, int $max_repetitions [, int $non_repeaters]])
- Return all objects including their respective object id withing the specified one as array of oid->value pairs */
+ Return all objects including their respective object id within the specified one as array of oid->value pairs */
PHP_METHOD(snmp, walk)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_WALK, (-1));
diff --git a/ext/soap/TODO.old b/ext/soap/TODO.old
index b219c61f8a..821dc31072 100644
--- a/ext/soap/TODO.old
+++ b/ext/soap/TODO.old
@@ -18,7 +18,7 @@ when using wsdls and function names are similar find the best match
void test(int);
void test(string);
maybe use the same alogrithim as ext/java.
-investigate further http keep_alive... inital testing proved slower.. maybe php_streams will speed things up..
+investigate further http keep_alive... initial testing proved slower.. maybe php_streams will speed things up..
provide schema 1999/2001 support....
through memory leak testing
possible using shared memory for sdl caching...
diff --git a/ext/soap/interop/client_round2_interop.php b/ext/soap/interop/client_round2_interop.php
index fd5767cc17..bd52f28771 100644
--- a/ext/soap/interop/client_round2_interop.php
+++ b/ext/soap/interop/client_round2_interop.php
@@ -93,7 +93,7 @@ class Interop_Client
function _fetchEndpoints(&$soapclient, $test) {
$this->_getEndpoints($test, 1);
- // retreive endpoints from the endpoint server
+ // retrieve endpoints from the endpoint server
$endpointArray = $soapclient->__soapCall("GetEndpointInfo",array("groupName"=>$test),array('soapaction'=>"http://soapinterop.org/",'uri'=>"http://soapinterop.org/"));
if (is_soap_fault($endpointArray) || PEAR::isError($endpointArray)) {
if ($this->html) print "<pre>";
@@ -133,7 +133,7 @@ class Interop_Client
/**
* fetchEndpoints
- * retreive endpoints interop server
+ * retrieve endpoints interop server
*
* @return boolean result
* @access private
@@ -158,7 +158,7 @@ class Interop_Client
}
return NULL;
}
- // retreive all endpoints now
+ // retrieve all endpoints now
$this->currentTest = $test;
$x = $this->_getEndpoints($test);
return $x;
@@ -166,7 +166,7 @@ class Interop_Client
/**
* getEndpoints
- * retreive endpoints from either database or interop server
+ * retrieve endpoints from either database or interop server
*
* @param string base (see local var $tests)
* @param boolean all (if false, only get valid endpoints, status=1)
@@ -182,7 +182,7 @@ class Interop_Client
/**
* _getEndpoints
- * retreive endpoints from database
+ * retrieve endpoints from database
*
* @param string base (see local var $tests)
* @param boolean all (if false, only get valid endpoints, status=1)
@@ -222,7 +222,7 @@ class Interop_Client
/**
* getResults
- * retreive results from the database, stuff them into the endpoint array
+ * retrieve results from the database, stuff them into the endpoint array
*
* @access private
*/
@@ -230,7 +230,7 @@ class Interop_Client
// be sure we have the right endpoints for this test result
$this->getEndpoints($test);
- // retreive the results and put them into the endpoint info
+ // retrieve the results and put them into the endpoint info
$sql = "select * from results where class='$test' and type='$type' and wsdl=$wsdl";
$results = $this->dbc->getAll($sql,NULL, DB_FETCHMODE_ASSOC );
foreach ($results as $result) {
@@ -657,12 +657,12 @@ try {
/**
* getResults
- * retreive results from the database, stuff them into the endpoint array
+ * retrieve results from the database, stuff them into the endpoint array
*
* @access private
*/
function getMethodList($test = 'base') {
- // retreive the results and put them into the endpoint info
+ // retrieve the results and put them into the endpoint info
$sql = "select distinct(function) from results where class='$test' order by function";
$results = $this->dbc->getAll($sql);
$ar = array();
diff --git a/ext/soap/package.xml b/ext/soap/package.xml
index e43fd36024..6c68f8dd4c 100644
--- a/ext/soap/package.xml
+++ b/ext/soap/package.xml
@@ -34,7 +34,7 @@
<date>2002-07-07</date>
<state>alpha</state>
<notes>
- - First offical PEAR/PECL release
+ - First official PEAR/PECL release
</notes>
</release>
<filelist>
diff --git a/ext/soap/php_sdl.h b/ext/soap/php_sdl.h
index cf6e26b179..9ecf40c067 100644
--- a/ext/soap/php_sdl.h
+++ b/ext/soap/php_sdl.h
@@ -87,7 +87,7 @@ struct _sdlBinding {
void *bindingAttributes; /* sdlSoapBindingPtr */
};
-/* Soap Binding Specfic stuff */
+/* Soap Binding Specific stuff */
struct _sdlSoapBinding {
sdlEncodingStyle style;
sdlTransport transport; /* not implemented yet */
diff --git a/ext/soap/php_soap.h b/ext/soap/php_soap.h
index bab2ded046..e636ef39e7 100644
--- a/ext/soap/php_soap.h
+++ b/ext/soap/php_soap.h
@@ -92,7 +92,7 @@ struct _soapService {
zend_class_entry *ce;
zval *argv;
int argc;
- int persistance;
+ int persistence;
} soap_class;
zval soap_object;
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index f3f336117f..cf409cedf2 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -1265,7 +1265,7 @@ PHP_METHOD(SoapServer, setPersistence)
if (service->type == SOAP_CLASS) {
if (value == SOAP_PERSISTENCE_SESSION ||
value == SOAP_PERSISTENCE_REQUEST) {
- service->soap_class.persistance = value;
+ service->soap_class.persistence = value;
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to set persistence with bogus value (%pd)", value);
return;
@@ -1305,7 +1305,7 @@ PHP_METHOD(SoapServer, setClass)
service->type = SOAP_CLASS;
service->soap_class.ce = ce;
- service->soap_class.persistance = SOAP_PERSISTENCE_REQUEST;
+ service->soap_class.persistence = SOAP_PERSISTENCE_REQUEST;
service->soap_class.argc = num_args;
if (service->soap_class.argc > 0) {
int i;
@@ -1663,7 +1663,7 @@ PHP_METHOD(SoapServer, handle)
} else if (service->type == SOAP_CLASS) {
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
/* If persistent then set soap_obj from from the previous created session (if available) */
- if (service->soap_class.persistance == SOAP_PERSISTENCE_SESSION) {
+ if (service->soap_class.persistence == SOAP_PERSISTENCE_SESSION) {
zval *tmp_soap;
zval *session_vars;
@@ -1747,7 +1747,7 @@ PHP_METHOD(SoapServer, handle)
}
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
/* If session then update session hash with new object */
- if (service->soap_class.persistance == SOAP_PERSISTENCE_SESSION) {
+ if (service->soap_class.persistence == SOAP_PERSISTENCE_SESSION) {
zval *tmp_soap_pp;
zval *session_vars = &PS(http_session_vars);
@@ -1854,7 +1854,7 @@ PHP_METHOD(SoapServer, handle)
call_status = call_user_function(NULL, soap_obj, &function_name, &retval, num_params, params TSRMLS_CC);
if (service->type == SOAP_CLASS) {
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
- if (service->soap_class.persistance != SOAP_PERSISTENCE_SESSION) {
+ if (service->soap_class.persistence != SOAP_PERSISTENCE_SESSION) {
zval_ptr_dtor(soap_obj);
soap_obj = NULL;
}
@@ -1881,7 +1881,7 @@ PHP_METHOD(SoapServer, handle)
}
if (service->type == SOAP_CLASS) {
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
- if (soap_obj && service->soap_class.persistance != SOAP_PERSISTENCE_SESSION) {
+ if (soap_obj && service->soap_class.persistence != SOAP_PERSISTENCE_SESSION) {
#else
if (soap_obj) {
#endif
@@ -1925,7 +1925,7 @@ PHP_METHOD(SoapServer, handle)
}
if (service->type == SOAP_CLASS) {
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
- if (soap_obj && service->soap_class.persistance != SOAP_PERSISTENCE_SESSION) {
+ if (soap_obj && service->soap_class.persistence != SOAP_PERSISTENCE_SESSION) {
#else
if (soap_obj) {
#endif
@@ -3119,7 +3119,7 @@ PHP_METHOD(SoapClient, __doRequest)
/* {{{ proto void SoapClient::__setCookie(string name [, strung value])
Sets cookie thet will sent with SOAP request.
- The call to this function will effect all folowing calls of SOAP methods.
+ The call to this function will effect all following calls of SOAP methods.
If value is not specified cookie is removed. */
PHP_METHOD(SoapClient, __setCookie)
{
diff --git a/ext/soap/tests/bugs/bug27742.wsdl b/ext/soap/tests/bugs/bug27742.wsdl
index 7f1514acbf..a9429981c3 100644
--- a/ext/soap/tests/bugs/bug27742.wsdl
+++ b/ext/soap/tests/bugs/bug27742.wsdl
@@ -726,7 +726,7 @@
</element>
<element name="genres">
<annotation>
- <documentation xml:lang="en">Containes genre information where available for the program records. A program may have more than one genre with different relevence factors.</documentation>
+ <documentation xml:lang="en">Contains genre information where available for the program records. A program may have more than one genre with different relevance factors.</documentation>
</annotation>
<complexType>
<sequence maxOccurs="unbounded">
@@ -749,7 +749,7 @@
</element>
<element name="relevance" type="xsd:int">
<annotation>
- <documentation xml:lang="en">A relevence factor that applies to the genre classification for the program. A relevence factor of 1 indicates that this is the top-level genre under which the program is classified.</documentation>
+ <documentation xml:lang="en">A relevance factor that applies to the genre classification for the program. A relevance factor of 1 indicates that this is the top-level genre under which the program is classified.</documentation>
</annotation>
</element>
</sequence>
diff --git a/ext/soap/tests/bugs/bug50698_2.phpt b/ext/soap/tests/bugs/bug50698_2.phpt
index a39f4b56bf..7ff667423c 100644
--- a/ext/soap/tests/bugs/bug50698_2.phpt
+++ b/ext/soap/tests/bugs/bug50698_2.phpt
@@ -1,5 +1,5 @@
--TEST--
-Request #50698_2 (SoapClient should handle wsdls with some incompatiable endpoints -- EDGECASE: Large mix of compatiable and incompatiable endpoints.)
+Request #50698_2 (SoapClient should handle wsdls with some incompatiable endpoints -- EDGECASE: Large mix of compatible and incompatiable endpoints.)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--INI--
diff --git a/ext/sockets/php_sockets.h b/ext/sockets/php_sockets.h
index 8a25f960a3..98c36cd1ad 100644
--- a/ext/sockets/php_sockets.h
+++ b/ext/sockets/php_sockets.h
@@ -70,6 +70,8 @@ struct sockaddr_un {
#endif
PHP_SOCKETS_API int php_sockets_le_socket(void);
+PHP_SOCKETS_API php_socket *php_create_socket(void);
+PHP_SOCKETS_API void php_destroy_socket(zend_resource *rsrc TSRMLS_DC);
#define php_sockets_le_socket_name "Socket"
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index 263b8c45f7..afd67b3bd4 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -387,7 +387,7 @@ PHP_SOCKETS_API int php_sockets_le_socket(void) /* {{{ */
/* allocating function to make programming errors due to uninitialized fields
* less likely */
-static php_socket *php_create_socket(void) /* {{{ */
+PHP_SOCKETS_API php_socket *php_create_socket(void) /* {{{ */
{
php_socket *php_sock = emalloc(sizeof(php_socket));
@@ -401,7 +401,7 @@ static php_socket *php_create_socket(void) /* {{{ */
}
/* }}} */
-static void php_destroy_socket(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+PHP_SOCKETS_API void php_destroy_socket(zend_resource *rsrc TSRMLS_DC) /* {{{ */
{
php_socket *php_sock = rsrc->ptr;
diff --git a/ext/spl/internal/recursivecachingiterator.inc b/ext/spl/internal/recursivecachingiterator.inc
index 0676d435f2..cd5d3e31f5 100644
--- a/ext/spl/internal/recursivecachingiterator.inc
+++ b/ext/spl/internal/recursivecachingiterator.inc
@@ -80,7 +80,7 @@ class RecursiveCachingIterator extends CachingIterator implements RecursiveItera
/** @return whether the current element has children
* @note The check whether the Iterator for the children can be created was
* already executed. Hence when flag CATCH_GET_CHILD was given in
- * constructor this fucntion returns false so that getChildren does
+ * constructor this function returns false so that getChildren does
* not try to access those children.
*/
function hasChildren()
diff --git a/ext/spl/spl.php b/ext/spl/spl.php
index c276f1f2ee..ff9d1b6bbe 100755
--- a/ext/spl/spl.php
+++ b/ext/spl/spl.php
@@ -958,7 +958,7 @@ class SplFileInfo
*
* @param mode open mode
* @param use_include_path whether to search include paths (don't use)
- * @param context resource context to pased to open function
+ * @param context resource context to passed to open function
* @throw RuntimeException if file cannot be opened (e.g. insufficient
* access rights).
* @return The opened file as a SplFileObject instance
diff --git a/ext/spl/tests/SplFixedArray_fromarray_param_multiarray.phpt b/ext/spl/tests/SplFixedArray_fromarray_param_multiarray.phpt
index f57fe78fb8..659f61c80d 100644
--- a/ext/spl/tests/SplFixedArray_fromarray_param_multiarray.phpt
+++ b/ext/spl/tests/SplFixedArray_fromarray_param_multiarray.phpt
@@ -1,5 +1,5 @@
--TEST--
-Tries to create a SplFixedArray using the fromArray() function and a multi dimentional array.
+Tries to create a SplFixedArray using the fromArray() function and a multi dimensional array.
--CREDITS--
Philip Norton philipnorton42@gmail.com
--FILE--
diff --git a/ext/spl/tests/bug53071.phpt b/ext/spl/tests/bug53071.phpt
index c2c2605e2e..9d5dac4cd0 100644
--- a/ext/spl/tests/bug53071.phpt
+++ b/ext/spl/tests/bug53071.phpt
@@ -12,7 +12,7 @@ function LimitedScope()
$myA = new myClass();
$myB = new SplObjectStorage();
$myC = new myClass();
- $myC->member = $myA; // myC has a referece to myA
+ $myC->member = $myA; // myC has a reference to myA
$myB->Attach($myC); // myB attaches myC
$myA->member = $myB; // myA has myB, comleting the cycle
}
diff --git a/ext/sqlite3/libsqlite/sqlite3.c b/ext/sqlite3/libsqlite/sqlite3.c
index e5aa96f6b0..99aeccc46f 100644
--- a/ext/sqlite3/libsqlite/sqlite3.c
+++ b/ext/sqlite3/libsqlite/sqlite3.c
@@ -10022,7 +10022,7 @@ SQLITE_PRIVATE void sqlite3PCacheSetDefault(void);
** shared locks begins at SHARED_FIRST.
**
** The same locking strategy and
-** byte ranges are used for Unix. This leaves open the possiblity of having
+** byte ranges are used for Unix. This leaves open the possibility of having
** clients on win95, winNT, and unix all talking to the same shared file
** and all locking correctly. To do so would require that samba (or whatever
** tool is being used for file sharing) implements locks correctly between
@@ -11971,7 +11971,7 @@ struct TriggerStep {
u8 op; /* One of TK_DELETE, TK_UPDATE, TK_INSERT, TK_SELECT */
u8 orconf; /* OE_Rollback etc. */
Trigger *pTrig; /* The trigger that this step is a part of */
- Select *pSelect; /* SELECT statment or RHS of INSERT INTO .. SELECT ... */
+ Select *pSelect; /* SELECT statement or RHS of INSERT INTO .. SELECT ... */
Token target; /* Target table for DELETE, UPDATE, INSERT */
Expr *pWhere; /* The WHERE clause for DELETE or UPDATE steps */
ExprList *pExprList; /* SET clause for UPDATE. */
@@ -13019,7 +13019,7 @@ SQLITE_PRIVATE int sqlite3MemdebugNoType(void*,u8);
**
*************************************************************************
**
-** This file contains definitions of global variables and contants.
+** This file contains definitions of global variables and constants.
*/
/* An array to map all upper-case characters into their corresponding
@@ -13908,7 +13908,7 @@ struct Mem {
#endif
/*
-** Each auxilliary data pointer stored by a user defined function
+** Each auxiliary data pointer stored by a user defined function
** implementation calling sqlite3_set_auxdata() is stored in an instance
** of this structure. All such structures associated with a single VM
** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed
@@ -17632,7 +17632,7 @@ SQLITE_PRIVATE const sqlite3_mem_methods *sqlite3MemGetMemsys3(void){
** 1. All memory allocations sizes are rounded up to a power of 2.
**
** 2. If two adjacent free blocks are the halves of a larger block,
-** then the two blocks are coalesed into the single larger block.
+** then the two blocks are coalesced into the single larger block.
**
** 3. New memory is allocated from the first available free block.
**
@@ -18570,7 +18570,7 @@ SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3DefaultMutex(void){
/*
** The sqlite3_mutex.id, sqlite3_mutex.nRef, and sqlite3_mutex.owner fields
-** are necessary under two condidtions: (1) Debug builds and (2) using
+** are necessary under two conditions: (1) Debug builds and (2) using
** home-grown mutexes. Encapsulate these conditions into a single #define.
*/
#if defined(SQLITE_DEBUG) || defined(SQLITE_HOMEGROWN_RECURSIVE_MUTEX)
@@ -21904,7 +21904,7 @@ SQLITE_PRIVATE void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){
** occur.
**
** 2002-Feb-14: This routine is extended to remove MS-Access style
-** brackets from around identifers. For example: "[a-b-c]" becomes
+** brackets from around identifiers. For example: "[a-b-c]" becomes
** "a-b-c".
*/
SQLITE_PRIVATE int sqlite3Dequote(char *z){
@@ -22146,7 +22146,7 @@ do_atof_calc:
/* store the result */
*pResult = result;
- /* return true if number and no extra non-whitespace chracters after */
+ /* return true if number and no extra non-whitespace characters after */
return z>=zEnd && nDigits>0 && eValid && nonNum==0;
#else
return !sqlite3Atoi64(z, pResult, length, enc);
@@ -22837,7 +22837,7 @@ SQLITE_PRIVATE int sqlite3SafetyCheckSickOrOk(sqlite3 *db){
}
/*
-** Attempt to add, substract, or multiply the 64-bit signed value iB against
+** Attempt to add, subtract, or multiply the 64-bit signed value iB against
** the other 64-bit signed integer at *pA and store the result in *pA.
** Return 0 on success. Or if the operation would have resulted in an
** overflow, leave *pA unchanged and return 1.
@@ -26863,7 +26863,7 @@ static int unixRead(
#endif
#if SQLITE_MAX_MMAP_SIZE>0
- /* Deal with as much of this read request as possible by transfering
+ /* Deal with as much of this read request as possible by transferring
** data from the memory mapping using memcpy(). */
if( offset<pFile->mmapSize ){
if( offset+amt <= pFile->mmapSize ){
@@ -26998,7 +26998,7 @@ static int unixWrite(
#endif
#if SQLITE_MAX_MMAP_SIZE>0
- /* Deal with as much of this write request as possible by transfering
+ /* Deal with as much of this write request as possible by transferring
** data from the memory mapping using memcpy(). */
if( offset<pFile->mmapSize ){
if( offset+amt <= pFile->mmapSize ){
@@ -28557,7 +28557,7 @@ static int unixUnfetch(sqlite3_file *fd, i64 iOff, void *p){
** looks at the filesystem type and tries to guess the best locking
** strategy from that.
**
-** For finder-funtion F, two objects are created:
+** For finder-function F, two objects are created:
**
** (1) The real finder-function named "FImpt()".
**
@@ -29998,7 +29998,7 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){
** setting the environment variable SQLITE_FORCE_PROXY_LOCKING to 1 will
** force proxy locking to be used for every database file opened, and 0
** will force automatic proxy locking to be disabled for all database
-** files (explicity calling the SQLITE_SET_LOCKPROXYFILE pragma or
+** files (explicitly calling the SQLITE_SET_LOCKPROXYFILE pragma or
** sqlite_file_control API is not affected by SQLITE_FORCE_PROXY_LOCKING).
*/
@@ -30529,7 +30529,7 @@ static int proxyTakeConch(unixFile *pFile){
fprintf(stderr, "fchmod %o FAILED with %d %s\n",
cmode, code, strerror(code));
} else {
- fprintf(stderr, "fchmod %o SUCCEDED\n",cmode);
+ fprintf(stderr, "fchmod %o SUCCEEDED\n",cmode);
}
}else{
int code = errno;
@@ -33761,7 +33761,7 @@ static int winRead(
pFile->h, pBuf, amt, offset, pFile->locktype));
#if SQLITE_MAX_MMAP_SIZE>0
- /* Deal with as much of this read request as possible by transfering
+ /* Deal with as much of this read request as possible by transferring
** data from the memory mapping using memcpy(). */
if( offset<pFile->mmapSize ){
if( offset+amt <= pFile->mmapSize ){
@@ -33833,7 +33833,7 @@ static int winWrite(
pFile->h, pBuf, amt, offset, pFile->locktype));
#if SQLITE_MAX_MMAP_SIZE>0
- /* Deal with as much of this write request as possible by transfering
+ /* Deal with as much of this write request as possible by transferring
** data from the memory mapping using memcpy(). */
if( offset<pFile->mmapSize ){
if( offset+amt <= pFile->mmapSize ){
@@ -33965,7 +33965,7 @@ static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){
#ifdef SQLITE_TEST
/*
** Count the number of fullsyncs and normal syncs. This is used to test
-** that syncs and fullsyncs are occuring at the right times.
+** that syncs and fullsyncs are occurring at the right times.
*/
SQLITE_API int sqlite3_sync_count = 0;
SQLITE_API int sqlite3_fullsync_count = 0;
@@ -39330,8 +39330,8 @@ SQLITE_PRIVATE int sqlite3RowSetNext(RowSet *p, i64 *pRowid){
** Check to see if element iRowid was inserted into the rowset as
** part of any insert batch prior to iBatch. Return 1 or 0.
**
-** If this is the first test of a new batch and if there exist entires
-** on pRowSet->pEntry, then sort those entires into the forest at
+** If this is the first test of a new batch and if there exist entries
+** on pRowSet->pEntry, then sort those entries into the forest at
** pRowSet->pForest so that they can be tested.
*/
SQLITE_PRIVATE int sqlite3RowSetTest(RowSet *pRowSet, u8 iBatch, sqlite3_int64 iRowid){
@@ -39613,7 +39613,7 @@ SQLITE_PRIVATE int sqlite3WalFramesize(Wal *pWal);
** Definition: Two databases (or the same database at two points it time)
** are said to be "logically equivalent" if they give the same answer to
** all queries. Note in particular the content of freelist leaf
-** pages can be changed arbitarily without effecting the logical equivalence
+** pages can be changed arbitrarily without effecting the logical equivalence
** of the database.
**
** (7) At any time, if any subset, including the empty set and the total set,
@@ -39838,7 +39838,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */
** outstanding transactions have been abandoned, the pager is able to
** transition back to OPEN state, discarding the contents of the
** page-cache and any other in-memory state at the same time. Everything
-** is reloaded from disk (and, if necessary, hot-journal rollback peformed)
+** is reloaded from disk (and, if necessary, hot-journal rollback performed)
** when a read-transaction is next opened on the pager (transitioning
** the pager into READER state). At that point the system has recovered
** from the error.
@@ -41196,7 +41196,7 @@ static int writeMasterJournal(Pager *pPager, const char *zMaster){
}
pPager->journalOff += (nMaster+20);
- /* If the pager is in peristent-journal mode, then the physical
+ /* If the pager is in persistent-journal mode, then the physical
** journal-file may extend past the end of the master-journal name
** and 8 bytes of magic data just written to the file. This is
** dangerous because the code to rollback a hot-journal file
@@ -41369,7 +41369,7 @@ static void pager_unlock(Pager *pPager){
/*
** This function is called whenever an IOERR or FULL error that requires
-** the pager to transition into the ERROR state may ahve occurred.
+** the pager to transition into the ERROR state may have occurred.
** The first argument is a pointer to the pager structure, the second
** the error-code about to be returned by a pager API function. The
** value returned is a copy of the second argument to this function.
@@ -48080,7 +48080,7 @@ SQLITE_PRIVATE int sqlite3WalOpen(
}
/*
-** Change the size to which the WAL file is trucated on each reset.
+** Change the size to which the WAL file is truncated on each reset.
*/
SQLITE_PRIVATE void sqlite3WalLimit(Wal *pWal, i64 iLimit){
if( pWal ) pWal->mxWalSize = iLimit;
@@ -54531,7 +54531,7 @@ SQLITE_PRIVATE int sqlite3BtreeCloseCursor(BtCursor *pCur){
** compiler to crash when getCellInfo() is implemented as a macro.
** But there is a measureable speed advantage to using the macro on gcc
** (when less compiler optimizations like -Os or -O0 are used and the
-** compiler is not doing agressive inlining.) So we use a real function
+** compiler is not doing aggressive inlining.) So we use a real function
** for MSVC and a macro for everything else. Ticket #2457.
*/
#ifndef NDEBUG
@@ -54929,7 +54929,7 @@ static int accessPayload(
/*
** Read part of the key associated with cursor pCur. Exactly
-** "amt" bytes will be transfered into pBuf[]. The transfer
+** "amt" bytes will be transferred into pBuf[]. The transfer
** begins at "offset".
**
** The caller must ensure that pCur is pointing to a valid row
@@ -54949,7 +54949,7 @@ SQLITE_PRIVATE int sqlite3BtreeKey(BtCursor *pCur, u32 offset, u32 amt, void *pB
/*
** Read part of the data associated with cursor pCur. Exactly
-** "amt" bytes will be transfered into pBuf[]. The transfer
+** "amt" bytes will be transferred into pBuf[]. The transfer
** begins at "offset".
**
** Return SQLITE_OK on success or an error code if anything goes
@@ -62945,7 +62945,7 @@ SQLITE_PRIVATE void sqlite3VdbeRewind(Vdbe *p){
**
** This function may be called exact once on a each virtual machine.
** After this routine is called the VM has been "packaged" and is ready
-** to run. After this routine is called, futher calls to
+** to run. After this routine is called, further calls to
** sqlite3VdbeAddOp() functions are prohibited. This routine disconnects
** the Vdbe from the Parse object that helped generate it so that the
** the Vdbe becomes an independent entity and the Parse object can be
@@ -62997,7 +62997,7 @@ SQLITE_PRIVATE void sqlite3VdbeMakeReady(
/* Allocate space for memory registers, SQL variables, VDBE cursors and
** an array to marshal SQL function arguments in.
*/
- zCsr = (u8*)&p->aOp[p->nOp]; /* Memory avaliable for allocation */
+ zCsr = (u8*)&p->aOp[p->nOp]; /* Memory available for allocation */
zEnd = (u8*)&p->aOp[pParse->nOpAlloc]; /* First byte past end of zCsr[] */
resolveP2Values(p, &nArg);
@@ -63323,7 +63323,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){
/* The complex case - There is a multi-file write-transaction active.
** This requires a master journal file to ensure the transaction is
- ** committed atomicly.
+ ** committed atomically.
*/
#ifndef SQLITE_OMIT_DISKIO
else{
@@ -65560,7 +65560,7 @@ SQLITE_API int sqlite3_value_type(sqlite3_value* pVal){
** The following routines are used by user-defined functions to specify
** the function result.
**
-** The setStrOrError() funtion calls sqlite3VdbeMemSetStr() to store the
+** The setStrOrError() function calls sqlite3VdbeMemSetStr() to store the
** result as a string or blob but if the string or blob is too large, it
** then sets the error code to SQLITE_TOOBIG
*/
@@ -65981,7 +65981,7 @@ SQLITE_API void *sqlite3_aggregate_context(sqlite3_context *p, int nByte){
}
/*
-** Return the auxilary data pointer, if any, for the iArg'th argument to
+** Return the auxiliary data pointer, if any, for the iArg'th argument to
** the user-function defined by pCtx.
*/
SQLITE_API void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
@@ -65996,7 +65996,7 @@ SQLITE_API void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
}
/*
-** Set the auxilary data pointer and delete function, for the iArg'th
+** Set the auxiliary data pointer and delete function, for the iArg'th
** argument to the user-function defined by pCtx. Any previous value is
** deleted by calling the delete function specified when it was set.
*/
@@ -75506,7 +75506,7 @@ SQLITE_PRIVATE int sqlite3MemJournalSize(void){
/*
** Walk an expression tree. Invoke the callback once for each node
-** of the expression, while decending. (In other words, the callback
+** of the expression, while descending. (In other words, the callback
** is invoked before visiting children.)
**
** The return value from the callback should be one of the WRC_*
@@ -77026,7 +77026,7 @@ SQLITE_PRIVATE int sqlite3ResolveExprNames(
/*
** Resolve all names in all expressions of a SELECT and in all
-** decendents of the SELECT, including compounds off of p->pPrior,
+** descendants of the SELECT, including compounds off of p->pPrior,
** subqueries in expressions, and subqueries used as FROM clause
** terms.
**
@@ -77119,7 +77119,7 @@ SQLITE_PRIVATE void sqlite3ResolveSelfReference(
** affinity of that column is returned. Otherwise, 0x00 is returned,
** indicating no affinity for the expression.
**
-** i.e. the WHERE clause expresssions in the following statements all
+** i.e. the WHERE clause expressions in the following statements all
** have an affinity:
**
** CREATE TABLE t1(a);
@@ -77835,7 +77835,7 @@ static int exprStructSize(Expr *p){
** Note that with flags==EXPRDUP_REDUCE, this routines works on full-size
** (unreduced) Expr objects as they or originally constructed by the parser.
** During expression analysis, extra information is computed and moved into
-** later parts of teh Expr object and that extra information might get chopped
+** later parts of the Expr object and that extra information might get chopped
** off if the expression is reduced. Note also that it does not work to
** make a EXPRDUP_REDUCE copy of a reduced expression. It is only legal
** to reduce a pristine expression tree from the parser. The implementation
@@ -81503,7 +81503,7 @@ static void renameParentFunc(
** ALTER TABLE command. The first argument is the text of a CREATE TRIGGER
** statement. The second is a table name. The table name in the CREATE
** TRIGGER statement is replaced with the third argument and the result
-** returned. This is analagous to renameTableFunc() above, except for CREATE
+** returned. This is analogous to renameTableFunc() above, except for CREATE
** TRIGGER, not CREATE INDEX and CREATE TABLE.
*/
static void renameTriggerFunc(
@@ -83682,7 +83682,7 @@ static void initAvgEq(Index *pIdx){
/* Set nSum to the number of distinct (iCol+1) field prefixes that
** occur in the stat4 table for this index before pFinal. Set
** sumEq to the sum of the nEq values for column iCol for the same
- ** set (adding the value only once where there exist dupicate
+ ** set (adding the value only once where there exist duplicate
** prefixes). */
for(i=0; i<(pIdx->nSample-1); i++){
if( aSample[i].anDLt[iCol]!=aSample[i+1].anDLt[iCol] ){
@@ -95333,7 +95333,7 @@ static int xferOptimization(
}
#endif
#ifndef SQLITE_OMIT_FOREIGN_KEY
- /* Disallow the transfer optimization if the destination table constains
+ /* Disallow the transfer optimization if the destination table contains
** any foreign key constraints. This is more restrictive than necessary.
** But the main beneficiary of the transfer optimization is the VACUUM
** command, and the VACUUM command disables foreign key constraints. So
@@ -96561,7 +96561,7 @@ static int sqlite3LoadExtension(
** entry point name "sqlite3_extension_init" was not found, then
** construct an entry point name "sqlite3_X_init" where the X is
** replaced by the lowercase value of every ASCII alphabetic
- ** character in the filename after the last "/" upto the first ".",
+ ** character in the filename after the last "/" up to the first ".",
** and eliding the first three characters if they are "lib".
** Examples:
**
@@ -101878,7 +101878,7 @@ static void generateWithRecursiveQuery(
int iQueue; /* The Queue table */
int iDistinct = 0; /* To ensure unique results if UNION */
int eDest = SRT_Table; /* How to write to Queue */
- SelectDest destQueue; /* SelectDest targetting the Queue table */
+ SelectDest destQueue; /* SelectDest targeting the Queue table */
int i; /* Loop counter */
int rc; /* Result code */
ExprList *pOrderBy; /* The ORDER BY clause */
@@ -102383,7 +102383,7 @@ multi_select_end:
/*
** Code an output subroutine for a coroutine implementation of a
-** SELECT statment.
+** SELECT statement.
**
** The data to be output is contained in pIn->iSdst. There are
** pIn->nSdst columns to be output. pDest is where the output should
@@ -103184,7 +103184,7 @@ static int flattenSubquery(
pSubSrc = pSub->pSrc;
assert( pSubSrc );
/* Prior to version 3.1.2, when LIMIT and OFFSET had to be simple constants,
- ** not arbitrary expresssions, we allowed some combining of LIMIT and OFFSET
+ ** not arbitrary expressions, we allowed some combining of LIMIT and OFFSET
** because they could be computed at compile-time. But when LIMIT and OFFSET
** became arbitrary expressions, we were forced to add restrictions (13)
** and (14). */
@@ -103570,7 +103570,7 @@ static u8 minMaxQuery(AggInfo *pAggInfo, ExprList **ppMinMax){
/*
** The select statement passed as the first argument is an aggregate query.
-** The second argment is the associated aggregate-info object. This
+** The second argument is the associated aggregate-info object. This
** function tests if the SELECT is of the form:
**
** SELECT count(*) FROM <tbl>
@@ -103903,7 +103903,7 @@ static void selectPopWith(Walker *pWalker, Select *p){
** without worrying about messing up the presistent representation
** of the view.
**
-** (3) Add terms to the WHERE clause to accomodate the NATURAL keyword
+** (3) Add terms to the WHERE clause to accommodate the NATURAL keyword
** on joins and the ON and USING clause of joins.
**
** (4) Scan the list of columns in the result set (pEList) looking
@@ -104871,7 +104871,7 @@ SQLITE_PRIVATE int sqlite3Select(
*/
if( pGroupBy ){
KeyInfo *pKeyInfo; /* Keying information for the group by clause */
- int j1; /* A-vs-B comparision jump */
+ int j1; /* A-vs-B comparison jump */
int addrOutputRow; /* Start of subroutine that outputs a result row */
int regOutputRow; /* Return address register for output subroutine */
int addrSetAbort; /* Set the abort flag and return */
@@ -107168,7 +107168,7 @@ SQLITE_PRIVATE void sqlite3Update(
}
/* Populate the array of registers beginning at regNew with the new
- ** row data. This array is used to check constaints, create the new
+ ** row data. This array is used to check constraints, create the new
** table and index records, and as the values for any new.* references
** made by triggers.
**
@@ -107542,7 +107542,7 @@ static int execExecSql(sqlite3 *db, char **pzErrMsg, const char *zSql){
** step (3) requires additional temporary disk space approximately equal
** to the size of the original database for the rollback journal.
** Hence, temporary disk space that is approximately 2x the size of the
-** orginal database is required. Every page of the database is written
+** original database is required. Every page of the database is written
** approximately 3 times: Once for step (2) and twice for step (3).
** Two writes per page are required in step (3) because the original
** database content must be written into the rollback journal prior to
@@ -109122,7 +109122,7 @@ static int whereLoopResize(sqlite3*, WhereLoop*, int);
** 1. Then using those as a basis to compute the N best WherePath objects
** of length 2. And so forth until the length of WherePaths equals the
** number of nodes in the FROM clause. The best (lowest cost) WherePath
-** at the end is the choosen query plan.
+** at the end is the chosen query plan.
*/
struct WherePath {
Bitmask maskLoop; /* Bitmask of all WhereLoop objects in this path */
@@ -110367,7 +110367,7 @@ static void exprAnalyzeOrTerm(
}
if( (chngToIN & getMask(&pWInfo->sMaskSet, pOrTerm->leftCursor))==0 ){
/* This term must be of the form t1.a==t2.b where t2 is in the
- ** chngToIN set but t1 is not. This term will be either preceeded
+ ** chngToIN set but t1 is not. This term will be either preceded
** or follwed by an inverted copy (t2.b==t1.a). Skip this term
** and use its inversion. */
testcase( pOrTerm->wtFlags & TERM_COPIED );
@@ -111396,7 +111396,7 @@ static void whereKeyStats(
** number of rows that the index scan is expected to visit without
** considering the range constraints. If nEq is 0, this is the number of
** rows in the index. Assuming no error occurs, *pnOut is adjusted (reduced)
-** to account for the range contraints pLower and pUpper.
+** to account for the range constraints pLower and pUpper.
**
** In the absence of sqlite_stat4 ANALYZE data, or if such data cannot be
** used, each range inequality reduces the search space by a factor of 4.
@@ -114067,7 +114067,7 @@ static int whereLoopAddAll(WhereLoopBuilder *pBuilder){
** strict. With GROUP BY and DISTINCT the only requirement is that
** equivalent rows appear immediately adjacent to one another. GROUP BY
** and DISTINT do not require rows to appear in any particular order as long
-** as equivelent rows are grouped together. Thus for GROUP BY and DISTINCT
+** as equivalent rows are grouped together. Thus for GROUP BY and DISTINCT
** the pOrderBy terms can be matched in any order. With ORDER BY, the
** pOrderBy terms must be matched in strict left-to-right order.
*/
@@ -119734,7 +119734,7 @@ SQLITE_PRIVATE const char sqlite3IsEbcdicIdChar[];
** a statement.
**
** (4) CREATE The keyword CREATE has been seen at the beginning of a
-** statement, possibly preceeded by EXPLAIN and/or followed by
+** statement, possibly preceded by EXPLAIN and/or followed by
** TEMP or TEMPORARY
**
** (5) TRIGGER We are in the middle of a trigger definition that must be
@@ -119787,7 +119787,7 @@ SQLITE_API int sqlite3_complete(const char *zSql){
};
#else
/* If triggers are not supported by this compile then the statement machine
- ** used to detect the end of a statement is much simplier
+ ** used to detect the end of a statement is much simpler
*/
static const u8 trans[3][3] = {
/* Token: */
@@ -124622,7 +124622,7 @@ struct Fts3Table {
#endif
#ifdef SQLITE_TEST
- /* True to disable the incremental doclist optimization. This is controled
+ /* True to disable the incremental doclist optimization. This is controlled
** by special insert command 'test-no-incr-doclist'. */
int bNoIncrDoclist;
#endif
@@ -124665,7 +124665,7 @@ struct Fts3Cursor {
/*
** The Fts3Cursor.eSearch member is always set to one of the following.
-** Actualy, Fts3Cursor.eSearch can be greater than or equal to
+** Actually, Fts3Cursor.eSearch can be greater than or equal to
** FTS3_FULLTEXT_SEARCH. If so, then Fts3Cursor.eSearch - 2 is the index
** of the column to be searched. For example, in
**
@@ -132785,7 +132785,7 @@ static const char cType[] = {
**
** In these routine, the letters are in reverse order. So the 'y' rule
** is that 'y' is a consonant unless it is followed by another
-** consonent.
+** consonant.
*/
static int isVowel(const char*);
static int isConsonant(const char *z){
@@ -132881,7 +132881,7 @@ static int doubleConsonant(const char *z){
/*
** Return TRUE if the word ends with three letters which
-** are consonant-vowel-consonent and where the final consonant
+** are consonant-vowel-consonant and where the final consonant
** is not 'w', 'x', or 'y'.
**
** The word is reversed here. So we are really checking the
@@ -132897,7 +132897,7 @@ static int star_oh(const char *z){
/*
** If the word ends with zFrom and xCond() is true for the stem
-** of the word that preceeds the zFrom ending, then change the
+** of the word that precedes the zFrom ending, then change the
** ending to zTo.
**
** The input word *pz and zFrom are both in reverse order. zTo
@@ -139692,7 +139692,7 @@ SQLITE_PRIVATE int sqlite3Fts3DeferToken(
/*
** SQLite value pRowid contains the rowid of a row that may or may not be
** present in the FTS3 table. If it is, delete it and adjust the contents
-** of subsiduary data structures accordingly.
+** of subsidiary data structures accordingly.
*/
static int fts3DeleteByRowid(
Fts3Table *p,
@@ -140399,7 +140399,7 @@ static int fts3StringAppend(
}
/* If there is insufficient space allocated at StrBuffer.z, use realloc()
- ** to grow the buffer until so that it is big enough to accomadate the
+ ** to grow the buffer until so that it is big enough to accommodate the
** appended data.
*/
if( pStr->n+nAppend+1>=pStr->nAlloc ){
@@ -141300,7 +141300,7 @@ SQLITE_PRIVATE void sqlite3Fts3Offsets(
sCtx.iTerm = 0;
(void)fts3ExprIterate(pCsr->pExpr, fts3ExprTermOffsetInit, (void *)&sCtx);
- /* Retreive the text stored in column iCol. If an SQL NULL is stored
+ /* Retrieve the text stored in column iCol. If an SQL NULL is stored
** in column iCol, jump immediately to the next iteration of the loop.
** If an OOM occurs while retrieving the data (this can happen if SQLite
** needs to transform the data from utf-16 to utf-8), return SQLITE_NOMEM
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index a168069cfb..9ffe0fe14e 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -549,12 +549,9 @@ ZEND_END_ARG_INFO()
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_ARG_INFO(ZEND_SEND_PREFER_REF, sort_order)
+ ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, sort_flags)
+ ZEND_ARG_VARIADIC_INFO(ZEND_SEND_PREFER_REF, arr2)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_rand, 0, 0, 1)
@@ -4114,13 +4111,17 @@ PHP_FUNCTION(putenv)
if (putenv(pe.putenv_string) == 0) { /* success */
# else
error_code = SetEnvironmentVariable(pe.key, value);
-# if _MSC_VER < 1500
- /* Yet another VC6 bug, unset may return env not found */
- if (error_code != 0 ||
- (error_code == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND)) {
-# else
- if (error_code != 0) { /* success */
-# endif
+
+ if (error_code != 0
+# ifndef ZTS
+ /* We need both SetEnvironmentVariable and _putenv here as some
+ dependency lib could use either way to read the environment.
+ Obviously the CRT version will be useful more often. But
+ generally, doing both brings us on the safe track at least
+ in NTS build. */
+ && _putenv(pe.putenv_string) == 0
+# endif
+ ) { /* success */
# endif
#endif
zend_hash_str_add_mem(&BG(putenv_ht), pe.key, pe.key_len, &pe, sizeof(putenv_entry));
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index b0be40ee35..b13f47be69 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -517,7 +517,7 @@ no_results:
continue;
}
}
- /* we need to do this everytime since GLOB_ONLYDIR does not guarantee that
+ /* we need to do this every time since GLOB_ONLYDIR does not guarantee that
* all directories will be filtered. GNU libc documentation states the
* following:
* If the information about the type of the file is easily available
diff --git a/ext/standard/html_tables/ents_html401.txt b/ext/standard/html_tables/ents_html401.txt
index 7e1564b229..bd3ded9fde 100644
--- a/ext/standard/html_tables/ents_html401.txt
+++ b/ext/standard/html_tables/ents_html401.txt
@@ -1,4 +1,4 @@
-#039 0027 //artifical; there's no &apos; in HTML 4.01
+#039 0027 //artificial; there's no &apos; in HTML 4.01
nbsp 00A0
iexcl 00A1
cent 00A2
diff --git a/ext/standard/image.c b/ext/standard/image.c
index 54159e3785..adeb1c5be6 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -461,7 +461,7 @@ static int php_read_APP(php_stream * stream, unsigned int marker, zval *info TSR
snprintf(markername, sizeof(markername), "APP%d", marker - M_APP0);
if ((tmp = zend_hash_str_find(Z_ARRVAL_P(info), markername, strlen(markername))) == NULL) {
- /* XXX we onyl catch the 1st tag of it's kind! */
+ /* XXX we only catch the 1st tag of it's kind! */
add_assoc_stringl(info, markername, buffer, length);
}
@@ -533,7 +533,7 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_D
case M_APP14:
case M_APP15:
if (info) {
- if (!php_read_APP(stream, marker, info TSRMLS_CC)) { /* read all the app markes... */
+ if (!php_read_APP(stream, marker, info TSRMLS_CC)) { /* read all the app marks... */
return result;
}
} else {
diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h
index 23225cdc42..a4df8f51f9 100644
--- a/ext/standard/php_var.h
+++ b/ext/standard/php_var.h
@@ -57,6 +57,7 @@ PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t
PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC);
PHPAPI int php_var_unserialize_ref(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC);
PHPAPI int php_var_unserialize_intern(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC);
+PHPAPI int php_var_unserialize_ex(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash, HashTable *classes TSRMLS_DC);
#define PHP_VAR_SERIALIZE_INIT(d) \
do { \
diff --git a/ext/standard/scanf.h b/ext/standard/scanf.h
index ddb9803512..6d9e8a443c 100644
--- a/ext/standard/scanf.h
+++ b/ext/standard/scanf.h
@@ -23,7 +23,7 @@
#define SCAN_MAX_ARGS 0xFF /* Maximum number of variable which can be */
- /* passed to (f|s)scanf. This is an artifical */
+ /* passed to (f|s)scanf. This is an artificial */
/* upper limit to keep resources in check and */
/* minimize the possibility of exploits */
diff --git a/ext/standard/tests/serialize/serialization_error_001.phpt b/ext/standard/tests/serialize/serialization_error_001.phpt
index da6f50cc02..014128b19f 100644
--- a/ext/standard/tests/serialize/serialization_error_001.phpt
+++ b/ext/standard/tests/serialize/serialization_error_001.phpt
@@ -21,7 +21,7 @@ var_dump( unserialize() );
//Test serialize with one more than the expected number of arguments
var_dump( serialize(1,2) );
-var_dump( unserialize(1,2) );
+var_dump( unserialize(1,2,3) );
echo "Done";
?>
@@ -31,12 +31,12 @@ echo "Done";
Warning: serialize() expects exactly 1 parameter, 0 given in %s on line 16
NULL
-Warning: unserialize() expects exactly 1 parameter, 0 given in %s on line 17
+Warning: unserialize() expects at least 1 parameter, 0 given in %s on line 17
bool(false)
Warning: serialize() expects exactly 1 parameter, 2 given in %s on line 20
NULL
-Warning: unserialize() expects exactly 1 parameter, 2 given in %s on line 21
+Warning: unserialize() expects at most 2 parameters, 3 given in %s on line 21
bool(false)
Done
diff --git a/ext/standard/tests/serialize/unserialize_classes.phpt b/ext/standard/tests/serialize/unserialize_classes.phpt
new file mode 100644
index 0000000000..2a9d8a743c
--- /dev/null
+++ b/ext/standard/tests/serialize/unserialize_classes.phpt
@@ -0,0 +1,88 @@
+--TEST--
+Test unserialize() with second parameter
+--FILE--
+<?php
+class foo {
+ public $x = "bar";
+}
+$z = array(new foo(), 2, "3");
+$s = serialize($z);
+
+var_dump(unserialize($s));
+var_dump(unserialize($s, ["allowed_classes" => false]));
+var_dump(unserialize($s, ["allowed_classes" => true]));
+var_dump(unserialize($s, ["allowed_classes" => ["bar"]]));
+var_dump(unserialize($s, ["allowed_classes" => ["FOO"]]));
+var_dump(unserialize($s, ["allowed_classes" => ["bar", "foO"]]));
+
+--EXPECTF--
+array(3) {
+ [0]=>
+ object(foo)#%d (1) {
+ ["x"]=>
+ string(3) "bar"
+ }
+ [1]=>
+ int(2)
+ [2]=>
+ string(1) "3"
+}
+array(3) {
+ [0]=>
+ object(__PHP_Incomplete_Class)#%d (2) {
+ ["__PHP_Incomplete_Class_Name"]=>
+ string(3) "foo"
+ ["x"]=>
+ string(3) "bar"
+ }
+ [1]=>
+ int(2)
+ [2]=>
+ string(1) "3"
+}
+array(3) {
+ [0]=>
+ object(foo)#%d (1) {
+ ["x"]=>
+ string(3) "bar"
+ }
+ [1]=>
+ int(2)
+ [2]=>
+ string(1) "3"
+}
+array(3) {
+ [0]=>
+ object(__PHP_Incomplete_Class)#%d (2) {
+ ["__PHP_Incomplete_Class_Name"]=>
+ string(3) "foo"
+ ["x"]=>
+ string(3) "bar"
+ }
+ [1]=>
+ int(2)
+ [2]=>
+ string(1) "3"
+}
+array(3) {
+ [0]=>
+ object(foo)#%d (1) {
+ ["x"]=>
+ string(3) "bar"
+ }
+ [1]=>
+ int(2)
+ [2]=>
+ string(1) "3"
+}
+array(3) {
+ [0]=>
+ object(foo)#%d (1) {
+ ["x"]=>
+ string(3) "bar"
+ }
+ [1]=>
+ int(2)
+ [2]=>
+ string(1) "3"
+}
diff --git a/ext/standard/tests/strings/addcslashes_005.phpt b/ext/standard/tests/strings/addcslashes_005.phpt
new file mode 100644
index 0000000000..f0b2fbcecb
--- /dev/null
+++ b/ext/standard/tests/strings/addcslashes_005.phpt
@@ -0,0 +1,12 @@
+--TEST--
+addcslashes(); function test with warning
+--CREDITS--
+ marcosptf - <marcosptf@yahoo.com.br>
+#phptestfest PHPSP on Google - Sao Paulo - Brazil - 2014-06-05
+--FILE--
+<?php
+echo addcslashes("zoo['.']","z..A");
+?>
+--EXPECTF--
+Warning: addcslashes(): Invalid '..'-range, '..'-range needs to be incrementing in %s on line %d
+\zoo['\.']
diff --git a/ext/standard/tests/strings/bin2hex_001.phpt b/ext/standard/tests/strings/bin2hex_001.phpt
new file mode 100644
index 0000000000..e73500a30e
--- /dev/null
+++ b/ext/standard/tests/strings/bin2hex_001.phpt
@@ -0,0 +1,11 @@
+--TEST--
+bin2hex(); function test
+--CREDITS--
+marcosptf - <marcosptf@yahoo.com.br>
+#phptestfest PHPSP on Google - Sao Paulo - Brazil - 2014-06-05
+--FILE--
+<?php
+echo bin2hex("123456");
+?>
+--EXPECT--
+313233343536
diff --git a/ext/standard/tests/strings/sprintf_variation34.phpt b/ext/standard/tests/strings/sprintf_variation34.phpt
index c6186b6780..8a5cd809d6 100644
--- a/ext/standard/tests/strings/sprintf_variation34.phpt
+++ b/ext/standard/tests/strings/sprintf_variation34.phpt
@@ -29,8 +29,8 @@ $integer_values = array(
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/tests/strings/sprintf_variation40_64bit.phpt b/ext/standard/tests/strings/sprintf_variation40_64bit.phpt
index da6f37ace4..029e94c782 100644
--- a/ext/standard/tests/strings/sprintf_variation40_64bit.phpt
+++ b/ext/standard/tests/strings/sprintf_variation40_64bit.phpt
@@ -25,8 +25,8 @@ $integer_values = array(
0Xfff,
0XFA,
-0x80000000, // max negative integer as hexadecimal
- 0x7fffffff, // max postive integer as hexadecimal
- 0x7FFFFFFF, // max postive integer as hexadecimal
+ 0x7fffffff, // max positive integer as hexadecimal
+ 0x7FFFFFFF, // max positive integer as hexadecimal
0123, // integer as octal
01912, // should be quivalent to octal 1
-020000000000, // max negative integer as octal
diff --git a/ext/standard/var.c b/ext/standard/var.c
index 4f0bd24bdc..24bdd385a5 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -990,7 +990,7 @@ PHP_FUNCTION(serialize)
}
/* }}} */
-/* {{{ proto mixed unserialize(string variable_representation)
+/* {{{ proto mixed unserialize(string variable_representation[, bool|array allowed_classes])
Takes a string representation of variable and recreates it */
PHP_FUNCTION(unserialize)
{
@@ -998,8 +998,10 @@ PHP_FUNCTION(unserialize)
size_t buf_len;
const unsigned char *p;
php_unserialize_data_t var_hash;
+ zval *options = NULL, *classes = NULL;
+ HashTable *class_hash = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a", &buf, &buf_len, &options) == FAILURE) {
RETURN_FALSE;
}
@@ -1009,8 +1011,32 @@ PHP_FUNCTION(unserialize)
p = (const unsigned char*) buf;
PHP_VAR_UNSERIALIZE_INIT(var_hash);
- if (!php_var_unserialize(return_value, &p, p + buf_len, &var_hash TSRMLS_CC)) {
+ if(options != NULL) {
+ classes = zend_hash_str_find(Z_ARRVAL_P(options), "allowed_classes", sizeof("allowed_classes")-1);
+ if(classes && (Z_TYPE_P(classes) == IS_ARRAY || !zend_is_true(classes TSRMLS_CC))) {
+ ALLOC_HASHTABLE(class_hash);
+ zend_hash_init(class_hash, (Z_TYPE_P(classes) == IS_ARRAY)?zend_hash_num_elements(Z_ARRVAL_P(classes)):0, NULL, NULL, 0);
+ }
+ if(class_hash && Z_TYPE_P(classes) == IS_ARRAY) {
+ zval *entry;
+ zend_string *lcname;
+
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(classes), entry) {
+ convert_to_string_ex(entry);
+ lcname = zend_string_alloc(Z_STRLEN_P(entry), 0);
+ zend_str_tolower_copy(lcname->val, Z_STRVAL_P(entry), Z_STRLEN_P(entry));
+ zend_hash_add_empty_element(class_hash, lcname);
+ zend_string_release(lcname);
+ } ZEND_HASH_FOREACH_END();
+ }
+ }
+
+ if (!php_var_unserialize_ex(return_value, &p, p + buf_len, &var_hash, class_hash TSRMLS_CC)) {
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
+ if(class_hash) {
+ zend_hash_destroy(class_hash);
+ FREE_HASHTABLE(class_hash);
+ }
zval_dtor(return_value);
if (!EG(exception)) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset " ZEND_LONG_FMT " of %d bytes", (zend_long)((char*)p - buf), buf_len);
@@ -1018,6 +1044,10 @@ PHP_FUNCTION(unserialize)
RETURN_FALSE;
}
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
+ if(class_hash) {
+ zend_hash_destroy(class_hash);
+ FREE_HASHTABLE(class_hash);
+ }
}
/* }}} */
diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c
index c7641b1334..d8b94e75cc 100644
--- a/ext/standard/var_unserializer.c
+++ b/ext/standard/var_unserializer.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 */
+/* Generated by re2c 0.13.7.5 */
#line 1 "ext/standard/var_unserializer.re"
/*
+----------------------------------------------------------------------+
@@ -226,6 +226,26 @@ static zend_string *unserialize_str(const unsigned char **p, size_t len, size_t
return str;
}
+static inline int unserialize_allowed_class(zend_string *class_name, HashTable *classes)
+{
+ zend_string *lcname;
+ int res;
+ ALLOCA_FLAG(use_heap)
+
+ if(classes == NULL) {
+ return 1;
+ }
+ if(!zend_hash_num_elements(classes)) {
+ return 0;
+ }
+
+ STR_ALLOCA_ALLOC(lcname, class_name->len, use_heap);
+ zend_str_tolower_copy(lcname->val, class_name->val, class_name->len);
+ res = zend_hash_exists(classes, lcname);
+ STR_ALLOCA_FREE(lcname, use_heap);
+ return res;
+}
+
#define YYFILL(n) do { } while (0)
#define YYCTYPE unsigned char
#define YYCURSOR cursor
@@ -233,7 +253,7 @@ static zend_string *unserialize_str(const unsigned char **p, size_t len, size_t
#define YYMARKER marker
-#line 241 "ext/standard/var_unserializer.re"
+#line 261 "ext/standard/var_unserializer.re"
@@ -293,8 +313,8 @@ static inline size_t parse_uiv(const unsigned char *p)
return result;
}
-#define UNSERIALIZE_PARAMETER zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC
-#define UNSERIALIZE_PASSTHRU rval, p, max, var_hash TSRMLS_CC
+#define UNSERIALIZE_PARAMETER zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash, HashTable *classes TSRMLS_DC
+#define UNSERIALIZE_PASSTHRU rval, p, max, var_hash, classes TSRMLS_CC
static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend_long elements, int objprops)
{
@@ -302,7 +322,8 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend
zval key, *data, d, *old_data;
ZVAL_UNDEF(&key);
- if (!php_var_unserialize(&key, p, max, NULL TSRMLS_CC)) {
+
+ if (!php_var_unserialize_ex(&key, p, max, NULL, classes TSRMLS_CC)) {
zval_dtor(&key);
return 0;
}
@@ -354,7 +375,7 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend
zval_dtor(&key);
- if (!php_var_unserialize(data, p, max, var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize_ex(data, p, max, var_hash, classes TSRMLS_CC)) {
return 0;
}
@@ -462,7 +483,14 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements)
# pragma optimize("", on)
#endif
-PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
+PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC)
+{
+ HashTable *classes = NULL;
+ return php_var_unserialize_ex(UNSERIALIZE_PASSTHRU);
+}
+
+
+PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER)
{
const unsigned char *cursor, *limit, *marker, *start;
zval *rval_ref;
@@ -481,7 +509,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
start = cursor;
-#line 485 "ext/standard/var_unserializer.c"
+#line 513 "ext/standard/var_unserializer.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -541,9 +569,9 @@ yy2:
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy95;
yy3:
-#line 826 "ext/standard/var_unserializer.re"
+#line 860 "ext/standard/var_unserializer.re"
{ return 0; }
-#line 547 "ext/standard/var_unserializer.c"
+#line 575 "ext/standard/var_unserializer.c"
yy4:
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy89;
@@ -586,13 +614,13 @@ yy13:
goto yy3;
yy14:
++YYCURSOR;
-#line 820 "ext/standard/var_unserializer.re"
+#line 854 "ext/standard/var_unserializer.re"
{
/* this is the case where we have less data than planned */
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data");
return 0; /* not sure if it should be 0 or 1 here? */
}
-#line 596 "ext/standard/var_unserializer.c"
+#line 624 "ext/standard/var_unserializer.c"
yy16:
yych = *++YYCURSOR;
goto yy3;
@@ -618,11 +646,12 @@ yy20:
if (yybm[0+yych] & 128) {
goto yy20;
}
- if (yych != ':') goto yy18;
+ if (yych <= '/') goto yy18;
+ if (yych >= ';') goto yy18;
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 681 "ext/standard/var_unserializer.re"
+#line 709 "ext/standard/var_unserializer.re"
{
size_t len, len2, len3, maxlen;
zend_long elements;
@@ -672,6 +701,12 @@ yy20:
class_name = zend_string_init(str, len, 0);
do {
+ if(!unserialize_allowed_class(class_name, classes)) {
+ incomplete_class = 1;
+ ce = PHP_IC_ENTRY;
+ break;
+ }
+
/* Try to find class directly */
BG(serialize_lock)++;
ce = zend_lookup_class(class_name TSRMLS_CC);
@@ -761,7 +796,7 @@ yy20:
return object_common2(UNSERIALIZE_PASSTHRU, elements);
}
-#line 765 "ext/standard/var_unserializer.c"
+#line 800 "ext/standard/var_unserializer.c"
yy25:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -786,7 +821,7 @@ yy27:
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 673 "ext/standard/var_unserializer.re"
+#line 701 "ext/standard/var_unserializer.re"
{
//??? INIT_PZVAL(rval);
@@ -794,7 +829,7 @@ yy27:
return object_common2(UNSERIALIZE_PASSTHRU,
object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR));
}
-#line 798 "ext/standard/var_unserializer.c"
+#line 833 "ext/standard/var_unserializer.c"
yy32:
yych = *++YYCURSOR;
if (yych == '+') goto yy33;
@@ -815,7 +850,7 @@ yy34:
yych = *++YYCURSOR;
if (yych != '{') goto yy18;
++YYCURSOR;
-#line 652 "ext/standard/var_unserializer.re"
+#line 680 "ext/standard/var_unserializer.re"
{
zend_long elements = parse_iv(start + 2);
/* use iv() not uiv() in order to check data range */
@@ -836,7 +871,7 @@ yy34:
return finish_nested_data(UNSERIALIZE_PASSTHRU);
}
-#line 840 "ext/standard/var_unserializer.c"
+#line 875 "ext/standard/var_unserializer.c"
yy39:
yych = *++YYCURSOR;
if (yych == '+') goto yy40;
@@ -857,7 +892,7 @@ yy41:
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 624 "ext/standard/var_unserializer.re"
+#line 652 "ext/standard/var_unserializer.re"
{
size_t len, maxlen;
zend_string *str;
@@ -885,7 +920,7 @@ yy41:
ZVAL_STR(rval, str);
return 1;
}
-#line 889 "ext/standard/var_unserializer.c"
+#line 924 "ext/standard/var_unserializer.c"
yy46:
yych = *++YYCURSOR;
if (yych == '+') goto yy47;
@@ -906,7 +941,7 @@ yy48:
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 597 "ext/standard/var_unserializer.re"
+#line 625 "ext/standard/var_unserializer.re"
{
size_t len, maxlen;
char *str;
@@ -933,7 +968,7 @@ yy48:
ZVAL_STRINGL(rval, str, len);
return 1;
}
-#line 937 "ext/standard/var_unserializer.c"
+#line 972 "ext/standard/var_unserializer.c"
yy53:
yych = *++YYCURSOR;
if (yych <= '/') {
@@ -1021,7 +1056,7 @@ yy61:
}
yy63:
++YYCURSOR;
-#line 588 "ext/standard/var_unserializer.re"
+#line 616 "ext/standard/var_unserializer.re"
{
#if SIZEOF_ZEND_LONG == 4
use_double:
@@ -1030,7 +1065,7 @@ use_double:
ZVAL_DOUBLE(rval, zend_strtod((const char *)start + 2, NULL));
return 1;
}
-#line 1034 "ext/standard/var_unserializer.c"
+#line 1069 "ext/standard/var_unserializer.c"
yy65:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1089,7 +1124,7 @@ yy73:
yych = *++YYCURSOR;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 572 "ext/standard/var_unserializer.re"
+#line 600 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
@@ -1105,7 +1140,7 @@ yy73:
return 1;
}
-#line 1109 "ext/standard/var_unserializer.c"
+#line 1144 "ext/standard/var_unserializer.c"
yy76:
yych = *++YYCURSOR;
if (yych == 'N') goto yy73;
@@ -1132,7 +1167,7 @@ yy79:
if (yych <= '9') goto yy79;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 546 "ext/standard/var_unserializer.re"
+#line 574 "ext/standard/var_unserializer.re"
{
#if SIZEOF_ZEND_LONG == 4
int digits = YYCURSOR - start - 3;
@@ -1158,7 +1193,7 @@ yy79:
ZVAL_LONG(rval, parse_iv(start + 2));
return 1;
}
-#line 1162 "ext/standard/var_unserializer.c"
+#line 1197 "ext/standard/var_unserializer.c"
yy83:
yych = *++YYCURSOR;
if (yych <= '/') goto yy18;
@@ -1166,22 +1201,22 @@ yy83:
yych = *++YYCURSOR;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 540 "ext/standard/var_unserializer.re"
+#line 568 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
ZVAL_BOOL(rval, parse_iv(start + 2));
return 1;
}
-#line 1176 "ext/standard/var_unserializer.c"
+#line 1211 "ext/standard/var_unserializer.c"
yy87:
++YYCURSOR;
-#line 534 "ext/standard/var_unserializer.re"
+#line 562 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
ZVAL_NULL(rval);
return 1;
}
-#line 1185 "ext/standard/var_unserializer.c"
+#line 1220 "ext/standard/var_unserializer.c"
yy89:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1204,7 +1239,7 @@ yy91:
if (yych <= '9') goto yy91;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 511 "ext/standard/var_unserializer.re"
+#line 539 "ext/standard/var_unserializer.re"
{
zend_long id;
@@ -1227,7 +1262,7 @@ yy91:
return 1;
}
-#line 1231 "ext/standard/var_unserializer.c"
+#line 1266 "ext/standard/var_unserializer.c"
yy95:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1250,7 +1285,7 @@ yy97:
if (yych <= '9') goto yy97;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 489 "ext/standard/var_unserializer.re"
+#line 517 "ext/standard/var_unserializer.re"
{
zend_long id;
@@ -1272,9 +1307,9 @@ yy97:
return 1;
}
-#line 1276 "ext/standard/var_unserializer.c"
+#line 1311 "ext/standard/var_unserializer.c"
}
-#line 828 "ext/standard/var_unserializer.re"
+#line 862 "ext/standard/var_unserializer.re"
return 0;
diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re
index b8c65b7c4b..7e0dc314d6 100644
--- a/ext/standard/var_unserializer.re
+++ b/ext/standard/var_unserializer.re
@@ -224,6 +224,26 @@ static zend_string *unserialize_str(const unsigned char **p, size_t len, size_t
return str;
}
+static inline int unserialize_allowed_class(zend_string *class_name, HashTable *classes)
+{
+ zend_string *lcname;
+ int res;
+ ALLOCA_FLAG(use_heap)
+
+ if(classes == NULL) {
+ return 1;
+ }
+ if(!zend_hash_num_elements(classes)) {
+ return 0;
+ }
+
+ STR_ALLOCA_ALLOC(lcname, class_name->len, use_heap);
+ zend_str_tolower_copy(lcname->val, class_name->val, class_name->len);
+ res = zend_hash_exists(classes, lcname);
+ STR_ALLOCA_FREE(lcname, use_heap);
+ return res;
+}
+
#define YYFILL(n) do { } while (0)
#define YYCTYPE unsigned char
#define YYCURSOR cursor
@@ -297,8 +317,8 @@ static inline size_t parse_uiv(const unsigned char *p)
return result;
}
-#define UNSERIALIZE_PARAMETER zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC
-#define UNSERIALIZE_PASSTHRU rval, p, max, var_hash TSRMLS_CC
+#define UNSERIALIZE_PARAMETER zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash, HashTable *classes TSRMLS_DC
+#define UNSERIALIZE_PASSTHRU rval, p, max, var_hash, classes TSRMLS_CC
static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend_long elements, int objprops)
{
@@ -306,7 +326,8 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend
zval key, *data, d, *old_data;
ZVAL_UNDEF(&key);
- if (!php_var_unserialize(&key, p, max, NULL TSRMLS_CC)) {
+
+ if (!php_var_unserialize_ex(&key, p, max, NULL, classes TSRMLS_CC)) {
zval_dtor(&key);
return 0;
}
@@ -358,7 +379,7 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend
zval_dtor(&key);
- if (!php_var_unserialize(data, p, max, var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize_ex(data, p, max, var_hash, classes TSRMLS_CC)) {
return 0;
}
@@ -466,7 +487,14 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements)
# pragma optimize("", on)
#endif
-PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
+PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC)
+{
+ HashTable *classes = NULL;
+ return php_var_unserialize_ex(UNSERIALIZE_PASSTHRU);
+}
+
+
+PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER)
{
const unsigned char *cursor, *limit, *marker, *start;
zval *rval_ref;
@@ -727,6 +755,12 @@ object ":" uiv ":" ["] {
class_name = zend_string_init(str, len, 0);
do {
+ if(!unserialize_allowed_class(class_name, classes)) {
+ incomplete_class = 1;
+ ce = PHP_IC_ENTRY;
+ break;
+ }
+
/* Try to find class directly */
BG(serialize_lock)++;
ce = zend_lookup_class(class_name TSRMLS_CC);
diff --git a/ext/xmlrpc/libxmlrpc/xml_to_soap.c b/ext/xmlrpc/libxmlrpc/xml_to_soap.c
index ac103e0616..61f9834e9d 100644
--- a/ext/xmlrpc/libxmlrpc/xml_to_soap.c
+++ b/ext/xmlrpc/libxmlrpc/xml_to_soap.c
@@ -243,7 +243,7 @@ XMLRPC_VALUE xml_element_to_SOAP_REQUEST_worker(XMLRPC_REQUEST request,
xCurrent = XMLRPC_CreateValueEmpty();
}
- /* increment recursion depth guage */
+ /* increment recursion depth gauge */
depth ++;
/* safety first. must have a valid element */
diff --git a/ext/xmlwriter/tests/011.phpt b/ext/xmlwriter/tests/011.phpt
new file mode 100644
index 0000000000..51861673a1
--- /dev/null
+++ b/ext/xmlwriter/tests/011.phpt
@@ -0,0 +1,35 @@
+--TEST--
+XMLWriter: libxml2 XML Writer, write_attribute_ns function
+--CREDITS--
+Mauricio Vieira <mauricio [at] @mauriciovieira [dot] net>
+#testfest PHPSP on 2014-07-05
+--SKIPIF--
+<?php
+if (!extension_loaded("xmlwriter")) die("skip");
+if (LIBXML_VERSION < 20617) die("skip: libxml2 2.6.17+ required");
+?>
+--FILE--
+<?php
+/* $Id$ */
+
+$xw = xmlwriter_open_memory();
+xmlwriter_set_indent($xw, TRUE);
+xmlwriter_set_indent_string($xw, ' ');
+xmlwriter_start_document($xw, '1.0', "UTF-8");
+xmlwriter_start_element($xw, 'root');
+xmlwriter_start_element_ns($xw, 'ns1', 'child1', 'urn:ns1');
+xmlwriter_write_attribute_ns($xw, 'ns1','att1', 'urn:ns1', '<>"\'&');
+xmlwriter_write_element($xw, 'chars', "special characters: <>\"'&");
+xmlwriter_end_element($xw);
+xmlwriter_end_document($xw);
+// Force to write and empty the buffer
+$output = xmlwriter_flush($xw, true);
+print $output;
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+ <ns1:child1 ns1:att1="&lt;&gt;&quot;'&amp;" xmlns:ns1="urn:ns1">
+ <chars>special characters: &lt;&gt;&quot;'&amp;</chars>
+ </ns1:child1>
+</root>
diff --git a/ext/xmlwriter/tests/012.phpt b/ext/xmlwriter/tests/012.phpt
new file mode 100644
index 0000000000..b6a4ad8c56
--- /dev/null
+++ b/ext/xmlwriter/tests/012.phpt
@@ -0,0 +1,38 @@
+--TEST--
+XMLWriter: libxml2 XML Writer, full_end_element function
+--CREDITS--
+Mauricio Vieira <mauricio [at] @mauriciovieira [dot] net>
+#testfest PHPSP on 2014-07-05
+--SKIPIF--
+<?php
+if (!extension_loaded("xmlwriter")) die("skip");
+if (LIBXML_VERSION < 20617) die("skip: libxml2 2.6.17+ required");
+?>
+--FILE--
+<?php
+/* $Id$ */
+
+$xw = xmlwriter_open_memory();
+xmlwriter_set_indent($xw, TRUE);
+xmlwriter_set_indent_string($xw, ' ');
+xmlwriter_start_document($xw, '1.0', "UTF-8");
+xmlwriter_start_element($xw, 'root');
+xmlwriter_start_element_ns($xw, 'ns1', 'child1', 'urn:ns1');
+xmlwriter_write_attribute_ns($xw, 'ns1','att1', 'urn:ns1', '<>"\'&');
+xmlwriter_write_element($xw, 'chars', "special characters: <>\"'&");
+xmlwriter_end_element($xw);
+xmlwriter_start_element($xw, 'empty');
+xmlwriter_full_end_element($xw);
+xmlwriter_full_end_element($xw);
+// Force to write and empty the buffer
+$output = xmlwriter_flush($xw, true);
+print $output;
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+ <ns1:child1 ns1:att1="&lt;&gt;&quot;'&amp;" xmlns:ns1="urn:ns1">
+ <chars>special characters: &lt;&gt;&quot;'&amp;</chars>
+ </ns1:child1>
+ <empty></empty>
+</root>
diff --git a/ext/xmlwriter/tests/OO_010.phpt b/ext/xmlwriter/tests/OO_010.phpt
new file mode 100644
index 0000000000..d4444bafe8
--- /dev/null
+++ b/ext/xmlwriter/tests/OO_010.phpt
@@ -0,0 +1,36 @@
+--TEST--
+XMLWriter: libxml2 XML Writer, writeAttributeNS method
+--CREDITS--
+Mauricio Vieira <mauricio [at] @mauriciovieira [dot] net>
+#testfest PHPSP on 2014-07-05
+--SKIPIF--
+<?php
+if (!extension_loaded("xmlwriter")) die("skip");
+if (LIBXML_VERSION < 20617) die("skip: libxml2 2.6.17+ required");
+?>
+--FILE--
+<?php
+/* $Id$ */
+
+$xw = new XMLWriter();
+$xw->openMemory();
+$xw->setIndent(TRUE);
+$xw->setIndentString(' ');
+$xw->startDocument('1.0', "UTF-8");
+$xw->startElement('root');
+$xw->startElementNS('ns1', 'child1', 'urn:ns1');
+$xw->writeAttributeNS('ns1', 'att1', 'urn:ns1', '<>"\'&');
+$xw->writeElement('chars', "special characters: <>\"'&");
+$xw->endElement();
+$xw->endDocument();
+// Force to write and empty the buffer
+$output = $xw->flush(true);
+print $output;
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+ <ns1:child1 ns1:att1="&lt;&gt;&quot;'&amp;" xmlns:ns1="urn:ns1">
+ <chars>special characters: &lt;&gt;&quot;'&amp;</chars>
+ </ns1:child1>
+</root>
diff --git a/ext/xmlwriter/tests/OO_011.phpt b/ext/xmlwriter/tests/OO_011.phpt
new file mode 100644
index 0000000000..0407e1b05f
--- /dev/null
+++ b/ext/xmlwriter/tests/OO_011.phpt
@@ -0,0 +1,39 @@
+--TEST--
+XMLWriter: libxml2 XML Writer, fullEndElement method
+--CREDITS--
+Mauricio Vieira <mauricio [at] @mauriciovieira [dot] net>
+#testfest PHPSP on 2014-07-05
+--SKIPIF--
+<?php
+if (!extension_loaded("xmlwriter")) die("skip");
+if (LIBXML_VERSION < 20617) die("skip: libxml2 2.6.17+ required");
+?>
+--FILE--
+<?php
+/* $Id$ */
+
+$xw = new XMLWriter();
+$xw->openMemory();
+$xw->setIndent(TRUE);
+$xw->setIndentString(' ');
+$xw->startDocument('1.0', "UTF-8");
+$xw->startElement('root');
+$xw->startElementNS('ns1', 'child1', 'urn:ns1');
+$xw->writeAttributeNS('ns1', 'att1', 'urn:ns1', '<>"\'&');
+$xw->writeElement('chars', "special characters: <>\"'&");
+$xw->endElement();
+$xw->startElement('empty');
+$xw->fullEndElement();
+$xw->fullEndElement();
+// Force to write and empty the buffer
+$output = $xw->flush(true);
+print $output;
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+ <ns1:child1 ns1:att1="&lt;&gt;&quot;'&amp;" xmlns:ns1="urn:ns1">
+ <chars>special characters: &lt;&gt;&quot;'&amp;</chars>
+ </ns1:child1>
+ <empty></empty>
+</root>
diff --git a/ext/xsl/tests/xsltprocessor_hasExsltSupport.phpt b/ext/xsl/tests/xsltprocessor_hasExsltSupport.phpt
new file mode 100644
index 0000000000..2267129307
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_hasExsltSupport.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Test the basics to function XSLTProcessor::hasExsltSupport().
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$proc = new XSLTProcessor();
+var_dump($proc->hasExsltSupport());
+?>
+--EXPECTF--
+bool(true) \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_hasExsltSupport_not_available_extension.phpt b/ext/xsl/tests/xsltprocessor_hasExsltSupport_not_available_extension.phpt
new file mode 100644
index 0000000000..d8b8fa846d
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_hasExsltSupport_not_available_extension.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Test the basics to function XSLTProcessor::hasExsltSupport() when the xsl extension os not available.
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php (!extension_loaded('xsl')) or die('skip xsl extension is available'); ?>
+--FILE--
+<?php
+$proc = new XSLTProcessor();
+var_dump($proc->hasExsltSupport());
+?>
+--EXPECTF--
+Fatal error: Class 'XSLTProcessor' not found in %s on line %i \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_hasExsltSupport_wrongparam_001.phpt b/ext/xsl/tests/xsltprocessor_hasExsltSupport_wrongparam_001.phpt
new file mode 100644
index 0000000000..107157fa28
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_hasExsltSupport_wrongparam_001.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Check XSLTProcessor::hasExsltSupport() with 1 parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$proc = new XSLTProcessor();
+var_dump($proc->hasExsltSupport('stringValue'));
+?>
+--EXPECTF--
+bool(true) \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToDoc.phpt b/ext/xsl/tests/xsltprocessor_transformToDoc.phpt
new file mode 100644
index 0000000000..ff4be47e3f
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToDoc.phpt
@@ -0,0 +1,51 @@
+--TEST--
+Test the basics to function XSLTProcessor::transformToDoc().
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>royopa</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+var_dump($proc->transformToDoc($xmldoc)->firstChild->tagName);
+?>
+--EXPECT--
+string(4) "html" \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToDoc_nullparam.phpt b/ext/xsl/tests/xsltprocessor_transformToDoc_nullparam.phpt
new file mode 100644
index 0000000000..735fd72958
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToDoc_nullparam.phpt
@@ -0,0 +1,54 @@
+--TEST--
+Check XSLTProcessor::transformToDoc() with null parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+echo $proc->transformToDoc(null);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToDoc() expects parameter 1 to be object, null given in %s on line %i \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_001.phpt b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_001.phpt
new file mode 100644
index 0000000000..1460de39a4
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_001.phpt
@@ -0,0 +1,56 @@
+--TEST--
+Check XSLTProcessor::transformToDoc() with array parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+$wrong_parameter = array();
+
+echo $proc->transformToDoc($wrong_parameter);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToDoc() expects parameter 1 to be object, array given in %s on line %i \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_002.phpt b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_002.phpt
new file mode 100644
index 0000000000..2c6c99ae25
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_002.phpt
@@ -0,0 +1,54 @@
+--TEST--
+Check XSLTProcessor::transformToDoc() with 4 parameters
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+echo $proc->transformToDoc($xmldoc, 'string', 98, true);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToDoc() expects at most 2 parameters, 4 given in %s on line %i
diff --git a/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_003.phpt b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_003.phpt
new file mode 100644
index 0000000000..19fc3e44ef
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_003.phpt
@@ -0,0 +1,56 @@
+--TEST--
+Check XSLTProcessor::transformToDoc() with string parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+$wrong_parameter = 'stringValue';
+
+echo $proc->transformToDoc($wrong_parameter);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToDoc() expects parameter 1 to be object, string given in %s on line %i \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_004.phpt b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_004.phpt
new file mode 100644
index 0000000000..8df84b7cbe
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_004.phpt
@@ -0,0 +1,56 @@
+--TEST--
+Check XSLTProcessor::transformToDoc() with boolean parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+$wrong_parameter = true;
+
+echo $proc->transformToDoc($wrong_parameter);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToDoc() expects parameter 1 to be object, boolean given in %s on line %i \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToURI.phpt b/ext/xsl/tests/xsltprocessor_transformToURI.phpt
new file mode 100644
index 0000000000..27ed4e2975
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToURI.phpt
@@ -0,0 +1,53 @@
+--TEST--
+Test the basics to function XSLTProcessor::transformToURI().
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+var_dump($proc->transformToURI($xsldoc, 'php://output'));
+?>
+--EXPECTF--
+int(56) \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToURI_nullparam.phpt b/ext/xsl/tests/xsltprocessor_transformToURI_nullparam.phpt
new file mode 100644
index 0000000000..69afeaf7be
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToURI_nullparam.phpt
@@ -0,0 +1,54 @@
+--TEST--
+Check XSLTProcessor::transformToURI() with null parameters
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+echo $proc->transformToURI(null, null);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToUri() expects parameter 1 to be object, null given in %s on line %i \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_001.phpt b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_001.phpt
new file mode 100644
index 0000000000..64b98ce7e5
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_001.phpt
@@ -0,0 +1,57 @@
+--TEST--
+Check XSLTProcessor::transformToURI() with array parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+$wrong_parameter = array();
+$uri = 'php://output';
+
+echo $proc->transformToURI($wrong_parameter, $uri);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToUri() expects parameter 1 to be object, array given in %s on line %i \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_002.phpt b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_002.phpt
new file mode 100644
index 0000000000..7f497ba2b8
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_002.phpt
@@ -0,0 +1,57 @@
+--TEST--
+Check XSLTProcessor::transformToURI() with string parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+$wrong_parameter = 'stringValue';
+$uri = 'php://output';
+
+echo $proc->transformToURI($wrong_parameter, $uri);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToUri() expects parameter 1 to be object, string given in %s on line %i \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_003.phpt b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_003.phpt
new file mode 100644
index 0000000000..c7742422fd
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_003.phpt
@@ -0,0 +1,57 @@
+--TEST--
+Check XSLTProcessor::transformToURI() with boolean parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+$wrong_parameter = false;
+$uri = 'php://output';
+
+echo $proc->transformToURI($wrong_parameter, $uri);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToUri() expects parameter 1 to be object, boolean given in %s on line %i \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_004.phpt b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_004.phpt
new file mode 100644
index 0000000000..c1de1d93c3
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_004.phpt
@@ -0,0 +1,56 @@
+--TEST--
+Check XSLTProcessor::transformToURI() with 3 parameters
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+$uri = 'php://output';
+
+echo $proc->transformToURI($xsldoc, $uri, 'stringValue');
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToUri() expects exactly 2 parameters, 3 given in %s on line %i \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToXML.phpt b/ext/xsl/tests/xsltprocessor_transformToXML.phpt
new file mode 100644
index 0000000000..c70200d102
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToXML.phpt
@@ -0,0 +1,61 @@
+--TEST--
+Test the basics to function XSLTProcessor::transformToXml().
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+var_dump($proc->transformToXML($xmldoc));
+?>
+--EXPECT--
+string(135) "<html xmlns:php="http://php.net/xsl"><body>
+<h2>Users</h2>
+<table>
+<tr><td>Bob</td></tr>
+<tr><td>Joe</td></tr>
+</table>
+</body></html>
+" \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToXML_nullparam.phpt b/ext/xsl/tests/xsltprocessor_transformToXML_nullparam.phpt
new file mode 100644
index 0000000000..a7689df078
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToXML_nullparam.phpt
@@ -0,0 +1,54 @@
+--TEST--
+Check XSLTProcessor::transformToXml() with null parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+echo $proc->transformToXML(null);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToXml() expects parameter 1 to be object, null given in %s on line %i
diff --git a/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_001.phpt b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_001.phpt
new file mode 100644
index 0000000000..32e1a8095b
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_001.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Check XSLTProcessor::transformToXML() with array parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+$wrong_parameter = array();
+echo $proc->transformToXML($wrong_parameter);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToXml() expects parameter 1 to be object, array given in %s on line %d \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_002.phpt b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_002.phpt
new file mode 100644
index 0000000000..69b9305e13
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_002.phpt
@@ -0,0 +1,54 @@
+--TEST--
+Check XSLTProcessor::transformToXML() with 3 parameters
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+echo $proc->transformToXML($xmldoc, 'string', 98);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToXml() expects exactly 1 parameter, 3 given in %s on line %i
diff --git a/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_003.phpt b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_003.phpt
new file mode 100644
index 0000000000..05cb7ebd9e
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_003.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Check XSLTProcessor::transformToXML() with string parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+$wrong_parameter = 'stringValue';
+echo $proc->transformToXML($wrong_parameter);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToXml() expects parameter 1 to be object, string given in %s on line %d \ No newline at end of file
diff --git a/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_004.phpt b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_004.phpt
new file mode 100644
index 0000000000..87db6e14d6
--- /dev/null
+++ b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_004.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Check XSLTProcessor::transformToXML() with boolean parameter
+--CREDITS--
+Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
+--SKIPIF--
+<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?>
+--FILE--
+<?php
+$xml = <<<EOB
+<allusers>
+ <user>
+ <uid>bob</uid>
+ </user>
+ <user>
+ <uid>joe</uid>
+ </user>
+</allusers>
+EOB;
+$xsl = <<<EOB
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl">
+<xsl:output method="html" encoding="utf-8" indent="yes"/>
+ <xsl:template match="allusers">
+ <html><body>
+ <h2>Users</h2>
+ <table>
+ <xsl:for-each select="user">
+ <tr><td>
+ <xsl:value-of
+ select="php:function('ucfirst',string(uid))"/>
+ </td></tr>
+ </xsl:for-each>
+ </table>
+ </body></html>
+ </xsl:template>
+</xsl:stylesheet>
+EOB;
+
+$xmldoc = new DOMDocument('1.0', 'utf-8');
+$xmldoc->loadXML($xml);
+
+$xsldoc = new DOMDocument('1.0', 'utf-8');
+$xsldoc->loadXML($xsl);
+
+$proc = new XSLTProcessor();
+$proc->registerPHPFunctions();
+$proc->importStyleSheet($xsldoc);
+
+$wrong_parameter = true;
+echo $proc->transformToXML($wrong_parameter);
+?>
+--EXPECTF--
+Warning: XSLTProcessor::transformToXml() expects parameter 1 to be object, boolean given in %s on line %d \ No newline at end of file
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 4accc22e30..b50e240656 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -556,7 +556,7 @@ int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_v
array_init(return_value);
for (n = 0; n < globbuf.gl_pathc; n++) {
- /* we need to do this everytime since GLOB_ONLYDIR does not guarantee that
+ /* we need to do this every time since GLOB_ONLYDIR does not guarantee that
* all directories will be filtered. GNU libc documentation states the
* following:
* If the information about the type of the file is easily available
diff --git a/ext/zlib/tests/gzfile_variation4.phpt b/ext/zlib/tests/gzfile_variation4.phpt
index 3310231566..9b3128125a 100644
--- a/ext/zlib/tests/gzfile_variation4.phpt
+++ b/ext/zlib/tests/gzfile_variation4.phpt
@@ -2,7 +2,7 @@
Test function gzfile() by substituting argument 1 with float values.
--SKIPIF--
<?php
-if (!extension_loaded(zlib)) die ('skip zlib extension not available in this build');
+if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
?>
--FILE--
<?php
diff --git a/ext/zlib/tests/readgzfile_variation4.phpt b/ext/zlib/tests/readgzfile_variation4.phpt
index 00211f7dfe..32f434cba2 100644
--- a/ext/zlib/tests/readgzfile_variation4.phpt
+++ b/ext/zlib/tests/readgzfile_variation4.phpt
@@ -2,7 +2,7 @@
Test function readgzfile() by substituting argument 1 with float values.
--SKIPIF--
<?php
-if (!extension_loaded(zlib)) die ('skip zlib extension not available in this build');
+if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
?>
--FILE--
<?php
diff --git a/ext/zlib/zlib_filter.c b/ext/zlib/zlib_filter.c
index 45ef2a8f7d..2f0d1f7706 100644
--- a/ext/zlib/zlib_filter.c
+++ b/ext/zlib/zlib_filter.c
@@ -386,7 +386,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f
if ((tmpzval = zend_hash_str_find(HASH_OF(filterparams), "level", sizeof("level") - 1))) {
ZVAL_COPY_VALUE(&tmp, tmpzval);
- /* Psuedo pass through to catch level validating code */
+ /* Pseudo pass through to catch level validating code */
goto factory_setlevel;
}
break;
diff --git a/ext/zlib/zlib_win32_howto.txt b/ext/zlib/zlib_win32_howto.txt
index 0c46a88831..59ff3c4f4c 100644
--- a/ext/zlib/zlib_win32_howto.txt
+++ b/ext/zlib/zlib_win32_howto.txt
@@ -1,7 +1,7 @@
Rules for building ZLIB
-----------------------
-The zlib project requires the folowing files:
+The zlib project requires the following files:
php_build\zlib\include\zlib.h
php_build\zlib\include\zconf.h
diff --git a/php.ini-development b/php.ini-development
index a3cb5a3b78..c619678878 100644
--- a/php.ini-development
+++ b/php.ini-development
@@ -289,20 +289,17 @@ serialize_precision = 17
; open_basedir, if set, limits all file operations to the defined directory
; and below. This directive makes most sense if used in a per-directory
-; or per-virtualhost web server configuration file. This directive is
-; *NOT* affected by whether Safe Mode is turned On or Off.
+; or per-virtualhost web server configuration file.
; http://php.net/open-basedir
;open_basedir =
; This directive allows you to disable certain functions for security reasons.
-; It receives a comma-delimited list of function names. This directive is
-; *NOT* affected by whether Safe Mode is turned On or Off.
+; It receives a comma-delimited list of function names.
; http://php.net/disable-functions
disable_functions =
; This directive allows you to disable certain classes for security reasons.
-; It receives a comma-delimited list of class names. This directive is
-; *NOT* affected by whether Safe Mode is turned On or Off.
+; It receives a comma-delimited list of class names.
; http://php.net/disable-classes
disable_classes =
@@ -607,13 +604,13 @@ html_errors = On
; http://php.net/variables-order
variables_order = "GPCS"
-; This directive determines which super global data (G,P,C,E & S) should
-; be registered into the super global array REQUEST. If so, it also determines
-; the order in which that data is registered. The values for this directive are
-; specified in the same manner as the variables_order directive, EXCEPT one.
-; Leaving this value empty will cause PHP to use the value set in the
-; variables_order directive. It does not mean it will leave the super globals
-; array REQUEST empty.
+; This directive determines which super global data (G,P & C) should be
+; registered into the super global array REQUEST. If so, it also determines
+; the order in which that data is registered. The values for this directive
+; are specified in the same manner as the variables_order directive,
+; EXCEPT one. Leaving this value empty will cause PHP to use the value set
+; in the variables_order directive. It does not mean it will leave the super
+; globals array REQUEST empty.
; Default Value: None
; Development Value: "GP"
; Production Value: "GP"
@@ -1024,7 +1021,7 @@ smtp_port = 25
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
-; the 5th parameter to mail(), even in safe mode.
+; the 5th parameter to mail().
;mail.force_extra_parameters =
; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
diff --git a/php.ini-production b/php.ini-production
index 15d432564f..1310f6c1c6 100644
--- a/php.ini-production
+++ b/php.ini-production
@@ -289,20 +289,17 @@ serialize_precision = 17
; open_basedir, if set, limits all file operations to the defined directory
; and below. This directive makes most sense if used in a per-directory
-; or per-virtualhost web server configuration file. This directive is
-; *NOT* affected by whether Safe Mode is turned On or Off.
+; or per-virtualhost web server configuration file.
; http://php.net/open-basedir
;open_basedir =
; This directive allows you to disable certain functions for security reasons.
-; It receives a comma-delimited list of function names. This directive is
-; *NOT* affected by whether Safe Mode is turned On or Off.
+; It receives a comma-delimited list of function names.
; http://php.net/disable-functions
disable_functions =
; This directive allows you to disable certain classes for security reasons.
-; It receives a comma-delimited list of class names. This directive is
-; *NOT* affected by whether Safe Mode is turned On or Off.
+; It receives a comma-delimited list of class names.
; http://php.net/disable-classes
disable_classes =
@@ -607,13 +604,13 @@ html_errors = On
; http://php.net/variables-order
variables_order = "GPCS"
-; This directive determines which super global data (G,P,C,E & S) should
-; be registered into the super global array REQUEST. If so, it also determines
-; the order in which that data is registered. The values for this directive are
-; specified in the same manner as the variables_order directive, EXCEPT one.
-; Leaving this value empty will cause PHP to use the value set in the
-; variables_order directive. It does not mean it will leave the super globals
-; array REQUEST empty.
+; This directive determines which super global data (G,P & C) should be
+; registered into the super global array REQUEST. If so, it also determines
+; the order in which that data is registered. The values for this directive
+; are specified in the same manner as the variables_order directive,
+; EXCEPT one. Leaving this value empty will cause PHP to use the value set
+; in the variables_order directive. It does not mean it will leave the super
+; globals array REQUEST empty.
; Default Value: None
; Development Value: "GP"
; Production Value: "GP"
@@ -1024,7 +1021,7 @@ smtp_port = 25
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
-; the 5th parameter to mail(), even in safe mode.
+; the 5th parameter to mail().
;mail.force_extra_parameters =
; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 10c7fbf355..5807d8a64d 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -2287,7 +2287,7 @@ consult the installation file that came with this distribution, or visit \n\
/* all remaining arguments are part of the query string
* this section of code concatenates all remaining arguments
- * into a single string, seperating args with a &
+ * into a single string, separating args with a &
* this allows command lines like:
*
* test.php v1=test v2=hello+world!
diff --git a/sapi/cli/php_http_parser.c b/sapi/cli/php_http_parser.c
index cc649af79a..31ae4167d1 100644
--- a/sapi/cli/php_http_parser.c
+++ b/sapi/cli/php_http_parser.c
@@ -1378,7 +1378,7 @@ size_t php_http_parser_execute (php_http_parser *parser,
/* Here we call the headers_complete callback. This is somewhat
* different than other callbacks because if the user returns 1, we
* will interpret that as saying that this message has no body. This
- * is needed for the annoying case of recieving a response to a HEAD
+ * is needed for the annoying case of receiving a response to a HEAD
* request.
*/
if (settings->on_headers_complete) {
diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index 1ee0169698..d4e46853ff 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -1200,15 +1200,15 @@ static int fpm_conf_post_process(int force_daemon TSRMLS_DC) /* {{{ */
return -1;
}
- if (0 > fpm_log_open(0)) {
+ if (0 > fpm_event_pre_init(fpm_global_config.events_mechanism)) {
return -1;
}
- if (0 > fpm_event_pre_init(fpm_global_config.events_mechanism)) {
+ if (0 > fpm_conf_process_all_pools()) {
return -1;
}
- if (0 > fpm_conf_process_all_pools()) {
+ if (0 > fpm_log_open(0)) {
return -1;
}
@@ -1257,7 +1257,7 @@ static void fpm_conf_ini_parser_include(char *inc, void *arg TSRMLS_DC) /* {{{ *
#ifdef HAVE_GLOB
{
g.gl_offs = 0;
- if ((i = glob(inc, GLOB_ERR | GLOB_MARK | GLOB_NOSORT, NULL, &g)) != 0) {
+ if ((i = glob(inc, GLOB_ERR | GLOB_MARK, NULL, &g)) != 0) {
#ifdef GLOB_NOMATCH
if (i == GLOB_NOMATCH) {
zlog(ZLOG_WARNING, "Nothing matches the include pattern '%s' from %s at line %d.", inc, filename, ini_lineno);
diff --git a/sapi/fpm/fpm/fpm_env.c b/sapi/fpm/fpm/fpm_env.c
index 2ff0bdc0e4..3bdb346341 100644
--- a/sapi/fpm/fpm/fpm_env.c
+++ b/sapi/fpm/fpm/fpm_env.c
@@ -212,7 +212,7 @@ int fpm_env_init_main() /* {{{ */
#ifndef HAVE_SETPROCTITLE
#ifdef __linux__
/*
- * This piece of code has been inspirated from nginx and pureftpd code, whic
+ * This piece of code has been inspirated from nginx and pureftpd code, which
* are under BSD licence.
*
* To change the process title in Linux we have to set argv[1] to NULL
diff --git a/sapi/fpm/fpm/fpm_log.c b/sapi/fpm/fpm/fpm_log.c
index c71281b0b9..b0bf32ac16 100644
--- a/sapi/fpm/fpm/fpm_log.c
+++ b/sapi/fpm/fpm/fpm_log.c
@@ -46,6 +46,8 @@ int fpm_log_open(int reopen) /* {{{ */
if (0 > fd) {
zlog(ZLOG_SYSERROR, "failed to open access log (%s)", wp->config->access_log);
return -1;
+ } else {
+ zlog(ZLOG_DEBUG, "open access log (%s)", wp->config->access_log);
}
if (reopen) {
diff --git a/sapi/fpm/fpm/fpm_sockets.c b/sapi/fpm/fpm/fpm_sockets.c
index 0286f0eee8..e4e494876f 100644
--- a/sapi/fpm/fpm/fpm_sockets.c
+++ b/sapi/fpm/fpm/fpm_sockets.c
@@ -268,6 +268,8 @@ static int fpm_socket_af_inet_listening_socket(struct fpm_worker_pool_s *wp) /*
} else if (strlen(dup_address) == strspn(dup_address, "0123456789")) { /* this is port */
port = atoi(dup_address);
port_str = dup_address;
+ /* IPv6 catch-all + IPv4-mapped */
+ addr = "::";
}
if (port == 0) {
@@ -275,18 +277,6 @@ static int fpm_socket_af_inet_listening_socket(struct fpm_worker_pool_s *wp) /*
return -1;
}
- if (!addr) {
- /* no address: default documented behavior, all IPv4 addresses */
- struct sockaddr_in sa_in;
-
- memset(&sa_in, 0, sizeof(sa_in));
- sa_in.sin_family = AF_INET;
- sa_in.sin_port = htons(port);
- sa_in.sin_addr.s_addr = htonl(INADDR_ANY);
- free(dup_address);
- return fpm_sockets_get_listening_socket(wp, (struct sockaddr *) &sa_in, sizeof(struct sockaddr_in));
- }
-
/* strip brackets from address for getaddrinfo */
addr_len = strlen(addr);
if (addr[0] == '[' && addr[addr_len - 1] == ']') {
@@ -307,10 +297,10 @@ static int fpm_socket_af_inet_listening_socket(struct fpm_worker_pool_s *wp) /*
inet_ntop(p->ai_family, fpm_get_in_addr(p->ai_addr), tmpbuf, INET6_ADDRSTRLEN);
if (sock < 0) {
if ((sock = fpm_sockets_get_listening_socket(wp, p->ai_addr, p->ai_addrlen)) != -1) {
- zlog(ZLOG_DEBUG, "Found address for %s, socket opened on %s", dup_address, tmpbuf);
+ zlog(ZLOG_DEBUG, "Found address for %s, socket opened on %s", addr, tmpbuf);
}
} else {
- zlog(ZLOG_WARNING, "Found multiple addresses for %s, %s ignored", dup_address, tmpbuf);
+ zlog(ZLOG_WARNING, "Found multiple addresses for %s, %s ignored", addr, tmpbuf);
}
}
diff --git a/sapi/fpm/php-fpm.conf.in b/sapi/fpm/php-fpm.conf.in
index bcdfe56a10..850a369002 100644
--- a/sapi/fpm/php-fpm.conf.in
+++ b/sapi/fpm/php-fpm.conf.in
@@ -131,6 +131,7 @@
; Per pool prefix
; It only applies on the following directives:
+; - 'access.log'
; - 'slowlog'
; - 'listen' (unixsocket)
; - 'chroot'
@@ -154,9 +155,7 @@ group = @php_fpm_group@
; a specific port;
; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
; a specific port;
-; 'port' - to listen on a TCP socket to all IPv4 addresses on a
-; specific port;
-; '[::]:port' - to listen on a TCP socket to all addresses
+; 'port' - to listen on a TCP socket to all addresses
; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
diff --git a/sapi/fpm/tests/016.phpt b/sapi/fpm/tests/016.phpt
new file mode 100644
index 0000000000..1a9e8e7577
--- /dev/null
+++ b/sapi/fpm/tests/016.phpt
@@ -0,0 +1,87 @@
+--TEST--
+FPM: Test splited configuration and load order #68391
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$logfile = __DIR__.'/php-fpm.log.tmp';
+$logdir = __DIR__.'/conf.d';
+$port = 9000+PHP_INT_SIZE;
+
+// Main configuration
+$cfg = <<<EOT
+[global]
+error_log = $logfile
+log_level = notice
+include = $logdir/*.conf
+EOT;
+
+// Splited configuration
+@mkdir($logdir);
+$i=$port;
+$names = ['cccc', 'aaaa', 'eeee', 'dddd', 'bbbb'];
+foreach($names as $name) {
+ $poolcfg = <<<EOT
+[$name]
+listen = 127.0.0.1:$i
+listen.allowed_clients=127.0.0.1
+user = foo
+pm = ondemand
+pm.max_children = 5
+EOT;
+ file_put_contents("$logdir/$name.conf", $poolcfg);
+ $i++;
+}
+
+// Test
+$fpm = run_fpm($cfg, $tail);
+if (is_resource($fpm)) {
+ fpm_display_log($tail, count($names)+2);
+ $i=$port;
+ foreach($names as $name) {
+ try {
+ run_request('127.0.0.1', $i++);
+ echo "OK $name\n";
+ } catch (Exception $e) {
+ echo "Error 1\n";
+ }
+ }
+ proc_terminate($fpm);
+ if (!feof($tail)) {
+ echo stream_get_contents($tail);
+ }
+ fclose($tail);
+ proc_close($fpm);
+}
+
+?>
+Done
+--EXPECTF--
+[%s] NOTICE: [pool aaaa] 'user' directive is ignored when FPM is not running as root
+[%s] NOTICE: [pool bbbb] 'user' directive is ignored when FPM is not running as root
+[%s] NOTICE: [pool cccc] 'user' directive is ignored when FPM is not running as root
+[%s] NOTICE: [pool dddd] 'user' directive is ignored when FPM is not running as root
+[%s] NOTICE: [pool eeee] 'user' directive is ignored when FPM is not running as root
+[%s] NOTICE: fpm is running, pid %d
+[%s] NOTICE: ready to handle connections
+OK cccc
+OK aaaa
+OK eeee
+OK dddd
+OK bbbb
+[%s] NOTICE: Terminating ...
+[%s] NOTICE: exiting, bye-bye!
+Done
+--CLEAN--
+<?php
+ $logfile = __DIR__.'/php-fpm.log.tmp';
+ $logdir = __DIR__.'/conf.d';
+ @unlink($logfile);
+ foreach(glob("$logdir/*.conf") as $name) {
+ unlink($name);
+ }
+ @rmdir($logdir);
+?> \ No newline at end of file
diff --git a/sapi/fpm/tests/017.phpt b/sapi/fpm/tests/017.phpt
new file mode 100644
index 0000000000..b3de089a70
--- /dev/null
+++ b/sapi/fpm/tests/017.phpt
@@ -0,0 +1,67 @@
+--TEST--
+FPM: Test fastcgi_finish_request function
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$logfile = __DIR__.'/php-fpm.log.tmp';
+$srcfile = __DIR__.'/php-fpm.tmp.php';
+$port = 9000+PHP_INT_SIZE;
+
+$cfg = <<<EOT
+[global]
+error_log = $logfile
+[unconfined]
+listen = 127.0.0.1:$port
+pm = dynamic
+pm.max_children = 5
+pm.start_servers = 1
+pm.min_spare_servers = 1
+pm.max_spare_servers = 3
+EOT;
+
+$code = <<<EOT
+<?php
+echo "Test Start\n";
+fastcgi_finish_request();
+echo "Test End\n";
+EOT;
+file_put_contents($srcfile, $code);
+
+$fpm = run_fpm($cfg, $tail);
+if (is_resource($fpm)) {
+ fpm_display_log($tail, 2);
+ try {
+ $req = run_request('127.0.0.1', $port, $srcfile);
+ echo strstr($req, "Test Start");
+ echo "Request ok\n";
+ } catch (Exception $e) {
+ echo "Request error\n";
+ }
+ proc_terminate($fpm);
+ echo stream_get_contents($tail);
+ fclose($tail);
+ proc_close($fpm);
+}
+
+?>
+Done
+--EXPECTF--
+[%s] NOTICE: fpm is running, pid %d
+[%s] NOTICE: ready to handle connections
+Test Start
+
+Request ok
+[%s] NOTICE: Terminating ...
+[%s] NOTICE: exiting, bye-bye!
+Done
+--CLEAN--
+<?php
+ $logfile = __DIR__.'/php-fpm.log.tmp';
+ $srcfile = __DIR__.'/php-fpm.tmp.php';
+ @unlink($logfile);
+ @unlink($srcfile);
+?> \ No newline at end of file
diff --git a/sapi/fpm/tests/019.phpt b/sapi/fpm/tests/019.phpt
new file mode 100644
index 0000000000..cdf8126244
--- /dev/null
+++ b/sapi/fpm/tests/019.phpt
@@ -0,0 +1,80 @@
+--TEST--
+FPM: Test global prefix
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$logfile = 'php-fpm.log.tmp';
+$accfile = 'php-fpm.acc.tmp';
+$slwfile = 'php-fpm.slw.tmp';
+$pidfile = 'php-fpm.pid.tmp';
+$port = 9000+PHP_INT_SIZE;
+
+$cfg = <<<EOT
+[global]
+error_log = $logfile
+pid = $pidfile
+[test]
+listen = 127.0.0.1:$port
+access.log = $accfile
+slowlog = $slwfile;
+request_slowlog_timeout = 1
+ping.path = /ping
+ping.response = pong
+pm = dynamic
+pm.max_children = 5
+pm.start_servers = 2
+pm.min_spare_servers = 1
+pm.max_spare_servers = 3
+catch_workers_output = yes
+EOT;
+
+$fpm = run_fpm($cfg, $tail, '--prefix '.__DIR__);
+if (is_resource($fpm)) {
+ fpm_display_log($tail, 2);
+ try {
+ run_request('127.0.0.1', $port);
+ echo "Ping ok\n";
+ } catch (Exception $e) {
+ echo "Ping error\n";
+ }
+ printf("File %s %s\n", $logfile, (file_exists(__DIR__.'/'.$logfile) ? "exists" : "missing"));
+ printf("File %s %s\n", $accfile, (file_exists(__DIR__.'/'.$accfile) ? "exists" : "missing"));
+ printf("File %s %s\n", $slwfile, (file_exists(__DIR__.'/'.$slwfile) ? "exists" : "missing"));
+ printf("File %s %s\n", $pidfile, (file_exists(__DIR__.'/'.$pidfile) ? "exists" : "missing"));
+
+ proc_terminate($fpm);
+ echo stream_get_contents($tail);
+ fclose($tail);
+ proc_close($fpm);
+ printf("File %s %s\n", $pidfile, (file_exists(__DIR__.'/'.$pidfile) ? "still exists" : "removed"));
+ readfile(__DIR__.'/'.$accfile);
+}
+
+?>
+--EXPECTF--
+[%s] NOTICE: fpm is running, pid %d
+[%s] NOTICE: ready to handle connections
+Ping ok
+File php-fpm.log.tmp exists
+File php-fpm.acc.tmp exists
+File php-fpm.slw.tmp exists
+File php-fpm.pid.tmp exists
+[%s] NOTICE: Terminating ...
+[%s] NOTICE: exiting, bye-bye!
+File php-fpm.pid.tmp removed
+127.0.0.1 - %s "GET /ping" 200
+--CLEAN--
+<?php
+ $logfile = __DIR__.'/php-fpm.log.tmp';
+ $accfile = __DIR__.'/php-fpm.acc.tmp';
+ $slwfile = __DIR__.'/php-fpm.slw.tmp';
+ $pidfile = __DIR__.'/php-fpm.pid.tmp';
+ @unlink($logfile);
+ @unlink($accfile);
+ @unlink($slwfile);
+ @unlink($pidfile);
+?>
diff --git a/sapi/fpm/tests/020.phpt b/sapi/fpm/tests/020.phpt
new file mode 100644
index 0000000000..d45eeccff8
--- /dev/null
+++ b/sapi/fpm/tests/020.phpt
@@ -0,0 +1,76 @@
+--TEST--
+FPM: Test pool prefix
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$prefix = __DIR__;
+$logfile = __DIR__.'/php-fpm.log.tmp';
+$accfile = 'php-fpm.acc.tmp';
+$slwfile = 'php-fpm.slw.tmp';
+$pidfile = __DIR__.'/php-fpm.pid.tmp';
+$port = 9000+PHP_INT_SIZE;
+$cfg = <<<EOT
+
+[global]
+error_log = $logfile
+pid = $pidfile
+[test]
+prefix = $prefix;
+listen = 127.0.0.1:$port
+access.log = $accfile
+slowlog = $slwfile;
+request_slowlog_timeout = 1
+ping.path = /ping
+ping.response = pong
+pm = dynamic
+pm.max_children = 5
+pm.start_servers = 2
+pm.min_spare_servers = 1
+pm.max_spare_servers = 3
+catch_workers_output = yes
+EOT;
+
+$fpm = run_fpm($cfg, $tail);
+if (is_resource($fpm)) {
+ fpm_display_log($tail, 2);
+ try {
+ run_request('127.0.0.1', $port);
+ echo "Ping ok\n";
+ } catch (Exception $e) {
+ echo "Ping error\n";
+ }
+ printf("File %s %s\n", $accfile, (file_exists(__DIR__.'/'.$accfile) ? "exists" : "missing"));
+ printf("File %s %s\n", $slwfile, (file_exists(__DIR__.'/'.$slwfile) ? "exists" : "missing"));
+
+ proc_terminate($fpm);
+ echo stream_get_contents($tail);
+ fclose($tail);
+ proc_close($fpm);
+ readfile(__DIR__.'/'.$accfile);
+}
+
+?>
+--EXPECTF--
+[%s] NOTICE: fpm is running, pid %d
+[%s] NOTICE: ready to handle connections
+Ping ok
+File php-fpm.acc.tmp exists
+File php-fpm.slw.tmp exists
+[%s] NOTICE: Terminating ...
+[%s] NOTICE: exiting, bye-bye!
+127.0.0.1 - %s "GET /ping" 200
+--CLEAN--
+<?php
+ $logfile = __DIR__.'/php-fpm.log.tmp';
+ $accfile = __DIR__.'/php-fpm.acc.tmp';
+ $slwfile = __DIR__.'/php-fpm.slw.tmp';
+ $pidfile = __DIR__.'/php-fpm.pid.tmp';
+ @unlink($logfile);
+ @unlink($accfile);
+ @unlink($slwfile);
+ @unlink($pidfile);
+?>
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index a9f27fcea1..54b7ef9166 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -200,7 +200,12 @@ static char *sapi_lsapi_getenv( char * name, size_t name_len TSRMLS_DC )
static int add_variable( const char * pKey, int keyLen, const char * pValue, int valLen,
void * arg )
{
- int filter_arg = (arg == PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER;
+#if PHP_MAJOR_VERSION >= 7
+ int filter_arg = (Z_ARR_P((zval *)arg) == Z_ARR(PG(http_globals)[TRACK_VARS_ENV]))
+ ? PARSE_ENV : PARSE_SERVER;
+#else
+ int filter_arg = (arg == PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER;
+#endif
char * new_val = (char *) pValue;
unsigned int new_val_len;
@@ -238,27 +243,45 @@ static void litespeed_php_import_environment_variables(zval *array_ptr TSRMLS_DC
size_t alloc_size = sizeof(buf);
unsigned long nlen; /* ptrdiff_t is not portable */
- if (PG(http_globals)[TRACK_VARS_ENV] &&
- array_ptr != PG(http_globals)[TRACK_VARS_ENV] &&
- Z_TYPE_P(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY &&
- zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_ENV])) > 0
+#if PHP_MAJOR_VERSION >= 7
+ if (Z_TYPE(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY &&
+ Z_ARR_P(array_ptr) != Z_ARR(PG(http_globals)[TRACK_VARS_ENV]) &&
+ zend_hash_num_elements(Z_ARRVAL(PG(http_globals)[TRACK_VARS_ENV])) > 0
) {
- zval_dtor(array_ptr);
- *array_ptr = *PG(http_globals)[TRACK_VARS_ENV];
- INIT_PZVAL(array_ptr);
- zval_copy_ctor(array_ptr);
+ zval_dtor(array_ptr);
+ ZVAL_DUP(array_ptr, &PG(http_globals)[TRACK_VARS_ENV]);
return;
- } else if (PG(http_globals)[TRACK_VARS_SERVER] &&
- array_ptr != PG(http_globals)[TRACK_VARS_SERVER] &&
- Z_TYPE_P(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY &&
- zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER])) > 0
+ } else if (Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY &&
+ Z_ARR_P(array_ptr) != Z_ARR(PG(http_globals)[TRACK_VARS_SERVER]) &&
+ zend_hash_num_elements(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER])) > 0
) {
- zval_dtor(array_ptr);
- *array_ptr = *PG(http_globals)[TRACK_VARS_SERVER];
- INIT_PZVAL(array_ptr);
- zval_copy_ctor(array_ptr);
+ zval_dtor(array_ptr);
+ ZVAL_DUP(array_ptr, &PG(http_globals)[TRACK_VARS_SERVER]);
return;
}
+#else
+ if (PG(http_globals)[TRACK_VARS_ENV] &&
+ array_ptr != PG(http_globals)[TRACK_VARS_ENV] &&
+ Z_TYPE_P(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY &&
+ zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_ENV])) > 0
+ ) {
+ zval_dtor(array_ptr);
+ *array_ptr = *PG(http_globals)[TRACK_VARS_ENV];
+ INIT_PZVAL(array_ptr);
+ zval_copy_ctor(array_ptr);
+ return;
+ } else if (PG(http_globals)[TRACK_VARS_SERVER] &&
+ array_ptr != PG(http_globals)[TRACK_VARS_SERVER] &&
+ Z_TYPE_P(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY &&
+ zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER])) > 0
+ ) {
+ zval_dtor(array_ptr);
+ *array_ptr = *PG(http_globals)[TRACK_VARS_SERVER];
+ INIT_PZVAL(array_ptr);
+ zval_copy_ctor(array_ptr);
+ return;
+ }
+#endif
for (env = environ; env != NULL && *env != NULL; env++) {
p = strchr(*env, '=');
@@ -592,6 +615,9 @@ static int lsapi_module_main(int show_source TSRMLS_DC)
static int alter_ini( const char * pKey, int keyLen, const char * pValue, int valLen,
void * arg )
{
+#if PHP_MAJOR_VERSION >= 7
+ zend_string * psKey;
+#endif
int type = ZEND_INI_PERDIR;
if ( '\001' == *pKey ) {
++pKey;
@@ -606,9 +632,19 @@ static int alter_ini( const char * pKey, int keyLen, const char * pValue, int va
engine = 0;
}
else
- zend_alter_ini_entry((char *)pKey, keyLen,
+ {
+#if PHP_MAJOR_VERSION >= 7
+ psKey = STR_INIT( pKey, keyLen, 1 );
+ zend_alter_ini_entry(psKey,
(char *)pValue, valLen,
type, PHP_INI_STAGE_ACTIVATE);
+ STR_RELEASE( psKey );
+#else
+ zend_alter_ini_entry((char *)pKey, keyLen,
+ (char *)pValue, valLen,
+ type, PHP_INI_STAGE_ACTIVATE);
+#endif
+ }
}
return 1;
}
@@ -749,6 +785,9 @@ static int cli_main( int argc, char * argv[] )
char ** argend= &argv[argc];
int ret = -1;
int c;
+#if PHP_MAJOR_VERSION >= 7
+ zend_string * psKey;
+#endif
lsapi_mode = 0; /* enter CLI mode */
#ifdef PHP_WIN32
@@ -763,12 +802,21 @@ static int cli_main( int argc, char * argv[] )
zend_uv.html_errors = 0; /* tell the engine we're in non-html mode */
CG(in_compilation) = 0; /* not initialized but needed for several options */
+#if PHP_MAJOR_VERSION < 7
EG(uninitialized_zval_ptr) = NULL;
-
+#endif
for( ini = ini_defaults; *ini; ini+=2 ) {
+#if PHP_MAJOR_VERSION >= 7
+ psKey = STR_INIT( *ini, strlen( *ini ), 1 );
+ zend_alter_ini_entry( psKey,
+ (char *)*(ini+1), strlen( *(ini+1) ),
+ PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
+ STR_RELEASE( psKey );
+#else
zend_alter_ini_entry( (char *)*ini, strlen( *ini )+1,
(char *)*(ini+1), strlen( *(ini+1) ),
PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
+#endif
}
while (( p < argend )&&(**p == '-' )) {
@@ -1148,7 +1196,11 @@ zend_module_entry litespeed_module_entry = {
static int add_associate_array( const char * pKey, int keyLen, const char * pValue, int valLen,
void * arg )
{
- add_assoc_string_ex( (zval *)arg, (char *)pKey, keyLen+1, (char *)pValue);
+ add_assoc_string_ex( (zval *)arg, (char *)pKey, keyLen+1, (char *)pValue
+#if PHP_MAJOR_VERSION < 7
+ , 1
+#endif
+ );
return 1;
}
@@ -1202,7 +1254,11 @@ PHP_FUNCTION(litespeed_response_headers)
headerBuf[len] = 0;
if ( len ) {
while( isspace(*++p));
- add_assoc_string_ex(return_value, headerBuf, len+1, p);
+ add_assoc_string_ex(return_value, headerBuf, len+1, p
+#if PHP_MAJOR_VERSION < 7
+ , 1
+#endif
+ );
}
}
}
@@ -1217,15 +1273,25 @@ PHP_FUNCTION(litespeed_response_headers)
Fetch all loaded module names */
PHP_FUNCTION(apache_get_modules)
{
+ static const char * mod_names[] =
+ {
+ "mod_rewrite", "mod_mime", "mod_headers", "mod_expires", NULL
+ };
+ const char **name = mod_names;
/* TODO: */
if (ZEND_NUM_ARGS() > 0) {
WRONG_PARAM_COUNT;
}
array_init(return_value);
- add_next_index_string(return_value, "mod_rewrite");
- add_next_index_string(return_value, "mod_mime");
- add_next_index_string(return_value, "mod_headers");
- add_next_index_string(return_value, "mod_expires");
+ while( *name )
+ {
+ add_next_index_string(return_value, *name
+#if PHP_MAJOR_VERSION < 7
+ , 1
+#endif
+ );
+ ++name;
+ }
}
/* }}} */
diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c
index cf63f6ab1c..daf0f37f14 100644
--- a/sapi/litespeed/lsapilib.c
+++ b/sapi/litespeed/lsapilib.c
@@ -2662,7 +2662,7 @@ static void lsapi_check_child_status( long tmCur )
}
if ( abs( g_prefork_server->m_iCurChildren - count ) > 1 )
{
- fprintf( stderr, "Children tracking is wrong: PID: %d, Cur Childen: %d, count: %d, idle: %d, dying: %d\n", getpid(),
+ fprintf( stderr, "Children tracking is wrong: PID: %d, Cur Children: %d, count: %d, idle: %d, dying: %d\n", getpid(),
g_prefork_server->m_iCurChildren, count, idle, dying );
}
diff --git a/sapi/nsapi/nsapi-readme.txt b/sapi/nsapi/nsapi-readme.txt
index 812507957e..6bf4afb83d 100644
--- a/sapi/nsapi/nsapi-readme.txt
+++ b/sapi/nsapi/nsapi-readme.txt
@@ -1,7 +1,7 @@
Configuration of your Netscape/iPlanet/Sun Webserver for PHP7
-----------------------------------------------------------------
-These instructions are targetted at Netscape Enterprise Web Server and
+These instructions are targeted at Netscape Enterprise Web Server and
SUN/Netscape Alliance iPlanet Web Server and the new Sun Java System Webserver.
On other web servers your milage may vary.
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index ec65a22f12..c624669785 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -1571,7 +1571,7 @@ phpdbg_out:
#ifdef _WIN32
} __except(phpdbg_exception_handler_win32(xp = GetExceptionInformation())) {
- phpdbg_error("segfault", "", "Access violation (Segementation fault) encountered\ntrying to abort cleanly...");
+ phpdbg_error("segfault", "", "Access violation (Segmentation fault) encountered\ntrying to abort cleanly...");
}
phpdbg_out:
#endif
diff --git a/sapi/phpdbg/xml.md b/sapi/phpdbg/xml.md
index 7871b31376..56dcaaa1f7 100644
--- a/sapi/phpdbg/xml.md
+++ b/sapi/phpdbg/xml.md
@@ -225,7 +225,7 @@ frame
- internal: has value "internal" when being an internal function call (one cannot inspect that frame)
- being an error: (by type)
- - maxnum: tried to access a frame with a number heigher than existing (or &lt; 0)
+ - maxnum: tried to access a frame with a number higher than existing (or &lt; 0)
### attributes on &lt;arg> ###
@@ -378,7 +378,7 @@ exec
- command executing and compiling a given file
- &lt;exec type="unset" context="" />: indicates unsetting of the old context
- &lt;exec type="unsetops" />: indicates unsetting of the old compiled opcodes
- - &lt;exec type="unchanged" />: same execution context choosen again
+ - &lt;exec type="unchanged" />: same execution context chosen again
- &lt;exec type="set" context="" />: indicates setting of the new context
- errors by tag
- &lt;compile>
@@ -527,7 +527,7 @@ set
### breaks ###
-- generally enables / disables breakpoint functionality silently with no futher xml answer
+- generally enables / disables breakpoint functionality silently with no further xml answer
- if the boolean switch is omitted, it emits current state in a &lt;setbreaks active="" /> where active is on or off
### color ###
diff --git a/sapi/thttpd/thttpd_patch b/sapi/thttpd/thttpd_patch
index 1a9ed29d60..1463d8fe0a 100644
--- a/sapi/thttpd/thttpd_patch
+++ b/sapi/thttpd/thttpd_patch
@@ -2059,7 +2059,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c
@@ -1519,7 +1697,7 @@
if ( c->bytes_sent >= c->bytes_to_send )
{
- /* This conection is finished! */
+ /* This connection is finished! */
- clear_connection( c, tvP );
+ clear_connection( c, tvP, 1 );
return;
diff --git a/scripts/apache/apconf-conv.sh b/scripts/apache/apconf-conv.sh
deleted file mode 100755
index 6126bdc27d..0000000000
--- a/scripts/apache/apconf-conv.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = "" ]; then
- echo "Usage: $0 /somewhere/httpd.conf"
- exit 1
-fi
-
-if [ ! -w $1 ]; then
- echo "You cannot write to $1"
- exit 1
-fi
-
-TMPFILE=tmpfile.$$
-
-awk -f conffix.awk <$1 >$TMPFILE
-
-if [ "$?" != 0 ]; then
- exit 1
-fi
-
-mv -f $1 $1.orig
-mv -f $TMPFILE $1
-exit 0
-
diff --git a/scripts/apache/aphtaccess-conv.sh b/scripts/apache/aphtaccess-conv.sh
deleted file mode 100755
index 1af59d2843..0000000000
--- a/scripts/apache/aphtaccess-conv.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = "" ]; then
- echo "Usage: $0 /somewhere/.htaccess"
- exit 1
-fi
-
-if [ ! -w $1 ]; then
- echo "You cannot write to $1"
- exit 1
-fi
-
-TMPFILE=tmpfile.$$
-
-awk -f htaccessfix.awk <$1 >$TMPFILE
-
-if [ "$?" != 0 ]; then
- exit 1
-fi
-
-mv -f $1 $1.orig
-mv -f $TMPFILE $1
-exit 0
-
diff --git a/scripts/apache/conffix.awk b/scripts/apache/conffix.awk
deleted file mode 100644
index 88be6fade7..0000000000
--- a/scripts/apache/conffix.awk
+++ /dev/null
@@ -1,23 +0,0 @@
-# $Id$
-
-/^[ \t]*php3_*/ {
- phpcommand=substr($1,6)
- phpvalue=tolower($2)
- print "<IfModule mod_php3.c>"
- print $0
- print "</IfModule>"
- print "<IfModule mod_php4.c>"
- if (phpvalue=="on") {
- print "php_admin_flag " phpcommand " on"
- } else if (phpvalue=="off") {
- print "php_admin_flag " phpcommand " off"
- } else {
- print "php_admin_value " phpcommand " " substr($0,index($0,$1)+length($1)+1)
- }
- print "</IfModule>"
-}
-
-! /^[ \t]*php3_*/ {
- print $0
-}
-
diff --git a/scripts/apache/htaccessfix.awk b/scripts/apache/htaccessfix.awk
deleted file mode 100644
index 3c784cd335..0000000000
--- a/scripts/apache/htaccessfix.awk
+++ /dev/null
@@ -1,23 +0,0 @@
-# $Id$
-
-/^[ \t]*php3_*/ {
- phpcommand=substr($1,6)
- phpvalue=tolower($2)
- print "<IfModule mod_php3.c>"
- print $0
- print "</IfModule>"
- print "<IfModule mod_php4.c>"
- if (phpvalue=="on") {
- print "php_flag " phpcommand " on"
- } else if (phpvalue=="off") {
- print "php_flag " phpcommand " off"
- } else {
- print "php_value " phpcommand " " substr($0,index($0,$1)+length($1)+1)
- }
- print "</IfModule>"
-}
-
-! /^[ \t]*php3_*/ {
- print $0
-}
-
diff --git a/server-tests.php b/server-tests.php
index 8666895a96..3c5e36532a 100755
--- a/server-tests.php
+++ b/server-tests.php
@@ -961,7 +961,7 @@ class testHarness {
if ($just_save_results || strlen(trim($user_input)) == 0 || strtolower($user_input[0]) == 'y') {
/*
* Collect information about the host system for our report
- * Fetch phpinfo() output so that we can see the PHP enviroment
+ * Fetch phpinfo() output so that we can see the PHP environment
* Make an archive of all the failed tests
* Send an email
*/