summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS6
-rw-r--r--UPGRADING20
-rw-r--r--Zend/tests/self_and.phpt25
-rw-r--r--Zend/tests/self_mod.phpt25
-rw-r--r--Zend/tests/self_or.phpt25
-rw-r--r--Zend/tests/self_xor.phpt25
-rw-r--r--Zend/zend_API.c33
-rw-r--r--Zend/zend_API.h27
-rw-r--r--Zend/zend_compile.c7
-rw-r--r--Zend/zend_execute.h8
-rw-r--r--Zend/zend_execute_API.c10
-rw-r--r--Zend/zend_multiply.h24
-rw-r--r--Zend/zend_objects.c4
-rw-r--r--Zend/zend_operators.c18
-rw-r--r--Zend/zend_operators.h12
-rw-r--r--Zend/zend_types.h2
-rw-r--r--Zend/zend_vm_def.h110
-rw-r--r--Zend/zend_vm_execute.h132
-rw-r--r--ext/bcmath/tests/bug60377.phpt3
-rw-r--r--ext/curl/tests/curl_version_variation1.phpt3
-rw-r--r--ext/date/tests/bug36988.phpt7
-rw-r--r--ext/date/tests/bug52062.phpt12
-rw-r--r--ext/date/tests/date_sunrise_variation2.phpt6
-rw-r--r--ext/date/tests/date_sunrise_variation9.phpt40
-rw-r--r--ext/date/tests/date_sunset_variation2.phpt8
-rw-r--r--ext/date/tests/date_sunset_variation9.phpt38
-rw-r--r--ext/date/tests/getdate_variation7.phpt65
-rw-r--r--ext/date/tests/gmdate_variation14.phpt18
-rw-r--r--ext/date/tests/gmstrftime_variation2.phpt8
-rw-r--r--ext/date/tests/idate_variation3.phpt20
-rw-r--r--ext/date/tests/localtime_variation3.phpt102
-rw-r--r--ext/date/tests/strftime_variation23.phpt20
-rw-r--r--ext/exif/tests/exif_tagname_variation1.phpt4
-rw-r--r--ext/gd/libgd/gd_gif_in.c11
-rw-r--r--ext/gd/tests/imagecolorallocate_variation2.phpt1
-rw-r--r--ext/gd/tests/imagecolorallocate_variation4.phpt3
-rw-r--r--ext/gd/tests/imagecreatetruecolor_error2.phpt4
-rw-r--r--ext/iconv/tests/iconv_mime_decode_headers_variation2.phpt23
-rw-r--r--ext/iconv/tests/iconv_mime_decode_headers_variation3.phpt23
-rw-r--r--ext/iconv/tests/iconv_mime_decode_variation2.phpt5
-rw-r--r--ext/iconv/tests/iconv_strpos_variation3.phpt2
-rw-r--r--ext/intl/tests/bug53512.phpt4
-rw-r--r--ext/intl/tests/bug61487.phpt4
-rw-r--r--ext/intl/tests/collator_get_locale2.phpt1
-rw-r--r--ext/intl/tests/dateformat_get_locale.phpt4
-rw-r--r--ext/intl/tests/formatter_get_set_symbol2.phpt1
-rw-r--r--ext/mbstring/tests/mb_encode_mimeheader_variation5.phpt1
-rw-r--r--ext/mbstring/tests/mb_split_variation3.phpt3
-rw-r--r--ext/mbstring/tests/mb_stripos_variation3.phpt1
-rw-r--r--ext/mbstring/tests/mb_strpos_variation3.phpt1
-rw-r--r--ext/mbstring/tests/mb_strripos_variation3_Bug45923.phpt1
-rw-r--r--ext/mysqli/tests/mysqli_field_seek.phpt4
-rw-r--r--ext/mysqli/tests/mysqli_stmt_get_result_seek.phpt7
-rw-r--r--ext/mysqli/tests/mysqli_stmt_send_long_data.phpt6
-rw-r--r--[-rwxr-xr-x]ext/openssl/openssl.c0
-rw-r--r--ext/pcre/php_pcre.c2
-rw-r--r--ext/phar/func_interceptors.c6
-rw-r--r--[-rwxr-xr-x]ext/phar/phar_object.c9
-rw-r--r--ext/posix/tests/posix_getgrgid_variation.phpt5
-rw-r--r--ext/posix/tests/posix_getpgid_variation.phpt3
-rw-r--r--ext/posix/tests/posix_getpwuid_variation.phpt5
-rw-r--r--ext/posix/tests/posix_kill_variation1.phpt5
-rw-r--r--ext/posix/tests/posix_kill_variation2.phpt3
-rw-r--r--ext/posix/tests/posix_seteuid_variation4.phpt5
-rw-r--r--ext/posix/tests/posix_setgid_variation4.phpt5
-rw-r--r--ext/posix/tests/posix_setuid_variation4.phpt5
-rw-r--r--ext/posix/tests/posix_strerror_variation1.phpt7
-rw-r--r--ext/simplexml/tests/SimpleXMLElement_xpath.phpt12
-rw-r--r--ext/standard/array.c18
-rw-r--r--ext/standard/basic_functions.c8
-rw-r--r--ext/standard/info.c15
-rw-r--r--ext/standard/php_type.h2
-rw-r--r--ext/standard/strnatcmp.c4
-rw-r--r--ext/standard/tests/array/array_change_key_case_variation2.phpt4
-rw-r--r--ext/standard/tests/array/array_chunk_variation2.phpt2
-rw-r--r--ext/standard/tests/array/array_fill_variation1.phpt9
-rw-r--r--ext/standard/tests/array/array_pad_variation2.phpt2
-rw-r--r--ext/standard/tests/array/array_rand_variation2.phpt2
-rw-r--r--ext/standard/tests/array/array_slice_variation2.phpt13
-rw-r--r--ext/standard/tests/array/count_variation2.phpt4
-rw-r--r--ext/standard/tests/array/rsort_variation2.phpt4
-rw-r--r--ext/standard/tests/dir/scandir_variation2.phpt2
-rw-r--r--ext/standard/tests/file/chmod_variation4.phpt2
-rw-r--r--ext/standard/tests/file/file_get_contents_variation5.phpt2
-rw-r--r--ext/standard/tests/file/file_variation3.phpt2
-rw-r--r--ext/standard/tests/file/fseek_variation2.phpt2
-rw-r--r--ext/standard/tests/file/mkdir_variation2.phpt2
-rw-r--r--ext/standard/tests/file/pathinfo_variation2.phpt2
-rw-r--r--ext/standard/tests/file/touch_variation3.phpt1
-rw-r--r--ext/standard/tests/file/touch_variation4.phpt1
-rw-r--r--ext/standard/tests/file/umask_variation3.phpt1
-rw-r--r--ext/standard/tests/general_functions/getrusage_variation1.phpt1
-rw-r--r--ext/standard/tests/general_functions/intval_variation2.phpt10
-rw-r--r--ext/standard/tests/image/image_type_to_mime_type_variation1.phpt4
-rw-r--r--ext/standard/tests/math/mt_rand_variation2.phpt6
-rw-r--r--ext/standard/tests/math/mt_srand_variation1.phpt4
-rw-r--r--ext/standard/tests/math/rand_variation1.phpt6
-rw-r--r--ext/standard/tests/math/rand_variation2.phpt6
-rw-r--r--ext/standard/tests/math/srand_variation1.phpt4
-rw-r--r--ext/standard/tests/serialize/bug68594.phpt23
-rw-r--r--ext/standard/tests/strings/bug54322.phpt5
-rw-r--r--ext/standard/tests/strings/chunk_split_variation2.phpt6
-rw-r--r--ext/standard/tests/strings/chunk_split_variation5.phptbin2289 -> 2285 bytes
-rw-r--r--ext/standard/tests/strings/chunk_split_variation8.phpt4
-rw-r--r--ext/standard/tests/strings/count_chars_variation2.phpt2
-rw-r--r--ext/standard/tests/strings/explode.phpt2
-rw-r--r--ext/standard/tests/strings/htmlspecialchars_decode_variation2.phpt4
-rw-r--r--ext/standard/tests/strings/str_pad_variation4.phpt2
-rw-r--r--ext/standard/tests/strings/str_split_variation2.phpt4
-rw-r--r--ext/standard/tests/strings/str_split_variation6.phpt4
-rw-r--r--ext/standard/tests/strings/str_split_variation7.phpt4
-rw-r--r--ext/standard/tests/strings/strcspn_variation4.phpt4
-rw-r--r--ext/standard/tests/strings/stripos_variation14.phpt2
-rw-r--r--ext/standard/tests/strings/stripos_variation15.phpt2
-rw-r--r--ext/standard/tests/strings/strncasecmp_variation5.phpt2
-rw-r--r--ext/standard/tests/strings/strncmp_variation5.phpt2
-rw-r--r--ext/standard/tests/strings/strripos_offset.phpt10
-rw-r--r--ext/standard/tests/strings/strrpos_offset.phpt10
-rw-r--r--ext/standard/tests/strings/strrpos_variation14.phpt4
-rw-r--r--ext/standard/tests/strings/strrpos_variation15.phpt4
-rw-r--r--ext/standard/tests/url/parse_url_variation_002_32bit.phpt62
-rw-r--r--ext/standard/type.c6
-rw-r--r--ext/standard/var_unserializer.c85
-rw-r--r--ext/standard/var_unserializer.re20
-rw-r--r--ext/tokenizer/tests/001.phpt3
-rw-r--r--ext/xml/tests/xml_error_string_variation1.phpt2
-rw-r--r--ext/xml/tests/xml_parser_get_option_variation2.phpt2
-rw-r--r--ext/xml/tests/xml_parser_set_option_variation2.phpt1
-rw-r--r--ext/zlib/tests/gzfile_variation11.phpt3
-rw-r--r--ext/zlib/tests/gzopen_variation3.phpt3
-rw-r--r--ext/zlib/tests/readgzfile_variation11.phpt3
-rw-r--r--main/php_streams.h4
-rw-r--r--sapi/apache2handler/php_apache.h6
-rw-r--r--sapi/apache2handler/php_functions.c6
-rw-r--r--sapi/apache2handler/sapi_apache2.c4
-rw-r--r--sapi/fpm/Makefile.frag3
-rw-r--r--sapi/fpm/config.m42
-rw-r--r--sapi/fpm/php-fpm.conf.in432
-rw-r--r--sapi/fpm/www.conf.in409
-rw-r--r--sapi/phpdbg/phpdbg.h5
-rw-r--r--sapi/phpdbg/phpdbg_info.c3
-rw-r--r--sapi/phpdbg/phpdbg_prompt.c9
-rw-r--r--tests/output/ob_implicit_flush_variation_001.phpt4
143 files changed, 1373 insertions, 998 deletions
diff --git a/NEWS b/NEWS
index 44c247624e..aad4837de4 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-PHP NEWS
+PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 20??, PHP 7.0.0
@@ -26,6 +26,9 @@ PHP NEWS
constructor). (dunglas at gmail dot com)
. Removed ZEND_ACC_FINAL_CLASS, promoting ZEND_ACC_FINAL as final class
modifier. (Guilherme Blanco)
+ . is_long() & is_integer() is now an alias of is_int(). (Kalle)
+ . Implemented FR #55467 (phpinfo: PHP Variables with $ and single quotes). (Kalle)
+ . Fixed bug #55415 (php_info produces invalid anchor names). (Kalle, Johannes)
- Date:
. Fixed day_of_week function as it could sometimes return negative values
@@ -48,6 +51,7 @@ PHP NEWS
- FPM:
. Fixed bug #65933 (Cannot specify config lines longer than 1024 bytes). (Chris Wright)
+ . Implement request #67106 (Split main fpm config). (Elan Ruusamäe, Remi)
- LiteSpeed:
. Updated LiteSpeed SAPI code from V5.5 to V6.6. (George Wang)
diff --git a/UPGRADING b/UPGRADING
index c81b1d1142..1ce98194bf 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -22,8 +22,6 @@ PHP X.Y UPGRADE NOTES
========================================
- Core
- . Added null coalesce operator (??).
- (RFC: https://wiki.php.net/rfc/isset_ternary)
. list() now always supports ArrayAccess and never supports strings.
Previously both were accepted in some situations and not in others.
(RFC: https://wiki.php.net/rfc/fix_list_behavior_inconsistency)
@@ -36,6 +34,19 @@ PHP X.Y UPGRADE NOTES
around.
. Removed ASP (<%) and script (<script language=php>) tags.
(RFC: https://wiki.php.net/rfc/remove_alternative_php_tags)
+ . call_user_method() and call_user_method_array() no longer exists.
+ . PHP 7 doesn't keep original values of arguments passed to user functions,
+ so func_get_arg() and func_get_args() will return current value of argument
+ instead of the actually passed. The following code is going to be affected:
+ function foo($x) { $x = 2; return func_get_arg(0);} var_dump(foo(1));
+ It will now produce 2, not 1.
+ . Function parameters with duplicate name are not allowed anymore. Definitions
+ like “function foo($x,$x) {}” will lead to compile time error.
+ . Indirect variable, property and method references are now interpreted with
+ left-to-right semantics. See details in:
+ https://wiki.php.net/rfc/uniform_variable_syntax#semantic_differences_in_existing_syntax
+ . The global keyword now only accepts simple variables. See details in:
+ https://wiki.php.net/rfc/uniform_variable_syntax#global_keyword_takes_only_simple_variables
- DBA
. dba_delete() now returns false if the key was not found for the inifile
@@ -51,6 +62,8 @@ PHP X.Y UPGRADE NOTES
========================================
- Core
+ . Added null coalesce operator (??).
+ (RFC: https://wiki.php.net/rfc/isset_ternary)
. Support for strings with length >= 2^31 bytes in 64 bit builds
. Closure::call() method added
@@ -137,6 +150,3 @@ PHP X.Y UPGRADE NOTES
always be zero when casted to integer.
. Calling a method on a non-object no longer raises a fatal error; see
also: https://wiki.php.net/rfc/catchable-call-to-member-of-non-object
-
-- Standard
- . call_user_method() and call_user_method_array() no longer exists.
diff --git a/Zend/tests/self_and.phpt b/Zend/tests/self_and.phpt
new file mode 100644
index 0000000000..cdcde77992
--- /dev/null
+++ b/Zend/tests/self_and.phpt
@@ -0,0 +1,25 @@
+--TEST--
+ANDing strings
+--FILE--
+<?php
+
+$s = "123";
+$s1 = "test";
+$s2 = "45345some";
+
+$s &= 22;
+var_dump($s);
+
+$s1 &= 11;
+var_dump($s1);
+
+$s2 &= 33;
+var_dump($s2);
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(18)
+int(0)
+int(33)
+Done
diff --git a/Zend/tests/self_mod.phpt b/Zend/tests/self_mod.phpt
new file mode 100644
index 0000000000..19e45d88fc
--- /dev/null
+++ b/Zend/tests/self_mod.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Moduloing strings
+--FILE--
+<?php
+
+$s = "123";
+$s1 = "test";
+$s2 = "45345some";
+
+$s %= 22;
+var_dump($s);
+
+$s1 %= 11;
+var_dump($s1);
+
+$s2 %= 33;
+var_dump($s2);
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(13)
+int(0)
+int(3)
+Done
diff --git a/Zend/tests/self_or.phpt b/Zend/tests/self_or.phpt
new file mode 100644
index 0000000000..ae667bff16
--- /dev/null
+++ b/Zend/tests/self_or.phpt
@@ -0,0 +1,25 @@
+--TEST--
+ORing strings
+--FILE--
+<?php
+
+$s = "123";
+$s1 = "test";
+$s2 = "45345some";
+
+$s |= 22;
+var_dump($s);
+
+$s1 |= 11;
+var_dump($s1);
+
+$s2 |= 33;
+var_dump($s2);
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(127)
+int(11)
+int(45345)
+Done
diff --git a/Zend/tests/self_xor.phpt b/Zend/tests/self_xor.phpt
new file mode 100644
index 0000000000..a7e43f539d
--- /dev/null
+++ b/Zend/tests/self_xor.phpt
@@ -0,0 +1,25 @@
+--TEST--
+XORing strings
+--FILE--
+<?php
+
+$s = "123";
+$s1 = "test";
+$s2 = "45345some";
+
+$s ^= 22;
+var_dump($s);
+
+$s1 ^= 11;
+var_dump($s1);
+
+$s2 ^= 33;
+var_dump($s2);
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(109)
+int(11)
+int(45312)
+Done
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 2e13f3a20e..74679c4f04 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -404,14 +404,16 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons
if ((type = is_numeric_string(Z_STRVAL_P(arg), Z_STRLEN_P(arg), p, &d, -1)) == 0) {
return "long";
} else if (type == IS_DOUBLE) {
- if (c == 'L') {
- if (d > ZEND_LONG_MAX) {
- *p = ZEND_LONG_MAX;
- break;
- } else if (d < ZEND_LONG_MIN) {
- *p = ZEND_LONG_MIN;
- break;
+ if (zend_isnan(d)) {
+ return "long";
+ }
+ if (!ZEND_DOUBLE_FITS_LONG(d)) {
+ if (c == 'L') {
+ *p = (d > 0) ? ZEND_LONG_MAX : ZEND_LONG_MIN;
+ } else {
+ return "long";
}
+ break;
}
*p = zend_dval_to_lval(d);
@@ -420,14 +422,16 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons
break;
case IS_DOUBLE:
- if (c == 'L') {
- if (Z_DVAL_P(arg) > ZEND_LONG_MAX) {
- *p = ZEND_LONG_MAX;
- break;
- } else if (Z_DVAL_P(arg) < ZEND_LONG_MIN) {
- *p = ZEND_LONG_MIN;
- break;
+ if (zend_isnan(Z_DVAL_P(arg))) {
+ return "long";
+ }
+ if (!ZEND_DOUBLE_FITS_LONG(Z_DVAL_P(arg))) {
+ if (c == 'L') {
+ *p = (Z_DVAL_P(arg) > 0) ? ZEND_LONG_MAX : ZEND_LONG_MIN;
+ } else {
+ return "long";
}
+ break;
}
case IS_NULL:
case IS_FALSE:
@@ -1880,7 +1884,6 @@ static int zend_startup_module_zval(zval *zv TSRMLS_DC) /* {{{ */
}
/* }}} */
-
static void zend_sort_modules(void *base, size_t count, size_t siz, compare_func_t compare TSRMLS_DC) /* {{{ */
{
Bucket *b1 = base;
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index 052214140f..1e031ca844 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -1064,10 +1064,16 @@ static zend_always_inline int _z_param_long(zval *arg, zend_long *dest, zend_boo
if (EXPECTED(Z_TYPE_P(arg) == IS_LONG)) {
*dest = Z_LVAL_P(arg);
} else if (EXPECTED(Z_TYPE_P(arg) == IS_DOUBLE)) {
- if (strict && UNEXPECTED(Z_DVAL_P(arg) > ZEND_LONG_MAX)) {
- *dest = ZEND_LONG_MAX;
- } else if (strict && UNEXPECTED(Z_DVAL_P(arg) < ZEND_LONG_MIN)) {
- *dest = ZEND_LONG_MIN;
+ if (UNEXPECTED(zend_isnan(Z_DVAL_P(arg)))) {
+ return 0;
+ }
+ if (UNEXPECTED(!ZEND_DOUBLE_FITS_LONG(Z_DVAL_P(arg)))) {
+ /* Ironically, the strict parameter makes zpp *non*-strict here */
+ if (strict) {
+ *dest = (Z_DVAL_P(arg) > 0) ? ZEND_LONG_MAX : ZEND_LONG_MIN;
+ } else {
+ return 0;
+ }
} else {
*dest = zend_dval_to_lval(Z_DVAL_P(arg));
}
@@ -1077,10 +1083,15 @@ static zend_always_inline int _z_param_long(zval *arg, zend_long *dest, zend_boo
if (UNEXPECTED((type = is_numeric_str_function(Z_STR_P(arg), dest, &d)) != IS_LONG)) {
if (EXPECTED(type != 0)) {
- if (strict && UNEXPECTED(d > ZEND_LONG_MAX)) {
- *dest = ZEND_LONG_MAX;
- } else if (strict && UNEXPECTED(d < ZEND_LONG_MIN)) {
- *dest = ZEND_LONG_MIN;
+ if (UNEXPECTED(zend_isnan(d))) {
+ return 0;
+ }
+ if (UNEXPECTED(!ZEND_DOUBLE_FITS_LONG(d))) {
+ if (strict) {
+ *dest = (d > 0) ? ZEND_LONG_MAX : ZEND_LONG_MIN;
+ } else {
+ return 0;
+ }
} else {
*dest = zend_dval_to_lval(d);
}
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index dae6c22026..95892cbe67 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -2407,6 +2407,7 @@ uint32_t zend_compile_args(zend_ast *ast, zend_function *fbc TSRMLS_DC) /* {{{ *
zend_compile_expr(&arg_node, arg->child[0] TSRMLS_CC);
opline = zend_emit_op(NULL, ZEND_SEND_UNPACK, &arg_node, NULL TSRMLS_CC);
opline->op2.num = arg_count;
+ opline->result.var = (uint32_t)(zend_intptr_t)ZEND_CALL_ARG(NULL, arg_count);
continue;
}
@@ -2469,6 +2470,7 @@ uint32_t zend_compile_args(zend_ast *ast, zend_function *fbc TSRMLS_DC) /* {{{ *
SET_NODE(opline->op1, &arg_node);
SET_UNUSED(opline->op2);
opline->op2.opline_num = arg_num;
+ opline->result.var = (uint32_t)(zend_intptr_t)ZEND_CALL_ARG(NULL, arg_num);
if (opcode == ZEND_SEND_VAR_NO_REF) {
if (fbc) {
@@ -2696,7 +2698,7 @@ int zend_compile_func_cufa(znode *result, zend_ast_list *args, zend_string *lcna
return FAILURE;
}
- zend_compile_init_user_func(args->child[0], 1, lcname TSRMLS_CC);
+ zend_compile_init_user_func(args->child[0], 0, lcname TSRMLS_CC);
zend_compile_expr(&arg_node, args->child[1] TSRMLS_CC);
zend_emit_op(NULL, ZEND_SEND_ARRAY, &arg_node, NULL TSRMLS_CC);
zend_emit_op(result, ZEND_DO_FCALL, NULL, NULL TSRMLS_CC);
@@ -2737,7 +2739,8 @@ int zend_compile_func_cuf(znode *result, zend_ast_list *args, zend_string *lcnam
opline = zend_emit_op(NULL, ZEND_SEND_VAL, &arg_node, NULL TSRMLS_CC);
}
- opline->op2.opline_num = i;
+ opline->op2.num = i;
+ opline->result.var = (uint32_t)(zend_intptr_t)ZEND_CALL_ARG(NULL, i);
}
zend_emit_op(result, ZEND_DO_FCALL, NULL, NULL TSRMLS_CC);
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h
index a410f47edf..fdf07d52ab 100644
--- a/Zend/zend_execute.h
+++ b/Zend/zend_execute.h
@@ -143,14 +143,14 @@ static zend_always_inline zval* zend_vm_stack_alloc(size_t size TSRMLS_DC)
return (zval*)top;
}
-static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame_ex(uint32_t call_info, zend_function *func, uint32_t used_stack, zend_class_entry *called_scope, zend_object *object, zend_execute_data *prev TSRMLS_DC)
+static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame_ex(uint32_t used_stack, uint32_t call_info, zend_function *func, uint32_t num_args, zend_class_entry *called_scope, zend_object *object, zend_execute_data *prev TSRMLS_DC)
{
zend_execute_data *call = (zend_execute_data*)zend_vm_stack_alloc(used_stack TSRMLS_CC);
call->func = func;
Z_OBJ(call->This) = object;
ZEND_SET_CALL_INFO(call, call_info);
- ZEND_CALL_NUM_ARGS(call) = 0;
+ ZEND_CALL_NUM_ARGS(call) = num_args;
call->called_scope = called_scope;
call->prev_execute_data = prev;
return call;
@@ -170,8 +170,8 @@ static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame(uint3
{
uint32_t used_stack = zend_vm_calc_used_stack(num_args, func);
- return zend_vm_stack_push_call_frame_ex(call_info,
- func, used_stack, called_scope, object, prev TSRMLS_CC);
+ return zend_vm_stack_push_call_frame_ex(used_stack, call_info,
+ func, num_args, called_scope, object, prev TSRMLS_CC);
}
static zend_always_inline void zend_vm_stack_free_extra_args(zend_execute_data *call TSRMLS_DC)
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 480206bfb5..2b7951a8ee 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -818,7 +818,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
ZVAL_COPY(param, &fci->params[i]);
}
}
- ZEND_CALL_NUM_ARGS(call) = fci->param_count;
EG(scope) = calling_scope;
if (func->common.fn_flags & ZEND_ACC_STATIC) {
@@ -1471,17 +1470,14 @@ ZEND_API void zend_attach_symbol_table(zend_execute_data *execute_data) /* {{{ *
if (zv) {
if (Z_TYPE_P(zv) == IS_INDIRECT) {
zval *val = Z_INDIRECT_P(zv);
- if (Z_TYPE_P(val) == IS_UNDEF) {
- ZVAL_UNDEF(EX_VAR_NUM(i));
- } else {
- ZVAL_COPY_VALUE(EX_VAR_NUM(i), val);
- }
+
+ ZVAL_COPY_VALUE(EX_VAR_NUM(i), val);
} else {
ZVAL_COPY_VALUE(EX_VAR_NUM(i), zv);
}
} else {
ZVAL_UNDEF(EX_VAR_NUM(i));
- zv = zend_hash_update(ht, op_array->vars[i], EX_VAR_NUM(i));
+ zv = zend_hash_add_new(ht, op_array->vars[i], EX_VAR_NUM(i));
}
ZVAL_INDIRECT(zv, EX_VAR_NUM(i));
}
diff --git a/Zend/zend_multiply.h b/Zend/zend_multiply.h
index ab5fd6279d..b0000449af 100644
--- a/Zend/zend_multiply.h
+++ b/Zend/zend_multiply.h
@@ -224,6 +224,30 @@ static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, si
return res;
}
+#elif defined(__GNUC__) && defined(__powerpc64__)
+
+static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, int *overflow)
+{
+ size_t res;
+ unsigned long m_overflow;
+
+ __asm__ ("mulld %0,%2,%3\n\t"
+ "mulhdu %1,%2,%3\n\t"
+ "addc %0,%0,%4\n\t"
+ "addze %1,%1\n"
+ : "=&r"(res), "=&r"(m_overflow)
+ : "r"(nmemb),
+ "r"(size),
+ "r"(offset));
+
+ if (UNEXPECTED(m_overflow)) {
+ *overflow = 1;
+ return 0;
+ }
+ *overflow = 0;
+ return res;
+}
+
#elif SIZEOF_SIZE_T == 4
static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, int *overflow)
diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c
index 2778b168ee..69b5df2eab 100644
--- a/Zend/zend_objects.c
+++ b/Zend/zend_objects.c
@@ -167,9 +167,9 @@ ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object *o
zval_add_ref(&new_prop);
}
if (key) {
- zend_hash_update(new_object->properties, key, &new_prop);
+ zend_hash_add_new(new_object->properties, key, &new_prop);
} else {
- zend_hash_index_update(new_object->properties, num_key, &new_prop);
+ zend_hash_index_add_new(new_object->properties, num_key, &new_prop);
}
} ZEND_HASH_FOREACH_END();
}
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index bdb4ea8861..b43c672526 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -1162,6 +1162,9 @@ ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ *
return SUCCESS;
}
+ if (op1 == result) {
+ zval_dtor(result);
+ }
ZVAL_LONG(result, op1_lval % op2_lval);
return SUCCESS;
}
@@ -1324,6 +1327,9 @@ ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /
op2_lval = Z_LVAL_P(op2);
}
+ if (op1 == result) {
+ zval_dtor(result);
+ }
ZVAL_LONG(result, op1_lval | op2_lval);
return SUCCESS;
}
@@ -1379,6 +1385,9 @@ ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
op2_lval = Z_LVAL_P(op2);
}
+ if (op1 == result) {
+ zval_dtor(result);
+ }
ZVAL_LONG(result, op1_lval & op2_lval);
return SUCCESS;
}
@@ -1434,6 +1443,9 @@ ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
op2_lval = Z_LVAL_P(op2);
}
+ if (op1 == result) {
+ zval_dtor(result);
+ }
ZVAL_LONG(result, op1_lval ^ op2_lval);
return SUCCESS;
}
@@ -1486,6 +1498,9 @@ ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /
}
}
+ if (op1 == result) {
+ zval_dtor(result);
+ }
ZVAL_LONG(result, op1_lval << op2_lval);
return SUCCESS;
}
@@ -1538,6 +1553,9 @@ ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
}
}
+ if (op1 == result) {
+ zval_dtor(result);
+ }
ZVAL_LONG(result, op1_lval >> op2_lval);
return SUCCESS;
}
diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h
index ccd00b4e52..d27f5bf6f6 100644
--- a/Zend/zend_operators.h
+++ b/Zend/zend_operators.h
@@ -89,6 +89,13 @@ ZEND_API zend_uchar _is_numeric_string_ex(const char *str, size_t length, zend_l
END_EXTERN_C()
+#if SIZEOF_ZEND_LONG == 4
+# define ZEND_DOUBLE_FITS_LONG(d) (!((d) > ZEND_LONG_MAX || (d) < ZEND_LONG_MIN))
+#else
+ /* >= as (double)ZEND_LONG_MAX is outside signed range */
+# define ZEND_DOUBLE_FITS_LONG(d) (!((d) >= ZEND_LONG_MAX || (d) < ZEND_LONG_MIN))
+#endif
+
#if ZEND_DVAL_TO_LVAL_CAST_OK
static zend_always_inline zend_long zend_dval_to_lval(double d)
{
@@ -103,7 +110,7 @@ static zend_always_inline zend_long zend_dval_to_lval(double d)
{
if (UNEXPECTED(!zend_finite(d)) || UNEXPECTED(zend_isnan(d))) {
return 0;
- } else if (d > ZEND_LONG_MAX || d < ZEND_LONG_MIN) {
+ } else if (!ZEND_DOUBLE_FITS_LONG(d)) {
double two_pow_32 = pow(2., 32.),
dmod;
@@ -122,8 +129,7 @@ static zend_always_inline zend_long zend_dval_to_lval(double d)
{
if (UNEXPECTED(!zend_finite(d)) || UNEXPECTED(zend_isnan(d))) {
return 0;
- /* >= as (double)ZEND_LONG_MAX is outside signed range */
- } else if (d >= ZEND_LONG_MAX || d < ZEND_LONG_MIN) {
+ } else if (!ZEND_DOUBLE_FITS_LONG(d)) {
double two_pow_64 = pow(2., 64.),
dmod;
diff --git a/Zend/zend_types.h b/Zend/zend_types.h
index c7591d6414..7d89b4d2d5 100644
--- a/Zend/zend_types.h
+++ b/Zend/zend_types.h
@@ -194,7 +194,7 @@ struct _zend_object {
struct _zend_resource {
zend_refcounted gc;
- zend_long handle; // TODO: may be removed ???
+ int handle; // TODO: may be removed ???
int type;
void *ptr;
};
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 0bf218d581..8bf7986eeb 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -2736,8 +2736,9 @@ ZEND_VM_HANDLER(61, ZEND_INIT_FCALL, ANY, CONST)
CACHE_PTR(Z_CACHE_SLOT_P(fname), fbc);
}
- EX(call) = zend_vm_stack_push_call_frame_ex(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->op1.num, NULL, NULL, EX(call) TSRMLS_CC);
+ EX(call) = zend_vm_stack_push_call_frame_ex(
+ opline->op1.num, ZEND_CALL_NESTED_FUNCTION,
+ fbc, opline->extended_value, NULL, NULL, EX(call) TSRMLS_CC);
FREE_OP2();
@@ -3126,8 +3127,7 @@ ZEND_VM_HANDLER(65, ZEND_SEND_VAL, CONST|TMP, ANY)
SAVE_OPLINE();
value = GET_OP1_ZVAL_PTR(BP_VAR_R);
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
+ arg = ZEND_CALL_VAR(EX(call), opline->result.var);
ZVAL_COPY_VALUE(arg, value);
if (OP1_TYPE == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(arg))) {
@@ -3148,8 +3148,7 @@ ZEND_VM_HANDLER(116, ZEND_SEND_VAL_EX, CONST|TMP, ANY)
zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.num);
}
value = GET_OP1_ZVAL_PTR(BP_VAR_R);
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
+ arg = ZEND_CALL_VAR(EX(call), opline->result.var);
ZVAL_COPY_VALUE(arg, value);
if (OP1_TYPE == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(arg))) {
@@ -3166,8 +3165,7 @@ ZEND_VM_HANDLER(117, ZEND_SEND_VAR, VAR|CV, ANY)
zend_free_op free_op1;
varptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
+ arg = ZEND_CALL_VAR(EX(call), opline->result.var);
if (Z_ISREF_P(varptr)) {
ZVAL_COPY(arg, Z_REFVAL_P(varptr));
FREE_OP1();
@@ -3211,8 +3209,7 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
}
}
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
+ arg = ZEND_CALL_VAR(EX(call), opline->result.var);
ZVAL_COPY_VALUE(arg, varptr);
CHECK_EXCEPTION();
@@ -3232,8 +3229,7 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
}
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
+ arg = ZEND_CALL_VAR(EX(call), opline->result.var);
if (OP1_TYPE == IS_VAR && UNEXPECTED(varptr == &EG(error_zval))) {
ZVAL_NEW_REF(arg, &EG(uninitialized_zval));
ZEND_VM_NEXT_OPCODE();
@@ -3265,8 +3261,7 @@ ZEND_VM_HANDLER(66, ZEND_SEND_VAR_EX, VAR|CV, ANY)
ZEND_VM_DISPATCH_TO_HANDLER(ZEND_SEND_REF);
}
varptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
+ arg = ZEND_CALL_VAR(EX(call), opline->result.var);
if (Z_ISREF_P(varptr)) {
ZVAL_COPY(arg, Z_REFVAL_P(varptr));
FREE_OP1();
@@ -3477,7 +3472,6 @@ ZEND_VM_HANDLER(119, ZEND_SEND_ARRAY, ANY, ANY)
zval *arg, *param, tmp;
ZEND_VM_C_LABEL(send_array):
- arg_num = 1;
ht = Z_ARRVAL_P(args);
zend_vm_stack_extend_call_frame(&EX(call), 0, zend_hash_num_elements(ht) TSRMLS_CC);
@@ -3487,7 +3481,7 @@ ZEND_VM_C_LABEL(send_array):
/* check if any of arguments are going to be passed by reference */
for (i = 0; i < zend_hash_num_elements(ht); i++) {
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num + i)) {
+ if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, i)) {
separate = 1;
break;
}
@@ -3498,7 +3492,8 @@ ZEND_VM_C_LABEL(send_array):
}
}
- param = ZEND_CALL_ARG(EX(call), arg_num);
+ arg_num = 1;
+ param = ZEND_CALL_ARG(EX(call), 1);
ZEND_HASH_FOREACH_VAL(ht, arg) {
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
// TODO: Scalar values don't have reference counters anymore.
@@ -3577,7 +3572,7 @@ ZEND_VM_HANDLER(120, ZEND_SEND_USER, VAR|CV, ANY)
zend_free_op free_op1;
arg = GET_OP1_ZVAL_PTR(BP_VAR_R);
- param = ZEND_CALL_ARG(EX(call), opline->op2.num);
+ param = ZEND_CALL_VAR(EX(call), opline->result.var);
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
// TODO: Scalar values don't have reference counters anymore.
@@ -3642,8 +3637,6 @@ ZEND_VM_HANDLER(120, ZEND_SEND_USER, VAR|CV, ANY)
ZVAL_COPY(param, arg);
}
- ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
-
FREE_OP1();
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -5670,11 +5663,86 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
}
}
- if (EX(call)) {
+ if (UNEXPECTED(EX(call))) {
zend_execute_data *call = EX(call);
+ zend_op *opline = EX(func)->op_array.opcodes + op_num;
+ int level;
+ int do_exit;
+
do {
/* If the exception was thrown during a function call there might be
* arguments pushed to the stack that have to be dtor'ed. */
+
+ /* find the number of actually passed arguments */
+ level = 0;
+ do_exit = 0;
+ do {
+ switch (opline->opcode) {
+ case ZEND_DO_FCALL:
+ level++;
+ break;
+ case ZEND_INIT_FCALL:
+ case ZEND_INIT_FCALL_BY_NAME:
+ case ZEND_INIT_NS_FCALL_BY_NAME:
+ case ZEND_INIT_USER_CALL:
+ case ZEND_INIT_METHOD_CALL:
+ case ZEND_INIT_STATIC_METHOD_CALL:
+ case ZEND_NEW:
+ if (level == 0) {
+ ZEND_CALL_NUM_ARGS(call) = 0;
+ do_exit = 1;
+ }
+ level--;
+ break;
+ case ZEND_SEND_VAL:
+ case ZEND_SEND_VAL_EX:
+ case ZEND_SEND_VAR:
+ case ZEND_SEND_VAR_EX:
+ case ZEND_SEND_REF:
+ case ZEND_SEND_VAR_NO_REF:
+ case ZEND_SEND_USER:
+ if (level == 0) {
+ ZEND_CALL_NUM_ARGS(call) = opline->op2.num;
+ do_exit = 1;
+ }
+ break;
+ case ZEND_SEND_ARRAY:
+ case ZEND_SEND_UNPACK:
+ if (level == 0) {
+ do_exit = 1;
+ }
+ break;
+ }
+ if (!do_exit) {
+ opline--;
+ }
+ } while (!do_exit);
+ if (call->prev_execute_data) {
+ /* skip current call region */
+ level = 0;
+ do_exit = 0;
+ do {
+ switch (opline->opcode) {
+ case ZEND_DO_FCALL:
+ level++;
+ break;
+ case ZEND_INIT_FCALL:
+ case ZEND_INIT_FCALL_BY_NAME:
+ case ZEND_INIT_NS_FCALL_BY_NAME:
+ case ZEND_INIT_USER_CALL:
+ case ZEND_INIT_METHOD_CALL:
+ case ZEND_INIT_STATIC_METHOD_CALL:
+ case ZEND_NEW:
+ if (level == 0) {
+ do_exit = 1;
+ }
+ level--;
+ break;
+ }
+ opline--;
+ } while (!do_exit);
+ }
+
zend_vm_stack_free_args(EX(call) TSRMLS_CC);
if (Z_OBJ(call->This)) {
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 038953ccd4..f3fb43db96 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -879,7 +879,6 @@ static int ZEND_FASTCALL ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *arg, *param, tmp;
send_array:
- arg_num = 1;
ht = Z_ARRVAL_P(args);
zend_vm_stack_extend_call_frame(&EX(call), 0, zend_hash_num_elements(ht) TSRMLS_CC);
@@ -889,7 +888,7 @@ send_array:
/* check if any of arguments are going to be passed by reference */
for (i = 0; i < zend_hash_num_elements(ht); i++) {
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num + i)) {
+ if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, i)) {
separate = 1;
break;
}
@@ -900,7 +899,8 @@ send_array:
}
}
- param = ZEND_CALL_ARG(EX(call), arg_num);
+ arg_num = 1;
+ param = ZEND_CALL_ARG(EX(call), 1);
ZEND_HASH_FOREACH_VAL(ht, arg) {
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
// TODO: Scalar values don't have reference counters anymore.
@@ -1231,11 +1231,86 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
}
}
- if (EX(call)) {
+ if (UNEXPECTED(EX(call))) {
zend_execute_data *call = EX(call);
+ zend_op *opline = EX(func)->op_array.opcodes + op_num;
+ int level;
+ int do_exit;
+
do {
/* If the exception was thrown during a function call there might be
* arguments pushed to the stack that have to be dtor'ed. */
+
+ /* find the number of actually passed arguments */
+ level = 0;
+ do_exit = 0;
+ do {
+ switch (opline->opcode) {
+ case ZEND_DO_FCALL:
+ level++;
+ break;
+ case ZEND_INIT_FCALL:
+ case ZEND_INIT_FCALL_BY_NAME:
+ case ZEND_INIT_NS_FCALL_BY_NAME:
+ case ZEND_INIT_USER_CALL:
+ case ZEND_INIT_METHOD_CALL:
+ case ZEND_INIT_STATIC_METHOD_CALL:
+ case ZEND_NEW:
+ if (level == 0) {
+ ZEND_CALL_NUM_ARGS(call) = 0;
+ do_exit = 1;
+ }
+ level--;
+ break;
+ case ZEND_SEND_VAL:
+ case ZEND_SEND_VAL_EX:
+ case ZEND_SEND_VAR:
+ case ZEND_SEND_VAR_EX:
+ case ZEND_SEND_REF:
+ case ZEND_SEND_VAR_NO_REF:
+ case ZEND_SEND_USER:
+ if (level == 0) {
+ ZEND_CALL_NUM_ARGS(call) = opline->op2.num;
+ do_exit = 1;
+ }
+ break;
+ case ZEND_SEND_ARRAY:
+ case ZEND_SEND_UNPACK:
+ if (level == 0) {
+ do_exit = 1;
+ }
+ break;
+ }
+ if (!do_exit) {
+ opline--;
+ }
+ } while (!do_exit);
+ if (call->prev_execute_data) {
+ /* skip current call region */
+ level = 0;
+ do_exit = 0;
+ do {
+ switch (opline->opcode) {
+ case ZEND_DO_FCALL:
+ level++;
+ break;
+ case ZEND_INIT_FCALL:
+ case ZEND_INIT_FCALL_BY_NAME:
+ case ZEND_INIT_NS_FCALL_BY_NAME:
+ case ZEND_INIT_USER_CALL:
+ case ZEND_INIT_METHOD_CALL:
+ case ZEND_INIT_STATIC_METHOD_CALL:
+ case ZEND_NEW:
+ if (level == 0) {
+ do_exit = 1;
+ }
+ level--;
+ break;
+ }
+ opline--;
+ } while (!do_exit);
+ }
+
zend_vm_stack_free_args(EX(call) TSRMLS_CC);
if (Z_OBJ(call->This)) {
@@ -1656,8 +1731,9 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER
CACHE_PTR(Z_CACHE_SLOT_P(fname), fbc);
}
- EX(call) = zend_vm_stack_push_call_frame_ex(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->op1.num, NULL, NULL, EX(call) TSRMLS_CC);
+ EX(call) = zend_vm_stack_push_call_frame_ex(
+ opline->op1.num, ZEND_CALL_NESTED_FUNCTION,
+ fbc, opline->extended_value, NULL, NULL, EX(call) TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
}
@@ -2559,8 +2635,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
value = EX_CONSTANT(opline->op1);
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
+ arg = ZEND_CALL_VAR(EX(call), opline->result.var);
ZVAL_COPY_VALUE(arg, value);
if (IS_CONST == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(arg))) {
@@ -2581,8 +2656,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAL_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLE
zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.num);
}
value = EX_CONSTANT(opline->op1);
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
+ arg = ZEND_CALL_VAR(EX(call), opline->result.var);
ZVAL_COPY_VALUE(arg, value);
if (IS_CONST == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(arg))) {
@@ -8571,8 +8645,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
+ arg = ZEND_CALL_VAR(EX(call), opline->result.var);
ZVAL_COPY_VALUE(arg, value);
if (IS_TMP_VAR == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(arg))) {
@@ -8593,8 +8666,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAL_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_
zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.num);
}
value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
+ arg = ZEND_CALL_VAR(EX(call), opline->result.var);
ZVAL_COPY_VALUE(arg, value);
if (IS_TMP_VAR == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(arg))) {
@@ -11150,8 +11222,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_free_op free_op1;
varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
+ arg = ZEND_CALL_VAR(EX(call), opline->result.var);
if (Z_ISREF_P(varptr)) {
ZVAL_COPY(arg, Z_REFVAL_P(varptr));
zval_ptr_dtor_nogc(free_op1);
@@ -11195,8 +11266,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
}
}
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
+ arg = ZEND_CALL_VAR(EX(call), opline->result.var);
ZVAL_COPY_VALUE(arg, varptr);
CHECK_EXCEPTION();
@@ -11216,8 +11286,7 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
}
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
+ arg = ZEND_CALL_VAR(EX(call), opline->result.var);
if (IS_VAR == IS_VAR && UNEXPECTED(varptr == &EG(error_zval))) {
ZVAL_NEW_REF(arg, &EG(uninitialized_zval));
ZEND_VM_NEXT_OPCODE();
@@ -11249,8 +11318,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_
return ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
+ arg = ZEND_CALL_VAR(EX(call), opline->result.var);
if (Z_ISREF_P(varptr)) {
ZVAL_COPY(arg, Z_REFVAL_P(varptr));
zval_ptr_dtor_nogc(free_op1);
@@ -11270,7 +11338,7 @@ static int ZEND_FASTCALL ZEND_SEND_USER_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_free_op free_op1;
arg = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
- param = ZEND_CALL_ARG(EX(call), opline->op2.num);
+ param = ZEND_CALL_VAR(EX(call), opline->result.var);
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
// TODO: Scalar values don't have reference counters anymore.
@@ -11335,8 +11403,6 @@ static int ZEND_FASTCALL ZEND_SEND_USER_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
ZVAL_COPY(param, arg);
}
- ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
-
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -23262,8 +23328,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
+ arg = ZEND_CALL_VAR(EX(call), opline->result.var);
if (Z_ISREF_P(varptr)) {
ZVAL_COPY(arg, Z_REFVAL_P(varptr));
@@ -23307,8 +23372,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
}
}
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
+ arg = ZEND_CALL_VAR(EX(call), opline->result.var);
ZVAL_COPY_VALUE(arg, varptr);
CHECK_EXCEPTION();
@@ -23328,8 +23392,7 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
}
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
+ arg = ZEND_CALL_VAR(EX(call), opline->result.var);
if (IS_CV == IS_VAR && UNEXPECTED(varptr == &EG(error_zval))) {
ZVAL_NEW_REF(arg, &EG(uninitialized_zval));
ZEND_VM_NEXT_OPCODE();
@@ -23360,8 +23423,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_A
return ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
- ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
+ arg = ZEND_CALL_VAR(EX(call), opline->result.var);
if (Z_ISREF_P(varptr)) {
ZVAL_COPY(arg, Z_REFVAL_P(varptr));
@@ -23381,7 +23443,7 @@ static int ZEND_FASTCALL ZEND_SEND_USER_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
arg = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- param = ZEND_CALL_ARG(EX(call), opline->op2.num);
+ param = ZEND_CALL_VAR(EX(call), opline->result.var);
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
// TODO: Scalar values don't have reference counters anymore.
@@ -23445,8 +23507,6 @@ static int ZEND_FASTCALL ZEND_SEND_USER_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZVAL_COPY(param, arg);
}
- ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
-
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
diff --git a/ext/bcmath/tests/bug60377.phpt b/ext/bcmath/tests/bug60377.phpt
index 7c42002917..af7f7d44fd 100644
--- a/ext/bcmath/tests/bug60377.phpt
+++ b/ext/bcmath/tests/bug60377.phpt
@@ -1,7 +1,8 @@
--TEST--
bcscale related problem on 64bits platforms
--SKIPIF--
-<?php if(!extension_loaded("bcmath")) print "skip"; ?>
+<?php if(!extension_loaded("bcmath")) die("skip");
+if (PHP_INT_SIZE != 8) die("skip: 64-bit only"); ?>
--FILE--
<?php
$var48 = bcscale(634314234334311);
diff --git a/ext/curl/tests/curl_version_variation1.phpt b/ext/curl/tests/curl_version_variation1.phpt
index 927b4ac317..8b9554e5aa 100644
--- a/ext/curl/tests/curl_version_variation1.phpt
+++ b/ext/curl/tests/curl_version_variation1.phpt
@@ -1,7 +1,8 @@
--TEST--
Test curl_version() function : usage variations - test values for $ascii argument
--SKIPIF--
-<?php if (!extension_loaded("curl")) exit("skip curl extension not loaded"); ?>
+<?php if (!extension_loaded("curl")) exit("skip curl extension not loaded");
+if (PHP_INT_SIZE != 8) die('skip 64-bit only'); ?>
--FILE--
<?php
diff --git a/ext/date/tests/bug36988.phpt b/ext/date/tests/bug36988.phpt
index c37d1fb768..5fcacd6737 100644
--- a/ext/date/tests/bug36988.phpt
+++ b/ext/date/tests/bug36988.phpt
@@ -1,11 +1,12 @@
--TEST--
Bug #36988 (mktime freezes on long numbers)
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) echo "skip this test is for 32-bit only"; ?>
--FILE--
<?php
date_default_timezone_set('GMT');
$start = microtime(true);
$a = mktime(1, 1, 1, 1, 1, 11111111111);
-echo (microtime(true) - $start) < 1 ? "smaller than one second" : "more than a second";
?>
---EXPECT--
-smaller than one second
+--EXPECTF--
+Warning: mktime() expects parameter 6 to be long, double given in %s on line %d
diff --git a/ext/date/tests/bug52062.phpt b/ext/date/tests/bug52062.phpt
index 81e767b0f0..9d35a2942f 100644
--- a/ext/date/tests/bug52062.phpt
+++ b/ext/date/tests/bug52062.phpt
@@ -2,7 +2,7 @@
Bug #52062 (large timestamps with DateTime::getTimestamp and DateTime::setTimestamp) (32 bit)
--SKIPIF--
<?php
-if (PHP_INT_SIZE == 8) die('skip 32-bit only');
+if (PHP_INT_SIZE != 4) die('skip 32-bit only');
?>
--INI--
date.timezone=UTC
@@ -20,10 +20,12 @@ var_dump($d->getTimestamp());
$i = new DateInterval('PT100000000000S');
var_dump($i->format('%s'));
?>
---EXPECT--
+--EXPECTF--
string(32) "5138-11-16 09:46:40 100000000000"
bool(false)
string(12) "100000000000"
-string(30) "2008-07-11 04:56:32 1215752192"
-int(1215752192)
-string(10) "1215752192"
+
+Warning: DateTime::setTimestamp() expects parameter 1 to be long, double given in %s on line %d
+string(32) "5138-11-16 09:46:40 100000000000"
+bool(false)
+string(10) "1215752192" \ No newline at end of file
diff --git a/ext/date/tests/date_sunrise_variation2.phpt b/ext/date/tests/date_sunrise_variation2.phpt
index b613b35f96..6af0fbd84e 100644
--- a/ext/date/tests/date_sunrise_variation2.phpt
+++ b/ext/date/tests/date_sunrise_variation2.phpt
@@ -1,5 +1,7 @@
--TEST--
Test date_sunrise() function : usage variation - Passing unexpected values to second argument format.
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) echo "skip this test is for 32-bit only"; ?>
--FILE--
<?php
/* Prototype : mixed date_sunrise(mixed time [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]])
@@ -114,12 +116,12 @@ bool(false)
--float 12.3456789000e10--
-Warning: date_sunrise(): Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE in %s on line %d
+Warning: date_sunrise() expects parameter 2 to be long, double given in %s on line %d
bool(false)
--float -12.3456789000e10--
-Warning: date_sunrise(): Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE in %s on line %d
+Warning: date_sunrise() expects parameter 2 to be long, double given in %s on line %d
bool(false)
--float .5--
diff --git a/ext/date/tests/date_sunrise_variation9.phpt b/ext/date/tests/date_sunrise_variation9.phpt
index 49af06d524..f85032620b 100644
--- a/ext/date/tests/date_sunrise_variation9.phpt
+++ b/ext/date/tests/date_sunrise_variation9.phpt
@@ -1,5 +1,7 @@
--TEST--
Test date_sunrise() function : usage variation - Passing high positive and negative float values to time argument.
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) echo "skip this test is for 32-bit only"; ?>
--FILE--
<?php
/* Prototype : mixed date_sunrise(mixed time [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]])
@@ -32,16 +34,28 @@ var_dump( date_sunrise($time, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, $ze
?>
===DONE===
---EXPECTREGEX--
-\*\*\* Testing date_sunrise\(\) : usage variation \*\*\*
-
--- Testing date_sunrise\(\) function by passing float 12.3456789000e10 value to time --
-string\(5\) "(07:34|07:49)"
-float\((7.566[0-9]*|7.821[0-9]*)\)
-int\((-1097256359|123456811756)\)
-
--- Testing date_sunrise\(\) function by passing float -12.3456789000e10 value to time --
-string\(5\) "(07:42|08:48|08:04)"
-float\((7.713[0-9]*|8.810[0-9]*|8.074[0-9]*)\)
-int\((1097304168|-2147443882|-123456761731)\)
-===DONE===
+--EXPECTF--
+*** Testing date_sunrise() : usage variation ***
+
+-- Testing date_sunrise() function by passing float 12.3456789000e10 value to time --
+
+Warning: date_sunrise() expects parameter 1 to be long, double given in %s on line %d
+bool(false)
+
+Warning: date_sunrise() expects parameter 1 to be long, double given in %s on line %d
+bool(false)
+
+Warning: date_sunrise() expects parameter 1 to be long, double given in %s on line %d
+bool(false)
+
+-- Testing date_sunrise() function by passing float -12.3456789000e10 value to time --
+
+Warning: date_sunrise() expects parameter 1 to be long, double given in %s on line %d
+bool(false)
+
+Warning: date_sunrise() expects parameter 1 to be long, double given in %s on line %d
+bool(false)
+
+Warning: date_sunrise() expects parameter 1 to be long, double given in %s on line %d
+bool(false)
+===DONE=== \ No newline at end of file
diff --git a/ext/date/tests/date_sunset_variation2.phpt b/ext/date/tests/date_sunset_variation2.phpt
index 575b64a22c..50f6a00164 100644
--- a/ext/date/tests/date_sunset_variation2.phpt
+++ b/ext/date/tests/date_sunset_variation2.phpt
@@ -1,5 +1,7 @@
--TEST--
Test date_sunset() function : usage variation - Passing unexpected values to second argument format.
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) echo "skip this test is for 32-bit only"; ?>
--FILE--
<?php
/* Prototype : mixed date_sunset(mixed time [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]])
@@ -114,12 +116,12 @@ bool(false)
--float 12.3456789000e10--
-Warning: date_sunset(): Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE in %s on line %d
+Warning: date_sunset() expects parameter 2 to be long, double given in %s on line %d
bool(false)
--float -12.3456789000e10--
-Warning: date_sunset(): Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE in %s on line %d
+Warning: date_sunset() expects parameter 2 to be long, double given in %s on line %d
bool(false)
--float .5--
@@ -208,4 +210,4 @@ int(1218199253)
--unset var--
int(1218199253)
-===DONE===
+===DONE=== \ No newline at end of file
diff --git a/ext/date/tests/date_sunset_variation9.phpt b/ext/date/tests/date_sunset_variation9.phpt
index 59a4b584a5..db0f6e25ed 100644
--- a/ext/date/tests/date_sunset_variation9.phpt
+++ b/ext/date/tests/date_sunset_variation9.phpt
@@ -1,5 +1,7 @@
--TEST--
Test date_sunset() function : usage variation - Passing high positive and negative float values to time argument.
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) echo "skip this test is for 32-bit only"; ?>
--FILE--
<?php
/* Prototype : mixed date_sunset(mixed time [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]])
@@ -32,16 +34,28 @@ var_dump( date_sunset($time, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, $zen
?>
===DONE===
---EXPECTREGEX--
-\*\*\* Testing date_sunset\(\) : usage variation \*\*\*
-
--- Testing date_sunset\(\) function by passing float 12.3456789000e10 value to time --
-string\(5\) "(19:49|19:28)"
-float\((19.830[0-9]*|19.830[0-9]*|19.480[0-9]*)\)
-int\((-1097212211|123456853728)\)
-
--- Testing date_sunset\(\) function by passing float -12.3456789000e10 value to time --
-string\(5\) "(19:03|18:12|18:48)"
-float\((19.056[0-9]*|18.213[0-9]*|18.808[0-9]*)\)
-int\((1097345002|-2147410031|-123456723090)\)
+--EXPECTF--
+*** Testing date_sunset() : usage variation ***
+
+-- Testing date_sunset() function by passing float 12.3456789000e10 value to time --
+
+Warning: date_sunset() expects parameter 1 to be long, double given in %s on line %d
+bool(false)
+
+Warning: date_sunset() expects parameter 1 to be long, double given in %s on line %d
+bool(false)
+
+Warning: date_sunset() expects parameter 1 to be long, double given in %s on line %d
+bool(false)
+
+-- Testing date_sunset() function by passing float -12.3456789000e10 value to time --
+
+Warning: date_sunset() expects parameter 1 to be long, double given in %s on line %d
+bool(false)
+
+Warning: date_sunset() expects parameter 1 to be long, double given in %s on line %d
+bool(false)
+
+Warning: date_sunset() expects parameter 1 to be long, double given in %s on line %d
+bool(false)
===DONE===
diff --git a/ext/date/tests/getdate_variation7.phpt b/ext/date/tests/getdate_variation7.phpt
index 2088fa1792..44f3762ff9 100644
--- a/ext/date/tests/getdate_variation7.phpt
+++ b/ext/date/tests/getdate_variation7.phpt
@@ -1,5 +1,7 @@
--TEST--
Test getdate() function : usage variation - Passing high positive and negative float values to timestamp.
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) echo "skip this test is for 32-bit only"; ?>
--FILE--
<?php
/* Prototype : array getdate([int timestamp])
@@ -20,59 +22,16 @@ $timestamp = -12.3456789000e10;
var_dump( getdate($timestamp) );
?>
===DONE===
---EXPECTREGEX--
+--EXPECTF--
+*** Testing getdate() : usage variation ***
-\*\*\* Testing getdate\(\) : usage variation \*\*\*
+-- Testing getdate() function by passing float 12.3456789000e10 value to timestamp --
--- Testing getdate\(\) function by passing float 12.3456789000e10 value to timestamp --
-array\(11\) {
- \["seconds"\]=>
- int\((36|0)\)
- \["minutes"\]=>
- int\((43|0)\)
- \["hours"\]=>
- int\((10|6)\)
- \["mday"\]=>
- int\((26|11)\)
- \["wday"\]=>
- int\((2|6)\)
- \["mon"\]=>
- int\(3\)
- \["year"\]=>
- int\((1935|5882)\)
- \["yday"\]=>
- int\((84|69)\)
- \["weekday"\]=>
- string\((7|8)\) "(Tuesday|Saturday)"
- \["month"\]=>
- string\(5\) "March"
- \[0\]=>
- int\((-1097262584|123456789000)\)
-}
+Warning: getdate() expects parameter 1 to be long, double given in %s on line %d
+bool(false)
--- Testing getdate\(\) function by passing float -12.3456789000e10 value to timestamp --
-array\(11\) {
- \["seconds"\]=>
- int\((44|12|20)\)
- \["minutes"\]=>
- int\((39|23)\)
- \["hours"\]=>
- int\((0|2|5)\)
- \["mday"\]=>
- int\((9|14|23)\)
- \["wday"\]=>
- int\(0\)
- \["mon"\]=>
- int\((10|12)\)
- \["year"\]=>
- int\((2004|1901|-1943)\)
- \["yday"\]=>
- int\((282|347|295)\)
- \["weekday"\]=>
- string\(6\) "Sunday"
- \["month"\]=>
- string\((7|8)\) "(October|December)"
- \[0\]=>
- int\((1097262584|-2147483648|-123456789000)\)
-}
-===DONE===
+-- Testing getdate() function by passing float -12.3456789000e10 value to timestamp --
+
+Warning: getdate() expects parameter 1 to be long, double given in %s on line %d
+bool(false)
+===DONE=== \ No newline at end of file
diff --git a/ext/date/tests/gmdate_variation14.phpt b/ext/date/tests/gmdate_variation14.phpt
index 5b62a8274d..099af0d732 100644
--- a/ext/date/tests/gmdate_variation14.phpt
+++ b/ext/date/tests/gmdate_variation14.phpt
@@ -1,5 +1,7 @@
--TEST--
Test gmdate() function : usage variation - Passing high positive and negetive float values to timestamp.
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) echo "skip this test is for 32-bit only"; ?>
--FILE--
<?php
/* Prototype : string gmdate(string format [, long timestamp])
@@ -23,12 +25,16 @@ var_dump( gmdate($format, $timestamp) );
?>
===DONE===
---EXPECTREGEX--
-\*\*\* Testing gmdate\(\) : usage variation \*\*\*
+--EXPECTF--
+*** Testing gmdate() : usage variation ***
--- Testing gmdate\(\) function with float 12.3456789000e10 to timestamp --
-string\((24|25)\) "(1935-03-26T04:50:16\+0000|5882-03-11T00:30:00\+0000)"
+-- Testing gmdate() function with float 12.3456789000e10 to timestamp --
--- Testing gmdate\(\) function with float -12.3456789000e10 to timestamp --
-string\((24|25)\) "(2004-10-08T19:09:44\+0000|1901-12-13T20:45:52\+0000|-1943-10-22T23:30:00\+0000)"
+Warning: gmdate() expects parameter 2 to be long, double given in %s on line %d
+bool(false)
+
+-- Testing gmdate() function with float -12.3456789000e10 to timestamp --
+
+Warning: gmdate() expects parameter 2 to be long, double given in %s on line %d
+bool(false)
===DONE=== \ No newline at end of file
diff --git a/ext/date/tests/gmstrftime_variation2.phpt b/ext/date/tests/gmstrftime_variation2.phpt
index c577fe1d3d..c591dc3b16 100644
--- a/ext/date/tests/gmstrftime_variation2.phpt
+++ b/ext/date/tests/gmstrftime_variation2.phpt
@@ -112,10 +112,14 @@ string(20) "Jan 01 1970 00:00:10"
string(20) "Dec 31 1969 23:59:50"
--float 12.3456789000e10--
-string(20) "Mar 26 1935 04:50:16"
+
+Warning: gmstrftime() expects parameter 2 to be long, double given in %s on line %d
+bool(false)
--float -12.3456789000e10--
-string(20) "Oct 08 2004 19:09:44"
+
+Warning: gmstrftime() expects parameter 2 to be long, double given in %s on line %d
+bool(false)
--float .5--
string(20) "Jan 01 1970 00:00:00"
diff --git a/ext/date/tests/idate_variation3.phpt b/ext/date/tests/idate_variation3.phpt
index 1a2ee1ffd5..fbbfa5ee1e 100644
--- a/ext/date/tests/idate_variation3.phpt
+++ b/ext/date/tests/idate_variation3.phpt
@@ -1,5 +1,7 @@
--TEST--
Test idate() function : usage variation - Passing higher positive and negetive float values to timestamp.
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) echo "skip this test is for 32-bit only"; ?>
--FILE--
<?php
/* Prototype : int idate(string format [, int timestamp])
@@ -24,12 +26,16 @@ var_dump( idate($format, $timestamp) );
?>
===DONE===
---EXPECTREGEX--
-\*\*\* Testing idate\(\) : usage variation \*\*\*
+--EXPECTF--
+*** Testing idate() : usage variation ***
--- Testing idate\(\) function with float 12.3456789000e10 to timestamp --
-int\((1935|5882)\)
+-- Testing idate() function with float 12.3456789000e10 to timestamp --
--- Testing idate\(\) function with float -12.3456789000e10 to timestamp --
-int\((2004|1901|-1943)\)
-===DONE===
+Warning: idate() expects parameter 2 to be long, double given in %s on line %d
+bool(false)
+
+-- Testing idate() function with float -12.3456789000e10 to timestamp --
+
+Warning: idate() expects parameter 2 to be long, double given in %s on line %d
+bool(false)
+===DONE=== \ No newline at end of file
diff --git a/ext/date/tests/localtime_variation3.phpt b/ext/date/tests/localtime_variation3.phpt
index 34d8f57f01..b29098d295 100644
--- a/ext/date/tests/localtime_variation3.phpt
+++ b/ext/date/tests/localtime_variation3.phpt
@@ -1,5 +1,7 @@
--TEST--
Test localtime() function : usage variation - Passing higher positive and negetive float values to timestamp.
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) echo "skip this test is for 32-bit only"; ?>
--FILE--
<?php
/* Prototype : array localtime([int timestamp [, bool associative_array]])
@@ -27,90 +29,22 @@ var_dump( localtime($timestamp, $is_associative) );
?>
===DONE===
---EXPECTREGEX--
-\*\*\* Testing localtime\(\) : usage variation \*\*\*
+--EXPECTF--
+*** Testing localtime() : usage variation ***
--- Testing localtime\(\) function with 'float 12.3456789000e10' to timestamp --
-array\(9\) {
- \[0\]=>
- int\((16|0)\)
- \[1\]=>
- int\((50|30)\)
- \[2\]=>
- int\((4|0)\)
- \[3\]=>
- int\((26|11)\)
- \[4\]=>
- int\(2\)
- \[5\]=>
- int\((35|3982)\)
- \[6\]=>
- int\((2|6)\)
- \[7\]=>
- int\((84|69)\)
- \[8\]=>
- int\(0\)
-}
-array\(9\) {
- \["tm_sec"\]=>
- int\((16|0)\)
- \["tm_min"\]=>
- int\((50|30)\)
- \["tm_hour"\]=>
- int\((4|0)\)
- \["tm_mday"\]=>
- int\((26|11)\)
- \["tm_mon"\]=>
- int\(2\)
- \["tm_year"\]=>
- int\((35|3982)\)
- \["tm_wday"\]=>
- int\((2|6)\)
- \["tm_yday"\]=>
- int\((84|69)\)
- \["tm_isdst"\]=>
- int\(0\)
-}
+-- Testing localtime() function with 'float 12.3456789000e10' to timestamp --
--- Testing localtime\(\) function with 'float -12.3456789000e10' to timestamp --
-array\(9\) {
- \[0\]=>
- int\((44|52|0)\)
- \[1\]=>
- int\((9|45|30)\)
- \[2\]=>
- int\((19|20|23)\)
- \[3\]=>
- int\((8|13|22)\)
- \[4\]=>
- int\((9|11)\)
- \[5\]=>
- int\((104|1|-3843)\)
- \[6\]=>
- int\(6\)
- \[7\]=>
- int\((281|346|294)\)
- \[8\]=>
- int\(0\)
-}
-array\(9\) {
- \["tm_sec"\]=>
- int\((44|52|0)\)
- \["tm_min"\]=>
- int\((9|45|30)\)
- \["tm_hour"\]=>
- int\((19|20|23)\)
- \["tm_mday"\]=>
- int\((8|13|22)\)
- \["tm_mon"\]=>
- int\((9|11)\)
- \["tm_year"\]=>
- int\((104|1|-3843)\)
- \["tm_wday"\]=>
- int\(6\)
- \["tm_yday"\]=>
- int\((281|346|294)\)
- \["tm_isdst"\]=>
- int\(0\)
-}
+Warning: localtime() expects parameter 1 to be long, double given in %s on line %d
+bool(false)
+
+Warning: localtime() expects parameter 1 to be long, double given in %s on line %d
+bool(false)
+
+-- Testing localtime() function with 'float -12.3456789000e10' to timestamp --
+
+Warning: localtime() expects parameter 1 to be long, double given in %s on line %d
+bool(false)
+
+Warning: localtime() expects parameter 1 to be long, double given in %s on line %d
+bool(false)
===DONE===
diff --git a/ext/date/tests/strftime_variation23.phpt b/ext/date/tests/strftime_variation23.phpt
index b7cf8d788e..7e027851dd 100644
--- a/ext/date/tests/strftime_variation23.phpt
+++ b/ext/date/tests/strftime_variation23.phpt
@@ -1,5 +1,7 @@
--TEST--
Test strftime() function : usage variation - Checking large positive and negative float values to timestamp.
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) echo "skip this test is for 32-bit only"; ?>
--FILE--
<?php
/* Prototype : string strftime(string format [, int timestamp])
@@ -25,12 +27,16 @@ var_dump( strftime($format, $timestamp) );
?>
===DONE===
---EXPECTREGEX--
-\*\*\* Testing strftime\(\) : usage variation \*\*\*
+--EXPECTF--
+*** Testing strftime() : usage variation ***
--- Testing strftime\(\) function with float 12.3456789000e10 to timestamp --
-string\(\d*\)\s"Mar\s(26|11)\s(1935|5882)\s(04|00):(50|30):(16|00)"
+-- Testing strftime() function with float 12.3456789000e10 to timestamp --
--- Testing strftime\(\) function with float -12.3456789000e10 to timestamp --
-string\(\d*\)\s"(Oct|Dec)\s(08|13|22)\s(2004|1901|-1943)\s(19|20|23):(09|45|30):(44|52|00)"
-===DONE===
+Warning: strftime() expects parameter 2 to be long, double given in %s on line %d
+bool(false)
+
+-- Testing strftime() function with float -12.3456789000e10 to timestamp --
+
+Warning: strftime() expects parameter 2 to be long, double given in %s on line %d
+bool(false)
+===DONE=== \ No newline at end of file
diff --git a/ext/exif/tests/exif_tagname_variation1.phpt b/ext/exif/tests/exif_tagname_variation1.phpt
index 0f9c135420..efa227ec7e 100644
--- a/ext/exif/tests/exif_tagname_variation1.phpt
+++ b/ext/exif/tests/exif_tagname_variation1.phpt
@@ -1,7 +1,9 @@
--TEST--
Test exif_tagname() function : usage variations - different types for index argument
--SKIPIF--
-<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
+<?php if (!extension_loaded('exif')) print 'skip exif extension not available';
+if (PHP_INT_SIZE != 8) die('skip 64-bit only');
+?>
--FILE--
<?php
diff --git a/ext/gd/libgd/gd_gif_in.c b/ext/gd/libgd/gd_gif_in.c
index ee88a2fc8e..491e9422db 100644
--- a/ext/gd/libgd/gd_gif_in.c
+++ b/ext/gd/libgd/gd_gif_in.c
@@ -72,8 +72,10 @@ static struct {
#define STACK_SIZE ((1<<(MAX_LWZ_BITS))*2)
+#define CSD_BUF_SIZE 280
+
typedef struct {
- unsigned char buf[280];
+ unsigned char buf[CSD_BUF_SIZE];
int curbit, lastbit, done, last_byte;
} CODE_STATIC_DATA;
@@ -400,7 +402,12 @@ GetCode_(gdIOCtx *fd, CODE_STATIC_DATA *scd, int code_size, int flag, int *ZeroD
ret = 0;
for (i = scd->curbit, j = 0; j < code_size; ++i, ++j)
- ret |= ((scd->buf[ i / 8 ] & (1 << (i % 8))) != 0) << j;
+ if (i < CSD_BUF_SIZE * 8) {
+ ret |= ((scd->buf[i / 8] & (1 << (i % 8))) != 0) << j;
+ } else {
+ ret = -1;
+ break;
+ }
scd->curbit += code_size;
return ret;
diff --git a/ext/gd/tests/imagecolorallocate_variation2.phpt b/ext/gd/tests/imagecolorallocate_variation2.phpt
index bd9dc984d1..84ff9e26ff 100644
--- a/ext/gd/tests/imagecolorallocate_variation2.phpt
+++ b/ext/gd/tests/imagecolorallocate_variation2.phpt
@@ -8,6 +8,7 @@ if(!extension_loaded('gd')) {
if(!function_exists('imagecreatetruecolor')) {
die('skip imagecreatetruecolor function is not available');
}
+if (PHP_INT_SIZE != 8) die('skip 64-bit only');
?>
--FILE--
<?php
diff --git a/ext/gd/tests/imagecolorallocate_variation4.phpt b/ext/gd/tests/imagecolorallocate_variation4.phpt
index 328a4cd3b2..8b82d01a87 100644
--- a/ext/gd/tests/imagecolorallocate_variation4.phpt
+++ b/ext/gd/tests/imagecolorallocate_variation4.phpt
@@ -8,6 +8,7 @@ if(!extension_loaded('gd')) {
if(!function_exists('imagecreatetruecolor')) {
die('skip imagecreatetruecolor function is not available');
}
+if (PHP_INT_SIZE != 8) die('skip 64-bit only');
?>
--FILE--
<?php
@@ -210,4 +211,4 @@ int(657920)
Warning: imagecolorallocate() expects parameter 4 to be long, resource given in %s on line %d
NULL
-===DONE=== \ No newline at end of file
+===DONE===
diff --git a/ext/gd/tests/imagecreatetruecolor_error2.phpt b/ext/gd/tests/imagecreatetruecolor_error2.phpt
index e4de7e382d..c5a5e69283 100644
--- a/ext/gd/tests/imagecreatetruecolor_error2.phpt
+++ b/ext/gd/tests/imagecreatetruecolor_error2.phpt
@@ -19,6 +19,6 @@ Warning: imagecreatetruecolor(): Invalid image dimensions in %s on line %d
Warning: imagecreatetruecolor(): Invalid image dimensions in %s on line %d
-Warning: imagecreatetruecolor(): Invalid image dimensions in %s on line %d
+Warning: imagecreatetruecolor() expects parameter 1 to be long, double given in %s on line %d
-Warning: imagecreatetruecolor(): Invalid image dimensions in %s on line %d \ No newline at end of file
+Warning: imagecreatetruecolor() expects parameter 2 to be long, double given in %s on line %d
diff --git a/ext/iconv/tests/iconv_mime_decode_headers_variation2.phpt b/ext/iconv/tests/iconv_mime_decode_headers_variation2.phpt
index 5ceb801bed..4c771dbb23 100644
--- a/ext/iconv/tests/iconv_mime_decode_headers_variation2.phpt
+++ b/ext/iconv/tests/iconv_mime_decode_headers_variation2.phpt
@@ -2,6 +2,7 @@
Test iconv_mime_encode() function : usage variations - Pass different data types to mode arg
--SKIPIF--
<?php
+PHP_INT_SIZE == 4 or die('skip');
extension_loaded('iconv') or die('skip');
function_exists('iconv_mime_decode_headers') or die("skip iconv_mime_decode_headers() is not available in this build");
?>
@@ -234,23 +235,9 @@ array(5) {
}
-- Iteration 7 --
-array(5) {
- ["Subject"]=>
- string(13) "A Sample Test"
- ["To"]=>
- string(19) "example@example.com"
- ["Date"]=>
- string(30) "Thu, 1 Jan 1970 00:00:00 +0000"
- ["Message-Id"]=>
- string(21) "<example@example.com>"
- ["Received"]=>
- array(2) {
- [0]=>
- string(204) "from localhost (localhost [127.0.0.1]) by localhost with SMTP id example for <example@example.com>; Thu, 1 Jan 1970 00:00:00 +0000 (UTC) (envelope-from example-return-0000-example=example.com@example.com)"
- [1]=>
- string(57) "(qmail 0 invoked by uid 65534); 1 Thu 2003 00:00:00 +0000"
- }
-}
+
+Warning: iconv_mime_decode_headers() expects parameter 2 to be long, double given in %s on line %d
+bool(false)
-- Iteration 8 --
array(5) {
@@ -476,4 +463,4 @@ array(5) {
Warning: iconv_mime_decode_headers() expects parameter 2 to be long, resource given in %s on line %d
bool(false)
-Done \ No newline at end of file
+Done
diff --git a/ext/iconv/tests/iconv_mime_decode_headers_variation3.phpt b/ext/iconv/tests/iconv_mime_decode_headers_variation3.phpt
index c4a9cc434a..0f604c4f2f 100644
--- a/ext/iconv/tests/iconv_mime_decode_headers_variation3.phpt
+++ b/ext/iconv/tests/iconv_mime_decode_headers_variation3.phpt
@@ -2,6 +2,7 @@
Test iconv_mime_encode() function : usage variations - Pass different data types to charset arg
--SKIPIF--
<?php
+PHP_INT_SIZE == 4 or die('skip');
extension_loaded('iconv') or die('skip');
function_exists('iconv_mime_decode_headers') or die("skip iconv_mime_decode_headers() is not available in this build");
?>
@@ -237,23 +238,9 @@ array(5) {
}
-- Iteration 7 --
-array(5) {
- ["Subject"]=>
- string(13) "A Sample Test"
- ["To"]=>
- string(19) "example@example.com"
- ["Date"]=>
- string(30) "Thu, 1 Jan 1970 00:00:00 +0000"
- ["Message-Id"]=>
- string(21) "<example@example.com>"
- ["Received"]=>
- array(2) {
- [0]=>
- string(204) "from localhost (localhost [127.0.0.1]) by localhost with SMTP id example for <example@example.com>; Thu, 1 Jan 1970 00:00:00 +0000 (UTC) (envelope-from example-return-0000-example=example.com@example.com)"
- [1]=>
- string(57) "(qmail 0 invoked by uid 65534); 1 Thu 2003 00:00:00 +0000"
- }
-}
+
+Warning: iconv_mime_decode_headers() expects parameter 2 to be long, double given in %s on line %d
+bool(false)
-- Iteration 8 --
array(5) {
@@ -479,4 +466,4 @@ array(5) {
Warning: iconv_mime_decode_headers() expects parameter 2 to be long, resource given in %s on line %d
bool(false)
-Done \ No newline at end of file
+Done
diff --git a/ext/iconv/tests/iconv_mime_decode_variation2.phpt b/ext/iconv/tests/iconv_mime_decode_variation2.phpt
index 1d828227ae..a779ecc436 100644
--- a/ext/iconv/tests/iconv_mime_decode_variation2.phpt
+++ b/ext/iconv/tests/iconv_mime_decode_variation2.phpt
@@ -2,6 +2,7 @@
Test iconv_mime_decode() function : usage variations - Pass different data types to mode arg
--SKIPIF--
<?php
+PHP_INT_SIZE == 4 or die('skip');
extension_loaded('iconv') or die('skip');
function_exists('iconv_mime_decode') or die("skip iconv_mime_decode() is not available in this build");
?>
@@ -126,7 +127,9 @@ string(52) "5375626a6563743a205072c3bc66756e67205072c3bc66756e67"
string(52) "5375626a6563743a205072c3bc66756e67205072c3bc66756e67"
-- Iteration 7 --
-string(52) "5375626a6563743a205072c3bc66756e67205072c3bc66756e67"
+
+Warning: iconv_mime_decode() expects parameter 2 to be long, double given in %s on line %d
+string(0) ""
-- Iteration 8 --
string(52) "5375626a6563743a205072c3bc66756e67205072c3bc66756e67"
diff --git a/ext/iconv/tests/iconv_strpos_variation3.phpt b/ext/iconv/tests/iconv_strpos_variation3.phpt
index 3c333bfa57..221b3a733f 100644
--- a/ext/iconv/tests/iconv_strpos_variation3.phpt
+++ b/ext/iconv/tests/iconv_strpos_variation3.phpt
@@ -131,7 +131,7 @@ bool(false)
-- Iteration 7 --
-Warning: iconv_strpos(): Offset not contained in string. in %s on line %d
+Warning: iconv_strpos() expects parameter 3 to be long, double given in %s on line %d
bool(false)
-- Iteration 8 --
diff --git a/ext/intl/tests/bug53512.phpt b/ext/intl/tests/bug53512.phpt
index a1b1dcf37a..0de2c49a20 100644
--- a/ext/intl/tests/bug53512.phpt
+++ b/ext/intl/tests/bug53512.phpt
@@ -1,7 +1,9 @@
--TEST--
Bug #53512 (NumberFormatter::setSymbol crash on bogus $attr values)
--SKIPIF--
-<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php if( !extension_loaded( 'intl' ) ) die('skip');
+if (PHP_INT_SIZE != 8) die('skip 64-bit only');
+?>
--FILE--
<?php
diff --git a/ext/intl/tests/bug61487.phpt b/ext/intl/tests/bug61487.phpt
index 361debe408..2270b25cce 100644
--- a/ext/intl/tests/bug61487.phpt
+++ b/ext/intl/tests/bug61487.phpt
@@ -1,7 +1,9 @@
--TEST--
grapheme() str[i]pos limits
--SKIPIF--
-<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php if( !extension_loaded( 'intl' ) ) die('skip');
+if (PHP_INT_SIZE != 8) die('skip 64-bit only');
+?>
--FILE--
<?php
var_dump(grapheme_stripos(1,1,2147483648));
diff --git a/ext/intl/tests/collator_get_locale2.phpt b/ext/intl/tests/collator_get_locale2.phpt
index 798c7927f6..e9a9f2653d 100644
--- a/ext/intl/tests/collator_get_locale2.phpt
+++ b/ext/intl/tests/collator_get_locale2.phpt
@@ -3,6 +3,7 @@ get_locale() icu >= 4.8
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip'; ?>
+<?php if (PHP_INT_SIZE != 8) die('skip 64-bit only'); ?>
--FILE--
<?php
diff --git a/ext/intl/tests/dateformat_get_locale.phpt b/ext/intl/tests/dateformat_get_locale.phpt
index 17fcca3551..48b7daa8d4 100644
--- a/ext/intl/tests/dateformat_get_locale.phpt
+++ b/ext/intl/tests/dateformat_get_locale.phpt
@@ -1,7 +1,9 @@
--TEST--
datefmt_get_locale_code()
--SKIPIF--
-<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php if( !extension_loaded( 'intl' ) ) die('skip');
+if (PHP_INT_SIZE != 8) die('skip 64-bit only');
+?>
--FILE--
<?php
diff --git a/ext/intl/tests/formatter_get_set_symbol2.phpt b/ext/intl/tests/formatter_get_set_symbol2.phpt
index 769713b97d..3f982cd063 100644
--- a/ext/intl/tests/formatter_get_set_symbol2.phpt
+++ b/ext/intl/tests/formatter_get_set_symbol2.phpt
@@ -3,6 +3,7 @@ numfmt_get/set_symbol() icu >= 4.8
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip'; ?>
+<?php if (PHP_INT_SIZE != 8) die('skip 64-bit only'); ?>
--FILE--
<?php
diff --git a/ext/mbstring/tests/mb_encode_mimeheader_variation5.phpt b/ext/mbstring/tests/mb_encode_mimeheader_variation5.phpt
index d57bc1061a..4833cd5df6 100644
--- a/ext/mbstring/tests/mb_encode_mimeheader_variation5.phpt
+++ b/ext/mbstring/tests/mb_encode_mimeheader_variation5.phpt
@@ -4,6 +4,7 @@ Test mb_encode_mimeheader() function : usage variations - Pass different data ty
<?php
extension_loaded('mbstring') or die('skip');
function_exists('mb_encode_mimeheader') or die("skip mb_encode_mimeheader() is not available in this build");
+if (PHP_INT_SIZE != 8) die('skip 64-bit only');
?>
--FILE--
<?php
diff --git a/ext/mbstring/tests/mb_split_variation3.phpt b/ext/mbstring/tests/mb_split_variation3.phpt
index 5422b169cd..ec20c53640 100644
--- a/ext/mbstring/tests/mb_split_variation3.phpt
+++ b/ext/mbstring/tests/mb_split_variation3.phpt
@@ -4,6 +4,7 @@ Test mb_split() function : usage variations - different parameter types for lim
<?php
extension_loaded('mbstring') or die('skip');
function_exists('mb_split') or die("skip mb_split() is not available in this build");
+if (PHP_INT_SIZE != 8) die('skip 64-bit only');
?>
--FILE--
<?php
@@ -328,4 +329,4 @@ array(1) {
Warning: mb_split() expects parameter 3 to be long, resource given in %s on line %d
bool(false)
-Done \ No newline at end of file
+Done
diff --git a/ext/mbstring/tests/mb_stripos_variation3.phpt b/ext/mbstring/tests/mb_stripos_variation3.phpt
index decf02e883..122a599a58 100644
--- a/ext/mbstring/tests/mb_stripos_variation3.phpt
+++ b/ext/mbstring/tests/mb_stripos_variation3.phpt
@@ -4,6 +4,7 @@ Test mb_stripos() function : usage variations - pass different data types as $of
<?php
extension_loaded('mbstring') or die('skip');
function_exists('mb_stripos') or die("skip mb_stripos() is not available in this build");
+if (PHP_INT_SIZE != 8) die('skip 64-bit only');
?>
--FILE--
<?php
diff --git a/ext/mbstring/tests/mb_strpos_variation3.phpt b/ext/mbstring/tests/mb_strpos_variation3.phpt
index ff69b8c6f8..ac78b62b54 100644
--- a/ext/mbstring/tests/mb_strpos_variation3.phpt
+++ b/ext/mbstring/tests/mb_strpos_variation3.phpt
@@ -4,6 +4,7 @@ Test mb_strpos() function : usage variations - pass different data types as $off
<?php
extension_loaded('mbstring') or die('skip');
function_exists('mb_strpos') or die("skip mb_strpos() is not available in this build");
+if (PHP_INT_SIZE != 8) die('skip 64-bit only');
?>
--FILE--
<?php
diff --git a/ext/mbstring/tests/mb_strripos_variation3_Bug45923.phpt b/ext/mbstring/tests/mb_strripos_variation3_Bug45923.phpt
index 8f4370f4b8..c7e17be2ec 100644
--- a/ext/mbstring/tests/mb_strripos_variation3_Bug45923.phpt
+++ b/ext/mbstring/tests/mb_strripos_variation3_Bug45923.phpt
@@ -4,6 +4,7 @@ Test mb_strripos() function : usage variations - pass different data types as $o
<?php
extension_loaded('mbstring') or die('skip');
function_exists('mb_strripos') or die("skip mb_strripos() is not available in this build");
+if (PHP_INT_SIZE != 8) die('skip 64-bit only');
?>
--FILE--
<?php
diff --git a/ext/mysqli/tests/mysqli_field_seek.phpt b/ext/mysqli/tests/mysqli_field_seek.phpt
index 449d2f90d4..44f25bcfed 100644
--- a/ext/mysqli/tests/mysqli_field_seek.phpt
+++ b/ext/mysqli/tests/mysqli_field_seek.phpt
@@ -218,8 +218,8 @@ Warning: mysqli_field_seek(): Invalid field offset in %s on line %d
bool(false)
bool(false)
-Warning: mysqli_field_seek(): Invalid field offset in %s on line %d
-bool(false)
+Warning: mysqli_field_seek() expects parameter 2 to be long, double given in %s on line %d
+NULL
bool(true)
object(stdClass)#%d (13) {
[%u|b%"name"]=>
diff --git a/ext/mysqli/tests/mysqli_stmt_get_result_seek.phpt b/ext/mysqli/tests/mysqli_stmt_get_result_seek.phpt
index ffb655d5fa..88add0aba5 100644
--- a/ext/mysqli/tests/mysqli_stmt_get_result_seek.phpt
+++ b/ext/mysqli/tests/mysqli_stmt_get_result_seek.phpt
@@ -67,8 +67,8 @@ if (!function_exists('mysqli_stmt_get_result'))
if (false !== ($tmp = $res->data_seek($res->num_rows + 1)))
printf("[012] Expecting boolean/false got %s/%s\n", gettype($tmp), $tmp);
- if (false !== ($tmp = $res->data_seek(PHP_INT_MAX + 1)))
- printf("[013] Expecting boolean/false got %s/%s\n", gettype($tmp), $tmp);
+ if (NULL !== ($tmp = $res->data_seek(PHP_INT_MAX + 1)))
+ printf("[013] Expecting NULL got %s/%s\n", gettype($tmp), $tmp);
for ($i = 0; $i < 100; $i++) {
/* intentionally out of range! */
@@ -118,6 +118,7 @@ if (!function_exists('mysqli_stmt_get_result'))
require_once("clean_table.inc");
?>
--EXPECTF--
+Warning: mysqli_result::data_seek() expects parameter 1 to be long, double given in %s on line %d
Warning: mysqli_data_seek(): Couldn't fetch mysqli_result in %s on line %d
@@ -126,4 +127,4 @@ Warning: mysqli_result::fetch_array(): Couldn't fetch mysqli_result in %s on lin
Warning: mysqli_data_seek(): Couldn't fetch mysqli_result in %s on line %d
Warning: mysqli_result::fetch_array(): Couldn't fetch mysqli_result in %s on line %d
-done! \ No newline at end of file
+done!
diff --git a/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt b/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt
index 7e2f8603a8..1fc2745511 100644
--- a/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt
+++ b/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt
@@ -80,8 +80,8 @@ require_once('skipifconnectfailure.inc');
printf("[012] Expecting boolean/false, got %s/%s. [%d] %s\n",
gettype($tmp), $tmp, mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
- if (false !== ($tmp = @mysqli_stmt_send_long_data($stmt, PHP_INT_MAX + 1, $blob)))
- printf("[013] Expecting boolean/false, got %s/%s. [%d] %s\n",
+ if (NULL !== ($tmp = @mysqli_stmt_send_long_data($stmt, PHP_INT_MAX + 1, $blob)))
+ printf("[013] Expecting NULL, got %s/%s. [%d] %s\n",
gettype($tmp), $tmp, mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
if (false !== ($tmp = mysqli_stmt_send_long_data($stmt, 999, $blob)))
@@ -132,4 +132,4 @@ require_once('skipifconnectfailure.inc');
?>
--EXPECTF--
Warning: mysqli_stmt_send_long_data(): Invalid parameter number in %s on line %d
-done! \ No newline at end of file
+done!
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 60d36ff743..60d36ff743 100755..100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 6f9f2aebbf..eb3b75abd2 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -1561,7 +1561,7 @@ static PHP_FUNCTION(preg_split)
/* Get function parameters and do error checking */
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|ll", &regex,
- &subject, &subject_len, &limit_val, &flags) == FAILURE) {
+ &subject, &limit_val, &flags) == FAILURE) {
RETURN_FALSE;
}
#else
diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c
index bd7324c78e..fa303a3b22 100644
--- a/ext/phar/func_interceptors.c
+++ b/ext/phar/func_interceptors.c
@@ -339,7 +339,7 @@ PHAR_FUNC(phar_fopen) /* {{{ */
}
if (use_include_path || (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://"))) {
char *arch, *entry, *fname;
- size_t arch_len, entry_len, fname_len;
+ int arch_len, entry_len, fname_len;
php_stream_context *context = NULL;
char *name;
phar_archive_data *phar;
@@ -349,7 +349,7 @@ PHAR_FUNC(phar_fopen) /* {{{ */
goto skip_phar;
}
fname_len = strlen(fname);
- if (FAILURE == phar_split_fname(fname, fname_len, &arch, (int *)&arch_len, &entry, (int *)&entry_len, 2, 0 TSRMLS_CC)) {
+ if (FAILURE == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
goto skip_phar;
}
@@ -371,7 +371,7 @@ PHAR_FUNC(phar_fopen) /* {{{ */
name = entry;
}
} else {
- entry = phar_fix_filepath(estrndup(entry, entry_len), (int *)&entry_len, 1 TSRMLS_CC);
+ entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1 TSRMLS_CC);
if (entry[0] == '/') {
if (!zend_hash_str_exists(&(phar->manifest), entry + 1, entry_len - 1)) {
/* this file is not in the phar, use the original path */
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index d23c7cd6c6..b6ce546086 100755..100644
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -546,7 +546,8 @@ PHP_METHOD(Phar, webPhar)
{
zval *mimeoverride = NULL, *rewrite = NULL;
char *alias = NULL, *error, *index_php = NULL, *f404 = NULL, *ru = NULL;
- size_t alias_len = 0, f404_len = 0, free_pathinfo = 0, ru_len = 0;
+ size_t alias_len = 0, f404_len = 0, free_pathinfo = 0;
+ int ru_len = 0;
char *fname, *path_info, *mime_type = NULL, *entry, *pt;
const char *basename;
size_t fname_len, index_php_len = 0;
@@ -729,7 +730,7 @@ PHP_METHOD(Phar, webPhar)
}
if (entry_len) {
- phar_postprocess_ru_web(fname, fname_len, &entry, (int *)&entry_len, &ru, (int *)&ru_len TSRMLS_CC);
+ phar_postprocess_ru_web(fname, fname_len, &entry, &entry_len, &ru, &ru_len TSRMLS_CC);
}
if (!entry_len || (entry_len == 1 && entry[0] == '/')) {
@@ -1999,7 +2000,7 @@ static zend_object *phar_rename_archive(phar_archive_data *phar, char *ext, zend
zend_class_entry *ce;
char *error;
const char *pcr_error;
- size_t ext_len = ext ? strlen(ext) : 0;
+ int ext_len = ext ? strlen(ext) : 0;
int oldname_len;
phar_archive_data *pphar = NULL;
php_stream_statbuf ssb;
@@ -2050,7 +2051,7 @@ static zend_object *phar_rename_archive(phar_archive_data *phar, char *ext, zend
ext = "phar";
}
}
- } else if (phar_path_check(&ext, (int *)&ext_len, &pcr_error) > pcr_is_ok) {
+ } else if (phar_path_check(&ext, &ext_len, &pcr_error) > pcr_is_ok) {
if (phar->is_data) {
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "data phar converted from \"%s\" has invalid extension %s", phar->fname, ext);
diff --git a/ext/posix/tests/posix_getgrgid_variation.phpt b/ext/posix/tests/posix_getgrgid_variation.phpt
index 5cce391d7b..4923f408c1 100644
--- a/ext/posix/tests/posix_getgrgid_variation.phpt
+++ b/ext/posix/tests/posix_getgrgid_variation.phpt
@@ -1,7 +1,8 @@
--TEST--
Test posix_getgrgid() function : usage variations - parameter types
--SKIPIF--
-<?php
+<?php
+ PHP_INT_SIZE == 4 or die("skip - 32-bit only");
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
?>
--FILE--
@@ -95,6 +96,8 @@ Arg value -10.5
valid output
Arg value 101234567000
+
+Warning: posix_getgrgid() expects parameter 1 to be long, double given in %s on line %d
valid output
Arg value 1.07654321E-9
diff --git a/ext/posix/tests/posix_getpgid_variation.phpt b/ext/posix/tests/posix_getpgid_variation.phpt
index b9c92b539a..f96bca29a3 100644
--- a/ext/posix/tests/posix_getpgid_variation.phpt
+++ b/ext/posix/tests/posix_getpgid_variation.phpt
@@ -2,6 +2,7 @@
Test posix_getpgid() function : variation
--SKIPIF--
<?php
+PHP_INT_SIZE == 4 or die("skip - 32-bit only");
if((!extension_loaded("posix")) || (!function_exists("posix_getpgid"))) {
print "skip - POSIX extension not loaded or posix_getpgid() does not exist";
}
@@ -95,6 +96,8 @@ Arg value -10.5
valid output
Arg value 101234567000
+
+Warning: posix_getpgid() expects parameter 1 to be long, double given in %s on line %d
valid output
Arg value 1.07654321E-9
diff --git a/ext/posix/tests/posix_getpwuid_variation.phpt b/ext/posix/tests/posix_getpwuid_variation.phpt
index 8b66f7f3d5..9e0698af42 100644
--- a/ext/posix/tests/posix_getpwuid_variation.phpt
+++ b/ext/posix/tests/posix_getpwuid_variation.phpt
@@ -1,7 +1,8 @@
--TEST--
Test posix_getpwuid() function : usage variations - parameter types
--SKIPIF--
-<?php
+<?php
+ PHP_INT_SIZE == 4 or die("skip - 32-bit only");
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
?>
--FILE--
@@ -95,6 +96,8 @@ Arg value -10.5
valid output
Arg value 101234567000
+
+Warning: posix_getpwuid() expects parameter 1 to be long, double given in %s on line %d
valid output
Arg value 1.07654321E-9
diff --git a/ext/posix/tests/posix_kill_variation1.phpt b/ext/posix/tests/posix_kill_variation1.phpt
index 230977a9d0..353c90d7cf 100644
--- a/ext/posix/tests/posix_kill_variation1.phpt
+++ b/ext/posix/tests/posix_kill_variation1.phpt
@@ -1,7 +1,8 @@
--TEST--
Test posix_kill() function : usage variations - first parameter type
--SKIPIF--
-<?php
+<?php
+ PHP_INT_SIZE == 4 or die("skip - 32-bit only");
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
?>
--FILE--
@@ -89,6 +90,8 @@ Arg value -10.5
bool(false)
Arg value 101234567000
+
+Warning: posix_kill() expects parameter 1 to be long, double given in %s on line %d
bool(false)
Arg value 1.07654321E-9
diff --git a/ext/posix/tests/posix_kill_variation2.phpt b/ext/posix/tests/posix_kill_variation2.phpt
index c03ead9a4b..6b104ccb22 100644
--- a/ext/posix/tests/posix_kill_variation2.phpt
+++ b/ext/posix/tests/posix_kill_variation2.phpt
@@ -2,6 +2,7 @@
Test posix_kill() function : usage variations - second parameter type
--SKIPIF--
<?php
+ PHP_INT_SIZE == 4 or die("skip - 32-bit only");
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
?>
--FILE--
@@ -89,6 +90,8 @@ Arg value -10.5
bool(false)
Arg value 101234567000
+
+Warning: posix_kill() expects parameter 2 to be long, double given in %s on line %d
bool(false)
Arg value 1.07654321E-9
diff --git a/ext/posix/tests/posix_seteuid_variation4.phpt b/ext/posix/tests/posix_seteuid_variation4.phpt
index a6473284d4..de814ce644 100644
--- a/ext/posix/tests/posix_seteuid_variation4.phpt
+++ b/ext/posix/tests/posix_seteuid_variation4.phpt
@@ -2,6 +2,7 @@
Test function posix_seteuid() by substituting argument 1 with float values.
--SKIPIF--
<?php
+ PHP_INT_SIZE == 4 or die("skip - 32-bit only");
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
if(posix_geteuid() == 0) print "skip - Cannot run test as root.";
?>
@@ -36,6 +37,10 @@ foreach ( $variation_array as $var ) {
*** Test substituting argument 1 with float values ***
bool(false)
bool(false)
+
+Warning: posix_seteuid() expects parameter 1 to be long, double given in %s on line %d
bool(false)
+
+Warning: posix_seteuid() expects parameter 1 to be long, double given in %s on line %d
bool(false)
bool(false)
diff --git a/ext/posix/tests/posix_setgid_variation4.phpt b/ext/posix/tests/posix_setgid_variation4.phpt
index faae4d4d44..1f02012453 100644
--- a/ext/posix/tests/posix_setgid_variation4.phpt
+++ b/ext/posix/tests/posix_setgid_variation4.phpt
@@ -2,6 +2,7 @@
Test function posix_setgid() by substituting argument 1 with float values.
--SKIPIF--
<?php
+ PHP_INT_SIZE == 4 or die("skip - 32-bit only");
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
if(posix_geteuid() == 0) print "skip - Cannot run test as root.";
?>
@@ -35,7 +36,11 @@ foreach ( $variation_array as $var ) {
*** Test substituting argument 1 with float values ***
bool(false)
bool(false)
+
+Warning: posix_setgid() expects parameter 1 to be long, double given in %s on line %d
bool(false)
+
+Warning: posix_setgid() expects parameter 1 to be long, double given in %s on line %d
bool(false)
bool(false)
===DONE===
diff --git a/ext/posix/tests/posix_setuid_variation4.phpt b/ext/posix/tests/posix_setuid_variation4.phpt
index 288ac0d8f1..dbdc6ab7bf 100644
--- a/ext/posix/tests/posix_setuid_variation4.phpt
+++ b/ext/posix/tests/posix_setuid_variation4.phpt
@@ -2,6 +2,7 @@
Test function posix_setuid() by substituting argument 1 with float values.
--SKIPIF--
<?php
+ PHP_INT_SIZE == 4 or die("skip - 32-bit only");
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
if(posix_geteuid() == 0) print "skip - Cannot run test as root.";
?>
@@ -36,6 +37,10 @@ foreach ( $variation_array as $var ) {
*** Test substituting argument 1 with float values ***
bool(false)
bool(false)
+
+Warning: posix_setuid() expects parameter 1 to be long, double given in %s on line %d
bool(false)
+
+Warning: posix_setuid() expects parameter 1 to be long, double given in %s on line %d
bool(false)
bool(false)
diff --git a/ext/posix/tests/posix_strerror_variation1.phpt b/ext/posix/tests/posix_strerror_variation1.phpt
index 4d2b526716..9e2099a71e 100644
--- a/ext/posix/tests/posix_strerror_variation1.phpt
+++ b/ext/posix/tests/posix_strerror_variation1.phpt
@@ -1,7 +1,8 @@
--TEST--
Test posix_strerror() function : usage variations
--SKIPIF--
-<?php
+<?php
+ PHP_INT_SIZE == 4 or die("skip - 32-bit only");
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
?>
--FILE--
@@ -88,7 +89,9 @@ Arg value -10.5
string
Arg value 101234567000
-string
+
+Warning: posix_strerror() expects parameter 1 to be long, double given in %s on line %d
+boolean
Arg value 1.07654321E-9
string
diff --git a/ext/simplexml/tests/SimpleXMLElement_xpath.phpt b/ext/simplexml/tests/SimpleXMLElement_xpath.phpt
index 4a613c2e51..afdf95b339 100644
--- a/ext/simplexml/tests/SimpleXMLElement_xpath.phpt
+++ b/ext/simplexml/tests/SimpleXMLElement_xpath.phpt
@@ -1,8 +1,14 @@
--TEST--
Testing xpath() with invalid XML
+--SKIPIF--
+<?php PHP_INT_SIZE == 4 or die("skip - 32-bit only");
--FILE--
<?php
-$xml = @simplexml_load_string("XXXXXXX^",$x,0x6000000000000001);
+$xml = simplexml_load_string("XXXXXXX^",$x,0x6000000000000001);
var_dump($xml->xpath("BBBB"));
---EXPECT--
-bool(false)
+--EXPECTF--
+Notice: Undefined variable: x in %s on line %d
+
+Warning: simplexml_load_string() expects parameter 3 to be long, double given in %s on line %d
+
+Catchable fatal error: Call to a member function xpath() on null in %s on line %d
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 1f03e5acb8..83c00c993e 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -3428,13 +3428,8 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
}
/* copy the argument array */
- RETVAL_ZVAL(&args[0], 1, 0);
- if (Z_ARRVAL_P(return_value) == &EG(symbol_table).ht) {
- HashTable *old_ht = Z_ARRVAL_P(return_value);
-
- ZVAL_NEW_ARR(return_value);
- zend_array_dup(Z_ARRVAL_P(return_value), old_ht);
- }
+ ZVAL_NEW_ARR(return_value);
+ zend_array_dup(Z_ARRVAL_P(return_value), Z_ARRVAL(args[0]));
/* go through the lists and look for common values */
while (Z_TYPE(ptrs[0]->val) != IS_UNDEF) {
@@ -3851,13 +3846,8 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
}
/* copy the argument array */
- RETVAL_ZVAL(&args[0], 1, 0);
- if (Z_ARRVAL_P(return_value) == &EG(symbol_table).ht) {
- HashTable *old_ht = Z_ARRVAL_P(return_value);
-
- ZVAL_NEW_ARR(return_value);
- zend_array_dup(Z_ARRVAL_P(return_value), old_ht);
- }
+ ZVAL_NEW_ARR(return_value);
+ zend_array_dup(Z_ARRVAL_P(return_value), Z_ARRVAL(args[0]));
/* go through the lists and look for values of ptr[0] that are not in the others */
while (Z_TYPE(ptrs[0]->val) != IS_UNDEF) {
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 9ffe0fe14e..479ac7b8a2 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -2513,7 +2513,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_is_bool, 0)
ZEND_ARG_INFO(0, var)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO(arginfo_is_long, 0)
+ZEND_BEGIN_ARG_INFO(arginfo_is_int, 0)
ZEND_ARG_INFO(0, var)
ZEND_END_ARG_INFO()
@@ -3027,10 +3027,10 @@ const zend_function_entry basic_functions[] = { /* {{{ */
PHP_FE(is_null, arginfo_is_null)
PHP_FE(is_resource, arginfo_is_resource)
PHP_FE(is_bool, arginfo_is_bool)
- PHP_FE(is_long, arginfo_is_long)
+ PHP_FE(is_int, arginfo_is_int)
PHP_FE(is_float, arginfo_is_float)
- PHP_FALIAS(is_int, is_long, arginfo_is_long)
- PHP_FALIAS(is_integer, is_long, arginfo_is_long)
+ PHP_FALIAS(is_integer, is_int, arginfo_is_int)
+ PHP_FALIAS(is_long, is_int, arginfo_is_int)
PHP_FALIAS(is_double, is_float, arginfo_is_float)
PHP_FALIAS(is_real, is_float, arginfo_is_float)
PHP_FE(is_numeric, arginfo_is_numeric)
diff --git a/ext/standard/info.c b/ext/standard/info.c
index 7a118af7b4..bd0770919f 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -37,7 +37,8 @@
#ifdef HAVE_SYS_UTSNAME_H
#include <sys/utsname.h>
#endif
-
+#include "url.h"
+#include "php_string.h"
#ifdef PHP_WIN32
typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
@@ -146,7 +147,12 @@ PHPAPI void php_info_print_module(zend_module_entry *zend_module TSRMLS_DC) /* {
{
if (zend_module->info_func || zend_module->version) {
if (!sapi_module.phpinfo_as_text) {
- php_info_printf("<h2><a name=\"module_%s\">%s</a></h2>\n", zend_module->name, zend_module->name);
+ zend_string *url_name = php_url_encode(zend_module->name, strlen(zend_module->name));
+
+ php_strtolower(url_name->val, url_name->len);
+ php_info_printf("<h2><a name=\"module_%s\">%s</a></h2>\n", url_name->val, zend_module->name);
+
+ efree(url_name);
} else {
php_info_print_table_start();
php_info_print_table_header(1, zend_module->name);
@@ -209,8 +215,9 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
php_info_print("<td class=\"e\">");
}
+ php_info_print("$");
php_info_print(name);
- php_info_print("[\"");
+ php_info_print("['");
if (string_key != NULL) {
if (!sapi_module.phpinfo_as_text) {
@@ -221,7 +228,7 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
} else {
php_info_printf(ZEND_ULONG_FMT, num_key);
}
- php_info_print("\"]");
+ php_info_print("']");
if (!sapi_module.phpinfo_as_text) {
php_info_print("</td><td class=\"v\">");
} else {
diff --git a/ext/standard/php_type.h b/ext/standard/php_type.h
index e6d8152b1b..14a782c37b 100644
--- a/ext/standard/php_type.h
+++ b/ext/standard/php_type.h
@@ -30,7 +30,7 @@ PHP_FUNCTION(settype);
PHP_FUNCTION(is_null);
PHP_FUNCTION(is_resource);
PHP_FUNCTION(is_bool);
-PHP_FUNCTION(is_long);
+PHP_FUNCTION(is_int);
PHP_FUNCTION(is_float);
PHP_FUNCTION(is_numeric);
PHP_FUNCTION(is_string);
diff --git a/ext/standard/strnatcmp.c b/ext/standard/strnatcmp.c
index de6f727343..0decda3df9 100644
--- a/ext/standard/strnatcmp.c
+++ b/ext/standard/strnatcmp.c
@@ -118,11 +118,11 @@ PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len
ca = *ap; cb = *bp;
/* skip over leading zeros */
- while (leading && ca == '0' && (ap+1 < aend) && isdigit(*(ap+1))) {
+ while (leading && ca == '0' && (ap+1 < aend) && isdigit((int)(unsigned char)*(ap+1))) {
ca = *++ap;
}
- while (leading && cb == '0' && (bp+1 < bend) && isdigit(*(bp+1))) {
+ while (leading && cb == '0' && (bp+1 < bend) && isdigit((int)(unsigned char)*(bp+1))) {
cb = *++bp;
}
diff --git a/ext/standard/tests/array/array_change_key_case_variation2.phpt b/ext/standard/tests/array/array_change_key_case_variation2.phpt
index 929ccb1c6a..d1a479f736 100644
--- a/ext/standard/tests/array/array_change_key_case_variation2.phpt
+++ b/ext/standard/tests/array/array_change_key_case_variation2.phpt
@@ -1,5 +1,7 @@
--TEST--
Test array_change_key_case() function : usage variations - Pass different data types as $case arg
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : array array_change_key_case(array $input [, int $case])
@@ -285,4 +287,4 @@ array(3) {
["three"]=>
int(3)
}
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/array/array_chunk_variation2.phpt b/ext/standard/tests/array/array_chunk_variation2.phpt
index 8cfe994404..93d9218296 100644
--- a/ext/standard/tests/array/array_chunk_variation2.phpt
+++ b/ext/standard/tests/array/array_chunk_variation2.phpt
@@ -1,5 +1,7 @@
--TEST--
Test array_chunk() function : usage variations - unexpected values for 'size' argument
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : array array_chunk(array $array, int $size [, bool $preserve_keys])
diff --git a/ext/standard/tests/array/array_fill_variation1.phpt b/ext/standard/tests/array/array_fill_variation1.phpt
index e2d0b6f58c..0bedf4a68b 100644
--- a/ext/standard/tests/array/array_fill_variation1.phpt
+++ b/ext/standard/tests/array/array_fill_variation1.phpt
@@ -124,12 +124,9 @@ array(2) {
int(100)
}
-- Iteration 3 --
-array(2) {
- [-1097262584]=>
- int(100)
- [0]=>
- int(100)
-}
+
+Warning: array_fill() expects parameter 1 to be long, double given in %s/ext/standard/tests/array/array_fill_variation1.php on line 92
+NULL
-- Iteration 4 --
array(2) {
[0]=>
diff --git a/ext/standard/tests/array/array_pad_variation2.phpt b/ext/standard/tests/array/array_pad_variation2.phpt
index 0267f203bb..f00c5908d6 100644
--- a/ext/standard/tests/array/array_pad_variation2.phpt
+++ b/ext/standard/tests/array/array_pad_variation2.phpt
@@ -1,5 +1,7 @@
--TEST--
Test array_pad() function : usage variations - unexpected values for 'pad_size' argument(Bug#43482)
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : array array_pad(array $input, int $pad_size, mixed $pad_value)
diff --git a/ext/standard/tests/array/array_rand_variation2.phpt b/ext/standard/tests/array/array_rand_variation2.phpt
index 3340a12b51..fe92181906 100644
--- a/ext/standard/tests/array/array_rand_variation2.phpt
+++ b/ext/standard/tests/array/array_rand_variation2.phpt
@@ -1,5 +1,7 @@
--TEST--
Test array_rand() function : usage variations - unexpected values for 'num_req' parameter
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : mixed array_rand(array input [, int num_req])
diff --git a/ext/standard/tests/array/array_slice_variation2.phpt b/ext/standard/tests/array/array_slice_variation2.phpt
index 217788fec7..8ec240818c 100644
--- a/ext/standard/tests/array/array_slice_variation2.phpt
+++ b/ext/standard/tests/array/array_slice_variation2.phpt
@@ -152,16 +152,9 @@ array(4) {
}
-- Iteration 7 --
-array(4) {
- ["one"]=>
- int(1)
- [0]=>
- int(2)
- ["three"]=>
- int(3)
- [1]=>
- int(4)
-}
+
+Warning: array_slice() expects parameter 2 to be long, double given in %s on line %d
+NULL
-- Iteration 8 --
array(4) {
diff --git a/ext/standard/tests/array/count_variation2.phpt b/ext/standard/tests/array/count_variation2.phpt
index 86aecc07b1..a45bf0cf2c 100644
--- a/ext/standard/tests/array/count_variation2.phpt
+++ b/ext/standard/tests/array/count_variation2.phpt
@@ -1,5 +1,7 @@
--TEST--
Test count() function : usage variations - Pass different data types as $mode arg
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : int count(mixed $var [, int $mode])
@@ -184,4 +186,4 @@ int(3)
Warning: count() expects parameter 2 to be long, resource given in %s on line %d
NULL
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/array/rsort_variation2.phpt b/ext/standard/tests/array/rsort_variation2.phpt
index 2196a6494d..14ca057038 100644
--- a/ext/standard/tests/array/rsort_variation2.phpt
+++ b/ext/standard/tests/array/rsort_variation2.phpt
@@ -1,5 +1,7 @@
--TEST--
Test rsort() function : usage variations - Pass different data types as $sort_flags arg
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : bool rsort(array &$array_arg [, int $sort_flags])
@@ -481,4 +483,4 @@ array(5) {
[4]=>
int(1)
}
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/dir/scandir_variation2.phpt b/ext/standard/tests/dir/scandir_variation2.phpt
index e6033f256c..0d8199b39a 100644
--- a/ext/standard/tests/dir/scandir_variation2.phpt
+++ b/ext/standard/tests/dir/scandir_variation2.phpt
@@ -1,5 +1,7 @@
--TEST--
Test scandir() function : usage variations - diff data types as $sorting_order arg
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : array scandir(string $dir [, int $sorting_order [, resource $context]])
diff --git a/ext/standard/tests/file/chmod_variation4.phpt b/ext/standard/tests/file/chmod_variation4.phpt
index 15310f1ca8..70615755c4 100644
--- a/ext/standard/tests/file/chmod_variation4.phpt
+++ b/ext/standard/tests/file/chmod_variation4.phpt
@@ -1,5 +1,7 @@
--TEST--
Test chmod() function : second parameter variation
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : bool chmod(string filename, int mode)
diff --git a/ext/standard/tests/file/file_get_contents_variation5.phpt b/ext/standard/tests/file/file_get_contents_variation5.phpt
index ce88d3c3be..e2dafbe0ee 100644
--- a/ext/standard/tests/file/file_get_contents_variation5.phpt
+++ b/ext/standard/tests/file/file_get_contents_variation5.phpt
@@ -2,6 +2,8 @@
Test file_get_contents() function : usage variation
--CREDITS--
Dave Kelsey <d_kelsey@uk.ibm.com>
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : string file_get_contents(string filename [, bool use_include_path [, resource context [, long offset [, long maxlen]]]])
diff --git a/ext/standard/tests/file/file_variation3.phpt b/ext/standard/tests/file/file_variation3.phpt
index 1dd8520a9e..54635d6d86 100644
--- a/ext/standard/tests/file/file_variation3.phpt
+++ b/ext/standard/tests/file/file_variation3.phpt
@@ -1,5 +1,7 @@
--TEST--
Test file() function : second parameter variation
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : array file(string filename [, int flags[, resource context]])
diff --git a/ext/standard/tests/file/fseek_variation2.phpt b/ext/standard/tests/file/fseek_variation2.phpt
index f454352301..5377843716 100644
--- a/ext/standard/tests/file/fseek_variation2.phpt
+++ b/ext/standard/tests/file/fseek_variation2.phpt
@@ -2,6 +2,8 @@
Test fseek() function : usage variations - different types for whence
--CREDITS--
Dave Kelsey <d_kelsey@uk.ibm.com>
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : proto int fseek(resource fp, int offset [, int whence])
diff --git a/ext/standard/tests/file/mkdir_variation2.phpt b/ext/standard/tests/file/mkdir_variation2.phpt
index ab9a676ac1..48e6cb8722 100644
--- a/ext/standard/tests/file/mkdir_variation2.phpt
+++ b/ext/standard/tests/file/mkdir_variation2.phpt
@@ -2,6 +2,8 @@
Test mkdir() function : usage variation: different types for mode
--CREDITS--
Dave Kelsey <d_kelsey@uk.ibm.com>
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : bool mkdir(string pathname [, int mode [, bool recursive [, resource context]]])
diff --git a/ext/standard/tests/file/pathinfo_variation2.phpt b/ext/standard/tests/file/pathinfo_variation2.phpt
index 9d18a4b79d..897b2d9836 100644
--- a/ext/standard/tests/file/pathinfo_variation2.phpt
+++ b/ext/standard/tests/file/pathinfo_variation2.phpt
@@ -2,6 +2,8 @@
Test pathinfo() function : usage variation
--CREDITS--
Dave Kelsey <d_kelsey@uk.ibm.com>
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : array pathinfo(string path[, int options])
diff --git a/ext/standard/tests/file/touch_variation3.phpt b/ext/standard/tests/file/touch_variation3.phpt
index 810cd71ef6..87cb199f8f 100644
--- a/ext/standard/tests/file/touch_variation3.phpt
+++ b/ext/standard/tests/file/touch_variation3.phpt
@@ -4,6 +4,7 @@ Test touch() function : usage variation - different types for time
Dave Kelsey <d_kelsey@uk.ibm.com>
--SKIPIF--
<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. Not for Windows');
}
diff --git a/ext/standard/tests/file/touch_variation4.phpt b/ext/standard/tests/file/touch_variation4.phpt
index b0238b1759..384b68b384 100644
--- a/ext/standard/tests/file/touch_variation4.phpt
+++ b/ext/standard/tests/file/touch_variation4.phpt
@@ -4,6 +4,7 @@ Test touch() function : usage variation - different types for atime
Dave Kelsey <d_kelsey@uk.ibm.com>
--SKIPIF--
<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. Not for Windows');
}
diff --git a/ext/standard/tests/file/umask_variation3.phpt b/ext/standard/tests/file/umask_variation3.phpt
index c666c328df..7885d0e5b8 100644
--- a/ext/standard/tests/file/umask_variation3.phpt
+++ b/ext/standard/tests/file/umask_variation3.phpt
@@ -4,6 +4,7 @@ Test umask() function : usage variation
Dave Kelsey <d_kelsey@uk.ibm.com>
--SKIPIF--
<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. only for Non Windows');
}
diff --git a/ext/standard/tests/general_functions/getrusage_variation1.phpt b/ext/standard/tests/general_functions/getrusage_variation1.phpt
index 3daf9e5e61..ae2b150548 100644
--- a/ext/standard/tests/general_functions/getrusage_variation1.phpt
+++ b/ext/standard/tests/general_functions/getrusage_variation1.phpt
@@ -2,6 +2,7 @@
Test getrusage() function : usage variation - diff data types as $who arg
--SKIPIF--
<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
if( substr(PHP_OS, 0, 3) == "WIN" )
die("skip.. Do not run on Windows");
?>
diff --git a/ext/standard/tests/general_functions/intval_variation2.phpt b/ext/standard/tests/general_functions/intval_variation2.phpt
index 65bc584254..8fdab26caa 100644
--- a/ext/standard/tests/general_functions/intval_variation2.phpt
+++ b/ext/standard/tests/general_functions/intval_variation2.phpt
@@ -1,5 +1,7 @@
--TEST--
Test intval() function : usage variation
+--SKIPIF--
+<?php if (PHP_INT_SIZE !== 4) die("skip this test is for 32-bit only");
--FILE--
<?php
/* Prototype : int intval(mixed var [, int base])
@@ -113,10 +115,12 @@ int(1)
int(1)
--float 12.3456789000e10--
-int(1)
+Error: 2 - intval() expects parameter 2 to be long, double given, %s(%d)
+NULL
--float -12.3456789000e10--
-int(1)
+Error: 2 - intval() expects parameter 2 to be long, double given, %s(%d)
+NULL
--float .5--
int(1)
@@ -192,4 +196,4 @@ int(1)
--unset var--
int(1)
-===DONE=== \ No newline at end of file
+===DONE===
diff --git a/ext/standard/tests/image/image_type_to_mime_type_variation1.phpt b/ext/standard/tests/image/image_type_to_mime_type_variation1.phpt
index 0023b7125d..5b941f7556 100644
--- a/ext/standard/tests/image/image_type_to_mime_type_variation1.phpt
+++ b/ext/standard/tests/image/image_type_to_mime_type_variation1.phpt
@@ -1,5 +1,7 @@
--TEST--
Test image_type_to_mime_type() function : usage variations - Pass different data types as imagetype
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : string image_type_to_mime_type(int imagetype)
@@ -149,4 +151,4 @@ string(24) "application/octet-stream"
-- Iteration 20 --
string(24) "application/octet-stream"
-===DONE=== \ No newline at end of file
+===DONE===
diff --git a/ext/standard/tests/math/mt_rand_variation2.phpt b/ext/standard/tests/math/mt_rand_variation2.phpt
index 2174a349e5..817252edd5 100644
--- a/ext/standard/tests/math/mt_rand_variation2.phpt
+++ b/ext/standard/tests/math/mt_rand_variation2.phpt
@@ -1,5 +1,7 @@
--TEST--
Test mt_rand() function : usage variations - different data types as $max argument
+--SKIPIF--
+<?php if (PHP_INT_SIZE !== 4) die("skip this test is for 32-bit only");
--FILE--
<?php
/* Prototype : int mt_rand ([ int $min , int $max ] )
@@ -110,7 +112,9 @@ int(%i)
int(%i)
-- Iteration 8 --
-int(%i)
+
+Warning: mt_rand() expects parameter 2 to be long, double given in %s on line %d
+NULL
-- Iteration 9 --
int(%i)
diff --git a/ext/standard/tests/math/mt_srand_variation1.phpt b/ext/standard/tests/math/mt_srand_variation1.phpt
index feb0b37972..0344f78252 100644
--- a/ext/standard/tests/math/mt_srand_variation1.phpt
+++ b/ext/standard/tests/math/mt_srand_variation1.phpt
@@ -1,5 +1,7 @@
--TEST--
Test mt_srand() function : usage variations - different data types as $seed argument
+--SKIPIF--
+<?php if (PHP_INT_SIZE !== 4) die("skip this test is for 32-bit only");
--FILE--
<?php
/* Prototype : void mt_srand ([ int $seed ] )
@@ -110,6 +112,8 @@ NULL
NULL
-- Iteration 8 --
+
+Warning: mt_srand() expects parameter 1 to be long, double given in %s on line %d
NULL
-- Iteration 9 --
diff --git a/ext/standard/tests/math/rand_variation1.phpt b/ext/standard/tests/math/rand_variation1.phpt
index 02e552b784..b9e7c81621 100644
--- a/ext/standard/tests/math/rand_variation1.phpt
+++ b/ext/standard/tests/math/rand_variation1.phpt
@@ -1,5 +1,7 @@
--TEST--
Test rand() function : usage variations - different data types as $min argument
+--SKIPIF--
+<?php if (PHP_INT_SIZE !== 4) die("skip this test is for 32-bit only");
--FILE--
<?php
/* Prototype : int rand ([ int $min , int $max ] )
@@ -110,7 +112,9 @@ int(%i)
int(%i)
-- Iteration 8 --
-int(%i)
+
+Warning: rand() expects parameter 1 to be long, double given in %s on line %d
+NULL
-- Iteration 9 --
int(%i)
diff --git a/ext/standard/tests/math/rand_variation2.phpt b/ext/standard/tests/math/rand_variation2.phpt
index c0e1fc6373..5ebd274aa6 100644
--- a/ext/standard/tests/math/rand_variation2.phpt
+++ b/ext/standard/tests/math/rand_variation2.phpt
@@ -1,5 +1,7 @@
--TEST--
Test rand() function : usage variations - different data types as $max argument
+--SKIPIF--
+<?php if (PHP_INT_SIZE !== 4) die("skip this test is for 32-bit only");
--FILE--
<?php
/* Prototype : int rand ([ int $min , int $max ] )
@@ -110,7 +112,9 @@ int(%i)
int(%i)
-- Iteration 8 --
-int(%i)
+
+Warning: rand() expects parameter 2 to be long, double given in %s on line %d
+NULL
-- Iteration 9 --
int(%i)
diff --git a/ext/standard/tests/math/srand_variation1.phpt b/ext/standard/tests/math/srand_variation1.phpt
index 16da80fd6a..cdd98850ae 100644
--- a/ext/standard/tests/math/srand_variation1.phpt
+++ b/ext/standard/tests/math/srand_variation1.phpt
@@ -1,5 +1,7 @@
--TEST--
Test srand() function : usage variations - different data types as $seed argument
+--SKIPIF--
+<?php if (PHP_INT_SIZE !== 4) die("skip this test is for 32-bit only");
--FILE--
<?php
/* Prototype : void srand ([ int $seed ] )
@@ -110,6 +112,8 @@ NULL
NULL
-- Iteration 8 --
+
+Warning: srand() expects parameter 1 to be long, double given in %s on line %d
NULL
-- Iteration 9 --
diff --git a/ext/standard/tests/serialize/bug68594.phpt b/ext/standard/tests/serialize/bug68594.phpt
new file mode 100644
index 0000000000..60fc7a76ab
--- /dev/null
+++ b/ext/standard/tests/serialize/bug68594.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Bug #68545 Use after free vulnerability in unserialize()
+--FILE--
+<?php
+for ($i=4; $i<100; $i++) {
+ $m = new StdClass();
+
+ $u = array(1);
+
+ $m->aaa = array(1,2,&$u,4,5);
+ $m->bbb = 1;
+ $m->ccc = &$u;
+ $m->ddd = str_repeat("A", $i);
+
+ $z = serialize($m);
+ $z = str_replace("bbb", "aaa", $z);
+ $y = unserialize($z);
+ $z = serialize($y);
+}
+?>
+===DONE===
+--EXPECTF--
+===DONE===
diff --git a/ext/standard/tests/strings/bug54322.phpt b/ext/standard/tests/strings/bug54322.phpt
index aead172b82..4834bdf236 100644
--- a/ext/standard/tests/strings/bug54322.phpt
+++ b/ext/standard/tests/strings/bug54322.phpt
@@ -5,5 +5,6 @@ Bug #54322: Null pointer deref in get_html_translation_table due to information
var_dump(
get_html_translation_table(NAN, 0, "UTF-8") > 0
);
---EXPECT--
-bool(true)
+--EXPECTF--
+Warning: get_html_translation_table() expects parameter 1 to be long, double given in %s on line %d
+bool(false)
diff --git a/ext/standard/tests/strings/chunk_split_variation2.phpt b/ext/standard/tests/strings/chunk_split_variation2.phpt
index d49ec3b1bd..1503d520f4 100644
--- a/ext/standard/tests/strings/chunk_split_variation2.phpt
+++ b/ext/standard/tests/strings/chunk_split_variation2.phpt
@@ -1,5 +1,7 @@
--TEST--
Test chunk_split() function : usage variations - unexpected values for 'chunklen' argument(Bug#42796)
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : string chunk_split(string $str [, int $chunklen [, string $ending]])
@@ -98,8 +100,8 @@ Warning: chunk_split(): Chunk length should be greater than zero in %schunk_spli
bool(false)
-- Iteration 3 --
-Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
-bool(false)
+Warning: chunk_split() expects parameter 2 to be long, double given in %s on line %d
+NULL
-- Iteration 4 --
Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
diff --git a/ext/standard/tests/strings/chunk_split_variation5.phpt b/ext/standard/tests/strings/chunk_split_variation5.phpt
index 580f8f0a6f..ca34959354 100644
--- a/ext/standard/tests/strings/chunk_split_variation5.phpt
+++ b/ext/standard/tests/strings/chunk_split_variation5.phpt
Binary files differ
diff --git a/ext/standard/tests/strings/chunk_split_variation8.phpt b/ext/standard/tests/strings/chunk_split_variation8.phpt
index cfb440e923..7f1e4959d4 100644
--- a/ext/standard/tests/strings/chunk_split_variation8.phpt
+++ b/ext/standard/tests/strings/chunk_split_variation8.phpt
@@ -83,8 +83,8 @@ It has _speci@l ch@r$ 2222 !!!Now \k as escape char to test
chunk_split():::"
-- Iteration 7 --
-Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
-bool(false)
+Warning: chunk_split() expects parameter 2 to be long, double given in %s on line %d
+NULL
-- Iteration 8 --
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
diff --git a/ext/standard/tests/strings/count_chars_variation2.phpt b/ext/standard/tests/strings/count_chars_variation2.phpt
index 7a17cb9c61..fe9597e3ae 100644
--- a/ext/standard/tests/strings/count_chars_variation2.phpt
+++ b/ext/standard/tests/strings/count_chars_variation2.phpt
@@ -1,5 +1,7 @@
--TEST--
Test count_chars() function : usage variations - test values for $mode argument
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
diff --git a/ext/standard/tests/strings/explode.phpt b/ext/standard/tests/strings/explode.phpt
index 1047fb7856..4c7a3fe45a 100644
--- a/ext/standard/tests/strings/explode.phpt
+++ b/ext/standard/tests/strings/explode.phpt
@@ -2,6 +2,8 @@
explode() function
--INI--
error_reporting=2047
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* From http://bugs.php.net/19865 */
diff --git a/ext/standard/tests/strings/htmlspecialchars_decode_variation2.phpt b/ext/standard/tests/strings/htmlspecialchars_decode_variation2.phpt
index 0e26d094a8..8fc4068b9a 100644
--- a/ext/standard/tests/strings/htmlspecialchars_decode_variation2.phpt
+++ b/ext/standard/tests/strings/htmlspecialchars_decode_variation2.phpt
@@ -102,7 +102,9 @@ string(104) "<html>Roy&#039;s height > Sam&#039;s height. 13 < 15. 1111 & 0000 =
string(104) "<html>Roy&#039;s height > Sam&#039;s height. 13 < 15. 1111 & 0000 = 0000. " double quote string "</html>"
-- Iteration 3 --
-string(114) "<html>Roy&#039;s height > Sam&#039;s height. 13 < 15. 1111 & 0000 = 0000. &quot; double quote string &quot;</html>"
+
+Warning: htmlspecialchars_decode() expects parameter 2 to be long, double given in %s on line %d
+NULL
-- Iteration 4 --
string(114) "<html>Roy&#039;s height > Sam&#039;s height. 13 < 15. 1111 & 0000 = 0000. &quot; double quote string &quot;</html>"
diff --git a/ext/standard/tests/strings/str_pad_variation4.phpt b/ext/standard/tests/strings/str_pad_variation4.phpt
index a622304c82..d2b51af0a3 100644
--- a/ext/standard/tests/strings/str_pad_variation4.phpt
+++ b/ext/standard/tests/strings/str_pad_variation4.phpt
@@ -1,5 +1,7 @@
--TEST--
Test str_pad() function : usage variations - unexpected inputs for '$pad_type' argument
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : string str_pad ( string $input , int $pad_length [, string $pad_string [, int $pad_type ]] )
diff --git a/ext/standard/tests/strings/str_split_variation2.phpt b/ext/standard/tests/strings/str_split_variation2.phpt
index ba1297b405..423d9d894c 100644
--- a/ext/standard/tests/strings/str_split_variation2.phpt
+++ b/ext/standard/tests/strings/str_split_variation2.phpt
@@ -111,8 +111,8 @@ Warning: str_split(): The length of each segment must be greater than zero in %s
bool(false)
--Iteration 3 --
-Warning: str_split(): The length of each segment must be greater than zero in %sstr_split_variation2.php on line %d
-bool(false)
+Warning: str_split() expects parameter 2 to be long, double given in %s on line %d
+NULL
--Iteration 4 --
Warning: str_split(): The length of each segment must be greater than zero in %sstr_split_variation2.php on line %d
diff --git a/ext/standard/tests/strings/str_split_variation6.phpt b/ext/standard/tests/strings/str_split_variation6.phpt
index 6d751bbccf..049d1fe401 100644
--- a/ext/standard/tests/strings/str_split_variation6.phpt
+++ b/ext/standard/tests/strings/str_split_variation6.phpt
@@ -157,8 +157,8 @@ array(1) {
}
-- Iteration 7 --
-Warning: str_split(): The length of each segment must be greater than zero in %s on line %d
-bool(false)
+Warning: str_split() expects parameter 2 to be long, double given in %s line %d
+NULL
-- Iteration 8 --
Warning: str_split(): The length of each segment must be greater than zero in %s on line %d
diff --git a/ext/standard/tests/strings/str_split_variation7.phpt b/ext/standard/tests/strings/str_split_variation7.phpt
index 455c5b8972..ee0e88c51a 100644
--- a/ext/standard/tests/strings/str_split_variation7.phpt
+++ b/ext/standard/tests/strings/str_split_variation7.phpt
@@ -135,8 +135,8 @@ array(1) {
}
-- Iteration 7 --
-Warning: str_split(): The length of each segment must be greater than zero in %s on line %d
-bool(false)
+Warning: str_split() expects parameter 2 to be long, double given in %s on line %d
+NULL
-- Iteration 8 --
Warning: str_split(): The length of each segment must be greater than zero in %s on line %d
diff --git a/ext/standard/tests/strings/strcspn_variation4.phpt b/ext/standard/tests/strings/strcspn_variation4.phpt
index d456a23318..04d9bceae1 100644
--- a/ext/standard/tests/strings/strcspn_variation4.phpt
+++ b/ext/standard/tests/strings/strcspn_variation4.phpt
@@ -1,5 +1,7 @@
--TEST--
Test strcspn() function : usage variations - unexpected values of len argument
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : proto int strcspn(string str, string mask [, int start [, int len]])
@@ -193,4 +195,4 @@ int(0)
Warning: strcspn() expects parameter 4 to be long, resource given in %s on line %d
NULL
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/strings/stripos_variation14.phpt b/ext/standard/tests/strings/stripos_variation14.phpt
index 023585dbb7..a6407425dd 100644
--- a/ext/standard/tests/strings/stripos_variation14.phpt
+++ b/ext/standard/tests/strings/stripos_variation14.phpt
@@ -1,5 +1,7 @@
--TEST--
Test stripos() function : usage variations - unexpected inputs for 'offset' argument
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
diff --git a/ext/standard/tests/strings/stripos_variation15.phpt b/ext/standard/tests/strings/stripos_variation15.phpt
index 2304c1d350..fd01cf8bd0 100644
--- a/ext/standard/tests/strings/stripos_variation15.phpt
+++ b/ext/standard/tests/strings/stripos_variation15.phpt
@@ -1,5 +1,7 @@
--TEST--
Test stripos() function : usage variations - unexpected inputs for 'haystack', 'needle' & 'offset' arguments
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
diff --git a/ext/standard/tests/strings/strncasecmp_variation5.phpt b/ext/standard/tests/strings/strncasecmp_variation5.phpt
index c391ba3e92..dc17b20043 100644
--- a/ext/standard/tests/strings/strncasecmp_variation5.phpt
+++ b/ext/standard/tests/strings/strncasecmp_variation5.phpt
@@ -1,5 +1,7 @@
--TEST--
Test strncasecmp() function : usage variations - unexpected values for 'len'
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : int strncasecmp ( string $str1, string $str2, int $len );
diff --git a/ext/standard/tests/strings/strncmp_variation5.phpt b/ext/standard/tests/strings/strncmp_variation5.phpt
index 73d7e8f319..36648c8b60 100644
--- a/ext/standard/tests/strings/strncmp_variation5.phpt
+++ b/ext/standard/tests/strings/strncmp_variation5.phpt
@@ -1,5 +1,7 @@
--TEST--
Test strncmp() function : usage variations - different lengths(all types)
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : int strncmp ( string $str1, string $str2, int $len );
diff --git a/ext/standard/tests/strings/strripos_offset.phpt b/ext/standard/tests/strings/strripos_offset.phpt
index 524699ad52..f6124c022d 100644
--- a/ext/standard/tests/strings/strripos_offset.phpt
+++ b/ext/standard/tests/strings/strripos_offset.phpt
@@ -1,5 +1,7 @@
--TEST--
strripos() offset integer overflow
+--SKIPIF--
+<?php if (PHP_INT_SIZE !== 4) die("skip this test is for 32-bit only");
--FILE--
<?php
@@ -16,16 +18,16 @@ var_dump(strripos(1024, "te", -PHP_INT_MAX-1));
echo "Done\n";
?>
--EXPECTF--
-Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: strripos() expects parameter 3 to be long, double given in %s on line %d
bool(false)
-Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: strripos() expects parameter 3 to be long, double given in %s on line %d
bool(false)
-Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: strripos() expects parameter 3 to be long, double given in %s on line %d
bool(false)
-Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: strripos() expects parameter 3 to be long, double given in %s on line %d
bool(false)
Warning: strripos() expects parameter 1 to be string, array given in %s on line %d
diff --git a/ext/standard/tests/strings/strrpos_offset.phpt b/ext/standard/tests/strings/strrpos_offset.phpt
index 18b5847063..41540f1b46 100644
--- a/ext/standard/tests/strings/strrpos_offset.phpt
+++ b/ext/standard/tests/strings/strrpos_offset.phpt
@@ -1,5 +1,7 @@
--TEST--
strrpos() offset integer overflow
+--SKIPIF--
+<?php if (PHP_INT_SIZE !== 4) die("skip this test is for 32-bit only");
--FILE--
<?php
@@ -15,16 +17,16 @@ var_dump(strrpos(1024, "te", -PHP_INT_MAX-1));
echo "Done\n";
?>
--EXPECTF--
-Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: strrpos() expects parameter 3 to be long, double given in %s on line %d
bool(false)
-Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: strrpos() expects parameter 3 to be long, double given in %s on line %d
bool(false)
-Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: strrpos() expects parameter 3 to be long, double given in %s on line %d
bool(false)
-Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: strrpos() expects parameter 3 to be long, double given in %s on line %d
bool(false)
Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
diff --git a/ext/standard/tests/strings/strrpos_variation14.phpt b/ext/standard/tests/strings/strrpos_variation14.phpt
index 53c123a3fd..9b5d2154e8 100644
--- a/ext/standard/tests/strings/strrpos_variation14.phpt
+++ b/ext/standard/tests/strings/strrpos_variation14.phpt
@@ -1,5 +1,7 @@
--TEST--
Test strrpos() function : usage variations - unexpected inputs for 'offset' argument
+--SKIPIF--
+<?php if (PHP_INT_SIZE !== 4) die("skip this test is for 32-bit only");
--FILE--
<?php
/* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
@@ -92,7 +94,7 @@ int(6)
int(6)
-- Iteration 3 --
-Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: strrpos() expects parameter 3 to be long, double given in %s on line %d
bool(false)
-- Iteration 4 --
int(6)
diff --git a/ext/standard/tests/strings/strrpos_variation15.phpt b/ext/standard/tests/strings/strrpos_variation15.phpt
index d958cdc485..412454913c 100644
--- a/ext/standard/tests/strings/strrpos_variation15.phpt
+++ b/ext/standard/tests/strings/strrpos_variation15.phpt
@@ -1,5 +1,7 @@
--TEST--
Test strrpos() function : usage variations - unexpected inputs for 'haystack', 'needle' & 'offset' arguments
+--SKIPIF--
+<?php if (PHP_INT_SIZE !== 4) die("skip this test is for 32-bit only");
--FILE--
<?php
/* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
@@ -110,7 +112,7 @@ Warning: strrpos(): Offset is greater than the length of haystack string in %s o
bool(false)
-- Iteration 7 --
-Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: strrpos() expects parameter 3 to be long, double given in %s on line %d
bool(false)
-- Iteration 8 --
bool(false)
diff --git a/ext/standard/tests/url/parse_url_variation_002_32bit.phpt b/ext/standard/tests/url/parse_url_variation_002_32bit.phpt
index aefb37a117..a0b8615b75 100644
--- a/ext/standard/tests/url/parse_url_variation_002_32bit.phpt
+++ b/ext/standard/tests/url/parse_url_variation_002_32bit.phpt
@@ -80,11 +80,11 @@ echo "Done";
?>
--EXPECTF--
*** Testing parse_url() : usage variations ***
-Error: 8 - Undefined variable: undefined_var, %s(61)
-Error: 8 - Undefined variable: unset_var, %s(64)
+Error: 8 - Undefined variable: undefined_var, %s(%d)
+Error: 8 - Undefined variable: unset_var, %s(%d)
Arg value 10.5
-Error: 2 - parse_url(): Invalid URL component identifier 10, %s(71)
+Error: 2 - parse_url(): Invalid URL component identifier 10, %s(%d)
bool(false)
Arg value -10.5
@@ -108,54 +108,38 @@ array(8) {
}
Arg value 101234567000
-array(8) {
- ["scheme"]=>
- string(4) "http"
- ["host"]=>
- string(11) "www.php.net"
- ["port"]=>
- int(80)
- ["user"]=>
- string(6) "secret"
- ["pass"]=>
- string(7) "hideout"
- ["path"]=>
- string(10) "/index.php"
- ["query"]=>
- string(31) "test=1&test2=char&test3=mixesCI"
- ["fragment"]=>
- string(16) "some_page_ref123"
-}
+Error: 2 - parse_url() expects parameter 2 to be long, double given, %s(%d)
+NULL
Arg value 1.07654321E-9
string(4) "http"
Arg value 0.5
string(4) "http"
-Error: 8 - Array to string conversion, %sparse_url_variation_002_32bit.php(%d)
+Error: 8 - Array to string conversion, %s(%d)
Arg value Array
-Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71)
+Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(%d)
NULL
-Error: 8 - Array to string conversion, %sparse_url_variation_002_32bit.php(%d)
+Error: 8 - Array to string conversion, %s(%d)
Arg value Array
-Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71)
+Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(%d)
NULL
-Error: 8 - Array to string conversion, %sparse_url_variation_002_32bit.php(%d)
+Error: 8 - Array to string conversion, %s(%d)
Arg value Array
-Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71)
+Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(%d)
NULL
-Error: 8 - Array to string conversion, %sparse_url_variation_002_32bit.php(%d)
+Error: 8 - Array to string conversion, %s(%d)
Arg value Array
-Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71)
+Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(%d)
NULL
-Error: 8 - Array to string conversion, %sparse_url_variation_002_32bit.php(%d)
+Error: 8 - Array to string conversion, %s(%d)
Arg value Array
-Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71)
+Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(%d)
NULL
Arg value
@@ -165,36 +149,36 @@ Arg value
string(4) "http"
Arg value 1
-string(11) "www.php.net"
+string(%d) "www.php.net"
Arg value
string(4) "http"
Arg value 1
-string(11) "www.php.net"
+string(%d) "www.php.net"
Arg value
string(4) "http"
Arg value
-Error: 2 - parse_url() expects parameter 2 to be long, string given, %s(71)
+Error: 2 - parse_url() expects parameter 2 to be long, string given, %s(%d)
NULL
Arg value
-Error: 2 - parse_url() expects parameter 2 to be long, string given, %s(71)
+Error: 2 - parse_url() expects parameter 2 to be long, string given, %s(%d)
NULL
Arg value string
-Error: 2 - parse_url() expects parameter 2 to be long, string given, %s(71)
+Error: 2 - parse_url() expects parameter 2 to be long, string given, %s(%d)
NULL
Arg value string
-Error: 2 - parse_url() expects parameter 2 to be long, string given, %s(71)
+Error: 2 - parse_url() expects parameter 2 to be long, string given, %s(%d)
NULL
-Error: 4096 - Object of class stdClass could not be converted to string, %s(70)
+Error: 4096 - Object of class stdClass could not be converted to string, %s(%d)
Arg value
-Error: 2 - parse_url() expects parameter 2 to be long, object given, %s(71)
+Error: 2 - parse_url() expects parameter 2 to be long, object given, %s(%d)
NULL
Arg value
diff --git a/ext/standard/type.c b/ext/standard/type.c
index a773e6c53c..41177f0b09 100644
--- a/ext/standard/type.c
+++ b/ext/standard/type.c
@@ -271,10 +271,10 @@ PHP_FUNCTION(is_bool)
}
/* }}} */
-/* {{{ proto bool is_long(mixed var)
- Returns true if variable is a long (integer)
+/* {{{ proto bool is_int(mixed var)
+ Returns true if variable is an integer
Warning: This function is special-cased by zend_compile.c and so is usually bypassed */
-PHP_FUNCTION(is_long)
+PHP_FUNCTION(is_int)
{
php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_LONG);
}
diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c
index 0217bba5fa..a6d3f9190a 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"
/*
+----------------------------------------------------------------------+
@@ -362,21 +362,13 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend
} else {
/* object properties should include no integers */
convert_to_string(&key);
-//???
-#if 1
- data = zend_hash_update_ind(ht, Z_STR(key), &d);
-#else
- if ((data = zend_hash_find(ht, Z_STR(key))) != NULL) {
- if (Z_TYPE_P(data) == IS_INDIRECT) {
- data = Z_INDIRECT_P(data);
+ if ((old_data = zend_hash_find(ht, Z_STR(key))) != NULL) {
+ if (Z_TYPE_P(old_data) == IS_INDIRECT) {
+ old_data = Z_INDIRECT_P(old_data);
}
- zval_ptr_dtor(data);
-//??? var_push_dtor(var_hash, data);
- ZVAL_UNDEF(data);
- } else {
- data = zend_hash_update(ht, Z_STR(key), &d);
- }
-#endif
+ var_push_dtor(var_hash, old_data);
+ }
+ data = zend_hash_update_ind(ht, Z_STR(key), &d);
}
zval_dtor(&key);
@@ -515,7 +507,7 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER)
start = cursor;
-#line 519 "ext/standard/var_unserializer.c"
+#line 511 "ext/standard/var_unserializer.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -575,9 +567,9 @@ yy2:
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy95;
yy3:
-#line 866 "ext/standard/var_unserializer.re"
+#line 858 "ext/standard/var_unserializer.re"
{ return 0; }
-#line 581 "ext/standard/var_unserializer.c"
+#line 573 "ext/standard/var_unserializer.c"
yy4:
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy89;
@@ -620,13 +612,13 @@ yy13:
goto yy3;
yy14:
++YYCURSOR;
-#line 860 "ext/standard/var_unserializer.re"
+#line 852 "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 630 "ext/standard/var_unserializer.c"
+#line 622 "ext/standard/var_unserializer.c"
yy16:
yych = *++YYCURSOR;
goto yy3;
@@ -652,11 +644,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 715 "ext/standard/var_unserializer.re"
+#line 707 "ext/standard/var_unserializer.re"
{
size_t len, len2, len3, maxlen;
zend_long elements;
@@ -801,7 +794,7 @@ yy20:
return object_common2(UNSERIALIZE_PASSTHRU, elements);
}
-#line 805 "ext/standard/var_unserializer.c"
+#line 798 "ext/standard/var_unserializer.c"
yy25:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -826,7 +819,7 @@ yy27:
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 707 "ext/standard/var_unserializer.re"
+#line 699 "ext/standard/var_unserializer.re"
{
//??? INIT_PZVAL(rval);
@@ -834,7 +827,7 @@ yy27:
return object_common2(UNSERIALIZE_PASSTHRU,
object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR));
}
-#line 838 "ext/standard/var_unserializer.c"
+#line 831 "ext/standard/var_unserializer.c"
yy32:
yych = *++YYCURSOR;
if (yych == '+') goto yy33;
@@ -855,7 +848,7 @@ yy34:
yych = *++YYCURSOR;
if (yych != '{') goto yy18;
++YYCURSOR;
-#line 686 "ext/standard/var_unserializer.re"
+#line 678 "ext/standard/var_unserializer.re"
{
zend_long elements = parse_iv(start + 2);
/* use iv() not uiv() in order to check data range */
@@ -876,7 +869,7 @@ yy34:
return finish_nested_data(UNSERIALIZE_PASSTHRU);
}
-#line 880 "ext/standard/var_unserializer.c"
+#line 873 "ext/standard/var_unserializer.c"
yy39:
yych = *++YYCURSOR;
if (yych == '+') goto yy40;
@@ -897,7 +890,7 @@ yy41:
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 658 "ext/standard/var_unserializer.re"
+#line 650 "ext/standard/var_unserializer.re"
{
size_t len, maxlen;
zend_string *str;
@@ -925,7 +918,7 @@ yy41:
ZVAL_STR(rval, str);
return 1;
}
-#line 929 "ext/standard/var_unserializer.c"
+#line 922 "ext/standard/var_unserializer.c"
yy46:
yych = *++YYCURSOR;
if (yych == '+') goto yy47;
@@ -946,7 +939,7 @@ yy48:
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 631 "ext/standard/var_unserializer.re"
+#line 623 "ext/standard/var_unserializer.re"
{
size_t len, maxlen;
char *str;
@@ -973,7 +966,7 @@ yy48:
ZVAL_STRINGL(rval, str, len);
return 1;
}
-#line 977 "ext/standard/var_unserializer.c"
+#line 970 "ext/standard/var_unserializer.c"
yy53:
yych = *++YYCURSOR;
if (yych <= '/') {
@@ -1061,7 +1054,7 @@ yy61:
}
yy63:
++YYCURSOR;
-#line 622 "ext/standard/var_unserializer.re"
+#line 614 "ext/standard/var_unserializer.re"
{
#if SIZEOF_ZEND_LONG == 4
use_double:
@@ -1070,7 +1063,7 @@ use_double:
ZVAL_DOUBLE(rval, zend_strtod((const char *)start + 2, NULL));
return 1;
}
-#line 1074 "ext/standard/var_unserializer.c"
+#line 1067 "ext/standard/var_unserializer.c"
yy65:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1129,7 +1122,7 @@ yy73:
yych = *++YYCURSOR;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 606 "ext/standard/var_unserializer.re"
+#line 598 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
@@ -1145,7 +1138,7 @@ yy73:
return 1;
}
-#line 1149 "ext/standard/var_unserializer.c"
+#line 1142 "ext/standard/var_unserializer.c"
yy76:
yych = *++YYCURSOR;
if (yych == 'N') goto yy73;
@@ -1172,7 +1165,7 @@ yy79:
if (yych <= '9') goto yy79;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 580 "ext/standard/var_unserializer.re"
+#line 572 "ext/standard/var_unserializer.re"
{
#if SIZEOF_ZEND_LONG == 4
int digits = YYCURSOR - start - 3;
@@ -1198,7 +1191,7 @@ yy79:
ZVAL_LONG(rval, parse_iv(start + 2));
return 1;
}
-#line 1202 "ext/standard/var_unserializer.c"
+#line 1195 "ext/standard/var_unserializer.c"
yy83:
yych = *++YYCURSOR;
if (yych <= '/') goto yy18;
@@ -1206,22 +1199,22 @@ yy83:
yych = *++YYCURSOR;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 574 "ext/standard/var_unserializer.re"
+#line 566 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
ZVAL_BOOL(rval, parse_iv(start + 2));
return 1;
}
-#line 1216 "ext/standard/var_unserializer.c"
+#line 1209 "ext/standard/var_unserializer.c"
yy87:
++YYCURSOR;
-#line 568 "ext/standard/var_unserializer.re"
+#line 560 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
ZVAL_NULL(rval);
return 1;
}
-#line 1225 "ext/standard/var_unserializer.c"
+#line 1218 "ext/standard/var_unserializer.c"
yy89:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1244,7 +1237,7 @@ yy91:
if (yych <= '9') goto yy91;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 545 "ext/standard/var_unserializer.re"
+#line 537 "ext/standard/var_unserializer.re"
{
zend_long id;
@@ -1267,7 +1260,7 @@ yy91:
return 1;
}
-#line 1271 "ext/standard/var_unserializer.c"
+#line 1264 "ext/standard/var_unserializer.c"
yy95:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1290,7 +1283,7 @@ yy97:
if (yych <= '9') goto yy97;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 523 "ext/standard/var_unserializer.re"
+#line 515 "ext/standard/var_unserializer.re"
{
zend_long id;
@@ -1312,9 +1305,9 @@ yy97:
return 1;
}
-#line 1316 "ext/standard/var_unserializer.c"
+#line 1309 "ext/standard/var_unserializer.c"
}
-#line 868 "ext/standard/var_unserializer.re"
+#line 860 "ext/standard/var_unserializer.re"
return 0;
diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re
index c7871671b6..43361a9ff0 100644
--- a/ext/standard/var_unserializer.re
+++ b/ext/standard/var_unserializer.re
@@ -366,21 +366,13 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend
} else {
/* object properties should include no integers */
convert_to_string(&key);
-//???
-#if 1
- data = zend_hash_update_ind(ht, Z_STR(key), &d);
-#else
- if ((data = zend_hash_find(ht, Z_STR(key))) != NULL) {
- if (Z_TYPE_P(data) == IS_INDIRECT) {
- data = Z_INDIRECT_P(data);
+ if ((old_data = zend_hash_find(ht, Z_STR(key))) != NULL) {
+ if (Z_TYPE_P(old_data) == IS_INDIRECT) {
+ old_data = Z_INDIRECT_P(old_data);
}
- zval_ptr_dtor(data);
-//??? var_push_dtor(var_hash, data);
- ZVAL_UNDEF(data);
- } else {
- data = zend_hash_update(ht, Z_STR(key), &d);
- }
-#endif
+ var_push_dtor(var_hash, old_data);
+ }
+ data = zend_hash_update_ind(ht, Z_STR(key), &d);
}
zval_dtor(&key);
diff --git a/ext/tokenizer/tests/001.phpt b/ext/tokenizer/tests/001.phpt
index 203e3c7ddb..195e4afbd4 100644
--- a/ext/tokenizer/tests/001.phpt
+++ b/ext/tokenizer/tests/001.phpt
@@ -1,7 +1,8 @@
--TEST--
token_name()
--SKIPIF--
-<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
+if (!extension_loaded("tokenizer")) print "skip"; ?>
--FILE--
<?php
diff --git a/ext/xml/tests/xml_error_string_variation1.phpt b/ext/xml/tests/xml_error_string_variation1.phpt
index 40b542c141..5e6010db0b 100644
--- a/ext/xml/tests/xml_error_string_variation1.phpt
+++ b/ext/xml/tests/xml_error_string_variation1.phpt
@@ -1,7 +1,7 @@
--TEST--
Test xml_error_string() function : usage variations - test different types for code
--SKIPIF--
-<?php
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
if (!extension_loaded("xml")) {
print "skip - XML extension not loaded";
}
diff --git a/ext/xml/tests/xml_parser_get_option_variation2.phpt b/ext/xml/tests/xml_parser_get_option_variation2.phpt
index 2341c413f1..3260e58b63 100644
--- a/ext/xml/tests/xml_parser_get_option_variation2.phpt
+++ b/ext/xml/tests/xml_parser_get_option_variation2.phpt
@@ -1,7 +1,7 @@
--TEST--
Test xml_parser_get_option() function : usage variations
--SKIPIF--
-<?php
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
if (!extension_loaded("xml")) {
print "skip - XML extension not loaded";
}
diff --git a/ext/xml/tests/xml_parser_set_option_variation2.phpt b/ext/xml/tests/xml_parser_set_option_variation2.phpt
index 9900d6fe6a..7b23b49fcf 100644
--- a/ext/xml/tests/xml_parser_set_option_variation2.phpt
+++ b/ext/xml/tests/xml_parser_set_option_variation2.phpt
@@ -2,6 +2,7 @@
Test xml_parser_set_option() function : usage variations
--SKIPIF--
<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
if (!extension_loaded("xml")) {
print "skip - XML extension not loaded";
}
diff --git a/ext/zlib/tests/gzfile_variation11.phpt b/ext/zlib/tests/gzfile_variation11.phpt
index a3585e5420..ba25bf570f 100644
--- a/ext/zlib/tests/gzfile_variation11.phpt
+++ b/ext/zlib/tests/gzfile_variation11.phpt
@@ -3,6 +3,7 @@ Test function gzfile() by substituting argument 2 with float values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
+if (PHP_INT_SIZE != 8) die('skip 64-bit only');
?>
--FILE--
<?php
@@ -126,4 +127,4 @@ array(6) {
string(39) "and I know that it descends down on me
"
}
-===DONE=== \ No newline at end of file
+===DONE===
diff --git a/ext/zlib/tests/gzopen_variation3.phpt b/ext/zlib/tests/gzopen_variation3.phpt
index 59e45a893c..0210a75905 100644
--- a/ext/zlib/tests/gzopen_variation3.phpt
+++ b/ext/zlib/tests/gzopen_variation3.phpt
@@ -4,7 +4,8 @@ Test gzopen() function : usage variation
<?php
if (!extension_loaded("zlib")) {
print "skip - zlib extension not loaded";
-}
+}
+if (PHP_INT_SIZE != 8) die('skip 64-bit only');
?>
--FILE--
<?php
diff --git a/ext/zlib/tests/readgzfile_variation11.phpt b/ext/zlib/tests/readgzfile_variation11.phpt
index 01dc78721d..6dd9c2ff39 100644
--- a/ext/zlib/tests/readgzfile_variation11.phpt
+++ b/ext/zlib/tests/readgzfile_variation11.phpt
@@ -3,6 +3,7 @@ Test function readgzfile() by substituting argument 2 with float values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
+if (PHP_INT_SIZE != 8) die('skip 64-bit only');
?>
--FILE--
<?php
@@ -61,4 +62,4 @@ Destiny who cares
as it turns around
and I know that it descends down on me
int(176)
-===DONE=== \ No newline at end of file
+===DONE===
diff --git a/main/php_streams.h b/main/php_streams.h
index 77a2234d92..79ceaf2761 100644
--- a/main/php_streams.h
+++ b/main/php_streams.h
@@ -210,6 +210,8 @@ struct _php_stream {
zend_resource *ctx;
int flags; /* PHP_STREAM_FLAG_XXX */
+ int eof;
+
/* buffer */
zend_off_t position; /* of underlying stream */
unsigned char *readbuf;
@@ -220,8 +222,6 @@ struct _php_stream {
/* how much data to read when filling buffer */
size_t chunk_size;
- int eof;
-
#if ZEND_DEBUG
const char *open_filename;
uint open_lineno;
diff --git a/sapi/apache2handler/php_apache.h b/sapi/apache2handler/php_apache.h
index f6f4f7a7c9..22eabaafd4 100644
--- a/sapi/apache2handler/php_apache.h
+++ b/sapi/apache2handler/php_apache.h
@@ -70,9 +70,9 @@ void php_ap2_register_hook(apr_pool_t *p);
#define APR_ARRAY_FOREACH_CLOSE() }}
typedef struct {
- long engine;
- long xbithack;
- long last_modified;
+ zend_bool engine;
+ zend_bool xbithack;
+ zend_bool last_modified;
} php_apache2_info_struct;
extern zend_module_entry apache2_module_entry;
diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c
index d038f9e9b9..76bbad6194 100644
--- a/sapi/apache2handler/php_functions.c
+++ b/sapi/apache2handler/php_functions.c
@@ -532,9 +532,9 @@ static const zend_function_entry apache_functions[] = {
};
PHP_INI_BEGIN()
- STD_PHP_INI_ENTRY("xbithack", "0", PHP_INI_ALL, OnUpdateLong, xbithack, php_apache2_info_struct, php_apache2_info)
- STD_PHP_INI_ENTRY("engine", "1", PHP_INI_ALL, OnUpdateLong, engine, php_apache2_info_struct, php_apache2_info)
- STD_PHP_INI_ENTRY("last_modified", "0", PHP_INI_ALL, OnUpdateLong, last_modified, php_apache2_info_struct, php_apache2_info)
+ STD_PHP_INI_ENTRY("xbithack", "0", PHP_INI_ALL, OnUpdateBool, xbithack, php_apache2_info_struct, php_apache2_info)
+ STD_PHP_INI_ENTRY("engine", "1", PHP_INI_ALL, OnUpdateBool, engine, php_apache2_info_struct, php_apache2_info)
+ STD_PHP_INI_ENTRY("last_modified", "0", PHP_INI_ALL, OnUpdateBool, last_modified, php_apache2_info_struct, php_apache2_info)
PHP_INI_END()
static PHP_MINIT_FUNCTION(apache)
diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c
index fe200304fd..3b7eaf2283 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -276,12 +276,12 @@ php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC)
if (!val) {
val = "";
}
- if (sapi_module.input_filter(PARSE_SERVER, key, &val, strlen(val), (size_t *)&new_val_len TSRMLS_CC)) {
+ if (sapi_module.input_filter(PARSE_SERVER, key, &val, strlen(val), &new_val_len TSRMLS_CC)) {
php_register_variable_safe(key, val, new_val_len, track_vars_array TSRMLS_CC);
}
APR_ARRAY_FOREACH_CLOSE()
- if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &ctx->r->uri, strlen(ctx->r->uri), (size_t *)&new_val_len TSRMLS_CC)) {
+ if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &ctx->r->uri, strlen(ctx->r->uri), &new_val_len TSRMLS_CC)) {
php_register_variable_safe("PHP_SELF", ctx->r->uri, new_val_len, track_vars_array TSRMLS_CC);
}
}
diff --git a/sapi/fpm/Makefile.frag b/sapi/fpm/Makefile.frag
index 6ed9e4a249..8e3b5e9316 100644
--- a/sapi/fpm/Makefile.frag
+++ b/sapi/fpm/Makefile.frag
@@ -11,8 +11,9 @@ install-fpm: $(SAPI_FPM_PATH)
@$(INSTALL) -m 0755 $(SAPI_FPM_PATH) $(INSTALL_ROOT)$(sbindir)/$(program_prefix)php-fpm$(program_suffix)$(EXEEXT)
@echo "Installing PHP FPM config: $(INSTALL_ROOT)$(sysconfdir)/" && \
- $(mkinstalldirs) $(INSTALL_ROOT)$(sysconfdir) || :
+ $(mkinstalldirs) $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d || :
@$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf.default || :
+ @$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf.default || :
@echo "Installing PHP FPM man page: $(INSTALL_ROOT)$(mandir)/man8/"
@$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man8
diff --git a/sapi/fpm/config.m4 b/sapi/fpm/config.m4
index f87776aa24..b4a4f4fb33 100644
--- a/sapi/fpm/config.m4
+++ b/sapi/fpm/config.m4
@@ -667,7 +667,7 @@ if test "$PHP_FPM" != "no"; then
PHP_ADD_BUILD_DIR(sapi/fpm/fpm)
PHP_ADD_BUILD_DIR(sapi/fpm/fpm/events)
- PHP_OUTPUT(sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html)
+ PHP_OUTPUT(sapi/fpm/php-fpm.conf sapi/fpm/www.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html)
PHP_ADD_MAKEFILE_FRAGMENT([$abs_srcdir/sapi/fpm/Makefile.frag])
SAPI_FPM_PATH=sapi/fpm/php-fpm
diff --git a/sapi/fpm/php-fpm.conf.in b/sapi/fpm/php-fpm.conf.in
index 6f384fb131..9e5b593f83 100644
--- a/sapi/fpm/php-fpm.conf.in
+++ b/sapi/fpm/php-fpm.conf.in
@@ -6,14 +6,6 @@
; prefix (@prefix@). This prefix can be dynamically changed by using the
; '-p' argument from the command line.
-; Include one or more files. If glob(3) exists, it is used to include a bunch of
-; files from a glob(3) pattern. This directive can be used everywhere in the
-; file.
-; Relative path can also be used. They will be prefixed by:
-; - the global prefix if it's been set (-p argument)
-; - @prefix@ otherwise
-;include=etc/fpm.d/*.conf
-
;;;;;;;;;;;;;;;;;;
; Global Options ;
;;;;;;;;;;;;;;;;;;
@@ -55,7 +47,7 @@
; Default Value: 0
;emergency_restart_threshold = 0
-; Interval of time used by emergency_restart_interval to determine when
+; Interval of time used by emergency_restart_interval to determine when
; a graceful restart will be initiated. This can be useful to work around
; accidental corruptions in an accelerator's shared memory.
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
@@ -87,11 +79,11 @@
; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
; Default Value: yes
;daemonize = yes
-
+
; Set open file descriptor rlimit for the master process.
; Default Value: system defined value
;rlimit_files = 1024
-
+
; Set max core size rlimit for the master process.
; Possible Values: 'unlimited' or an integer greater or equal to 0
; Default Value: system defined value
@@ -116,7 +108,7 @@
;systemd_interval = 10
;;;;;;;;;;;;;;;;;;;;
-; Pool Definitions ;
+; Pool Definitions ;
;;;;;;;;;;;;;;;;;;;;
; Multiple pools of child processes may be started with different listening
@@ -124,412 +116,10 @@
; used in logs and stats. There is no limitation on the number of pools which
; FPM can handle. Your system will tell you anyway :)
-; Start a new pool named 'www'.
-; the variable $pool can we used in any directive and will be replaced by the
-; pool name ('www' here)
-[www]
-
-; Per pool prefix
-; It only applies on the following directives:
-; - 'access.log'
-; - 'slowlog'
-; - 'listen' (unixsocket)
-; - 'chroot'
-; - 'chdir'
-; - 'php_values'
-; - 'php_admin_values'
-; When not set, the global prefix (or @php_fpm_prefix@) applies instead.
-; Note: This directive can also be relative to the global prefix.
-; Default Value: none
-;prefix = /path/to/pools/$pool
-
-; Unix user/group of processes
-; Note: The user is mandatory. If the group is not set, the default user's group
-; will be used.
-user = @php_fpm_user@
-group = @php_fpm_group@
-
-; The address on which to accept FastCGI requests.
-; Valid syntaxes are:
-; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
-; 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 addresses
-; (IPv6 and IPv4-mapped) on a specific port;
-; '/path/to/unix/socket' - to listen on a unix socket.
-; Note: This value is mandatory.
-listen = 127.0.0.1:9000
-
-; Set listen(2) backlog.
-; Default Value: 65535 (-1 on FreeBSD and OpenBSD)
-;listen.backlog = 65535
-
-; Set permissions for unix socket, if one is used. In Linux, read/write
-; permissions must be set in order to allow connections from a web server. Many
-; BSD-derived systems allow connections regardless of permissions.
-; Default Values: user and group are set as the running user
-; mode is set to 0660
-;listen.owner = @php_fpm_user@
-;listen.group = @php_fpm_group@
-;listen.mode = 0660
-; When POSIX Access Control Lists are supported you can set them using
-; these options, value is a coma separated list of user/group names.
-; When set, listen.owner and listen.group are ignored
-;listen.acl_users =
-;listen.acl_groups =
-
-; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
-; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
-; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
-; must be separated by a comma. If this value is left blank, connections will be
-; accepted from any ip address.
-; Default Value: any
-;listen.allowed_clients = 127.0.0.1
-
-; Specify the nice(2) priority to apply to the pool processes (only if set)
-; The value can vary from -19 (highest priority) to 20 (lower priority)
-; Note: - It will only work if the FPM master process is launched as root
-; - The pool processes will inherit the master process priority
-; unless it specified otherwise
-; Default Value: no set
-; process.priority = -19
-
-; Choose how the process manager will control the number of child processes.
-; Possible Values:
-; static - a fixed number (pm.max_children) of child processes;
-; dynamic - the number of child processes are set dynamically based on the
-; following directives. With this process management, there will be
-; always at least 1 children.
-; pm.max_children - the maximum number of children that can
-; be alive at the same time.
-; pm.start_servers - the number of children created on startup.
-; pm.min_spare_servers - the minimum number of children in 'idle'
-; state (waiting to process). If the number
-; of 'idle' processes is less than this
-; number then some children will be created.
-; pm.max_spare_servers - the maximum number of children in 'idle'
-; state (waiting to process). If the number
-; of 'idle' processes is greater than this
-; number then some children will be killed.
-; ondemand - no children are created at startup. Children will be forked when
-; new requests will connect. The following parameter are used:
-; pm.max_children - the maximum number of children that
-; can be alive at the same time.
-; pm.process_idle_timeout - The number of seconds after which
-; an idle process will be killed.
-; Note: This value is mandatory.
-pm = dynamic
-
-; The number of child processes to be created when pm is set to 'static' and the
-; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
-; This value sets the limit on the number of simultaneous requests that will be
-; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
-; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
-; CGI. The below defaults are based on a server without much resources. Don't
-; forget to tweak pm.* to fit your needs.
-; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
-; Note: This value is mandatory.
-pm.max_children = 5
-
-; The number of child processes created on startup.
-; Note: Used only when pm is set to 'dynamic'
-; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
-pm.start_servers = 2
-
-; The desired minimum number of idle server processes.
-; Note: Used only when pm is set to 'dynamic'
-; Note: Mandatory when pm is set to 'dynamic'
-pm.min_spare_servers = 1
-
-; The desired maximum number of idle server processes.
-; Note: Used only when pm is set to 'dynamic'
-; Note: Mandatory when pm is set to 'dynamic'
-pm.max_spare_servers = 3
-
-; The number of seconds after which an idle process will be killed.
-; Note: Used only when pm is set to 'ondemand'
-; Default Value: 10s
-;pm.process_idle_timeout = 10s;
-
-; The number of requests each child process should execute before respawning.
-; This can be useful to work around memory leaks in 3rd party libraries. For
-; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
-; Default Value: 0
-;pm.max_requests = 500
-
-; The URI to view the FPM status page. If this value is not set, no URI will be
-; recognized as a status page. It shows the following informations:
-; pool - the name of the pool;
-; process manager - static, dynamic or ondemand;
-; start time - the date and time FPM has started;
-; start since - number of seconds since FPM has started;
-; accepted conn - the number of request accepted by the pool;
-; listen queue - the number of request in the queue of pending
-; connections (see backlog in listen(2));
-; max listen queue - the maximum number of requests in the queue
-; of pending connections since FPM has started;
-; listen queue len - the size of the socket queue of pending connections;
-; idle processes - the number of idle processes;
-; active processes - the number of active processes;
-; total processes - the number of idle + active processes;
-; max active processes - the maximum number of active processes since FPM
-; has started;
-; max children reached - number of times, the process limit has been reached,
-; when pm tries to start more children (works only for
-; pm 'dynamic' and 'ondemand');
-; Value are updated in real time.
-; Example output:
-; pool: www
-; process manager: static
-; start time: 01/Jul/2011:17:53:49 +0200
-; start since: 62636
-; accepted conn: 190460
-; listen queue: 0
-; max listen queue: 1
-; listen queue len: 42
-; idle processes: 4
-; active processes: 11
-; total processes: 15
-; max active processes: 12
-; max children reached: 0
-;
-; By default the status page output is formatted as text/plain. Passing either
-; 'html', 'xml' or 'json' in the query string will return the corresponding
-; output syntax. Example:
-; http://www.foo.bar/status
-; http://www.foo.bar/status?json
-; http://www.foo.bar/status?html
-; http://www.foo.bar/status?xml
-;
-; By default the status page only outputs short status. Passing 'full' in the
-; query string will also return status for each pool process.
-; Example:
-; http://www.foo.bar/status?full
-; http://www.foo.bar/status?json&full
-; http://www.foo.bar/status?html&full
-; http://www.foo.bar/status?xml&full
-; The Full status returns for each process:
-; pid - the PID of the process;
-; state - the state of the process (Idle, Running, ...);
-; start time - the date and time the process has started;
-; start since - the number of seconds since the process has started;
-; requests - the number of requests the process has served;
-; request duration - the duration in µs of the requests;
-; request method - the request method (GET, POST, ...);
-; request URI - the request URI with the query string;
-; content length - the content length of the request (only with POST);
-; user - the user (PHP_AUTH_USER) (or '-' if not set);
-; script - the main script called (or '-' if not set);
-; last request cpu - the %cpu the last request consumed
-; it's always 0 if the process is not in Idle state
-; because CPU calculation is done when the request
-; processing has terminated;
-; last request memory - the max amount of memory the last request consumed
-; it's always 0 if the process is not in Idle state
-; because memory calculation is done when the request
-; processing has terminated;
-; If the process is in Idle state, then informations are related to the
-; last request the process has served. Otherwise informations are related to
-; the current request being served.
-; Example output:
-; ************************
-; pid: 31330
-; state: Running
-; start time: 01/Jul/2011:17:53:49 +0200
-; start since: 63087
-; requests: 12808
-; request duration: 1250261
-; request method: GET
-; request URI: /test_mem.php?N=10000
-; content length: 0
-; user: -
-; script: /home/fat/web/docs/php/test_mem.php
-; last request cpu: 0.00
-; last request memory: 0
-;
-; Note: There is a real-time FPM status monitoring sample web page available
-; It's available in: @EXPANDED_DATADIR@/fpm/status.html
-;
-; Note: The value must start with a leading slash (/). The value can be
-; anything, but it may not be a good idea to use the .php extension or it
-; may conflict with a real PHP file.
-; Default Value: not set
-;pm.status_path = /status
-
-; The ping URI to call the monitoring page of FPM. If this value is not set, no
-; URI will be recognized as a ping page. This could be used to test from outside
-; that FPM is alive and responding, or to
-; - create a graph of FPM availability (rrd or such);
-; - remove a server from a group if it is not responding (load balancing);
-; - trigger alerts for the operating team (24/7).
-; Note: The value must start with a leading slash (/). The value can be
-; anything, but it may not be a good idea to use the .php extension or it
-; may conflict with a real PHP file.
-; Default Value: not set
-;ping.path = /ping
-
-; This directive may be used to customize the response of a ping request. The
-; response is formatted as text/plain with a 200 response code.
-; Default Value: pong
-;ping.response = pong
-
-; The access log file
-; Default: not set
-;access.log = log/$pool.access.log
-
-; The access log format.
-; The following syntax is allowed
-; %%: the '%' character
-; %C: %CPU used by the request
-; it can accept the following format:
-; - %{user}C for user CPU only
-; - %{system}C for system CPU only
-; - %{total}C for user + system CPU (default)
-; %d: time taken to serve the request
-; it can accept the following format:
-; - %{seconds}d (default)
-; - %{miliseconds}d
-; - %{mili}d
-; - %{microseconds}d
-; - %{micro}d
-; %e: an environment variable (same as $_ENV or $_SERVER)
-; it must be associated with embraces to specify the name of the env
-; variable. Some exemples:
-; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
-; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
-; %f: script filename
-; %l: content-length of the request (for POST request only)
-; %m: request method
-; %M: peak of memory allocated by PHP
-; it can accept the following format:
-; - %{bytes}M (default)
-; - %{kilobytes}M
-; - %{kilo}M
-; - %{megabytes}M
-; - %{mega}M
-; %n: pool name
-; %o: output header
-; it must be associated with embraces to specify the name of the header:
-; - %{Content-Type}o
-; - %{X-Powered-By}o
-; - %{Transfert-Encoding}o
-; - ....
-; %p: PID of the child that serviced the request
-; %P: PID of the parent of the child that serviced the request
-; %q: the query string
-; %Q: the '?' character if query string exists
-; %r: the request URI (without the query string, see %q and %Q)
-; %R: remote IP address
-; %s: status (response code)
-; %t: server time the request was received
-; it can accept a strftime(3) format:
-; %d/%b/%Y:%H:%M:%S %z (default)
-; %T: time the log has been written (the request has finished)
-; it can accept a strftime(3) format:
-; %d/%b/%Y:%H:%M:%S %z (default)
-; %u: remote user
-;
-; Default: "%R - %u %t \"%m %r\" %s"
-;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
-
-; The log file for slow requests
-; Default Value: not set
-; Note: slowlog is mandatory if request_slowlog_timeout is set
-;slowlog = log/$pool.log.slow
-
-; The timeout for serving a single request after which a PHP backtrace will be
-; dumped to the 'slowlog' file. A value of '0s' means 'off'.
-; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
-; Default Value: 0
-;request_slowlog_timeout = 0
-
-; The timeout for serving a single request after which the worker process will
-; be killed. This option should be used when the 'max_execution_time' ini option
-; does not stop script execution for some reason. A value of '0' means 'off'.
-; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
-; Default Value: 0
-;request_terminate_timeout = 0
-
-; Set open file descriptor rlimit.
-; Default Value: system defined value
-;rlimit_files = 1024
-
-; Set max core size rlimit.
-; Possible Values: 'unlimited' or an integer greater or equal to 0
-; Default Value: system defined value
-;rlimit_core = 0
-
-; Chroot to this directory at the start. This value must be defined as an
-; absolute path. When this value is not set, chroot is not used.
-; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
-; of its subdirectories. If the pool prefix is not set, the global prefix
-; will be used instead.
-; Note: chrooting is a great security feature and should be used whenever
-; possible. However, all PHP paths will be relative to the chroot
-; (error_log, sessions.save_path, ...).
-; Default Value: not set
-;chroot =
-
-; Chdir to this directory at the start.
-; Note: relative path can be used.
-; Default Value: current directory or / when chroot
-;chdir = /var/www
-
-; Redirect worker stdout and stderr into main error log. If not set, stdout and
-; stderr will be redirected to /dev/null according to FastCGI specs.
-; Note: on highloaded environement, this can cause some delay in the page
-; process time (several ms).
-; Default Value: no
-;catch_workers_output = yes
-
-; Clear environment in FPM workers
-; Prevents arbitrary environment variables from reaching FPM worker processes
-; by clearing the environment in workers before env vars specified in this
-; pool configuration are added.
-; Setting to "no" will make all environment variables available to PHP code
-; via getenv(), $_ENV and $_SERVER.
-; Default Value: yes
-;clear_env = no
-
-; Limits the extensions of the main script FPM will allow to parse. This can
-; prevent configuration mistakes on the web server side. You should only limit
-; FPM to .php extensions to prevent malicious users to use other extensions to
-; exectute php code.
-; Note: set an empty value to allow all extensions.
-; Default Value: .php
-;security.limit_extensions = .php .php3 .php4 .php5 .php7
-
-; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
-; the current environment.
-; Default Value: clean env
-;env[HOSTNAME] = $HOSTNAME
-;env[PATH] = /usr/local/bin:/usr/bin:/bin
-;env[TMP] = /tmp
-;env[TMPDIR] = /tmp
-;env[TEMP] = /tmp
-
-; Additional php.ini defines, specific to this pool of workers. These settings
-; overwrite the values previously defined in the php.ini. The directives are the
-; same as the PHP SAPI:
-; php_value/php_flag - you can set classic ini defines which can
-; be overwritten from PHP call 'ini_set'.
-; php_admin_value/php_admin_flag - these directives won't be overwritten by
-; PHP call 'ini_set'
-; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
-
-; Defining 'extension' will load the corresponding shared extension from
-; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
-; overwrite previously defined php.ini values, but will append the new value
-; instead.
-
-; Note: path INI options can be relative and will be expanded with the prefix
-; (pool, global or @prefix@)
-
-; Default Value: nothing is defined by default except the values in php.ini and
-; specified at startup with the -d argument
-;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
-;php_flag[display_errors] = off
-;php_admin_value[error_log] = /var/log/fpm-php.www.log
-;php_admin_flag[log_errors] = on
-;php_admin_value[memory_limit] = 32M
+; Include one or more files. If glob(3) exists, it is used to include a bunch of
+; files from a glob(3) pattern. This directive can be used everywhere in the
+; file.
+; Relative path can also be used. They will be prefixed by:
+; - the global prefix if it's been set (-p argument)
+; - @prefix@ otherwise
+include=@php_fpm_sysconfdir@/php-fpm.d/*.conf
diff --git a/sapi/fpm/www.conf.in b/sapi/fpm/www.conf.in
new file mode 100644
index 0000000000..1f0130c866
--- /dev/null
+++ b/sapi/fpm/www.conf.in
@@ -0,0 +1,409 @@
+; Start a new pool named 'www'.
+; the variable $pool can we used in any directive and will be replaced by the
+; pool name ('www' here)
+[www]
+
+; Per pool prefix
+; It only applies on the following directives:
+; - 'access.log'
+; - 'slowlog'
+; - 'listen' (unixsocket)
+; - 'chroot'
+; - 'chdir'
+; - 'php_values'
+; - 'php_admin_values'
+; When not set, the global prefix (or @php_fpm_prefix@) applies instead.
+; Note: This directive can also be relative to the global prefix.
+; Default Value: none
+;prefix = /path/to/pools/$pool
+
+; Unix user/group of processes
+; Note: The user is mandatory. If the group is not set, the default user's group
+; will be used.
+user = @php_fpm_user@
+group = @php_fpm_group@
+
+; The address on which to accept FastCGI requests.
+; Valid syntaxes are:
+; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
+; 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 addresses
+; (IPv6 and IPv4-mapped) on a specific port;
+; '/path/to/unix/socket' - to listen on a unix socket.
+; Note: This value is mandatory.
+listen = 127.0.0.1:9000
+
+; Set listen(2) backlog.
+; Default Value: 65535 (-1 on FreeBSD and OpenBSD)
+;listen.backlog = 65535
+
+; Set permissions for unix socket, if one is used. In Linux, read/write
+; permissions must be set in order to allow connections from a web server. Many
+; BSD-derived systems allow connections regardless of permissions.
+; Default Values: user and group are set as the running user
+; mode is set to 0660
+;listen.owner = @php_fpm_user@
+;listen.group = @php_fpm_group@
+;listen.mode = 0660
+; When POSIX Access Control Lists are supported you can set them using
+; these options, value is a comma separated list of user/group names.
+; When set, listen.owner and listen.group are ignored
+;listen.acl_users =
+;listen.acl_groups =
+
+; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
+; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
+; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
+; must be separated by a comma. If this value is left blank, connections will be
+; accepted from any ip address.
+; Default Value: any
+;listen.allowed_clients = 127.0.0.1
+
+; Specify the nice(2) priority to apply to the pool processes (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+; - The pool processes will inherit the master process priority
+; unless it specified otherwise
+; Default Value: no set
+; process.priority = -19
+
+; Choose how the process manager will control the number of child processes.
+; Possible Values:
+; static - a fixed number (pm.max_children) of child processes;
+; dynamic - the number of child processes are set dynamically based on the
+; following directives. With this process management, there will be
+; always at least 1 children.
+; pm.max_children - the maximum number of children that can
+; be alive at the same time.
+; pm.start_servers - the number of children created on startup.
+; pm.min_spare_servers - the minimum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is less than this
+; number then some children will be created.
+; pm.max_spare_servers - the maximum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is greater than this
+; number then some children will be killed.
+; ondemand - no children are created at startup. Children will be forked when
+; new requests will connect. The following parameter are used:
+; pm.max_children - the maximum number of children that
+; can be alive at the same time.
+; pm.process_idle_timeout - The number of seconds after which
+; an idle process will be killed.
+; Note: This value is mandatory.
+pm = dynamic
+
+; The number of child processes to be created when pm is set to 'static' and the
+; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
+; This value sets the limit on the number of simultaneous requests that will be
+; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
+; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
+; CGI. The below defaults are based on a server without much resources. Don't
+; forget to tweak pm.* to fit your needs.
+; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
+; Note: This value is mandatory.
+pm.max_children = 5
+
+; The number of child processes created on startup.
+; Note: Used only when pm is set to 'dynamic'
+; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
+pm.start_servers = 2
+
+; The desired minimum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.min_spare_servers = 1
+
+; The desired maximum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.max_spare_servers = 3
+
+; The number of seconds after which an idle process will be killed.
+; Note: Used only when pm is set to 'ondemand'
+; Default Value: 10s
+;pm.process_idle_timeout = 10s;
+
+; The number of requests each child process should execute before respawning.
+; This can be useful to work around memory leaks in 3rd party libraries. For
+; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
+; Default Value: 0
+;pm.max_requests = 500
+
+; The URI to view the FPM status page. If this value is not set, no URI will be
+; recognized as a status page. It shows the following informations:
+; pool - the name of the pool;
+; process manager - static, dynamic or ondemand;
+; start time - the date and time FPM has started;
+; start since - number of seconds since FPM has started;
+; accepted conn - the number of request accepted by the pool;
+; listen queue - the number of request in the queue of pending
+; connections (see backlog in listen(2));
+; max listen queue - the maximum number of requests in the queue
+; of pending connections since FPM has started;
+; listen queue len - the size of the socket queue of pending connections;
+; idle processes - the number of idle processes;
+; active processes - the number of active processes;
+; total processes - the number of idle + active processes;
+; max active processes - the maximum number of active processes since FPM
+; has started;
+; max children reached - number of times, the process limit has been reached,
+; when pm tries to start more children (works only for
+; pm 'dynamic' and 'ondemand');
+; Value are updated in real time.
+; Example output:
+; pool: www
+; process manager: static
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 62636
+; accepted conn: 190460
+; listen queue: 0
+; max listen queue: 1
+; listen queue len: 42
+; idle processes: 4
+; active processes: 11
+; total processes: 15
+; max active processes: 12
+; max children reached: 0
+;
+; By default the status page output is formatted as text/plain. Passing either
+; 'html', 'xml' or 'json' in the query string will return the corresponding
+; output syntax. Example:
+; http://www.foo.bar/status
+; http://www.foo.bar/status?json
+; http://www.foo.bar/status?html
+; http://www.foo.bar/status?xml
+;
+; By default the status page only outputs short status. Passing 'full' in the
+; query string will also return status for each pool process.
+; Example:
+; http://www.foo.bar/status?full
+; http://www.foo.bar/status?json&full
+; http://www.foo.bar/status?html&full
+; http://www.foo.bar/status?xml&full
+; The Full status returns for each process:
+; pid - the PID of the process;
+; state - the state of the process (Idle, Running, ...);
+; start time - the date and time the process has started;
+; start since - the number of seconds since the process has started;
+; requests - the number of requests the process has served;
+; request duration - the duration in µs of the requests;
+; request method - the request method (GET, POST, ...);
+; request URI - the request URI with the query string;
+; content length - the content length of the request (only with POST);
+; user - the user (PHP_AUTH_USER) (or '-' if not set);
+; script - the main script called (or '-' if not set);
+; last request cpu - the %cpu the last request consumed
+; it's always 0 if the process is not in Idle state
+; because CPU calculation is done when the request
+; processing has terminated;
+; last request memory - the max amount of memory the last request consumed
+; it's always 0 if the process is not in Idle state
+; because memory calculation is done when the request
+; processing has terminated;
+; If the process is in Idle state, then informations are related to the
+; last request the process has served. Otherwise informations are related to
+; the current request being served.
+; Example output:
+; ************************
+; pid: 31330
+; state: Running
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 63087
+; requests: 12808
+; request duration: 1250261
+; request method: GET
+; request URI: /test_mem.php?N=10000
+; content length: 0
+; user: -
+; script: /home/fat/web/docs/php/test_mem.php
+; last request cpu: 0.00
+; last request memory: 0
+;
+; Note: There is a real-time FPM status monitoring sample web page available
+; It's available in: @EXPANDED_DATADIR@/fpm/status.html
+;
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;pm.status_path = /status
+
+; The ping URI to call the monitoring page of FPM. If this value is not set, no
+; URI will be recognized as a ping page. This could be used to test from outside
+; that FPM is alive and responding, or to
+; - create a graph of FPM availability (rrd or such);
+; - remove a server from a group if it is not responding (load balancing);
+; - trigger alerts for the operating team (24/7).
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;ping.path = /ping
+
+; This directive may be used to customize the response of a ping request. The
+; response is formatted as text/plain with a 200 response code.
+; Default Value: pong
+;ping.response = pong
+
+; The access log file
+; Default: not set
+;access.log = log/$pool.access.log
+
+; The access log format.
+; The following syntax is allowed
+; %%: the '%' character
+; %C: %CPU used by the request
+; it can accept the following format:
+; - %{user}C for user CPU only
+; - %{system}C for system CPU only
+; - %{total}C for user + system CPU (default)
+; %d: time taken to serve the request
+; it can accept the following format:
+; - %{seconds}d (default)
+; - %{miliseconds}d
+; - %{mili}d
+; - %{microseconds}d
+; - %{micro}d
+; %e: an environment variable (same as $_ENV or $_SERVER)
+; it must be associated with embraces to specify the name of the env
+; variable. Some exemples:
+; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
+; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
+; %f: script filename
+; %l: content-length of the request (for POST request only)
+; %m: request method
+; %M: peak of memory allocated by PHP
+; it can accept the following format:
+; - %{bytes}M (default)
+; - %{kilobytes}M
+; - %{kilo}M
+; - %{megabytes}M
+; - %{mega}M
+; %n: pool name
+; %o: output header
+; it must be associated with embraces to specify the name of the header:
+; - %{Content-Type}o
+; - %{X-Powered-By}o
+; - %{Transfert-Encoding}o
+; - ....
+; %p: PID of the child that serviced the request
+; %P: PID of the parent of the child that serviced the request
+; %q: the query string
+; %Q: the '?' character if query string exists
+; %r: the request URI (without the query string, see %q and %Q)
+; %R: remote IP address
+; %s: status (response code)
+; %t: server time the request was received
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; %T: time the log has been written (the request has finished)
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; %u: remote user
+;
+; Default: "%R - %u %t \"%m %r\" %s"
+;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
+
+; The log file for slow requests
+; Default Value: not set
+; Note: slowlog is mandatory if request_slowlog_timeout is set
+;slowlog = log/$pool.log.slow
+
+; The timeout for serving a single request after which a PHP backtrace will be
+; dumped to the 'slowlog' file. A value of '0s' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_slowlog_timeout = 0
+
+; The timeout for serving a single request after which the worker process will
+; be killed. This option should be used when the 'max_execution_time' ini option
+; does not stop script execution for some reason. A value of '0' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_terminate_timeout = 0
+
+; Set open file descriptor rlimit.
+; Default Value: system defined value
+;rlimit_files = 1024
+
+; Set max core size rlimit.
+; Possible Values: 'unlimited' or an integer greater or equal to 0
+; Default Value: system defined value
+;rlimit_core = 0
+
+; Chroot to this directory at the start. This value must be defined as an
+; absolute path. When this value is not set, chroot is not used.
+; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
+; of its subdirectories. If the pool prefix is not set, the global prefix
+; will be used instead.
+; Note: chrooting is a great security feature and should be used whenever
+; possible. However, all PHP paths will be relative to the chroot
+; (error_log, sessions.save_path, ...).
+; Default Value: not set
+;chroot =
+
+; Chdir to this directory at the start.
+; Note: relative path can be used.
+; Default Value: current directory or / when chroot
+;chdir = /var/www
+
+; Redirect worker stdout and stderr into main error log. If not set, stdout and
+; stderr will be redirected to /dev/null according to FastCGI specs.
+; Note: on highloaded environement, this can cause some delay in the page
+; process time (several ms).
+; Default Value: no
+;catch_workers_output = yes
+
+; Clear environment in FPM workers
+; Prevents arbitrary environment variables from reaching FPM worker processes
+; by clearing the environment in workers before env vars specified in this
+; pool configuration are added.
+; Setting to "no" will make all environment variables available to PHP code
+; via getenv(), $_ENV and $_SERVER.
+; Default Value: yes
+;clear_env = no
+
+; Limits the extensions of the main script FPM will allow to parse. This can
+; prevent configuration mistakes on the web server side. You should only limit
+; FPM to .php extensions to prevent malicious users to use other extensions to
+; exectute php code.
+; Note: set an empty value to allow all extensions.
+; Default Value: .php
+;security.limit_extensions = .php .php3 .php4 .php5 .php7
+
+; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
+; the current environment.
+; Default Value: clean env
+;env[HOSTNAME] = $HOSTNAME
+;env[PATH] = /usr/local/bin:/usr/bin:/bin
+;env[TMP] = /tmp
+;env[TMPDIR] = /tmp
+;env[TEMP] = /tmp
+
+; Additional php.ini defines, specific to this pool of workers. These settings
+; overwrite the values previously defined in the php.ini. The directives are the
+; same as the PHP SAPI:
+; php_value/php_flag - you can set classic ini defines which can
+; be overwritten from PHP call 'ini_set'.
+; php_admin_value/php_admin_flag - these directives won't be overwritten by
+; PHP call 'ini_set'
+; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
+
+; Defining 'extension' will load the corresponding shared extension from
+; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
+; overwrite previously defined php.ini values, but will append the new value
+; instead.
+
+; Note: path INI options can be relative and will be expanded with the prefix
+; (pool, global or @prefix@)
+
+; Default Value: nothing is defined by default except the values in php.ini and
+; specified at startup with the -d argument
+;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
+;php_flag[display_errors] = off
+;php_admin_value[error_log] = /var/log/fpm-php.www.log
+;php_admin_flag[log_errors] = on
+;php_admin_value[memory_limit] = 32M
diff --git a/sapi/phpdbg/phpdbg.h b/sapi/phpdbg/phpdbg.h
index 60d1239a27..a6d4935d45 100644
--- a/sapi/phpdbg/phpdbg.h
+++ b/sapi/phpdbg/phpdbg.h
@@ -71,9 +71,14 @@
#endif
#undef zend_hash_str_add
+#ifdef PHP_WIN32
+#define zend_hash_str_add(...) \
+ _zend_hash_str_add(__VA_ARGS__ ZEND_FILE_LINE_CC)
+#else
#define zend_hash_str_add_tmp(ht, key, len, pData) \
_zend_hash_str_add(ht, key, len, pData ZEND_FILE_LINE_CC)
#define zend_hash_str_add(...) zend_hash_str_add_tmp(__VA_ARGS__)
+#endif
#ifdef HAVE_LIBREADLINE
# include <readline/readline.h>
diff --git a/sapi/phpdbg/phpdbg_info.c b/sapi/phpdbg/phpdbg_info.c
index 01633e4feb..7963ff35e2 100644
--- a/sapi/phpdbg/phpdbg_info.c
+++ b/sapi/phpdbg/phpdbg_info.c
@@ -386,8 +386,9 @@ PHPDBG_INFO(classes) /* {{{ */
phpdbg_print_class_name(ce TSRMLS_CC);
if (ce->parent) {
+ zend_class_entry *pce;
phpdbg_xml("<parents %r>");
- zend_class_entry *pce = ce->parent;
+ pce = ce->parent;
do {
phpdbg_out("|-------- ");
phpdbg_print_class_name(pce TSRMLS_CC);
diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c
index aa431a8ae0..0ab5b4d230 100644
--- a/sapi/phpdbg/phpdbg_prompt.c
+++ b/sapi/phpdbg/phpdbg_prompt.c
@@ -306,7 +306,7 @@ void phpdbg_string_init(char *buffer TSRMLS_DC) {
void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_init TSRMLS_DC) /* {{{ */
{
- struct stat sb;
+ zend_stat_t sb;
if (init_file && VCWD_STAT(init_file, &sb) != -1) {
FILE *fp = fopen(init_file, "r");
@@ -374,7 +374,7 @@ void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default TS
PHPDBG_COMMAND(exec) /* {{{ */
{
- struct stat sb;
+ zend_stat_t sb;
if (VCWD_STAT(param->str, &sb) != FAILURE) {
if (sb.st_mode & (S_IFREG|S_IFLNK)) {
@@ -698,10 +698,11 @@ PHPDBG_COMMAND(ev) /* {{{ */
zend_execute_data *original_execute_data = EG(current_execute_data);
zend_class_entry *original_scope = EG(scope);
zend_vm_stack original_stack = EG(vm_stack);
- original_stack->top = EG(vm_stack_top);
PHPDBG_OUTPUT_BACKUP();
+ original_stack->top = EG(vm_stack_top);
+
if (PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER) {
phpdbg_try_access {
phpdbg_parse_variable(param->str, param->len, &EG(symbol_table).ht, 0, phpdbg_output_ev_variable, 0 TSRMLS_CC);
@@ -1072,7 +1073,7 @@ PHPDBG_COMMAND(dl) /* {{{ */
PHPDBG_COMMAND(source) /* {{{ */
{
- struct stat sb;
+ zend_stat_t sb;
if (VCWD_STAT(param->str, &sb) != -1) {
phpdbg_try_file_init(param->str, param->len, 0 TSRMLS_CC);
diff --git a/tests/output/ob_implicit_flush_variation_001.phpt b/tests/output/ob_implicit_flush_variation_001.phpt
index ef5a9efb75..73d5820691 100644
--- a/tests/output/ob_implicit_flush_variation_001.phpt
+++ b/tests/output/ob_implicit_flush_variation_001.phpt
@@ -1,5 +1,7 @@
--TEST--
Test ob_implicit_flush() function : usage variation
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
--FILE--
<?php
/* Prototype : void ob_implicit_flush([int flag])
@@ -189,4 +191,4 @@ NULL
NULL
--unset var--
-NULL \ No newline at end of file
+NULL