diff --git a/Zend/tests/bug43201.phpt b/Zend/tests/bug43201.phpt index 49816ea1c158d..c93b118e1696d 100644 --- a/Zend/tests/bug43201.phpt +++ b/Zend/tests/bug43201.phpt @@ -30,25 +30,37 @@ Warning: Undefined variable $ref in %s on line %d Warning: Undefined variable $undef in %s on line %d +Deprecated: chop(): Passing null to parameter #1 ($string) of type string is deprecated in %s on line %d + Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17 Warning: Undefined variable $undef in %s on line %d +Deprecated: chop(): Passing null to parameter #1 ($string) of type string is deprecated in %s on line %d + Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17 Warning: Undefined variable $undef in %s on line %d +Deprecated: chop(): Passing null to parameter #1 ($string) of type string is deprecated in %s on line %d + Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17 Warning: Undefined variable $undef in %s on line %d +Deprecated: chop(): Passing null to parameter #1 ($string) of type string is deprecated in %s on line %d + Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17 Warning: Undefined variable $undef in %s on line %d +Deprecated: chop(): Passing null to parameter #1 ($string) of type string is deprecated in %s on line %d + Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17 Warning: Undefined variable $undef in %s on line %d +Deprecated: chop(): Passing null to parameter #1 ($string) of type string is deprecated in %s on line %d + Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17 ok diff --git a/Zend/tests/bug64677.phpt b/Zend/tests/bug64677.phpt index 2dcd00ce0a8f4..c3b168bd83b51 100644 --- a/Zend/tests/bug64677.phpt +++ b/Zend/tests/bug64677.phpt @@ -7,7 +7,7 @@ class cat { } } $cat = new cat(); -$cat->show_output('Files: ', trim(`cd .`)); // this gives invalid args to shell_exec +$cat->show_output('Files: ', trim((string) `cd .`)); // this gives invalid args to shell_exec $cat->show_output('Files: ', `cd .`); // this causes a segmentation fault $cat->show_output(`cd .`); // this causes a segmentation fault diff --git a/Zend/tests/class_exists_002.phpt b/Zend/tests/class_exists_002.phpt index 5e5df1d37188f..e020c1d623e62 100644 --- a/Zend/tests/class_exists_002.phpt +++ b/Zend/tests/class_exists_002.phpt @@ -8,7 +8,6 @@ class foo { } var_dump(class_exists('')); -var_dump(class_exists(NULL)); var_dump(class_exists('FOO')); var_dump(class_exists('bar')); var_dump(class_exists(1)); @@ -16,7 +15,6 @@ var_dump(class_exists(1)); ?> --EXPECT-- bool(false) -bool(false) bool(true) bool(false) bool(false) diff --git a/Zend/tests/exception_001.phpt b/Zend/tests/exception_001.phpt index 232ef012eddba..aba29d4aa3ee1 100644 --- a/Zend/tests/exception_001.phpt +++ b/Zend/tests/exception_001.phpt @@ -7,7 +7,7 @@ try { try { try { try { - throw new Exception(NULL); + throw new Exception(); } catch (Exception $e) { var_dump($e->getMessage()); throw $e; diff --git a/Zend/tests/interface_exists_001.phpt b/Zend/tests/interface_exists_001.phpt index 84e9c6df1e42e..4bc01221a8356 100644 --- a/Zend/tests/interface_exists_001.phpt +++ b/Zend/tests/interface_exists_001.phpt @@ -8,10 +8,8 @@ interface foo { var_dump(interface_exists('foo')); var_dump(interface_exists(1)); -var_dump(interface_exists(NULL)); ?> --EXPECT-- bool(true) bool(false) -bool(false) diff --git a/Zend/tests/null_to_non_nullable_special_func.phpt b/Zend/tests/null_to_non_nullable_special_func.phpt new file mode 100644 index 0000000000000..9dc1c96f72999 --- /dev/null +++ b/Zend/tests/null_to_non_nullable_special_func.phpt @@ -0,0 +1,12 @@ +--TEST-- +Test null arg behavior for special functions +--FILE-- + +--EXPECTF-- +Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in %s on line %d +int(0) diff --git a/Zend/tests/nullsafe_operator/013.phpt b/Zend/tests/nullsafe_operator/013.phpt index fd1fbc9006f68..595f292f6f456 100644 --- a/Zend/tests/nullsafe_operator/013.phpt +++ b/Zend/tests/nullsafe_operator/013.phpt @@ -38,14 +38,21 @@ dump_error(fn() => array_key_exists('foo', $foo?->foo())); ?> --EXPECTF-- +Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in %s on line %d int(0) bool(true) bool(false) bool(false) bool(false) bool(false) + +Deprecated: defined(): Passing null to parameter #1 ($constant_name) of type string is deprecated in %s on line %d bool(false) + +Deprecated: chr(): Passing null to parameter #1 ($codepoint) of type int is deprecated in %s on line %d string(1) "%s" + +Deprecated: ord(): Passing null to parameter #1 ($character) of type string is deprecated in %s on line %d int(0) string(98) "call_user_func_array(): Argument #1 ($function) must be a valid callback, no array or string given" string(77) "call_user_func_array(): Argument #2 ($args) must be of type array, null given" @@ -55,6 +62,8 @@ string(4) "NULL" string(52) "func_num_args() expects exactly 0 arguments, 1 given" string(52) "func_get_args() expects exactly 0 arguments, 1 given" string(69) "array_slice(): Argument #1 ($array) must be of type array, null given" + +Deprecated: array_slice(): Passing null to parameter #2 ($offset) of type int is deprecated in %s on line %d array(1) { [0]=> string(3) "foo" diff --git a/Zend/tests/str_or_obj_of_class_zpp.phpt b/Zend/tests/str_or_obj_of_class_zpp.phpt index 6f6a155895b8f..04a321a69265b 100644 --- a/Zend/tests/str_or_obj_of_class_zpp.phpt +++ b/Zend/tests/str_or_obj_of_class_zpp.phpt @@ -51,9 +51,11 @@ try { } ?> ---EXPECT-- +--EXPECTF-- string(6) "string" string(1) "1" + +Deprecated: zend_string_or_stdclass(): Passing null to parameter #1 ($param) of type string is deprecated in %s on line %d string(0) "" object(stdClass)#1 (0) { } diff --git a/Zend/tests/str_or_obj_zpp.phpt b/Zend/tests/str_or_obj_zpp.phpt index 6328c61b2dbf0..00eec7a688295 100644 --- a/Zend/tests/str_or_obj_zpp.phpt +++ b/Zend/tests/str_or_obj_zpp.phpt @@ -34,9 +34,11 @@ try { } ?> ---EXPECT-- +--EXPECTF-- string(6) "string" string(1) "1" + +Deprecated: zend_string_or_object(): Passing null to parameter #1 ($param) of type object|string is deprecated in %s on line %d string(0) "" object(stdClass)#1 (0) { } diff --git a/Zend/tests/trait_exists_001.phpt b/Zend/tests/trait_exists_001.phpt index 8a7c55d58608d..8699b07cefd16 100644 --- a/Zend/tests/trait_exists_001.phpt +++ b/Zend/tests/trait_exists_001.phpt @@ -8,10 +8,8 @@ trait foo { var_dump(trait_exists('foo')); var_dump(trait_exists(1)); -var_dump(trait_exists(NULL)); ?> --EXPECT-- bool(true) bool(false) -bool(false) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index abfbb411a53db..6aa9a043ff99d 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -426,9 +426,41 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **p } /* }}} */ -ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, bool *dest) /* {{{ */ +static ZEND_COLD bool zend_null_arg_deprecated(const char *fallback_type, uint32_t arg_num) { + zend_function *func = EG(current_execute_data)->func; + ZEND_ASSERT(arg_num > 0); + uint32_t arg_offset = arg_num - 1; + if (arg_offset >= func->common.num_args) { + ZEND_ASSERT(func->common.fn_flags & ZEND_ACC_VARIADIC); + arg_offset = func->common.num_args; + } + + zend_arg_info *arg_info = &func->common.arg_info[arg_offset]; + zend_string *func_name = get_active_function_or_method_name(); + const char *arg_name = get_active_function_arg_name(arg_num); + + /* If no type is specified in arginfo, use the specified fallback_type determined through + * zend_parse_parameters instead. */ + zend_string *type_str = zend_type_to_string(arg_info->type); + const char *type = type_str ? ZSTR_VAL(type_str) : fallback_type; + zend_error(E_DEPRECATED, + "%s(): Passing null to parameter #%" PRIu32 "%s%s%s of type %s is deprecated", + ZSTR_VAL(func_name), arg_num, + arg_name ? " ($" : "", arg_name ? arg_name : "", arg_name ? ")" : "", + type); + zend_string_release(func_name); + if (type_str) { + zend_string_release(type_str); + } + return !EG(exception); +} + +ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, bool *dest, uint32_t arg_num) /* {{{ */ { if (EXPECTED(Z_TYPE_P(arg) <= IS_STRING)) { + if (UNEXPECTED(Z_TYPE_P(arg) == IS_NULL) && !zend_null_arg_deprecated("bool", arg_num)) { + return 0; + } *dest = zend_is_true(arg); } else { return 0; @@ -437,16 +469,16 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, bool *dest) /* { } /* }}} */ -ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(zval *arg, bool *dest) /* {{{ */ +ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(zval *arg, bool *dest, uint32_t arg_num) /* {{{ */ { if (UNEXPECTED(ZEND_ARG_USES_STRICT_TYPES())) { return 0; } - return zend_parse_arg_bool_weak(arg, dest); + return zend_parse_arg_bool_weak(arg, dest, arg_num); } /* }}} */ -ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(zval *arg, zend_long *dest) /* {{{ */ +ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(zval *arg, zend_long *dest, uint32_t arg_num) /* {{{ */ { if (EXPECTED(Z_TYPE_P(arg) == IS_DOUBLE)) { if (UNEXPECTED(zend_isnan(Z_DVAL_P(arg)))) { @@ -479,6 +511,9 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(zval *arg, zend_long *dest) return 0; } } else if (EXPECTED(Z_TYPE_P(arg) < IS_TRUE)) { + if (UNEXPECTED(Z_TYPE_P(arg) == IS_NULL) && !zend_null_arg_deprecated("int", arg_num)) { + return 0; + } *dest = 0; } else if (EXPECTED(Z_TYPE_P(arg) == IS_TRUE)) { *dest = 1; @@ -489,16 +524,16 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(zval *arg, zend_long *dest) } /* }}} */ -ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_slow(zval *arg, zend_long *dest) /* {{{ */ +ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_slow(zval *arg, zend_long *dest, uint32_t arg_num) /* {{{ */ { if (UNEXPECTED(ZEND_ARG_USES_STRICT_TYPES())) { return 0; } - return zend_parse_arg_long_weak(arg, dest); + return zend_parse_arg_long_weak(arg, dest, arg_num); } /* }}} */ -ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_weak(zval *arg, double *dest) /* {{{ */ +ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_weak(zval *arg, double *dest, uint32_t arg_num) /* {{{ */ { if (EXPECTED(Z_TYPE_P(arg) == IS_LONG)) { *dest = (double)Z_LVAL_P(arg); @@ -517,6 +552,9 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_weak(zval *arg, double *dest) return 0; } } else if (EXPECTED(Z_TYPE_P(arg) < IS_TRUE)) { + if (UNEXPECTED(Z_TYPE_P(arg) == IS_NULL) && !zend_null_arg_deprecated("float", arg_num)) { + return 0; + } *dest = 0.0; } else if (EXPECTED(Z_TYPE_P(arg) == IS_TRUE)) { *dest = 1.0; @@ -527,7 +565,7 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_weak(zval *arg, double *dest) } /* }}} */ -ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_slow(zval *arg, double *dest) /* {{{ */ +ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_slow(zval *arg, double *dest, uint32_t arg_num) /* {{{ */ { if (EXPECTED(Z_TYPE_P(arg) == IS_LONG)) { /* SSTH Exception: IS_LONG may be accepted instead as IS_DOUBLE */ @@ -535,11 +573,11 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_slow(zval *arg, double *dest) } else if (UNEXPECTED(ZEND_ARG_USES_STRICT_TYPES())) { return 0; } - return zend_parse_arg_double_weak(arg, dest); + return zend_parse_arg_double_weak(arg, dest, arg_num); } /* }}} */ -ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_slow(zval *arg, zval **dest) /* {{{ */ +ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_slow(zval *arg, zval **dest, uint32_t arg_num) /* {{{ */ { if (UNEXPECTED(ZEND_ARG_USES_STRICT_TYPES())) { return 0; @@ -558,6 +596,9 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_slow(zval *arg, zval **dest) / } zend_string_release(str); } else if (Z_TYPE_P(arg) < IS_TRUE) { + if (UNEXPECTED(Z_TYPE_P(arg) == IS_NULL) && !zend_null_arg_deprecated("int|float", arg_num)) { + return 0; + } ZVAL_LONG(arg, 0); } else if (Z_TYPE_P(arg) == IS_TRUE) { ZVAL_LONG(arg, 1); @@ -569,9 +610,12 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_slow(zval *arg, zval **dest) / } /* }}} */ -ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_weak(zval *arg, zend_string **dest) /* {{{ */ +ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_weak(zval *arg, zend_string **dest, uint32_t arg_num) /* {{{ */ { if (EXPECTED(Z_TYPE_P(arg) < IS_STRING)) { + if (UNEXPECTED(Z_TYPE_P(arg) == IS_NULL) && !zend_null_arg_deprecated("string", arg_num)) { + return 0; + } convert_to_string(arg); *dest = Z_STR_P(arg); } else if (UNEXPECTED(Z_TYPE_P(arg) == IS_OBJECT)) { @@ -591,24 +635,24 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_weak(zval *arg, zend_string **des } /* }}} */ -ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_slow(zval *arg, zend_string **dest) /* {{{ */ +ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_slow(zval *arg, zend_string **dest, uint32_t arg_num) /* {{{ */ { if (UNEXPECTED(ZEND_ARG_USES_STRICT_TYPES())) { return 0; } - return zend_parse_arg_str_weak(arg, dest); + return zend_parse_arg_str_weak(arg, dest, arg_num); } /* }}} */ -ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_or_long_slow(zval *arg, zend_string **dest_str, zend_long *dest_long) /* {{{ */ +ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_or_long_slow(zval *arg, zend_string **dest_str, zend_long *dest_long, uint32_t arg_num) /* {{{ */ { if (UNEXPECTED(ZEND_ARG_USES_STRICT_TYPES())) { return 0; } - if (zend_parse_arg_long_weak(arg, dest_long)) { + if (zend_parse_arg_long_weak(arg, dest_long, arg_num)) { *dest_str = NULL; return 1; - } else if (zend_parse_arg_str_weak(arg, dest_str)) { + } else if (zend_parse_arg_str_weak(arg, dest_str, arg_num)) { *dest_long = 0; return 1; } else { @@ -617,7 +661,7 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_or_long_slow(zval *arg, zend_stri } /* }}} */ -static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec, char **error) /* {{{ */ +static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec, char **error, uint32_t arg_num) /* {{{ */ { const char *spec_walk = *spec; char c = *spec_walk++; @@ -650,7 +694,7 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec is_null = va_arg(*va, bool *); } - if (!zend_parse_arg_long(arg, p, is_null, check_null)) { + if (!zend_parse_arg_long(arg, p, is_null, check_null, arg_num)) { return check_null ? "?int" : "int"; } } @@ -665,7 +709,7 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec is_null = va_arg(*va, bool *); } - if (!zend_parse_arg_double(arg, p, is_null, check_null)) { + if (!zend_parse_arg_double(arg, p, is_null, check_null, arg_num)) { return check_null ? "?float" : "float"; } } @@ -675,7 +719,7 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec { zval **p = va_arg(*va, zval **); - if (!zend_parse_arg_number(arg, p, check_null)) { + if (!zend_parse_arg_number(arg, p, check_null, arg_num)) { return check_null ? "int|float|null" : "int|float"; } } @@ -685,7 +729,7 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec { char **p = va_arg(*va, char **); size_t *pl = va_arg(*va, size_t *); - if (!zend_parse_arg_string(arg, p, pl, check_null)) { + if (!zend_parse_arg_string(arg, p, pl, check_null, arg_num)) { return check_null ? "?string" : "string"; } } @@ -695,7 +739,7 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec { char **p = va_arg(*va, char **); size_t *pl = va_arg(*va, size_t *); - if (!zend_parse_arg_path(arg, p, pl, check_null)) { + if (!zend_parse_arg_path(arg, p, pl, check_null, arg_num)) { if (Z_TYPE_P(arg) == IS_STRING) { zend_spprintf(error, 0, "must not contain any null bytes"); return ""; @@ -709,7 +753,7 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec case 'P': { zend_string **str = va_arg(*va, zend_string **); - if (!zend_parse_arg_path_str(arg, str, check_null)) { + if (!zend_parse_arg_path_str(arg, str, check_null, arg_num)) { if (Z_TYPE_P(arg) == IS_STRING) { zend_spprintf(error, 0, "must not contain any null bytes"); return ""; @@ -723,7 +767,7 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec case 'S': { zend_string **str = va_arg(*va, zend_string **); - if (!zend_parse_arg_str(arg, str, check_null)) { + if (!zend_parse_arg_str(arg, str, check_null, arg_num)) { return check_null ? "?string" : "string"; } } @@ -738,7 +782,7 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec is_null = va_arg(*va, bool *); } - if (!zend_parse_arg_bool(arg, p, is_null, check_null)) { + if (!zend_parse_arg_bool(arg, p, is_null, check_null, arg_num)) { return check_null ? "?bool" : "bool"; } } @@ -899,7 +943,7 @@ static zend_result zend_parse_arg(uint32_t arg_num, zval *arg, va_list *va, cons const char *expected_type = NULL; char *error = NULL; - expected_type = zend_parse_arg_impl(arg, va, spec, &error); + expected_type = zend_parse_arg_impl(arg, va, spec, &error, arg_num); if (expected_type) { if (EG(exception)) { return FAILURE; diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 6c867b2869f57..a811d9c5334f6 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -1450,7 +1450,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * /* old "b" */ #define Z_PARAM_BOOL_EX(dest, is_null, check_null, deref) \ Z_PARAM_PROLOGUE(deref, 0); \ - if (UNEXPECTED(!zend_parse_arg_bool(_arg, &dest, &is_null, check_null))) { \ + if (UNEXPECTED(!zend_parse_arg_bool(_arg, &dest, &is_null, check_null, _i))) { \ _expected_type = check_null ? Z_EXPECTED_BOOL_OR_NULL : Z_EXPECTED_BOOL; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ @@ -1492,7 +1492,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * #define Z_PARAM_OBJ_OR_STR_EX(destination_object, destination_string, allow_null) \ Z_PARAM_PROLOGUE(0, 0); \ - if (UNEXPECTED(!zend_parse_arg_obj_or_str(_arg, &destination_object, NULL, &destination_string, allow_null))) { \ + if (UNEXPECTED(!zend_parse_arg_obj_or_str(_arg, &destination_object, NULL, &destination_string, allow_null, _i))) { \ _expected_type = allow_null ? Z_EXPECTED_OBJECT_OR_STRING_OR_NULL : Z_EXPECTED_OBJECT_OR_STRING; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ @@ -1506,7 +1506,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * #define Z_PARAM_OBJ_OF_CLASS_OR_STR_EX(destination_object, base_ce, destination_string, allow_null) \ Z_PARAM_PROLOGUE(0, 0); \ - if (UNEXPECTED(!zend_parse_arg_obj_or_str(_arg, &destination_object, base_ce, &destination_string, allow_null))) { \ + if (UNEXPECTED(!zend_parse_arg_obj_or_str(_arg, &destination_object, base_ce, &destination_string, allow_null, _i))) { \ if (base_ce) { \ _error = ZSTR_VAL((base_ce)->name); \ _error_code = allow_null ? ZPP_ERROR_WRONG_CLASS_OR_STRING_OR_NULL : ZPP_ERROR_WRONG_CLASS_OR_STRING; \ @@ -1527,7 +1527,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * /* old "d" */ #define Z_PARAM_DOUBLE_EX(dest, is_null, check_null, deref) \ Z_PARAM_PROLOGUE(deref, 0); \ - if (UNEXPECTED(!zend_parse_arg_double(_arg, &dest, &is_null, check_null))) { \ + if (UNEXPECTED(!zend_parse_arg_double(_arg, &dest, &is_null, check_null, _i))) { \ _expected_type = check_null ? Z_EXPECTED_DOUBLE_OR_NULL : Z_EXPECTED_DOUBLE; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ @@ -1578,7 +1578,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * #define Z_PARAM_ARRAY_HT_OR_LONG_EX(dest_ht, dest_long, is_null, allow_null) \ Z_PARAM_PROLOGUE(0, 0); \ - if (UNEXPECTED(!zend_parse_arg_array_ht_or_long(_arg, &dest_ht, &dest_long, &is_null, allow_null))) { \ + if (UNEXPECTED(!zend_parse_arg_array_ht_or_long(_arg, &dest_ht, &dest_long, &is_null, allow_null, _i))) { \ _expected_type = allow_null ? Z_EXPECTED_ARRAY_OR_LONG_OR_NULL : Z_EXPECTED_ARRAY_OR_LONG; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ @@ -1608,7 +1608,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * /* old "l" */ #define Z_PARAM_LONG_EX(dest, is_null, check_null, deref) \ Z_PARAM_PROLOGUE(deref, 0); \ - if (UNEXPECTED(!zend_parse_arg_long(_arg, &dest, &is_null, check_null))) { \ + if (UNEXPECTED(!zend_parse_arg_long(_arg, &dest, &is_null, check_null, _i))) { \ _expected_type = check_null ? Z_EXPECTED_LONG_OR_NULL : Z_EXPECTED_LONG; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ @@ -1623,7 +1623,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * /* old "n" */ #define Z_PARAM_NUMBER_EX(dest, check_null) \ Z_PARAM_PROLOGUE(0, 0); \ - if (UNEXPECTED(!zend_parse_arg_number(_arg, &dest, check_null))) { \ + if (UNEXPECTED(!zend_parse_arg_number(_arg, &dest, check_null, _i))) { \ _expected_type = check_null ? Z_EXPECTED_NUMBER_OR_NULL : Z_EXPECTED_NUMBER; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ @@ -1709,7 +1709,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * #define Z_PARAM_OBJ_OF_CLASS_OR_LONG_EX(dest_obj, _ce, dest_long, is_null, allow_null) \ Z_PARAM_PROLOGUE(0, 0); \ - if (UNEXPECTED(!zend_parse_arg_obj_or_long(_arg, &dest_obj, _ce, &dest_long, &is_null, allow_null))) { \ + if (UNEXPECTED(!zend_parse_arg_obj_or_long(_arg, &dest_obj, _ce, &dest_long, &is_null, allow_null, _i))) { \ _error = ZSTR_VAL((_ce)->name); \ _error_code = allow_null ? ZPP_ERROR_WRONG_CLASS_OR_LONG_OR_NULL : ZPP_ERROR_WRONG_CLASS_OR_LONG; \ break; \ @@ -1724,7 +1724,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * /* old "p" */ #define Z_PARAM_PATH_EX(dest, dest_len, check_null, deref) \ Z_PARAM_PROLOGUE(deref, 0); \ - if (UNEXPECTED(!zend_parse_arg_path(_arg, &dest, &dest_len, check_null))) { \ + if (UNEXPECTED(!zend_parse_arg_path(_arg, &dest, &dest_len, check_null, _i))) { \ _expected_type = check_null ? Z_EXPECTED_PATH_OR_NULL : Z_EXPECTED_PATH; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ @@ -1739,7 +1739,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * /* old "P" */ #define Z_PARAM_PATH_STR_EX(dest, check_null, deref) \ Z_PARAM_PROLOGUE(deref, 0); \ - if (UNEXPECTED(!zend_parse_arg_path_str(_arg, &dest, check_null))) { \ + if (UNEXPECTED(!zend_parse_arg_path_str(_arg, &dest, check_null, _i))) { \ _expected_type = check_null ? Z_EXPECTED_PATH_OR_NULL : Z_EXPECTED_PATH; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ @@ -1769,7 +1769,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * /* old "s" */ #define Z_PARAM_STRING_EX(dest, dest_len, check_null, deref) \ Z_PARAM_PROLOGUE(deref, 0); \ - if (UNEXPECTED(!zend_parse_arg_string(_arg, &dest, &dest_len, check_null))) { \ + if (UNEXPECTED(!zend_parse_arg_string(_arg, &dest, &dest_len, check_null, _i))) { \ _expected_type = check_null ? Z_EXPECTED_STRING_OR_NULL : Z_EXPECTED_STRING; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ @@ -1784,7 +1784,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * /* old "S" */ #define Z_PARAM_STR_EX(dest, check_null, deref) \ Z_PARAM_PROLOGUE(deref, 0); \ - if (UNEXPECTED(!zend_parse_arg_str(_arg, &dest, check_null))) { \ + if (UNEXPECTED(!zend_parse_arg_str(_arg, &dest, check_null, _i))) { \ _expected_type = check_null ? Z_EXPECTED_STRING_OR_NULL : Z_EXPECTED_STRING; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ @@ -1849,7 +1849,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * #define Z_PARAM_ARRAY_HT_OR_STR_EX(dest_ht, dest_str, allow_null) \ Z_PARAM_PROLOGUE(0, 0); \ - if (UNEXPECTED(!zend_parse_arg_array_ht_or_str(_arg, &dest_ht, &dest_str, allow_null))) { \ + if (UNEXPECTED(!zend_parse_arg_array_ht_or_str(_arg, &dest_ht, &dest_str, allow_null, _i))) { \ _expected_type = allow_null ? Z_EXPECTED_ARRAY_OR_STRING_OR_NULL : Z_EXPECTED_ARRAY_OR_STRING; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ @@ -1863,7 +1863,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * #define Z_PARAM_STR_OR_LONG_EX(dest_str, dest_long, is_null, allow_null) \ Z_PARAM_PROLOGUE(0, 0); \ - if (UNEXPECTED(!zend_parse_arg_str_or_long(_arg, &dest_str, &dest_long, &is_null, allow_null))) { \ + if (UNEXPECTED(!zend_parse_arg_str_or_long(_arg, &dest_str, &dest_long, &is_null, allow_null, _i))) { \ _expected_type = allow_null ? Z_EXPECTED_STRING_OR_LONG_OR_NULL : Z_EXPECTED_STRING_OR_LONG; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ @@ -1880,18 +1880,18 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * /* Inlined implementations shared by new and old parameter parsing APIs */ ZEND_API bool ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pce, uint32_t num, bool check_null); -ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(zval *arg, bool *dest); -ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, bool *dest); -ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_slow(zval *arg, zend_long *dest); -ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(zval *arg, zend_long *dest); -ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_slow(zval *arg, double *dest); -ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_weak(zval *arg, double *dest); -ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_slow(zval *arg, zend_string **dest); -ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_weak(zval *arg, zend_string **dest); -ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_slow(zval *arg, zval **dest); -ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_or_long_slow(zval *arg, zend_string **dest_str, zend_long *dest_long); - -static zend_always_inline bool zend_parse_arg_bool(zval *arg, bool *dest, bool *is_null, bool check_null) +ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(zval *arg, bool *dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, bool *dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_slow(zval *arg, zend_long *dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(zval *arg, zend_long *dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_slow(zval *arg, double *dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_weak(zval *arg, double *dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_slow(zval *arg, zend_string **dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_weak(zval *arg, zend_string **dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_slow(zval *arg, zval **dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_or_long_slow(zval *arg, zend_string **dest_str, zend_long *dest_long, uint32_t arg_num); + +static zend_always_inline bool zend_parse_arg_bool(zval *arg, bool *dest, bool *is_null, bool check_null, uint32_t arg_num) { if (check_null) { *is_null = 0; @@ -1904,12 +1904,12 @@ static zend_always_inline bool zend_parse_arg_bool(zval *arg, bool *dest, bool * *is_null = 1; *dest = 0; } else { - return zend_parse_arg_bool_slow(arg, dest); + return zend_parse_arg_bool_slow(arg, dest, arg_num); } return 1; } -static zend_always_inline bool zend_parse_arg_long(zval *arg, zend_long *dest, bool *is_null, bool check_null) +static zend_always_inline bool zend_parse_arg_long(zval *arg, zend_long *dest, bool *is_null, bool check_null, uint32_t arg_num) { if (check_null) { *is_null = 0; @@ -1920,12 +1920,12 @@ static zend_always_inline bool zend_parse_arg_long(zval *arg, zend_long *dest, b *is_null = 1; *dest = 0; } else { - return zend_parse_arg_long_slow(arg, dest); + return zend_parse_arg_long_slow(arg, dest, arg_num); } return 1; } -static zend_always_inline bool zend_parse_arg_double(zval *arg, double *dest, bool *is_null, bool check_null) +static zend_always_inline bool zend_parse_arg_double(zval *arg, double *dest, bool *is_null, bool check_null, uint32_t arg_num) { if (check_null) { *is_null = 0; @@ -1936,40 +1936,40 @@ static zend_always_inline bool zend_parse_arg_double(zval *arg, double *dest, bo *is_null = 1; *dest = 0.0; } else { - return zend_parse_arg_double_slow(arg, dest); + return zend_parse_arg_double_slow(arg, dest, arg_num); } return 1; } -static zend_always_inline bool zend_parse_arg_number(zval *arg, zval **dest, bool check_null) +static zend_always_inline bool zend_parse_arg_number(zval *arg, zval **dest, bool check_null, uint32_t arg_num) { if (EXPECTED(Z_TYPE_P(arg) == IS_LONG || Z_TYPE_P(arg) == IS_DOUBLE)) { *dest = arg; } else if (check_null && EXPECTED(Z_TYPE_P(arg) == IS_NULL)) { *dest = NULL; } else { - return zend_parse_arg_number_slow(arg, dest); + return zend_parse_arg_number_slow(arg, dest, arg_num); } return 1; } -static zend_always_inline bool zend_parse_arg_str(zval *arg, zend_string **dest, bool check_null) +static zend_always_inline bool zend_parse_arg_str(zval *arg, zend_string **dest, bool check_null, uint32_t arg_num) { if (EXPECTED(Z_TYPE_P(arg) == IS_STRING)) { *dest = Z_STR_P(arg); } else if (check_null && Z_TYPE_P(arg) == IS_NULL) { *dest = NULL; } else { - return zend_parse_arg_str_slow(arg, dest); + return zend_parse_arg_str_slow(arg, dest, arg_num); } return 1; } -static zend_always_inline bool zend_parse_arg_string(zval *arg, char **dest, size_t *dest_len, bool check_null) +static zend_always_inline bool zend_parse_arg_string(zval *arg, char **dest, size_t *dest_len, bool check_null, uint32_t arg_num) { zend_string *str; - if (!zend_parse_arg_str(arg, &str, check_null)) { + if (!zend_parse_arg_str(arg, &str, check_null, arg_num)) { return 0; } if (check_null && UNEXPECTED(!str)) { @@ -1982,20 +1982,20 @@ static zend_always_inline bool zend_parse_arg_string(zval *arg, char **dest, siz return 1; } -static zend_always_inline bool zend_parse_arg_path_str(zval *arg, zend_string **dest, bool check_null) +static zend_always_inline bool zend_parse_arg_path_str(zval *arg, zend_string **dest, bool check_null, uint32_t arg_num) { - if (!zend_parse_arg_str(arg, dest, check_null) || + if (!zend_parse_arg_str(arg, dest, check_null, arg_num) || (*dest && UNEXPECTED(CHECK_NULL_PATH(ZSTR_VAL(*dest), ZSTR_LEN(*dest))))) { return 0; } return 1; } -static zend_always_inline bool zend_parse_arg_path(zval *arg, char **dest, size_t *dest_len, bool check_null) +static zend_always_inline bool zend_parse_arg_path(zval *arg, char **dest, size_t *dest_len, bool check_null, uint32_t arg_num) { zend_string *str; - if (!zend_parse_arg_path_str(arg, &str, check_null)) { + if (!zend_parse_arg_path_str(arg, &str, check_null, arg_num)) { return 0; } if (check_null && UNEXPECTED(!str)) { @@ -2060,7 +2060,7 @@ static zend_always_inline bool zend_parse_arg_array_ht(zval *arg, HashTable **de } static zend_always_inline bool zend_parse_arg_array_ht_or_long( - zval *arg, HashTable **dest_ht, zend_long *dest_long, bool *is_null, bool allow_null + zval *arg, HashTable **dest_ht, zend_long *dest_long, bool *is_null, bool allow_null, uint32_t arg_num ) { if (allow_null) { *is_null = 0; @@ -2076,7 +2076,7 @@ static zend_always_inline bool zend_parse_arg_array_ht_or_long( *is_null = 1; } else { *dest_ht = NULL; - return zend_parse_arg_long_slow(arg, dest_long); + return zend_parse_arg_long_slow(arg, dest_long, arg_num); } return 1; @@ -2109,7 +2109,7 @@ static zend_always_inline bool zend_parse_arg_obj(zval *arg, zend_object **dest, } static zend_always_inline bool zend_parse_arg_obj_or_long( - zval *arg, zend_object **dest_obj, zend_class_entry *ce, zend_long *dest_long, bool *is_null, bool allow_null + zval *arg, zend_object **dest_obj, zend_class_entry *ce, zend_long *dest_long, bool *is_null, bool allow_null, uint32_t arg_num ) { if (allow_null) { *is_null = 0; @@ -2125,7 +2125,7 @@ static zend_always_inline bool zend_parse_arg_obj_or_long( *is_null = 1; } else { *dest_obj = NULL; - return zend_parse_arg_long_slow(arg, dest_long); + return zend_parse_arg_long_slow(arg, dest_long, arg_num); } return 1; @@ -2173,7 +2173,7 @@ static zend_always_inline void zend_parse_arg_zval_deref(zval *arg, zval **dest, } static zend_always_inline bool zend_parse_arg_array_ht_or_str( - zval *arg, HashTable **dest_ht, zend_string **dest_str, bool allow_null) + zval *arg, HashTable **dest_ht, zend_string **dest_str, bool allow_null, uint32_t arg_num) { if (EXPECTED(Z_TYPE_P(arg) == IS_STRING)) { *dest_ht = NULL; @@ -2186,13 +2186,13 @@ static zend_always_inline bool zend_parse_arg_array_ht_or_str( *dest_str = NULL; } else { *dest_ht = NULL; - return zend_parse_arg_str_slow(arg, dest_str); + return zend_parse_arg_str_slow(arg, dest_str, arg_num); } return 1; } static zend_always_inline bool zend_parse_arg_str_or_long(zval *arg, zend_string **dest_str, zend_long *dest_long, - bool *is_null, bool allow_null) + bool *is_null, bool allow_null, uint32_t arg_num) { if (allow_null) { *is_null = 0; @@ -2206,7 +2206,7 @@ static zend_always_inline bool zend_parse_arg_str_or_long(zval *arg, zend_string *dest_str = NULL; *is_null = 1; } else { - return zend_parse_arg_str_or_long_slow(arg, dest_str, dest_long); + return zend_parse_arg_str_or_long_slow(arg, dest_str, dest_long, arg_num); } return 1; } @@ -2230,7 +2230,7 @@ static zend_always_inline bool zend_parse_arg_obj_or_class_name( } static zend_always_inline bool zend_parse_arg_obj_or_str( - zval *arg, zend_object **destination_object, zend_class_entry *base_ce, zend_string **destination_string, bool allow_null + zval *arg, zend_object **destination_object, zend_class_entry *base_ce, zend_string **destination_string, bool allow_null, uint32_t arg_num ) { if (EXPECTED(Z_TYPE_P(arg) == IS_OBJECT)) { if (!base_ce || EXPECTED(instanceof_function(Z_OBJCE_P(arg), base_ce))) { @@ -2241,7 +2241,7 @@ static zend_always_inline bool zend_parse_arg_obj_or_str( } *destination_object = NULL; - return zend_parse_arg_str(arg, destination_string, allow_null); + return zend_parse_arg_str(arg, destination_string, allow_null, arg_num); } END_EXTERN_C() diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 753eef426735d..2a93cece8a6d4 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -739,22 +739,22 @@ static bool zend_verify_weak_scalar_type_hint(uint32_t type_mask, zval *arg) ZVAL_DOUBLE(arg, dval); return 1; } - } else if (zend_parse_arg_long_weak(arg, &lval)) { + } else if (zend_parse_arg_long_weak(arg, &lval, 0)) { zval_ptr_dtor(arg); ZVAL_LONG(arg, lval); return 1; } } - if ((type_mask & MAY_BE_DOUBLE) && zend_parse_arg_double_weak(arg, &dval)) { + if ((type_mask & MAY_BE_DOUBLE) && zend_parse_arg_double_weak(arg, &dval, 0)) { zval_ptr_dtor(arg); ZVAL_DOUBLE(arg, dval); return 1; } - if ((type_mask & MAY_BE_STRING) && zend_parse_arg_str_weak(arg, &str)) { + if ((type_mask & MAY_BE_STRING) && zend_parse_arg_str_weak(arg, &str, 0)) { /* on success "arg" is converted to IS_STRING */ return 1; } - if ((type_mask & MAY_BE_BOOL) == MAY_BE_BOOL && zend_parse_arg_bool_weak(arg, &bval)) { + if ((type_mask & MAY_BE_BOOL) == MAY_BE_BOOL && zend_parse_arg_bool_weak(arg, &bval, 0)) { zval_ptr_dtor(arg); ZVAL_BOOL(arg, bval); return 1; @@ -781,16 +781,16 @@ static bool zend_verify_weak_scalar_type_hint_no_sideeffect(uint32_t type_mask, double dval; bool bval; - if ((type_mask & MAY_BE_LONG) && zend_parse_arg_long_weak(arg, &lval)) { + if ((type_mask & MAY_BE_LONG) && zend_parse_arg_long_weak(arg, &lval, 0)) { return 1; } - if ((type_mask & MAY_BE_DOUBLE) && zend_parse_arg_double_weak(arg, &dval)) { + if ((type_mask & MAY_BE_DOUBLE) && zend_parse_arg_double_weak(arg, &dval, 0)) { return 1; } if ((type_mask & MAY_BE_STRING) && can_convert_to_string(arg)) { return 1; } - if ((type_mask & MAY_BE_BOOL) == MAY_BE_BOOL && zend_parse_arg_bool_weak(arg, &bval)) { + if ((type_mask & MAY_BE_BOOL) == MAY_BE_BOOL && zend_parse_arg_bool_weak(arg, &bval, 0)) { return 1; } return 0; diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 98b8b51d7fa8f..7d0b30ff2bdc2 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -8310,8 +8310,18 @@ ZEND_VM_COLD_CONST_HANDLER(121, ZEND_STRLEN, CONST|TMPVAR|CV, ANY) zend_string *str; zval tmp; + if (UNEXPECTED(Z_TYPE_P(value) == IS_NULL)) { + zend_error(E_DEPRECATED, + "strlen(): Passing null to parameter #1 ($string) of type string is deprecated"); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + ZVAL_LONG(EX_VAR(opline->result.var), 0); + break; + } + ZVAL_COPY(&tmp, value); - if (zend_parse_arg_str_weak(&tmp, &str)) { + if (zend_parse_arg_str_weak(&tmp, &str, 1)) { ZVAL_LONG(EX_VAR(opline->result.var), ZSTR_LEN(str)); zval_ptr_dtor(&tmp); break; diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index d680541f03851..0fe4fb5bb5d0c 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -5286,8 +5286,18 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_STRLEN_SPEC_CONST zend_string *str; zval tmp; + if (UNEXPECTED(Z_TYPE_P(value) == IS_NULL)) { + zend_error(E_DEPRECATED, + "strlen(): Passing null to parameter #1 ($string) of type string is deprecated"); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + ZVAL_LONG(EX_VAR(opline->result.var), 0); + break; + } + ZVAL_COPY(&tmp, value); - if (zend_parse_arg_str_weak(&tmp, &str)) { + if (zend_parse_arg_str_weak(&tmp, &str, 1)) { ZVAL_LONG(EX_VAR(opline->result.var), ZSTR_LEN(str)); zval_ptr_dtor(&tmp); break; @@ -14459,8 +14469,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_STRLEN_SPEC_TMPVAR_HANDLER(ZEN zend_string *str; zval tmp; + if (UNEXPECTED(Z_TYPE_P(value) == IS_NULL)) { + zend_error(E_DEPRECATED, + "strlen(): Passing null to parameter #1 ($string) of type string is deprecated"); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + ZVAL_LONG(EX_VAR(opline->result.var), 0); + break; + } + ZVAL_COPY(&tmp, value); - if (zend_parse_arg_str_weak(&tmp, &str)) { + if (zend_parse_arg_str_weak(&tmp, &str, 1)) { ZVAL_LONG(EX_VAR(opline->result.var), ZSTR_LEN(str)); zval_ptr_dtor(&tmp); break; @@ -38546,8 +38566,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_STRLEN_SPEC_CV_HANDLER(ZEND_OP zend_string *str; zval tmp; + if (UNEXPECTED(Z_TYPE_P(value) == IS_NULL)) { + zend_error(E_DEPRECATED, + "strlen(): Passing null to parameter #1 ($string) of type string is deprecated"); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + ZVAL_LONG(EX_VAR(opline->result.var), 0); + break; + } + ZVAL_COPY(&tmp, value); - if (zend_parse_arg_str_weak(&tmp, &str)) { + if (zend_parse_arg_str_weak(&tmp, &str, 1)) { ZVAL_LONG(EX_VAR(opline->result.var), ZSTR_LEN(str)); zval_ptr_dtor(&tmp); break; diff --git a/ext/date/tests/bug54283.phpt b/ext/date/tests/bug54283.phpt index 65669b6b39b74..cadedd8691c2c 100644 --- a/ext/date/tests/bug54283.phpt +++ b/ext/date/tests/bug54283.phpt @@ -10,5 +10,6 @@ try { } ?> ---EXPECT-- +--EXPECTF-- +Deprecated: DatePeriod::__construct(): Passing null to parameter #1 ($start) of type string is deprecated in %s on line %d string(51) "DatePeriod::__construct(): Unknown or bad format ()" diff --git a/ext/date/tests/bug73858.phpt b/ext/date/tests/bug73858.phpt index fb41390b0fd93..b6074ff01a336 100644 --- a/ext/date/tests/bug73858.phpt +++ b/ext/date/tests/bug73858.phpt @@ -15,8 +15,8 @@ $e = new DateTime($es); $d= $e->diff($s); var_dump($d->days); // 0 ... but should be 30 -$s = (new DateTime(null))->setTimestamp(strtotime($ss)); // verbose setup method -$e = (new DateTime(null))->setTimestamp(strtotime($es)); // verbose setup method +$s = (new DateTime("now"))->setTimestamp(strtotime($ss)); // verbose setup method +$e = (new DateTime("now"))->setTimestamp(strtotime($es)); // verbose setup method $d = $e->diff($s); var_dump($d->days); // 30 ... and should be 30 @@ -24,13 +24,13 @@ var_dump($d->days); // 30 ... and should be 30 Next we will try mix/match the code to see what happens, surprisingly it seems that the end date ($e) is the important one, if it uses the verbose method it returns the correct values. */ -$s = (new DateTime(null))->setTimestamp(strtotime($ss)); // verbose setup method +$s = (new DateTime("now"))->setTimestamp(strtotime($ss)); // verbose setup method $e = new DateTime($es); $d= $e->diff($s); var_dump($d->days); // 0 ... but should be 30 $s = new DateTime($ss); -$e = (new DateTime(null))->setTimestamp(strtotime($es)); // verbose setup method +$e = (new DateTime("now"))->setTimestamp(strtotime($es)); // verbose setup method $d= $e->diff($s); var_dump($d->days); // 30 ... and should be 30 @@ -39,7 +39,7 @@ This test just proves that the $e date is important BUT NOT because it's the one on, that's just coincidental that seems to imply that the "- 1 second" in the date string is the problem. */ $s = new DateTime($ss); -$e = (new DateTime(null))->setTimestamp(strtotime($es)); // verbose setup method +$e = (new DateTime("now"))->setTimestamp(strtotime($es)); // verbose setup method $d= $s->diff($e); var_dump($d->days); // 30 ... and should be 30 diff --git a/ext/date/tests/date_interval_create_from_date_string_nullparam.phpt b/ext/date/tests/date_interval_create_from_date_string_nullparam.phpt index e03386ad3c4f4..afac12b7a33a4 100644 --- a/ext/date/tests/date_interval_create_from_date_string_nullparam.phpt +++ b/ext/date/tests/date_interval_create_from_date_string_nullparam.phpt @@ -8,5 +8,7 @@ $i = date_interval_create_from_date_string(null); var_dump($i); ?> --EXPECTF-- +Deprecated: date_interval_create_from_date_string(): Passing null to parameter #1 ($datetime) of type string is deprecated in %s on line %d + Warning: date_interval_create_from_date_string(): Unknown or bad format () at position 0 ( ): Empty string in %sdate_interval_create_from_date_string_nullparam.php on line 2 bool(false) diff --git a/ext/date/tests/date_timestamp_set_nullparam2.phpt b/ext/date/tests/date_timestamp_set_nullparam2.phpt index c22dc3011aa51..2e5894bc24089 100644 --- a/ext/date/tests/date_timestamp_set_nullparam2.phpt +++ b/ext/date/tests/date_timestamp_set_nullparam2.phpt @@ -13,7 +13,8 @@ $dtms021 = date_create(); var_dump(date_timestamp_set($dtms021, null)); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: date_timestamp_set(): Passing null to parameter #2 ($timestamp) of type int is deprecated in %s on line %d object(DateTime)#1 (3) { ["date"]=> string(26) "1970-01-01 00:00:00.000000" diff --git a/ext/date/tests/microtime_error.phpt b/ext/date/tests/microtime_error.phpt deleted file mode 100644 index ce13875e67b1a..0000000000000 --- a/ext/date/tests/microtime_error.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -Test wrong number of arguments for microtime() ---FILE-- -'v', array(0)), - new stdClass, - 1); -foreach ($bad_args as $bad_arg) { - echo "\n--> bad arg: "; - var_dump($bad_arg); - try { - var_dump(microtime($bad_arg)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -} - -?> ---EXPECTF-- --- Bad Arg types -- - ---> bad arg: NULL -string(%d) "%s %s" - ---> bad arg: float(1.5) -float(%s) - ---> bad arg: string(5) "hello" -float(%s) - ---> bad arg: array(2) { - ["k"]=> - string(1) "v" - [0]=> - array(1) { - [0]=> - int(0) - } -} -microtime(): Argument #1 ($as_float) must be of type bool, array given - ---> bad arg: object(stdClass)#%d (0) { -} -microtime(): Argument #1 ($as_float) must be of type bool, stdClass given - ---> bad arg: int(1) -float(%s) diff --git a/ext/dba/tests/dba_handlers.phpt b/ext/dba/tests/dba_handlers.phpt index e896116818a51..966b44a629d82 100644 --- a/ext/dba/tests/dba_handlers.phpt +++ b/ext/dba/tests/dba_handlers.phpt @@ -31,7 +31,7 @@ check(dba_handlers()); echo "Test 2\n"; -check(dba_handlers(null)); +check(dba_handlers(false)); echo "Test 3\n"; diff --git a/ext/dom/tests/DOMDocument_saveHTMLFile_invalid_filename.phpt b/ext/dom/tests/DOMDocument_saveHTMLFile_invalid_filename.phpt index 12b45a491bd04..4e724585f1db9 100644 --- a/ext/dom/tests/DOMDocument_saveHTMLFile_invalid_filename.phpt +++ b/ext/dom/tests/DOMDocument_saveHTMLFile_invalid_filename.phpt @@ -9,7 +9,7 @@ require_once __DIR__ .'/skipif.inc'; ?> --FILE-- createElement('html'); $root = $doc->appendChild($root); diff --git a/ext/fileinfo/tests/finfo_file_001.phpt b/ext/fileinfo/tests/finfo_file_001.phpt index 71d88bbd43f03..fb11aa89210ff 100644 --- a/ext/fileinfo/tests/finfo_file_001.phpt +++ b/ext/fileinfo/tests/finfo_file_001.phpt @@ -16,11 +16,6 @@ try { } catch (\ValueError $e) { echo $e->getMessage() . \PHP_EOL; } -try { - var_dump(finfo_file($fp, NULL)); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; -} var_dump(finfo_file($fp, '.')); var_dump(finfo_file($fp, '&')); @@ -28,7 +23,6 @@ var_dump(finfo_file($fp, '&')); --EXPECTF-- finfo_file(): Argument #1 ($finfo) must not contain any null bytes finfo_file(): Argument #1 ($finfo) cannot be empty -finfo_file(): Argument #1 ($finfo) cannot be empty string(9) "directory" Warning: finfo_file(&): Failed to open stream: No such file or directory in %s on line %d diff --git a/ext/filter/tests/055.phpt b/ext/filter/tests/055.phpt index 0edc241efdc6a..32ede68034e20 100644 --- a/ext/filter/tests/055.phpt +++ b/ext/filter/tests/055.phpt @@ -5,18 +5,18 @@ filter_var() and FILTER_VALIDATE_MAC --FILE-- array("separator" => "-"))), array("01-23-45-67-89-ab", array("options" => array("separator" => "."))), array("01-23-45-67-89-ab", array("options" => array("separator" => ":"))), - array("01-23-45-67-89-AB", null), - array("01-23-45-67-89-aB", null), - array("01:23:45:67:89:ab", null), - array("01:23:45:67:89:AB", null), - array("01:23:45:67:89:aB", null), - array("01:23:45-67:89:aB", null), - array("xx:23:45:67:89:aB", null), - array("0123.4567.89ab", null), + array("01-23-45-67-89-AB", 0), + array("01-23-45-67-89-aB", 0), + array("01:23:45:67:89:ab", 0), + array("01:23:45:67:89:AB", 0), + array("01:23:45:67:89:aB", 0), + array("01:23:45-67:89:aB", 0), + array("xx:23:45:67:89:aB", 0), + array("0123.4567.89ab", 0), array("01-23-45-67-89-ab", array("options" => array("separator" => "--"))), array("01-23-45-67-89-ab", array("options" => array("separator" => ""))), ); diff --git a/ext/filter/tests/057.phpt b/ext/filter/tests/057.phpt index 7c57a2670b9ff..7ad83e81b0876 100644 --- a/ext/filter/tests/057.phpt +++ b/ext/filter/tests/057.phpt @@ -19,9 +19,13 @@ foreach (array(null, true, false, 1, "", new stdClass) as $invalid) { } ?> --EXPECTF-- +Deprecated: filter_input_array(): Passing null to parameter #2 ($options) of type array|int is deprecated in %s on line %d + Warning: filter_input_array(): Unknown filter with ID 0 in %s on line %d bool(false) +Deprecated: filter_var_array(): Passing null to parameter #2 ($options) of type array|int is deprecated in %s on line %d + Warning: filter_var_array(): Unknown filter with ID 0 in %s on line %d bool(false) diff --git a/ext/gd/tests/imagetruecolortopalette_error3.phpt b/ext/gd/tests/imagetruecolortopalette_error3.phpt index 0af49bf38c55a..58bd1cf1e884e 100644 --- a/ext/gd/tests/imagetruecolortopalette_error3.phpt +++ b/ext/gd/tests/imagetruecolortopalette_error3.phpt @@ -14,7 +14,7 @@ require __DIR__ . '/func.inc'; $image = imagecreatetruecolor(50, 50); trycatch_dump( - fn() => imagetruecolortopalette($image, true, null) + fn() => imagetruecolortopalette($image, true, 0) ); ?> diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index 78c286cc8385b..800878e27861a 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -628,7 +628,7 @@ static zend_result convert_to_gmp(mpz_t gmpnumber, zval *val, zend_long base, ui } default: { zend_long lval; - if (!zend_parse_arg_long_slow(val, &lval)) { + if (!zend_parse_arg_long_slow(val, &lval, arg_pos)) { zend_argument_type_error(arg_pos, "must be of type GMP|string|int, %s given", zend_zval_type_name(val)); return FAILURE; } diff --git a/ext/hash/tests/hash_init_error.phpt b/ext/hash/tests/hash_init_error.phpt index fdea4174d6fc9..4256b570e45b6 100644 --- a/ext/hash/tests/hash_init_error.phpt +++ b/ext/hash/tests/hash_init_error.phpt @@ -37,7 +37,7 @@ catch (\Error $e) { ?> ---EXPECT-- +--EXPECTF-- *** Testing hash_init(): error conditions *** -- Testing hash_init() function with unknown algorithms -- @@ -48,4 +48,6 @@ hash_init(): Argument #1 ($algo) must be a cryptographic hashing algorithm if HM -- Testing hash_init() function with HASH_HMAC and no key -- hash_init(): Argument #3 ($key) cannot be empty when HMAC is requested + +Deprecated: hash_init(): Passing null to parameter #3 ($key) of type string is deprecated in %s on line %d hash_init(): Argument #3 ($key) cannot be empty when HMAC is requested diff --git a/ext/iconv/tests/iconv_mime_decode-charset-length-cve-2007-4840.phpt b/ext/iconv/tests/iconv_mime_decode-charset-length-cve-2007-4840.phpt index 59a8668957d65..b6af4749e8bab 100644 --- a/ext/iconv/tests/iconv_mime_decode-charset-length-cve-2007-4840.phpt +++ b/ext/iconv/tests/iconv_mime_decode-charset-length-cve-2007-4840.phpt @@ -5,7 +5,7 @@ iconv_mime_decode() charset parameter length checks (CVE-2007-4840) --FILE-- --EXPECTF-- Warning: iconv_mime_decode(): Encoding parameter exceeds the maximum allowed length of 64 characters in %s on line %d diff --git a/ext/iconv/tests/iconv_mime_decode_headers-charset-length-cve-2007-4840.phpt b/ext/iconv/tests/iconv_mime_decode_headers-charset-length-cve-2007-4840.phpt index 818b599500ade..1ef41213051ed 100644 --- a/ext/iconv/tests/iconv_mime_decode_headers-charset-length-cve-2007-4840.phpt +++ b/ext/iconv/tests/iconv_mime_decode_headers-charset-length-cve-2007-4840.phpt @@ -5,7 +5,7 @@ iconv_mime_decode_headers() charset parameter length checks (CVE-2007-4840) --FILE-- --EXPECTF-- Warning: iconv_mime_decode_headers(): Encoding parameter exceeds the maximum allowed length of 64 characters in %s on line %d diff --git a/ext/imap/tests/bug45705_1.phpt b/ext/imap/tests/bug45705_1.phpt index b8d33e675839e..c2c8f155172b5 100644 --- a/ext/imap/tests/bug45705_1.phpt +++ b/ext/imap/tests/bug45705_1.phpt @@ -9,7 +9,7 @@ extension_loaded('imap') or die('skip imap extension not available in this build $address = 'John Doe '; var_dump($address); -imap_rfc822_parse_adrlist($address, null); +imap_rfc822_parse_adrlist($address, ''); var_dump($address); ?> diff --git a/ext/intl/tests/bug48227.phpt b/ext/intl/tests/bug48227.phpt index 11f89df535a46..b143a7eda2a53 100644 --- a/ext/intl/tests/bug48227.phpt +++ b/ext/intl/tests/bug48227.phpt @@ -15,8 +15,10 @@ foreach (['', 1, NULL, $x] as $value) { } ?> ---EXPECT-- +--EXPECTF-- NumberFormatter::format(): Argument #1 ($num) must be of type int|float, string given string(1) "1" + +Deprecated: NumberFormatter::format(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d string(1) "0" NumberFormatter::format(): Argument #1 ($num) must be of type int|float, NumberFormatter given diff --git a/ext/intl/tests/bug72241.phpt b/ext/intl/tests/bug72241.phpt index 05336969e222d..c2017d74705a0 100644 --- a/ext/intl/tests/bug72241.phpt +++ b/ext/intl/tests/bug72241.phpt @@ -6,8 +6,7 @@ Bug #72241: get_icu_value_internal out-of-bounds read --EXPECT-- -0 +NULL diff --git a/ext/intl/tests/collator_compare_variant2.phpt b/ext/intl/tests/collator_compare_variant2.phpt index 15c725bc4fb5f..9be10e293583e 100644 --- a/ext/intl/tests/collator_compare_variant2.phpt +++ b/ext/intl/tests/collator_compare_variant2.phpt @@ -71,12 +71,11 @@ function ut_main() array( 'ab' , 'b' ), array( 'ab' , 'a' ), array( 123 , 'abc' ), - array( 'ac' , null ), + array( 'ac' , '' ), array( '.' , '.' ), // Try to compare long strings. array( 'abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcde', 'abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdea'), - array( null , null ) ); $res_str .= compare_pairs( 'en_US', $test_params ); @@ -91,7 +90,7 @@ function ut_main() array( 'а', 'b' ), array( 'а', 'bb' ), array( 'а', 'ab' ), - array( 'а', null ) + array( 'а', '' ) ); $res_str .= compare_pairs( 'ru_RU', $test_params ); @@ -120,10 +119,9 @@ ut_run(); 'ab' < 'b' 'ab' > 'a' 123 < 'abc' -'ac' > NULL +'ac' > '' '.' = '.' 'abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcde' < 'abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdea' -NULL = NULL 'а' < 'б' 'а' < 'аа' 'аб' < 'ба' @@ -131,5 +129,5 @@ NULL = NULL 'а' < 'b' 'а' < 'bb' 'а' < 'ab' -'а' > NULL +'а' > '' 'y' < 'k' diff --git a/ext/intl/tests/collator_get_sort_key_variant7.phpt b/ext/intl/tests/collator_get_sort_key_variant7.phpt index 8ac0154d4fcf2..12dd66aece606 100644 --- a/ext/intl/tests/collator_get_sort_key_variant7.phpt +++ b/ext/intl/tests/collator_get_sort_key_variant7.phpt @@ -33,7 +33,7 @@ function ut_main() $test_params = array( 'abc', 'abd', 'aaa', 'аа', 'а', 'z', - '', null , '3', + '', '3', 'y' , 'i' , 'k' ); @@ -70,8 +70,6 @@ source: z key: 5c01050105 source: key: 0101 -source: -key: 0101 source: 3 key: 1901050105 source: y diff --git a/ext/intl/tests/formatter_fail.phpt b/ext/intl/tests/formatter_fail.phpt index 937a52f0989cb..1d9ca341287f7 100644 --- a/ext/intl/tests/formatter_fail.phpt +++ b/ext/intl/tests/formatter_fail.phpt @@ -107,6 +107,18 @@ ArgumentCountError: NumberFormatter::create() expects at least 2 arguments, 0 gi Error: NumberFormatter object is already constructed in %s on line %d 'U_ZERO_ERROR' +Deprecated: NumberFormatter::__construct(): Passing null to parameter #1 ($locale) of type string is deprecated in %s on line %d + +Deprecated: NumberFormatter::__construct(): Passing null to parameter #2 ($style) of type int is deprecated in %s on line %d + +Deprecated: NumberFormatter::create(): Passing null to parameter #1 ($locale) of type string is deprecated in %s on line %d + +Deprecated: NumberFormatter::create(): Passing null to parameter #2 ($style) of type int is deprecated in %s on line %d + +Deprecated: numfmt_create(): Passing null to parameter #1 ($locale) of type string is deprecated in %s on line %d + +Deprecated: numfmt_create(): Passing null to parameter #2 ($style) of type int is deprecated in %s on line %d + IntlException: Constructor failed in %s on line %d 'numfmt_create: number formatter creation failed: U_UNSUPPORTED_ERROR' 'numfmt_create: number formatter creation failed: U_UNSUPPORTED_ERROR' diff --git a/ext/intl/tests/gregoriancalendar___construct_error.phpt b/ext/intl/tests/gregoriancalendar___construct_error.phpt index 2bc87c723d89b..4ddcca32289e4 100644 --- a/ext/intl/tests/gregoriancalendar___construct_error.phpt +++ b/ext/intl/tests/gregoriancalendar___construct_error.phpt @@ -29,7 +29,7 @@ try { echo $e->getMessage(), "\n"; } try { - var_dump(new IntlGregorianCalendar(1,2,3,4,NULL,array())); + var_dump(new IntlGregorianCalendar(1,2,3,4,5,array())); } catch (TypeError $e) { echo $e->getMessage(), "\n"; } diff --git a/ext/intl/tests/gregoriancalendar___construct_variant1.phpt b/ext/intl/tests/gregoriancalendar___construct_variant1.phpt index 22dae52d77d28..1a225fe62031f 100644 --- a/ext/intl/tests/gregoriancalendar___construct_variant1.phpt +++ b/ext/intl/tests/gregoriancalendar___construct_variant1.phpt @@ -10,7 +10,7 @@ ini_set("intl.error_level", E_WARNING); date_default_timezone_set('Europe/Amsterdam'); -$intlcal = intlgregcal_create_instance(2012, 1, 29, 16, 0, NULL); +$intlcal = intlgregcal_create_instance(2012, 1, 29, 16, 0, 0); var_dump($intlcal->getTimeZone()->getId()); var_dump($intlcal->getTime(), (float)strtotime('2012-02-29 16:00:00') * 1000); diff --git a/ext/intl/tests/msgfmt_fail2.phpt b/ext/intl/tests/msgfmt_fail2.phpt index f604de0727694..8823e36a6f61d 100644 --- a/ext/intl/tests/msgfmt_fail2.phpt +++ b/ext/intl/tests/msgfmt_fail2.phpt @@ -126,9 +126,21 @@ ArgumentCountError: msgfmt_create() expects exactly 2 arguments, 1 given in %s o ArgumentCountError: MessageFormatter::create() expects exactly 2 arguments, 1 given in %s on line %d 'U_ZERO_ERROR' +Deprecated: MessageFormatter::__construct(): Passing null to parameter #1 ($locale) of type string is deprecated in %s on line %d + +Deprecated: MessageFormatter::__construct(): Passing null to parameter #2 ($pattern) of type string is deprecated in %s on line %d + IntlException: msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR in %s on line %d 'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR' + +Deprecated: MessageFormatter::create(): Passing null to parameter #1 ($locale) of type string is deprecated in %s on line %d + +Deprecated: MessageFormatter::create(): Passing null to parameter #2 ($pattern) of type string is deprecated in %s on line %d 'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR' + +Deprecated: msgfmt_create(): Passing null to parameter #1 ($locale) of type string is deprecated in %s on line %d + +Deprecated: msgfmt_create(): Passing null to parameter #2 ($pattern) of type string is deprecated in %s on line %d 'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR' IntlException: msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR in %s on line %d diff --git a/ext/intl/tests/ut_common.inc b/ext/intl/tests/ut_common.inc index 4a2675b01f16f..fdc013dea41c9 100644 --- a/ext/intl/tests/ut_common.inc +++ b/ext/intl/tests/ut_common.inc @@ -142,7 +142,7 @@ function ut_nfmt_create( $locale, $style, $pattern = null ) return numfmt_create( $locale, $style, $pattern ); } } -function ut_nfmt_format( $fmt, $number, $type = null ) +function ut_nfmt_format( $fmt, $number, $type = NumberFormatter::TYPE_DEFAULT ) { return $GLOBALS['oo-mode'] ? $fmt->format( $number, $type ) : numfmt_format( $fmt, $number, $type ); } diff --git a/ext/json/tests/001.phpt b/ext/json/tests/001.phpt index b7e6003ac5eb5..12ff6c15ef58a 100644 --- a/ext/json/tests/001.phpt +++ b/ext/json/tests/001.phpt @@ -31,6 +31,8 @@ NULL NULL NULL NULL + +Deprecated: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in %s on line %d NULL object(stdClass)#%d (1) { ["test"]=> diff --git a/ext/json/tests/bug69187.phpt b/ext/json/tests/bug69187.phpt index b7d7deafc689b..4d076c4b50b17 100644 --- a/ext/json/tests/bug69187.phpt +++ b/ext/json/tests/bug69187.phpt @@ -2,8 +2,6 @@ Bug #69187 json_last_error return BC in PHP7 --FILE-- json_decode(null, true)]); +$result = json_encode(['end' => json_decode('', true)]); var_dump($result); class A implements \JsonSerializable { function jsonSerialize() { - return ['end' => json_decode(null, true)]; + return ['end' => json_decode('', true)]; } } $a = new A(); diff --git a/ext/ldap/tests/bug72021.phpt b/ext/ldap/tests/bug72021.phpt index 6dfcf4468070f..f5e46eb615ac7 100644 --- a/ext/ldap/tests/bug72021.phpt +++ b/ext/ldap/tests/bug72021.phpt @@ -8,7 +8,7 @@ Chad Sikorra --EXPECT-- string(24) "\20Joe\2c\3d \0dSmith\20" diff --git a/ext/ldap/tests/bug73933.phpt b/ext/ldap/tests/bug73933.phpt index 8e50a750e284e..0a02aca2edc0b 100644 --- a/ext/ldap/tests/bug73933.phpt +++ b/ext/ldap/tests/bug73933.phpt @@ -9,11 +9,11 @@ require_once('skipif.inc'); /* We are assuming 3333 is not connectable */ $ldap = ldap_connect('127.0.0.1', 3333); -ldap_mod_replace($ldap, null, array( +ldap_mod_replace($ldap, '', array( 'lockoutTime' => array(0), )); -ldap_modify_batch($ldap, null, array( [ +ldap_modify_batch($ldap, '', array( [ "attrib" => "mail", "modtype" => LDAP_MODIFY_BATCH_ADD, "values" => [ diff --git a/ext/ldap/tests/ldap_escape_both.phpt b/ext/ldap/tests/ldap_escape_both.phpt index 424a4575affae..6c8c970b98ca3 100644 --- a/ext/ldap/tests/ldap_escape_both.phpt +++ b/ext/ldap/tests/ldap_escape_both.phpt @@ -7,7 +7,7 @@ ldap_escape() test filter and DN $subject = 'foo=bar(baz)*'; -var_dump(ldap_escape($subject, null, LDAP_ESCAPE_DN | LDAP_ESCAPE_FILTER)); +var_dump(ldap_escape($subject, '', LDAP_ESCAPE_DN | LDAP_ESCAPE_FILTER)); ?> --EXPECT-- diff --git a/ext/ldap/tests/ldap_escape_dn.phpt b/ext/ldap/tests/ldap_escape_dn.phpt index d80e02dee73da..fd2ffb2567567 100644 --- a/ext/ldap/tests/ldap_escape_dn.phpt +++ b/ext/ldap/tests/ldap_escape_dn.phpt @@ -7,7 +7,7 @@ ldap_escape() test DN $subject = 'foo=bar(baz)*'; -var_dump(ldap_escape($subject, null, LDAP_ESCAPE_DN)); +var_dump(ldap_escape($subject, '', LDAP_ESCAPE_DN)); ?> --EXPECT-- diff --git a/ext/ldap/tests/ldap_escape_filter.phpt b/ext/ldap/tests/ldap_escape_filter.phpt index d156f56c87a7a..5f0be7f40a0de 100644 --- a/ext/ldap/tests/ldap_escape_filter.phpt +++ b/ext/ldap/tests/ldap_escape_filter.phpt @@ -7,7 +7,7 @@ ldap_escape() test filter $subject = 'foo=bar(baz)*'; -var_dump(ldap_escape($subject, null, LDAP_ESCAPE_FILTER)); +var_dump(ldap_escape($subject, '', LDAP_ESCAPE_FILTER)); ?> --EXPECT-- diff --git a/ext/ldap/tests/ldap_read_variation1.phpt b/ext/ldap/tests/ldap_read_variation1.phpt index d5c731870cf12..f0865dee62150 100644 --- a/ext/ldap/tests/ldap_read_variation1.phpt +++ b/ext/ldap/tests/ldap_read_variation1.phpt @@ -8,7 +8,7 @@ if (!extension_loaded('ldap')) die('skip ldap extension not available'); diff --git a/ext/ldap/tests/ldap_search_overrides.phpt b/ext/ldap/tests/ldap_search_overrides.phpt index 5bd351a741d20..01a96fd86a383 100644 --- a/ext/ldap/tests/ldap_search_overrides.phpt +++ b/ext/ldap/tests/ldap_search_overrides.phpt @@ -20,7 +20,7 @@ ldap_set_option($link, LDAP_OPT_NETWORK_TIMEOUT, 44); insert_dummy_data($link, $base); var_dump( - $result = ldap_search($link, "$base", "(objectClass=person)", array(), null, 111, 22, LDAP_DEREF_NEVER), + $result = ldap_search($link, "$base", "(objectClass=person)", array(), 0, 111, 22, LDAP_DEREF_NEVER), ldap_get_entries($link, $result) ); var_dump( diff --git a/ext/mbstring/tests/bug43994.phpt b/ext/mbstring/tests/bug43994.phpt index d41bf90a9fc83..9c84a7464ac7c 100644 --- a/ext/mbstring/tests/bug43994.phpt +++ b/ext/mbstring/tests/bug43994.phpt @@ -13,10 +13,7 @@ function_exists('mb_ereg') or die("skip mb_ereg() is not available in this build * pattern is supplied to mb_ereg. Similar error message to ereg(). */ -$unset_var = 10; -unset ($unset_var); -$inputs = array(NULL, null, false, FALSE, "", '', @$undefined_var, -@$unset_var); +$inputs = array(false, FALSE, "", ''); $iterator = 1; foreach($inputs as $input) { @@ -70,31 +67,3 @@ mb_ereg(): Argument #1 ($pattern) must not be empty With $regs arg: mb_ereg(): Argument #1 ($pattern) must not be empty NULL - --- Iteration 5 -- -Without $regs arg: -mb_ereg(): Argument #1 ($pattern) must not be empty -With $regs arg: -mb_ereg(): Argument #1 ($pattern) must not be empty -NULL - --- Iteration 6 -- -Without $regs arg: -mb_ereg(): Argument #1 ($pattern) must not be empty -With $regs arg: -mb_ereg(): Argument #1 ($pattern) must not be empty -NULL - --- Iteration 7 -- -Without $regs arg: -mb_ereg(): Argument #1 ($pattern) must not be empty -With $regs arg: -mb_ereg(): Argument #1 ($pattern) must not be empty -NULL - --- Iteration 8 -- -Without $regs arg: -mb_ereg(): Argument #1 ($pattern) must not be empty -With $regs arg: -mb_ereg(): Argument #1 ($pattern) must not be empty -NULL diff --git a/ext/mbstring/tests/bug72164.phpt b/ext/mbstring/tests/bug72164.phpt index eff18982d5ea5..3e04f0f0f7924 100644 --- a/ext/mbstring/tests/bug72164.phpt +++ b/ext/mbstring/tests/bug72164.phpt @@ -9,7 +9,7 @@ if (!function_exists('mb_ereg')) die('skip mbregex support not available'); ---EXPECT-- +--EXPECTF-- +Deprecated: mb_ereg_search_init(): Passing null to parameter #1 ($string) of type string is deprecated in %s on line %d bool(true) diff --git a/ext/mbstring/tests/mb_ereg_replace_variation1.phpt b/ext/mbstring/tests/mb_ereg_replace_variation1.phpt index 90af39cf58146..dfa2e18eb0823 100644 --- a/ext/mbstring/tests/mb_ereg_replace_variation1.phpt +++ b/ext/mbstring/tests/mb_ereg_replace_variation1.phpt @@ -16,10 +16,6 @@ $replacement = 'string_val'; $string = 'string_val'; $option = ''; -//get an unset variable -$unset_var = 10; -unset ($unset_var); - // get a class class classA { @@ -49,10 +45,6 @@ $inputs = array( 12.3456789000E-10, .5, - // null data -/*10*/ NULL, - null, - // boolean data /*12*/ true, false, @@ -71,12 +63,6 @@ $inputs = array( // object data /*21*/ new classA(), - // undefined data -/*22*/ @$undefined_var, - - // unset data -/*23*/ @$unset_var, - ); // loop through each element of the array for pattern @@ -121,7 +107,7 @@ string(10) "string_val" string(10) "string_val" -- Iteration 10 -- -string(120) "string_valsstring_valtstring_valrstring_valistring_valnstring_valgstring_val_string_valvstring_valastring_vallstring_val" +string(10) "string_val" -- Iteration 11 -- string(120) "string_valsstring_valtstring_valrstring_valistring_valnstring_valgstring_val_string_valvstring_valastring_vallstring_val" @@ -133,32 +119,20 @@ string(10) "string_val" string(120) "string_valsstring_valtstring_valrstring_valistring_valnstring_valgstring_val_string_valvstring_valastring_vallstring_val" -- Iteration 14 -- -string(10) "string_val" +string(120) "string_valsstring_valtstring_valrstring_valistring_valnstring_valgstring_val_string_valvstring_valastring_vallstring_val" -- Iteration 15 -- string(120) "string_valsstring_valtstring_valrstring_valistring_valnstring_valgstring_val_string_valvstring_valastring_vallstring_val" -- Iteration 16 -- -string(120) "string_valsstring_valtstring_valrstring_valistring_valnstring_valgstring_val_string_valvstring_valastring_vallstring_val" +string(10) "string_val" -- Iteration 17 -- -string(120) "string_valsstring_valtstring_valrstring_valistring_valnstring_valgstring_val_string_valvstring_valastring_vallstring_val" +string(10) "string_val" -- Iteration 18 -- string(10) "string_val" -- Iteration 19 -- string(10) "string_val" - --- Iteration 20 -- -string(10) "string_val" - --- Iteration 21 -- -string(10) "string_val" - --- Iteration 22 -- -string(120) "string_valsstring_valtstring_valrstring_valistring_valnstring_valgstring_val_string_valvstring_valastring_vallstring_val" - --- Iteration 23 -- -string(120) "string_valsstring_valtstring_valrstring_valistring_valnstring_valgstring_val_string_valvstring_valastring_vallstring_val" Done diff --git a/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt b/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt index fc99a487472a2..07376dc911a29 100644 --- a/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt +++ b/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt @@ -1,5 +1,5 @@ --TEST-- -Optional long parameter might be null +Optional long parameter might be null (deprecated) --SKIPIF-- --FILE-- @@ -16,15 +16,32 @@ echo mb_substr('foobarbaz', 6, null, 'UTF-8') . "\n"; echo mb_strcut('foobarbaz', 6, null, 'UTF-8') . "\n"; echo mb_strimwidth('foobar', 0, 3, null, 'UTF-8') . "\n"; ?> ---EXPECT-- +--EXPECTF-- +Deprecated: mb_strpos(): Passing null to parameter #3 ($offset) of type int is deprecated in %s on line %d 1 + +Deprecated: mb_strrpos(): Passing null to parameter #3 ($offset) of type int is deprecated in %s on line %d 2 + +Deprecated: mb_stripos(): Passing null to parameter #3 ($offset) of type int is deprecated in %s on line %d 1 + +Deprecated: mb_strripos(): Passing null to parameter #3 ($offset) of type int is deprecated in %s on line %d 2 + +Deprecated: mb_strstr(): Passing null to parameter #3 ($before_needle) of type bool is deprecated in %s on line %d barbaz + +Deprecated: mb_strrchr(): Passing null to parameter #3 ($before_needle) of type bool is deprecated in %s on line %d baz + +Deprecated: mb_stristr(): Passing null to parameter #3 ($before_needle) of type bool is deprecated in %s on line %d barbaz + +Deprecated: mb_strrichr(): Passing null to parameter #3 ($before_needle) of type bool is deprecated in %s on line %d baz baz baz + +Deprecated: mb_strimwidth(): Passing null to parameter #4 ($trim_marker) of type string is deprecated in %s on line %d foo diff --git a/ext/mysqli/tests/bug34810.phpt b/ext/mysqli/tests/bug34810.phpt index 9157a13b9ab32..e1568d30385f4 100644 --- a/ext/mysqli/tests/bug34810.phpt +++ b/ext/mysqli/tests/bug34810.phpt @@ -12,13 +12,14 @@ class DbConnection { public function connect() { require_once("connect.inc"); - $link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket); + /* Pass false as $connect_flags cannot be accessed via globals. */ + $link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket, false); var_dump($link); $link = mysqli_init(); var_dump($link); - $mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket); + $mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket, false); $mysql->query("DROP TABLE IF EXISTS test_warnings"); $mysql->query("CREATE TABLE test_warnings (a int not null)"); $mysql->query("SET sql_mode=''"); diff --git a/ext/mysqli/tests/bug62885.phpt b/ext/mysqli/tests/bug62885.phpt index 4d02475570834..c0815c7f04713 100644 --- a/ext/mysqli/tests/bug62885.phpt +++ b/ext/mysqli/tests/bug62885.phpt @@ -12,11 +12,11 @@ if (!$IS_MYSQLND) { --EXPECTF-- diff --git a/ext/mysqli/tests/mysqli_kill.phpt b/ext/mysqli/tests/mysqli_kill.phpt index bec08cc1e1d3b..d2c0fc6df6435 100644 --- a/ext/mysqli/tests/mysqli_kill.phpt +++ b/ext/mysqli/tests/mysqli_kill.phpt @@ -11,9 +11,8 @@ require_once('skipifconnectfailure.inc'); require('table.inc'); - // Zend will cast the NULL to 0 try { - mysqli_kill($link, null); + mysqli_kill($link, 0); } catch (\ValueError $e) { echo $e->getMessage() . \PHP_EOL; } diff --git a/ext/mysqli/tests/mysqli_stmt_get_result_non_select.phpt b/ext/mysqli/tests/mysqli_stmt_get_result_non_select.phpt index f2428aeb92785..9a0e52d5cb7be 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result_non_select.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result_non_select.phpt @@ -35,12 +35,12 @@ if (!function_exists('mysqli_stmt_get_result')) printf("[004] It is very unlikely that SHOW ENGINES returns no data, check manually\n"); } else { $found = false; - foreach ($engines as $k => $engine) - foreach ($engine as $k => $v) - if (stristr($v, 'MyISAM')) { - $found = true; - break; - } + foreach ($engines as $engine) { + if (stristr($engine[0], 'MyISAM')) { + $found = true; + break; + } + } if (!$found) printf("[005] It is very unlikely that SHOW ENGINES does not show MyISAM, check manually\n"); } diff --git a/ext/odbc/tests/odbc_columnprivileges_001.phpt b/ext/odbc/tests/odbc_columnprivileges_001.phpt index 062985d55f540..353ae1e81a2f2 100644 --- a/ext/odbc/tests/odbc_columnprivileges_001.phpt +++ b/ext/odbc/tests/odbc_columnprivileges_001.phpt @@ -22,6 +22,12 @@ var_dump(odbc_fetch_row($result)); --EXPECTF-- resource(%d) of type (odbc result) bool(false) + +Deprecated: odbc_columnprivileges(): Passing null to parameter #3 ($schema) of type string is deprecated in %s on line %d + +Deprecated: odbc_columnprivileges(): Passing null to parameter #4 ($table) of type string is deprecated in %s on line %d + +Deprecated: odbc_columnprivileges(): Passing null to parameter #5 ($column) of type string is deprecated in %s on line %d resource(%d) of type (odbc result) bool(false) resource(%d) of type (odbc result) diff --git a/ext/openssl/tests/openssl_decrypt_ccm.phpt b/ext/openssl/tests/openssl_decrypt_ccm.phpt index 13ee520b79aa0..74c67872d35e2 100644 --- a/ext/openssl/tests/openssl_decrypt_ccm.phpt +++ b/ext/openssl/tests/openssl_decrypt_ccm.phpt @@ -24,7 +24,7 @@ foreach ($methods as $method) { // no IV var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, - NULL, $test['tag'], $test['aad'])); + '', $test['tag'], $test['aad'])); // failed because no AAD var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, $test['iv'], $test['tag'])); diff --git a/ext/openssl/tests/openssl_decrypt_gcm.phpt b/ext/openssl/tests/openssl_decrypt_gcm.phpt index 223c9e72c4df9..bfec7240dffe9 100644 --- a/ext/openssl/tests/openssl_decrypt_gcm.phpt +++ b/ext/openssl/tests/openssl_decrypt_gcm.phpt @@ -22,7 +22,7 @@ foreach ($tests as $idx => $test) { // no IV var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, - NULL, $test['tag'], $test['aad'])); + '', $test['tag'], $test['aad'])); // failed because no AAD var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, $test['iv'], $test['tag'])); diff --git a/ext/openssl/tests/openssl_decrypt_ocb.phpt b/ext/openssl/tests/openssl_decrypt_ocb.phpt index cea35501dd352..52b5d03c7de8b 100644 --- a/ext/openssl/tests/openssl_decrypt_ocb.phpt +++ b/ext/openssl/tests/openssl_decrypt_ocb.phpt @@ -22,7 +22,7 @@ foreach ($tests as $idx => $test) { // no IV var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, - NULL, $test['tag'], $test['aad'])); + '', $test['tag'], $test['aad'])); // IV too long var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, diff --git a/ext/openssl/tests/openssl_encrypt_ccm.phpt b/ext/openssl/tests/openssl_encrypt_ccm.phpt index 8c4c41f81870c..f4b773749a2b4 100644 --- a/ext/openssl/tests/openssl_encrypt_ccm.phpt +++ b/ext/openssl/tests/openssl_encrypt_ccm.phpt @@ -24,7 +24,7 @@ foreach ($methods as $method) { } // Empty IV error -var_dump(openssl_encrypt('data', $method, 'password', 0, NULL, $tag, '')); +var_dump(openssl_encrypt('data', $method, 'password', 0, '', $tag, '')); // Test setting different IV length and tag length var_dump(openssl_encrypt('data', $method, 'password', 0, str_repeat('x', 10), $tag, '', 14)); diff --git a/ext/openssl/tests/openssl_encrypt_gcm.phpt b/ext/openssl/tests/openssl_encrypt_gcm.phpt index 2b4a31b0f4cff..d976f4a5f32c7 100644 --- a/ext/openssl/tests/openssl_encrypt_gcm.phpt +++ b/ext/openssl/tests/openssl_encrypt_gcm.phpt @@ -22,7 +22,7 @@ foreach ($tests as $idx => $test) { } // Empty IV error -var_dump(openssl_encrypt('data', $method, 'password', 0, NULL, $tag, '')); +var_dump(openssl_encrypt('data', $method, 'password', 0, '', $tag, '')); // Failing to retrieve tag (max is 16 bytes) var_dump(openssl_encrypt('data', $method, 'password', 0, str_repeat('x', 32), $tag, '', 20)); diff --git a/ext/openssl/tests/openssl_encrypt_ocb.phpt b/ext/openssl/tests/openssl_encrypt_ocb.phpt index ee35a37ce43b7..57106f7855fec 100644 --- a/ext/openssl/tests/openssl_encrypt_ocb.phpt +++ b/ext/openssl/tests/openssl_encrypt_ocb.phpt @@ -22,7 +22,7 @@ foreach ($tests as $idx => $test) { } // Empty IV error -var_dump(openssl_encrypt('data', $method, 'password', 0, NULL, $tag, '')); +var_dump(openssl_encrypt('data', $method, 'password', 0, '', $tag, '')); // Failing to retrieve tag (must be at most 16 bytes) var_dump(openssl_encrypt('data', $method, 'password', 0, str_repeat('x', 12), $tag, '', 20)); diff --git a/ext/openssl/tests/openssl_x509_export_basic.phpt b/ext/openssl/tests/openssl_x509_export_basic.phpt index 2f872960199ca..c1c886356b567 100644 --- a/ext/openssl/tests/openssl_x509_export_basic.phpt +++ b/ext/openssl/tests/openssl_x509_export_basic.phpt @@ -29,9 +29,9 @@ if (PHP_EOL !== "\n") { var_dump(strcmp($output, $a)); var_dump(strcmp($output, $output2)); -var_dump(strcmp($output, $output3)); -var_dump(strcmp($output, $output4)); // different -var_dump(strcmp($output, $output5)); // different +var_dump(strcmp($output, $output4)); +var_dump($output3); +var_dump($output5); ?> --EXPECTF-- bool(true) @@ -44,5 +44,5 @@ openssl_x509_export(): Argument #1 ($certificate) must be of type OpenSSLCertifi int(0) int(0) int(%d) -int(0) -int(%d) +NULL +NULL diff --git a/ext/pdo_dblib/tests/pdo_dblib_quote.phpt b/ext/pdo_dblib/tests/pdo_dblib_quote.phpt index c5f2a4b62050d..582c54c5d22e6 100644 --- a/ext/pdo_dblib/tests/pdo_dblib_quote.phpt +++ b/ext/pdo_dblib/tests/pdo_dblib_quote.phpt @@ -29,10 +29,12 @@ $db = new PDO($dsn, $user, $pass, [PDO::ATTR_DEFAULT_STR_PARAM => PDO::PARAM_STR var_dump($db->getAttribute(PDO::ATTR_DEFAULT_STR_PARAM) === PDO::PARAM_STR_NATL); ?> ---EXPECT-- +--EXPECTF-- string(3) "'1'" string(2) "''" string(4) "'42'" + +Deprecated: PDO::quote(): Passing null to parameter #1 ($string) of type string is deprecated in %s on line %d string(2) "''" string(4) "''''" string(5) "'foo'" diff --git a/ext/phar/tests/bug60164.phpt b/ext/phar/tests/bug60164.phpt index 8cc2eceaa0c59..0a7b9227e7323 100644 --- a/ext/phar/tests/bug60164.phpt +++ b/ext/phar/tests/bug60164.phpt @@ -10,7 +10,7 @@ phar.readonly=0 --FILE-- getFileName()); } ?> diff --git a/ext/phar/tests/bug77022.phpt b/ext/phar/tests/bug77022.phpt index 40d908f1eeb01..4f5795842d030 100644 --- a/ext/phar/tests/bug77022.phpt +++ b/ext/phar/tests/bug77022.phpt @@ -13,9 +13,9 @@ var_dump(decoct(umask())); $sFile = tempnam(__DIR__, 'test77022'); var_dump(decoct(stat($sFile)['mode'])); -foreach([Phar::TAR => 'tar', Phar::ZIP => 'zip'] as $mode => $ext) { +foreach([Phar::TAR => 'tar', Phar::ZIP => 'zip'] as $format => $ext) { clearstatcache(); - $phar = new PharData(__DIR__ . '/test77022.' . $ext, null, null, $mode); + $phar = new PharData(__DIR__ . '/test77022.' . $ext, format: $format); $phar->addFile($sFile, 'test-file-phar'); $phar->addFromString("test-from-string", 'test-file-phar'); $phar->extractTo(__DIR__); @@ -33,4 +33,4 @@ string(6) "100600" string(6) "100600" string(6) "100644" string(6) "100600" -string(6) "100644" \ No newline at end of file +string(6) "100644" diff --git a/ext/phar/tests/bug79082.phpt b/ext/phar/tests/bug79082.phpt index 512c4fb95c48c..1c36db2b1a447 100644 --- a/ext/phar/tests/bug79082.phpt +++ b/ext/phar/tests/bug79082.phpt @@ -12,9 +12,9 @@ var_dump(decoct(umask())); chmod(__DIR__ . '/test79082/test79082-testfile', 0644); chmod(__DIR__ . '/test79082/test79082-testfile2', 0400); -foreach([Phar::TAR => 'tar', Phar::ZIP => 'zip'] as $mode => $ext) { +foreach([Phar::TAR => 'tar', Phar::ZIP => 'zip'] as $format => $ext) { clearstatcache(); - $phar = new PharData(__DIR__ . '/test79082.' . $ext, null, null, $mode); + $phar = new PharData(__DIR__ . '/test79082.' . $ext, format: $format); $phar->buildFromIterator(new \RecursiveDirectoryIterator(__DIR__ . '/test79082', \FilesystemIterator::SKIP_DOTS), __DIR__ . '/test79082'); $phar->extractTo(__DIR__); var_dump(decoct(stat(__DIR__ . '/test79082-testfile')['mode'])); @@ -22,9 +22,9 @@ foreach([Phar::TAR => 'tar', Phar::ZIP => 'zip'] as $mode => $ext) { unlink(__DIR__ . '/test79082-testfile'); unlink(__DIR__ . '/test79082-testfile2'); } -foreach([Phar::TAR => 'tar', Phar::ZIP => 'zip'] as $mode => $ext) { +foreach([Phar::TAR => 'tar', Phar::ZIP => 'zip'] as $format => $ext) { clearstatcache(); - $phar = new PharData(__DIR__ . '/test79082-d.' . $ext, null, null, $mode); + $phar = new PharData(__DIR__ . '/test79082-d.' . $ext, format: $format); $phar->buildFromDirectory(__DIR__ . '/test79082'); $phar->extractTo(__DIR__); var_dump(decoct(stat(__DIR__ . '/test79082-testfile')['mode'])); diff --git a/ext/phar/tests/files/phar_test.inc b/ext/phar/tests/files/phar_test.inc index f5279a93d20b1..277271ef4c63b 100644 --- a/ext/phar/tests/files/phar_test.inc +++ b/ext/phar/tests/files/phar_test.inc @@ -35,7 +35,7 @@ foreach($files as $name => $cont) if (empty($ulen)) $ulen = strlen($cont); if (empty($clen)) $clen = strlen($comp); if (empty($crc32))$crc32= crc32((binary)$cont); - if (isset($meta)) $meta = serialize($meta); + $meta = isset($meta) ? serialize($meta) : ""; // write manifest entry $manifest .= pack('V', strlen($name)) . (binary)$name; diff --git a/ext/posix/tests/posix_initgroups.phpt b/ext/posix/tests/posix_initgroups.phpt index c77acfe3a488f..5800c594d7aa2 100644 --- a/ext/posix/tests/posix_initgroups.phpt +++ b/ext/posix/tests/posix_initgroups.phpt @@ -8,7 +8,7 @@ if (!function_exists('posix_initgroups')) die('skip posix_initgroups() not found --FILE-- --EXPECT-- diff --git a/ext/posix/tests/posix_mknod.phpt b/ext/posix/tests/posix_mknod.phpt index a238f18186b0d..fc3258f069b85 100644 --- a/ext/posix/tests/posix_mknod.phpt +++ b/ext/posix/tests/posix_mknod.phpt @@ -8,7 +8,7 @@ if (!function_exists('posix_mknod')) die('skip posix_mknod() not found'); --FILE-- --EXPECT-- diff --git a/ext/posix/tests/posix_mknod_basic.phpt b/ext/posix/tests/posix_mknod_basic.phpt deleted file mode 100644 index 568d8d3dc6c7d..0000000000000 --- a/ext/posix/tests/posix_mknod_basic.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -posix_mknod(): Basic tests ---SKIPIF-- - ---FILE-- - -===DONE==== ---EXPECT-- -Basic test of POSIX posix_mknod function -bool(false) -===DONE==== diff --git a/ext/pspell/tests/004.phpt b/ext/pspell/tests/004.phpt index 80602bce390fd..24c4bffffa680 100644 --- a/ext/pspell/tests/004.phpt +++ b/ext/pspell/tests/004.phpt @@ -22,8 +22,6 @@ var_dump(pspell_config_runtogether($cfg, true)); $p = pspell_new_config($cfg); var_dump(pspell_check($p, 'theoasis')); -var_dump(pspell_config_runtogether($cfg, NULL)) - ?> --EXPECT-- bool(true) @@ -32,4 +30,3 @@ bool(false) --- bool(true) bool(true) -bool(true) diff --git a/ext/readline/tests/libedit_write_history_001-win32.phpt b/ext/readline/tests/libedit_write_history_001-win32.phpt index 6cc94bd1294f5..e6ff60af5c068 100644 --- a/ext/readline/tests/libedit_write_history_001-win32.phpt +++ b/ext/readline/tests/libedit_write_history_001-win32.phpt @@ -15,7 +15,6 @@ $name = tempnam(sys_get_temp_dir(), 'readline.tmp'); readline_add_history('foo'); readline_add_history(''); readline_add_history(1); -readline_add_history(NULL); readline_write_history($name); var_dump(file_get_contents($name)); diff --git a/ext/readline/tests/libedit_write_history_001.phpt b/ext/readline/tests/libedit_write_history_001.phpt index 69739c488e7ba..e7013111e7154 100644 --- a/ext/readline/tests/libedit_write_history_001.phpt +++ b/ext/readline/tests/libedit_write_history_001.phpt @@ -16,7 +16,6 @@ $name = tempnam('/tmp', 'readline.tmp'); readline_add_history('foo'); readline_add_history(''); readline_add_history(1); -readline_add_history(NULL); readline_write_history($name); var_dump(file_get_contents($name)); @@ -25,9 +24,8 @@ unlink($name); ?> --EXPECT-- -string(21) "_HiStOrY_V2_ +string(20) "_HiStOrY_V2_ foo 1 - " diff --git a/ext/readline/tests/readline_add_history_001.phpt b/ext/readline/tests/readline_add_history_001.phpt index 7b6b4112db946..bd505d45f6651 100644 --- a/ext/readline/tests/readline_add_history_001.phpt +++ b/ext/readline/tests/readline_add_history_001.phpt @@ -7,7 +7,7 @@ readline_add_history(): Basic test var_dump(readline_add_history('foo')); var_dump(readline_list_history()); -var_dump(readline_add_history(NULL)); +var_dump(readline_add_history('')); var_dump(readline_list_history()); var_dump(readline_clear_history()); diff --git a/ext/readline/tests/readline_write_history_001.phpt b/ext/readline/tests/readline_write_history_001.phpt index bcbeb5efa45a3..b1e934c3b01a2 100644 --- a/ext/readline/tests/readline_write_history_001.phpt +++ b/ext/readline/tests/readline_write_history_001.phpt @@ -13,7 +13,6 @@ $name = tempnam('/tmp', 'readline.tmp'); readline_add_history('foo'); readline_add_history(''); readline_add_history(1); -readline_add_history(NULL); readline_write_history($name); var_dump(file_get_contents($name)); @@ -22,8 +21,7 @@ unlink($name); ?> --EXPECT-- -string(8) "foo +string(7) "foo 1 - " diff --git a/ext/reflection/tests/ReflectionClass_constructor_002.phpt b/ext/reflection/tests/ReflectionClass_constructor_002.phpt index 7df620eaaa50e..adb3784347374 100644 --- a/ext/reflection/tests/ReflectionClass_constructor_002.phpt +++ b/ext/reflection/tests/ReflectionClass_constructor_002.phpt @@ -45,8 +45,10 @@ try { } ?> ---EXPECT-- +--EXPECTF-- ReflectionClass::__construct() expects exactly 1 argument, 0 given + +Deprecated: ReflectionClass::__construct(): Passing null to parameter #1 ($objectOrClass) of type object|string is deprecated in %s on line %d Class "" does not exist Class "1" does not exist Class "1" does not exist diff --git a/ext/reflection/tests/ReflectionClass_getConstant_error.phpt b/ext/reflection/tests/ReflectionClass_getConstant_error.phpt index ca9bc0ce2d1e0..d143006af9992 100644 --- a/ext/reflection/tests/ReflectionClass_getConstant_error.phpt +++ b/ext/reflection/tests/ReflectionClass_getConstant_error.phpt @@ -8,7 +8,6 @@ class C { $rc = new ReflectionClass("C"); echo "Check invalid params:\n"; -var_dump($rc->getConstant(null)); var_dump($rc->getConstant(1)); var_dump($rc->getConstant(1.5)); var_dump($rc->getConstant(true)); @@ -18,4 +17,3 @@ Check invalid params: bool(false) bool(false) bool(false) -bool(false) diff --git a/ext/reflection/tests/ReflectionClass_getMethod_002.phpt b/ext/reflection/tests/ReflectionClass_getMethod_002.phpt index 827182288454f..9278b47875448 100644 --- a/ext/reflection/tests/ReflectionClass_getMethod_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getMethod_002.phpt @@ -54,10 +54,12 @@ try { ?> ---EXPECT-- +--EXPECTF-- Check invalid params: ReflectionClass::getMethod() expects exactly 1 argument, 0 given ReflectionClass::getMethod() expects exactly 1 argument, 2 given + +Deprecated: ReflectionClass::getMethod(): Passing null to parameter #1 ($name) of type string is deprecated in %s on line %d Method C::() does not exist Method C::1() does not exist Method C::1.5() does not exist diff --git a/ext/reflection/tests/ReflectionClass_getProperty_002.phpt b/ext/reflection/tests/ReflectionClass_getProperty_002.phpt index 80ef77c8a3b62..c2f8419a1ea7f 100644 --- a/ext/reflection/tests/ReflectionClass_getProperty_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getProperty_002.phpt @@ -52,10 +52,12 @@ try { echo $e->getMessage() . "\n"; } ?> ---EXPECT-- +--EXPECTF-- Check invalid params: ReflectionClass::getProperty() expects exactly 1 argument, 0 given ReflectionClass::getProperty() expects exactly 1 argument, 2 given + +Deprecated: ReflectionClass::getProperty(): Passing null to parameter #1 ($name) of type string is deprecated in %s on line %d Property C::$ does not exist Property C::$1 does not exist Property C::$1.5 does not exist diff --git a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt index 4a5a5929d55ed..2b6fda0590840 100644 --- a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt @@ -38,9 +38,11 @@ try { ?> ---EXPECT-- +--EXPECTF-- ReflectionClass::getStaticPropertyValue() expects at most 2 arguments, 3 given ReflectionClass::getStaticPropertyValue() expects at least 1 argument, 0 given + +Deprecated: ReflectionClass::getStaticPropertyValue(): Passing null to parameter #1 ($name) of type string is deprecated in %s on line %d Property C::$ does not exist string(3) "def" ReflectionClass::getStaticPropertyValue(): Argument #1 ($name) must be of type string, array given diff --git a/ext/reflection/tests/ReflectionClass_hasConstant_002.phpt b/ext/reflection/tests/ReflectionClass_hasConstant_002.phpt index 5dcc7df173da3..4e4c206ac23ee 100644 --- a/ext/reflection/tests/ReflectionClass_hasConstant_002.phpt +++ b/ext/reflection/tests/ReflectionClass_hasConstant_002.phpt @@ -11,7 +11,6 @@ class C { $rc = new ReflectionClass("C"); echo "Check invalid params:\n"; -var_dump($rc->hasConstant(null)); var_dump($rc->hasConstant(1)); var_dump($rc->hasConstant(1.5)); var_dump($rc->hasConstant(true)); @@ -21,4 +20,3 @@ Check invalid params: bool(false) bool(false) bool(false) -bool(false) diff --git a/ext/reflection/tests/ReflectionClass_hasMethod_002.phpt b/ext/reflection/tests/ReflectionClass_hasMethod_002.phpt index 2bbc84551ef75..5e175fbb7e5da 100644 --- a/ext/reflection/tests/ReflectionClass_hasMethod_002.phpt +++ b/ext/reflection/tests/ReflectionClass_hasMethod_002.phpt @@ -11,7 +11,6 @@ class C { $rc = new ReflectionClass("C"); echo "Check invalid params:\n"; -var_dump($rc->hasMethod(null)); var_dump($rc->hasMethod(1)); var_dump($rc->hasMethod(1.5)); var_dump($rc->hasMethod(true)); @@ -21,4 +20,3 @@ Check invalid params: bool(false) bool(false) bool(false) -bool(false) diff --git a/ext/reflection/tests/ReflectionClass_hasProperty_002.phpt b/ext/reflection/tests/ReflectionClass_hasProperty_002.phpt index 607fead65ca71..14b4520e07ef0 100644 --- a/ext/reflection/tests/ReflectionClass_hasProperty_002.phpt +++ b/ext/reflection/tests/ReflectionClass_hasProperty_002.phpt @@ -11,7 +11,6 @@ class C { $rc = new ReflectionClass("C"); echo "Check invalid params:\n"; -var_dump($rc->hasProperty(null)); var_dump($rc->hasProperty(1)); var_dump($rc->hasProperty(1.5)); var_dump($rc->hasProperty(true)); @@ -21,4 +20,3 @@ Check invalid params: bool(false) bool(false) bool(false) -bool(false) diff --git a/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt b/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt index 5fb158cb8d9a9..7af12f07b7013 100644 --- a/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt +++ b/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt @@ -65,7 +65,7 @@ try { echo $e->getMessage() . "\n"; } ?> ---EXPECT-- +--EXPECTF-- Does A implement A? - Using object argument: A is not an interface - Using string argument: A is not an interface @@ -146,6 +146,8 @@ Does I2 implement I2? Test bad arguments: ReflectionClass::implementsInterface() expects exactly 1 argument, 0 given ReflectionClass::implementsInterface() expects exactly 1 argument, 2 given + +Deprecated: ReflectionClass::implementsInterface(): Passing null to parameter #1 ($interface) of type ReflectionClass|string is deprecated in %s on line %d Interface "" does not exist Interface "ThisClassDoesNotExist" does not exist Interface "2" does not exist diff --git a/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt b/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt index 51fc52b8ee6bd..db3961b3e6494 100644 --- a/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt +++ b/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt @@ -35,10 +35,12 @@ try { echo $e->getMessage() . "\n"; } ?> ---EXPECT-- +--EXPECTF-- Test bad arguments: ReflectionClass::isSubclassOf() expects exactly 1 argument, 0 given ReflectionClass::isSubclassOf() expects exactly 1 argument, 2 given + +Deprecated: ReflectionClass::isSubclassOf(): Passing null to parameter #1 ($class) of type ReflectionClass|string is deprecated in %s on line %d Class "" does not exist Class "ThisClassDoesNotExist" does not exist Class "2" does not exist diff --git a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt index 7bd2b1eecd9ad..82de2ce0c2a80 100644 --- a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt +++ b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt @@ -43,10 +43,12 @@ try { ?> ---EXPECT-- +--EXPECTF-- ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 3 given ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 0 given ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 1 given + +Deprecated: ReflectionClass::setStaticPropertyValue(): Passing null to parameter #1 ($name) of type string is deprecated in %s on line %d Class C does not have a property named Class C does not have a property named 1.5 ReflectionClass::setStaticPropertyValue(): Argument #1 ($name) must be of type string, array given diff --git a/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt b/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt index ceedc7d4f0430..03a4cfcc22505 100644 --- a/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt +++ b/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt @@ -35,10 +35,12 @@ try { echo $e->getMessage() . "\n"; } ?> ---EXPECT-- +--EXPECTF-- Test bad arguments: ReflectionClass::isSubclassOf() expects exactly 1 argument, 0 given ReflectionClass::isSubclassOf() expects exactly 1 argument, 2 given + +Deprecated: ReflectionClass::isSubclassOf(): Passing null to parameter #1 ($class) of type ReflectionClass|string is deprecated in %s on line %d Class "" does not exist Class "ThisClassDoesNotExist" does not exist Class "2" does not exist diff --git a/ext/session/tests/bug69111.phpt b/ext/session/tests/bug69111.phpt index c7a6cada65199..7dff0590dd2ea 100644 --- a/ext/session/tests/bug69111.phpt +++ b/ext/session/tests/bug69111.phpt @@ -14,7 +14,7 @@ $sessionName = ini_get('session.name'); $sh->open($savePath, $sessionName); $sh->write("foo", "bar"); -var_dump($sh->read(@$id)); +var_dump($sh->read("")); ?> --EXPECTF-- Warning: SessionHandler::open(): Session is not active in %s on line 10 diff --git a/ext/shmop/tests/002.phpt b/ext/shmop/tests/002.phpt index 2cd9db6187110..41f2ce5783157 100644 --- a/ext/shmop/tests/002.phpt +++ b/ext/shmop/tests/002.phpt @@ -27,11 +27,11 @@ try { } // Warning outputs: Unable to attach or create shared memory segment -var_dump(shmop_open(null, 'a', 0644, 1024)); +var_dump(shmop_open(0, 'a', 0644, 1024)); // Shared memory segment size must be greater than zero try { - shmop_open(null, 'a', 0644, 1024); + shmop_open(0, 'a', 0644, 1024); } catch (ValueError $exception) { echo $exception->getMessage() . "\n"; } diff --git a/ext/sockets/tests/socket_create_pair-wrongparams-win32.phpt b/ext/sockets/tests/socket_create_pair-wrongparams-win32.phpt index ff4dd5de064ea..399563fde1747 100644 --- a/ext/sockets/tests/socket_create_pair-wrongparams-win32.phpt +++ b/ext/sockets/tests/socket_create_pair-wrongparams-win32.phpt @@ -11,10 +11,10 @@ if (!extension_loaded('sockets')) { --FILE-- getMessage() . \PHP_EOL; } diff --git a/ext/sockets/tests/socket_create_pair-wrongparams.phpt b/ext/sockets/tests/socket_create_pair-wrongparams.phpt index 57111c83f1901..d6a4d4562d713 100644 --- a/ext/sockets/tests/socket_create_pair-wrongparams.phpt +++ b/ext/sockets/tests/socket_create_pair-wrongparams.phpt @@ -11,10 +11,10 @@ if (!extension_loaded('sockets')) { --FILE-- getMessage() . \PHP_EOL; } diff --git a/ext/sodium/tests/utils.phpt b/ext/sodium/tests/utils.phpt index eeca5363e1b67..944a25ca2238a 100644 --- a/ext/sodium/tests/utils.phpt +++ b/ext/sodium/tests/utils.phpt @@ -7,7 +7,7 @@ Check for libsodium utils $a = 'test'; sodium_memzero($a); if ($a !== 'test') { - echo strlen($a); + var_dump($a); } else { echo $a; } @@ -107,7 +107,8 @@ try { ?> --EXPECT-- -0 +NULL + bool(true) bool(false) string(22) "0000810102030405060708" diff --git a/ext/spl/tests/SplFixedArray__construct_param_null.phpt b/ext/spl/tests/SplFixedArray__construct_param_null.phpt index 919c72021aae9..acd9d44af50da 100644 --- a/ext/spl/tests/SplFixedArray__construct_param_null.phpt +++ b/ext/spl/tests/SplFixedArray__construct_param_null.phpt @@ -10,7 +10,8 @@ $array = new SplFixedArray( NULL ); print_r( $array ); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: SplFixedArray::__construct(): Passing null to parameter #1 ($size) of type int is deprecated in %s on line %d SplFixedArray Object ( ) diff --git a/ext/spl/tests/SplFixedArray_setSize_param_null.phpt b/ext/spl/tests/SplFixedArray_setSize_param_null.phpt index ddb37be9f0352..dd98935f2f209 100644 --- a/ext/spl/tests/SplFixedArray_setSize_param_null.phpt +++ b/ext/spl/tests/SplFixedArray_setSize_param_null.phpt @@ -8,6 +8,7 @@ $fixed_array = new SplFixedArray(2); $fixed_array->setSize(null); var_dump($fixed_array); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: SplFixedArray::setSize(): Passing null to parameter #1 ($size) of type int is deprecated in %s on line %d object(SplFixedArray)#1 (0) { } diff --git a/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter3.phpt b/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter3.phpt index bc9f78a1ca32b..6934c3af1bf88 100644 --- a/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter3.phpt +++ b/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter3.phpt @@ -1,5 +1,5 @@ --TEST-- -Check that SplObjectStorage::unserialize doesn't throws exception when NULL passed +Check that SplObjectStorage::unserialize doesn't throws exception when empty string passed --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- @@ -8,7 +8,7 @@ PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) $s = new SplObjectStorage(); try { - $s->unserialize(NULL); + $s->unserialize(''); } catch(UnexpectedValueException $e) { echo $e->getMessage(); } diff --git a/ext/spl/tests/bug46051.phpt b/ext/spl/tests/bug46051.phpt index cebe8a52d7efa..535dd2ddaecc8 100644 --- a/ext/spl/tests/bug46051.phpt +++ b/ext/spl/tests/bug46051.phpt @@ -6,7 +6,7 @@ Bug #46051 (SplFileInfo::openFile - memory overlap) $x = new splfileinfo(__FILE__); try { - $x->openFile(NULL, NULL, []); + $x->openFile("", false, []); } catch (TypeError $e) { } var_dump($x->getPathName()); diff --git a/ext/spl/tests/bug61527.phpt b/ext/spl/tests/bug61527.phpt index fa8291228c0c9..f068897246311 100644 --- a/ext/spl/tests/bug61527.phpt +++ b/ext/spl/tests/bug61527.phpt @@ -42,12 +42,12 @@ var_dump($ai2->next()); var_dump($ai2->key()); /* testing RecursiveArrayIterator */ -$ao3 = new ArrayObject(array(), NULL, 'RecursiveArrayIterator'); +$ao3 = new ArrayObject(array(), 0, 'RecursiveArrayIterator'); $ai3 = $ao3->getIterator(); var_dump($ai3->getChildren()); -$ao4 = new ArrayObject(array(1, 2), NULL, 'RecursiveArrayIterator'); +$ao4 = new ArrayObject(array(1, 2), 0, 'RecursiveArrayIterator'); $ai4 = $ao4->getIterator(); $ai4->next(); diff --git a/ext/spl/tests/bug65387.phpt b/ext/spl/tests/bug65387.phpt index a5b028954ccea..e5d501ccf1596 100644 --- a/ext/spl/tests/bug65387.phpt +++ b/ext/spl/tests/bug65387.phpt @@ -31,13 +31,13 @@ $it2 = new RecursiveCallbackFilterIterator($it, function($elem) use(&$it2) { // Cache $it = new ArrayIterator(); $it2 = new CachingIterator($it, CachingIterator::FULL_CACHE); -$it2[] = $it2; +$it2['x'] = $it2; $it2->next(); // Recursive cache $it = new RecursiveArrayIterator(); $it2 = new RecursiveCachingIterator($it, CachingIterator::FULL_CACHE); -$it2[] = $it2; +$it2['x'] = $it2; $it2->next(); // Append diff --git a/ext/spl/tests/bug75717.phpt b/ext/spl/tests/bug75717.phpt index 77226e10993d8..920dda9c5301e 100644 --- a/ext/spl/tests/bug75717.phpt +++ b/ext/spl/tests/bug75717.phpt @@ -8,7 +8,7 @@ function flatten(array $nestedArraysAndStrings){ $iter = new RecursiveIteratorIterator( new RecursiveArrayIterator($nestedArraysAndStrings)); foreach($iter as $leaf){ $flat[] = $leaf; } - return join(null, $flat); + return join('', $flat); } $noRefs = [[[['some']]],[' nested '],"items"]; diff --git a/ext/spl/tests/fixedarray_011.phpt b/ext/spl/tests/fixedarray_011.phpt deleted file mode 100644 index eddf320fcc3e9..0000000000000 --- a/ext/spl/tests/fixedarray_011.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -SPL: FixedArray: Testing setSize() with NULL ---FILE-- -setSize(NULL); - -print "ok\n"; - -?> ---EXPECT-- -ok diff --git a/ext/spl/tests/fixedarray_014.phpt b/ext/spl/tests/fixedarray_014.phpt index a6f2fc188c6dc..75108b5868476 100644 --- a/ext/spl/tests/fixedarray_014.phpt +++ b/ext/spl/tests/fixedarray_014.phpt @@ -4,7 +4,7 @@ SPL: FixedArray: Trying to access inexistent item getMessage(); diff --git a/ext/spl/tests/iterator_044.phpt b/ext/spl/tests/iterator_044.phpt index 66f722af9a1bd..74321194e0986 100644 --- a/ext/spl/tests/iterator_044.phpt +++ b/ext/spl/tests/iterator_044.phpt @@ -94,8 +94,12 @@ Warning: Undefined array key "foo" in %s on line %d NULL ===3=== NULL + +Deprecated: CachingIterator::offsetExists(): Passing null to parameter #1 ($key) of type string is deprecated in %s on line %d bool(false) +Deprecated: CachingIterator::offsetGet(): Passing null to parameter #1 ($key) of type string is deprecated in %s on line %d + Warning: Undefined array key "" in %s on line %d NULL ===4=== @@ -133,8 +137,12 @@ bool(true) int(1) ===3=== NULL + +Deprecated: CachingIterator::offsetExists(): Passing null to parameter #1 ($key) of type string is deprecated in %s on line %d bool(false) +Deprecated: CachingIterator::offsetGet(): Passing null to parameter #1 ($key) of type string is deprecated in %s on line %d + Warning: Undefined array key "" in %s on line %d NULL ===4=== diff --git a/ext/spl/tests/regexIterator_flags_basic.phpt b/ext/spl/tests/regexIterator_flags_basic.phpt index 535be00035898..d5b778f86bb62 100644 --- a/ext/spl/tests/regexIterator_flags_basic.phpt +++ b/ext/spl/tests/regexIterator_flags_basic.phpt @@ -7,7 +7,7 @@ Felix De Vliegher $array = array('foo', 'bar', 'baz'); $iterator = new ArrayIterator($array); -$regexIterator = new RegexIterator($iterator, "/f/", null, RegexIterator::USE_KEY); +$regexIterator = new RegexIterator($iterator, "/f/", RegexIterator::MATCH, RegexIterator::USE_KEY); var_dump($regexIterator->getFlags() === RegexIterator::USE_KEY); diff --git a/ext/sqlite3/tests/sqlite3_busyTimeout.phpt b/ext/sqlite3/tests/sqlite3_busyTimeout.phpt index ea97d8ee00984..e27235a6af0cb 100644 --- a/ext/sqlite3/tests/sqlite3_busyTimeout.phpt +++ b/ext/sqlite3/tests/sqlite3_busyTimeout.phpt @@ -8,7 +8,6 @@ marcosptf - - @phpsp - sao paulo - br busyTimeout(0)); -var_dump($db->busyTimeout(null)); var_dump($db->busyTimeout(-1000)); var_dump($db->busyTimeout(1000)); $db->close(); @@ -17,4 +16,3 @@ $db->close(); bool(true) bool(true) bool(true) -bool(true) diff --git a/ext/standard/tests/array/array_filter_variation9.phpt b/ext/standard/tests/array/array_filter_variation9.phpt index f5158e337ccc9..d9abf7dac1994 100644 --- a/ext/standard/tests/array/array_filter_variation9.phpt +++ b/ext/standard/tests/array/array_filter_variation9.phpt @@ -8,7 +8,7 @@ Test array_filter() function : usage variations - built-in functions as 'callbac echo "*** Testing array_filter() : usage variations - built-in functions as 'callback' argument ***\n"; -$input = array(0, 1, -1, 10, 100, 1000, null); +$input = array(0, 1, -1, 10, 100, 1000); // using built-in function 'is_int' as 'callback' var_dump( array_filter($input, 'is_int') ); @@ -48,7 +48,7 @@ array(6) { [5]=> int(1000) } -array(7) { +array(6) { [0]=> int(0) [1]=> @@ -61,8 +61,6 @@ array(7) { int(100) [5]=> int(1000) - [6]=> - NULL } array_filter(): Argument #2 ($callback) must be a valid callback, function "echo" not found or invalid function name array_filter(): Argument #2 ($callback) must be a valid callback, function "exit" not found or invalid function name diff --git a/ext/standard/tests/array/count_invalid_mode.phpt b/ext/standard/tests/array/count_invalid_mode.phpt index 710741d122eac..be39690e856b2 100644 --- a/ext/standard/tests/array/count_invalid_mode.phpt +++ b/ext/standard/tests/array/count_invalid_mode.phpt @@ -12,7 +12,6 @@ $modes = [ 2, TRUE, FALSE, - NULL, ]; foreach ($modes as $mode) { @@ -32,4 +31,3 @@ count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE int(0) int(0) -int(0) diff --git a/ext/standard/tests/array/range_errors.phpt b/ext/standard/tests/array/range_errors.phpt index 7bc552ee978f9..e8bdf376e3c36 100644 --- a/ext/standard/tests/array/range_errors.phpt +++ b/ext/standard/tests/array/range_errors.phpt @@ -91,7 +91,7 @@ foreach( $step_arr as $step ) { } } ?> ---EXPECT-- +--EXPECTF-- *** Testing error conditions *** -- Testing ( (low < high) && (step = 0) ) -- @@ -126,6 +126,8 @@ range(): Argument #3 ($step) must not exceed the specified range -- Testing Invalid steps -- range(): Argument #3 ($step) must be of type int|float, string given + +Deprecated: range(): Passing null to parameter #3 ($step) of type int|float is deprecated in %s on line %d range(): Argument #3 ($step) must not exceed the specified range range(): Argument #3 ($step) must not exceed the specified range range(): Argument #3 ($step) must be of type int|float, string given diff --git a/ext/standard/tests/file/005_variation2-win32.phpt b/ext/standard/tests/file/005_variation2-win32.phpt index 407f51a4d160d..9f5b7ba6795d6 100644 --- a/ext/standard/tests/file/005_variation2-win32.phpt +++ b/ext/standard/tests/file/005_variation2-win32.phpt @@ -28,13 +28,11 @@ function stat_fn( $filename ) { echo "*** Testing fileattime(), filemtime(), filectime() & touch() : usage variations ***\n"; echo "\n*** testing file info ***"; -stat_fn(NULL); stat_fn(false); stat_fn(''); stat_fn(' '); stat_fn('|'); -echo "\n*** testing touch ***"; -var_dump(touch(NULL)); +echo "\n*** testing touch ***\n"; var_dump(touch(false)); var_dump(touch('')); @@ -59,11 +57,6 @@ echo "Done"; -- File modification time is => -- inode change time is => --- File '' -- --- File access time is => --- File modification time is => --- inode change time is => - -- File ' ' -- -- File access time is => Warning: fileatime(): stat failed for in %s on line %d @@ -86,7 +79,7 @@ Warning: filemtime(): stat failed for | in %s on line %d Warning: filectime(): stat failed for | in %s on line %d -*** testing touch ***bool(false) +*** testing touch *** bool(false) bool(false) diff --git a/ext/standard/tests/file/005_variation2.phpt b/ext/standard/tests/file/005_variation2.phpt index 5a878a687b9c6..55d1d6666098c 100644 --- a/ext/standard/tests/file/005_variation2.phpt +++ b/ext/standard/tests/file/005_variation2.phpt @@ -28,7 +28,6 @@ function stat_fn( $filename ) { echo "*** Testing fileattime(), filemtime(), filectime() & touch() : usage variations ***\n"; echo "\n*** testing touch ***\n"; -$a = touch(NULL); $b = touch(false); $c = touch(''); $d = touch(' '); @@ -41,7 +40,6 @@ var_dump($d); var_dump($e); echo "\n*** testing file info ***"; -stat_fn(NULL); stat_fn(false); stat_fn(''); stat_fn(' '); @@ -56,7 +54,9 @@ echo "Done"; *** Testing fileattime(), filemtime(), filectime() & touch() : usage variations *** *** testing touch *** -bool(false) + +Warning: Undefined variable $a in %s on line %d +NULL bool(false) bool(false) bool(true) @@ -73,11 +73,6 @@ bool(true) -- File modification time is => -- inode change time is => --- File '' -- --- File access time is => --- File modification time is => --- inode change time is => - -- File ' ' -- -- File access time is => %d -- File modification time is => %d diff --git a/ext/standard/tests/file/basename-win32.phpt b/ext/standard/tests/file/basename-win32.phpt index 4d6cf7e089bc5..53f243a634d62 100644 --- a/ext/standard/tests/file/basename-win32.phpt +++ b/ext/standard/tests/file/basename-win32.phpt @@ -56,13 +56,11 @@ $file_path_variations = array ( /* paths with shortcut home dir char, with suffix variation */ array("C:\\temp\\bar"), array("C:\\temp\\bar", ""), - array("C:\\temp\\bar", NULL), array("C:\\temp\\bar", ' '), array("C:\\temp\\bar.tar", ".tar"), array("C:\\temp\\bar.tar", "~"), array("C:\\temp\\bar.tar\\", "~"), array("C:\\temp\\bar.tar\\", ""), - array("C:\\temp\\bar.tar", NULL), array("C:\\temp\\bar.tar", ''), array("C:\\temp\\bar.tar", " "), @@ -84,7 +82,6 @@ $file_path_variations = array ( array("\\bar.zip\\", "\\bar.zip\\"), array(" ", " "), array(' ', ' '), - array(NULL, NULL), /* path with spaces */ array(" "), @@ -93,7 +90,6 @@ $file_path_variations = array ( /* empty paths */ array(""), array(''), - array(NULL) ); function check_basename( $path_arrays ) { @@ -209,7 +205,7 @@ string(3) "bar" string(3) "bar" --Iteration 5-- -string(3) "bar" +string(7) "bar.tar" --Iteration 6-- string(7) "bar.tar" @@ -224,10 +220,10 @@ string(7) "bar.tar" string(7) "bar.tar" --Iteration 10-- -string(7) "bar.tar" +string(4) "10.5" --Iteration 11-- -string(7) "bar.tar" +string(2) "10" --Iteration 12-- string(4) "10.5" @@ -236,37 +232,37 @@ string(4) "10.5" string(2) "10" --Iteration 14-- -string(4) "10.5" +string(2) "10" --Iteration 15-- -string(2) "10" +string(4) "10.5" --Iteration 16-- -string(2) "10" +string(4) "10.5" --Iteration 17-- -string(4) "10.5" +string(6) "10.zip" --Iteration 18-- -string(4) "10.5" +string(1) "0" --Iteration 19-- -string(6) "10.zip" +string(1) "0" --Iteration 20-- -string(1) "0" +string(7) "bar.zip" --Iteration 21-- -string(1) "0" +string(7) "bar.zip" --Iteration 22-- string(7) "bar.zip" --Iteration 23-- -string(7) "bar.zip" +string(1) " " --Iteration 24-- -string(7) "bar.zip" +string(1) " " --Iteration 25-- string(1) " " @@ -278,17 +274,5 @@ string(1) " " string(0) "" --Iteration 28-- -string(1) " " - ---Iteration 29-- -string(1) " " - ---Iteration 30-- -string(0) "" - ---Iteration 31-- -string(0) "" - ---Iteration 32-- string(0) "" Done diff --git a/ext/standard/tests/file/basename.phpt b/ext/standard/tests/file/basename.phpt index 2b8507fa2d834..c2dbf34f51f5c 100644 Binary files a/ext/standard/tests/file/basename.phpt and b/ext/standard/tests/file/basename.phpt differ diff --git a/ext/standard/tests/file/basename_basic-win32.phpt b/ext/standard/tests/file/basename_basic-win32.phpt index 79de350eaeeb7..0678a7fd95dd4 100644 --- a/ext/standard/tests/file/basename_basic-win32.phpt +++ b/ext/standard/tests/file/basename_basic-win32.phpt @@ -56,7 +56,6 @@ $file_paths = array ( /* empty paths */ "", '', - NULL, ); foreach ($file_paths as $file_path) { @@ -98,4 +97,3 @@ string(1) " " string(1) " " string(0) "" string(0) "" -string(0) "" diff --git a/ext/standard/tests/file/basename_basic.phpt b/ext/standard/tests/file/basename_basic.phpt index 55bd868c55c44..bd86695b92cd1 100644 --- a/ext/standard/tests/file/basename_basic.phpt +++ b/ext/standard/tests/file/basename_basic.phpt @@ -56,7 +56,6 @@ $file_paths = array ( /* empty paths */ "", '', - NULL, ); foreach ($file_paths as $file_path) { @@ -98,4 +97,3 @@ string(1) " " string(1) " " string(0) "" string(0) "" -string(0) "" diff --git a/ext/standard/tests/file/bug51094.phpt b/ext/standard/tests/file/bug51094.phpt index cf2bb254c9241..77d7470cb5cef 100644 --- a/ext/standard/tests/file/bug51094.phpt +++ b/ext/standard/tests/file/bug51094.phpt @@ -3,15 +3,15 @@ Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that includ --FILE-- --EXPECT-- diff --git a/ext/standard/tests/file/bug61961.phpt b/ext/standard/tests/file/bug61961.phpt index c9ae4c88808b5..fbef22ba4c013 100644 --- a/ext/standard/tests/file/bug61961.phpt +++ b/ext/standard/tests/file/bug61961.phpt @@ -5,7 +5,7 @@ Bug #61961 (file_get_content leaks when access empty file with max length) $tmp_empty_file = __FILE__ . ".tmp"; file_put_contents($tmp_empty_file, ""); -var_dump(file_get_contents($tmp_empty_file, NULL, NULL, NULL, 10)); +var_dump(file_get_contents($tmp_empty_file, false, NULL, 0, 10)); unlink($tmp_empty_file); ?> --EXPECT-- diff --git a/ext/standard/tests/file/chgrp.phpt b/ext/standard/tests/file/chgrp.phpt index b94def684a8c6..1e4899e465742 100644 --- a/ext/standard/tests/file/chgrp.phpt +++ b/ext/standard/tests/file/chgrp.phpt @@ -8,7 +8,7 @@ if(substr(PHP_OS, 0, 3) == "WIN") --FILE-- getMessage() . "\n"; } diff --git a/ext/standard/tests/file/chown.phpt b/ext/standard/tests/file/chown.phpt index 05cd4e4d7d414..5791c04c9b297 100644 --- a/ext/standard/tests/file/chown.phpt +++ b/ext/standard/tests/file/chown.phpt @@ -7,7 +7,7 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- --EXPECTF-- diff --git a/ext/standard/tests/file/fgetcsv_error_conditions.phpt b/ext/standard/tests/file/fgetcsv_error_conditions.phpt index dd2b4d61d9fde..9bb090246a539 100644 --- a/ext/standard/tests/file/fgetcsv_error_conditions.phpt +++ b/ext/standard/tests/file/fgetcsv_error_conditions.phpt @@ -27,23 +27,23 @@ try { echo $e->getMessage() . \PHP_EOL; } -echo 'fgetcsv() with delimiter as NULL' . \PHP_EOL; +echo 'fgetcsv() with delimiter as empty string' . \PHP_EOL; try { - var_dump( fgetcsv($file_handle, $length, NULL, $enclosure) ); + var_dump( fgetcsv($file_handle, $length, '', $enclosure) ); } catch (\ValueError $e) { echo $e->getMessage() . \PHP_EOL; } -echo 'fgetcsv() with enclosure as NULL' . \PHP_EOL; +echo 'fgetcsv() with enclosure as empty string' . \PHP_EOL; try { - var_dump( fgetcsv($file_handle, $length, $delimiter, NULL) ); + var_dump( fgetcsv($file_handle, $length, $delimiter, '') ); } catch (\ValueError $e) { echo $e->getMessage() . \PHP_EOL; } -echo 'fgetcsv() with delimiter & enclosure as NULL' . \PHP_EOL; +echo 'fgetcsv() with delimiter & enclosure as empty string' . \PHP_EOL; try { - var_dump( fgetcsv($file_handle, $length, NULL, NULL) ); + var_dump( fgetcsv($file_handle, $length, '', '') ); } catch (\ValueError $e) { echo $e->getMessage() . \PHP_EOL; } @@ -53,9 +53,9 @@ fgetcsv() with negative length fgetcsv(): Argument #2 ($length) must be a greater than or equal to 0 fgetcsv(): Argument #2 ($length) must be a greater than or equal to 0 fgetcsv(): Argument #2 ($length) must be a greater than or equal to 0 -fgetcsv() with delimiter as NULL +fgetcsv() with delimiter as empty string fgetcsv(): Argument #3 ($separator) must be a single character -fgetcsv() with enclosure as NULL +fgetcsv() with enclosure as empty string fgetcsv(): Argument #4 ($enclosure) must be a single character -fgetcsv() with delimiter & enclosure as NULL +fgetcsv() with delimiter & enclosure as empty string fgetcsv(): Argument #3 ($separator) must be a single character diff --git a/ext/standard/tests/file/file_exists_variation1.phpt b/ext/standard/tests/file/file_exists_variation1.phpt index 55c6c9498141f..446e7fac16a06 100644 --- a/ext/standard/tests/file/file_exists_variation1.phpt +++ b/ext/standard/tests/file/file_exists_variation1.phpt @@ -6,7 +6,6 @@ Dave Kelsey -1, "TRUE" => TRUE, "FALSE" => FALSE, - "NULL" => NULL, "\"\"" => "", "\" \"" => " ", "\\0" => "\0", @@ -58,9 +57,6 @@ bool(false) -- Filename: FALSE -- ValueError: Path cannot be empty --- Filename: NULL -- -ValueError: Path cannot be empty - -- Filename: "" -- ValueError: Path cannot be empty diff --git a/ext/standard/tests/file/file_get_contents_variation8.phpt b/ext/standard/tests/file/file_get_contents_variation8.phpt index 126f7b9fd7510..ad23a13bb6b79 100644 --- a/ext/standard/tests/file/file_get_contents_variation8.phpt +++ b/ext/standard/tests/file/file_get_contents_variation8.phpt @@ -19,7 +19,6 @@ $names_arr = array( -1, TRUE, FALSE, - NULL, "", " ", "\0", @@ -57,20 +56,18 @@ ValueError: Path cannot be empty -- Iteration 3 -- ValueError: Path cannot be empty -- Iteration 4 -- -ValueError: Path cannot be empty --- Iteration 5 -- Warning: file_get_contents( ): Failed to open stream: No such file or directory in %s on line %d bool(false) --- Iteration 6 -- +-- Iteration 5 -- ValueError: file_get_contents(): Argument #1 ($filename) must not contain any null bytes --- Iteration 7 -- +-- Iteration 6 -- TypeError: file_get_contents(): Argument #1 ($filename) must be of type string, array given --- Iteration 8 -- +-- Iteration 7 -- Warning: file_get_contents(/no/such/file/dir): Failed to open stream: No such file or directory in %s on line %d bool(false) --- Iteration 9 -- +-- Iteration 8 -- Warning: file_get_contents(php/php): Failed to open stream: No such file or directory in %s on line %d bool(false) diff --git a/ext/standard/tests/file/file_put_contents_variation5.phpt b/ext/standard/tests/file/file_put_contents_variation5.phpt index d16db38b14c67..97eb2604e02a5 100644 --- a/ext/standard/tests/file/file_put_contents_variation5.phpt +++ b/ext/standard/tests/file/file_put_contents_variation5.phpt @@ -19,7 +19,7 @@ runtest(); $newpath = ""; set_include_path($newpath); runtest(); -set_include_path(null); +set_include_path(""); runtest(); set_include_path(";; ; ;c:\\rubbish"); runtest(); diff --git a/ext/standard/tests/file/file_put_contents_variation8-win32.phpt b/ext/standard/tests/file/file_put_contents_variation8-win32.phpt index e3cd4609d42df..dac2ba6d37ad3 100644 --- a/ext/standard/tests/file/file_put_contents_variation8-win32.phpt +++ b/ext/standard/tests/file/file_put_contents_variation8-win32.phpt @@ -18,7 +18,6 @@ $names_arr = array( "-1" => -1, "TRUE" => TRUE, "FALSE" => FALSE, - "NULL" => NULL, "\"\"" => "", "\" \"" => " ", "\\0" => "\0", @@ -58,9 +57,6 @@ foreach($names_arr as $key =>$value) { -- Filename: FALSE -- ValueError: Path cannot be empty --- Filename: NULL -- -ValueError: Path cannot be empty - -- Filename: "" -- ValueError: Path cannot be empty diff --git a/ext/standard/tests/file/file_put_contents_variation8.phpt b/ext/standard/tests/file/file_put_contents_variation8.phpt index f5b956faee3ff..70456fad9ff7d 100644 --- a/ext/standard/tests/file/file_put_contents_variation8.phpt +++ b/ext/standard/tests/file/file_put_contents_variation8.phpt @@ -22,7 +22,6 @@ $names_arr = array( -1, TRUE, FALSE, - NULL, "", " ", //this one also generates a java message rather than our own so we don't replicate php message @@ -64,18 +63,16 @@ ValueError: Path cannot be empty -- Iteration 3 -- ValueError: Path cannot be empty -- Iteration 4 -- -ValueError: Path cannot be empty --- Iteration 5 -- 9 bytes written to: ' ' --- Iteration 6 -- +-- Iteration 5 -- ValueError: file_put_contents(): Argument #1 ($filename) must not contain any null bytes --- Iteration 7 -- +-- Iteration 6 -- TypeError: file_put_contents(): Argument #1 ($filename) must be of type string, array given --- Iteration 8 -- +-- Iteration 7 -- Warning: file_put_contents(%sdir): Failed to open stream: %s in %s on line %d Failed to write data to: '%sir' --- Iteration 9 -- +-- Iteration 8 -- Warning: file_put_contents(%sphp): Failed to open stream: %s in %s on line %d Failed to write data to: '%sphp' diff --git a/ext/standard/tests/file/filegroup_variation2.phpt b/ext/standard/tests/file/filegroup_variation2.phpt index 85ee170660b19..7d0a87d247244 100644 --- a/ext/standard/tests/file/filegroup_variation2.phpt +++ b/ext/standard/tests/file/filegroup_variation2.phpt @@ -18,7 +18,6 @@ $filenames = array( "", TRUE, FALSE, - NULL, /* scalars */ 1234, @@ -49,7 +48,6 @@ bool(false) Warning: filegroup(): stat failed for 1 in %s on line %d bool(false) bool(false) -bool(false) Warning: filegroup(): stat failed for 1234 in %s on line %d bool(false) diff --git a/ext/standard/tests/file/fileinode_variation2.phpt b/ext/standard/tests/file/fileinode_variation2.phpt index d8593733a8b9e..2dace6413c3e6 100644 --- a/ext/standard/tests/file/fileinode_variation2.phpt +++ b/ext/standard/tests/file/fileinode_variation2.phpt @@ -18,7 +18,6 @@ $filenames = array( "", TRUE, FALSE, - NULL, /* scalars */ 1234, @@ -49,7 +48,6 @@ bool(false) Warning: fileinode(): stat failed for 1 in %s on line %d bool(false) bool(false) -bool(false) Warning: fileinode(): stat failed for 1234 in %s on line %d bool(false) diff --git a/ext/standard/tests/file/fileowner_variation2.phpt b/ext/standard/tests/file/fileowner_variation2.phpt index 752fa1d6ef77e..05cc8495b1345 100644 --- a/ext/standard/tests/file/fileowner_variation2.phpt +++ b/ext/standard/tests/file/fileowner_variation2.phpt @@ -19,7 +19,6 @@ $filenames = array( "", TRUE, FALSE, - NULL, /* scalars */ 1234, @@ -50,7 +49,6 @@ bool(false) Warning: fileowner(): stat failed for 1 in %s on line %d bool(false) bool(false) -bool(false) Warning: fileowner(): stat failed for 1234 in %s on line %d bool(false) diff --git a/ext/standard/tests/file/fileperms_variation2.phpt b/ext/standard/tests/file/fileperms_variation2.phpt index 9c9d263ebe24c..c46ce617ae72d 100644 --- a/ext/standard/tests/file/fileperms_variation2.phpt +++ b/ext/standard/tests/file/fileperms_variation2.phpt @@ -18,7 +18,6 @@ $filenames = array( "", TRUE, FALSE, - NULL, /* scalars */ 1234, @@ -49,7 +48,6 @@ bool(false) Warning: fileperms(): stat failed for 1 in %s on line %d bool(false) bool(false) -bool(false) Warning: fileperms(): stat failed for 1234 in %s on line %d bool(false) diff --git a/ext/standard/tests/file/filesize_variation5.phpt b/ext/standard/tests/file/filesize_variation5.phpt index ab1fc6c9ffc8f..7da6e73e06139 100644 --- a/ext/standard/tests/file/filesize_variation5.phpt +++ b/ext/standard/tests/file/filesize_variation5.phpt @@ -7,7 +7,6 @@ Dave Kelsey echo "*** Testing filesize(): usage variations ***\n"; /* null, false, "", " " */ -var_dump( filesize(NULL) ); var_dump( filesize(false) ); var_dump( filesize('') ); var_dump( filesize(' ') ); @@ -18,7 +17,6 @@ echo "*** Done ***\n"; *** Testing filesize(): usage variations *** bool(false) bool(false) -bool(false) Warning: filesize(): stat failed for in %s on line %d bool(false) diff --git a/ext/standard/tests/file/flock_basic.phpt b/ext/standard/tests/file/flock_basic.phpt index df1199d468c51..8b4ae30e0fd45 100644 --- a/ext/standard/tests/file/flock_basic.phpt +++ b/ext/standard/tests/file/flock_basic.phpt @@ -9,7 +9,7 @@ Description: PHP supports a portable way of locking complete files echo "*** Testing flock() fun with file and dir ***\n"; -$lock_file = preg_replace("~\.phpt?$~", null, __FILE__); +$lock_file = preg_replace("~\.phpt?$~", '', __FILE__); $file_handle = fopen($lock_file, "w"); var_dump(flock($file_handle, LOCK_SH|LOCK_NB)); @@ -19,7 +19,7 @@ var_dump(flock($file_handle, LOCK_UN)); fclose($file_handle); unlink($lock_file); -$lock_dir = sprintf("%s.dir", preg_replace("~\.phpt?$~", null, __FILE__)); +$lock_dir = sprintf("%s.dir", preg_replace("~\.phpt?$~", '', __FILE__)); mkdir($lock_dir); $dir_handle = opendir($lock_dir); diff --git a/ext/standard/tests/file/flock_error.phpt b/ext/standard/tests/file/flock_error.phpt index add22959816dc..753aaa6fb34e8 100644 --- a/ext/standard/tests/file/flock_error.phpt +++ b/ext/standard/tests/file/flock_error.phpt @@ -19,7 +19,6 @@ $operations = array( 0, LOCK_NB, FALSE, - NULL, array(1,2,3), array(), "string", @@ -62,15 +61,13 @@ flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN --- Iteration 2 --- flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN --- Iteration 3 --- -flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN +flock(): Argument #2 ($operation) must be of type int, array given --- Iteration 4 --- flock(): Argument #2 ($operation) must be of type int, array given --- Iteration 5 --- -flock(): Argument #2 ($operation) must be of type int, array given +flock(): Argument #2 ($operation) must be of type int, string given --- Iteration 6 --- flock(): Argument #2 ($operation) must be of type int, string given --- Iteration 7 --- flock(): Argument #2 ($operation) must be of type int, string given ---- Iteration 8 --- -flock(): Argument #2 ($operation) must be of type int, string given flock(): supplied resource is not a valid stream resource diff --git a/ext/standard/tests/file/flock_variation.phpt b/ext/standard/tests/file/flock_variation.phpt index 40945be58eb26..f4a51999592b4 100644 --- a/ext/standard/tests/file/flock_variation.phpt +++ b/ext/standard/tests/file/flock_variation.phpt @@ -5,7 +5,7 @@ Test flock() function: Variations echo "*** Testing flock() fun with the various operation and wouldblock values ***\n"; -$file = preg_replace("~\.phpt?$~", null, __FILE__); +$file = preg_replace("~\.phpt?$~", '', __FILE__); $fp = fopen($file, "w"); /* array of operations */ diff --git a/ext/standard/tests/file/fnmatch_basic.phpt b/ext/standard/tests/file/fnmatch_basic.phpt index 18a8161966330..8b74bb430b371 100644 --- a/ext/standard/tests/file/fnmatch_basic.phpt +++ b/ext/standard/tests/file/fnmatch_basic.phpt @@ -23,7 +23,6 @@ var_dump( fnmatch(100, 100) ); var_dump( fnmatch("string", "string") ); var_dump( fnmatch(TRUE, TRUE) ); var_dump( fnmatch(FALSE, FALSE) ); -var_dump( fnmatch(NULL, NULL) ); echo "\n*** Done ***\n"; ?> @@ -40,6 +39,5 @@ bool(true) bool(true) bool(true) bool(true) -bool(true) *** Done *** diff --git a/ext/standard/tests/file/fnmatch_variation.phpt b/ext/standard/tests/file/fnmatch_variation.phpt index 2d6a08e72fc89..3413c3e6f76c6 100644 --- a/ext/standard/tests/file/fnmatch_variation.phpt +++ b/ext/standard/tests/file/fnmatch_variation.phpt @@ -127,8 +127,6 @@ match_($bool_arr, $bool_arr); echo "\n--- With NULL ---\n"; $null_arr = array( - NULL, - null, "", "\0", "string", @@ -399,42 +397,20 @@ bool(true) --- With NULL --- -- Iteration 0 -- bool(true) -bool(true) -bool(true) fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(false) bool(false) -- Iteration 1 -- -bool(true) -bool(true) -bool(true) -fnmatch(): Argument #2 ($filename) must not contain any null bytes -bool(false) -bool(false) --- Iteration 2 -- -bool(true) -bool(true) -bool(true) -fnmatch(): Argument #2 ($filename) must not contain any null bytes -bool(false) -bool(false) --- Iteration 3 -- -fnmatch(): Argument #1 ($pattern) must not contain any null bytes fnmatch(): Argument #1 ($pattern) must not contain any null bytes fnmatch(): Argument #1 ($pattern) must not contain any null bytes fnmatch(): Argument #1 ($pattern) must not contain any null bytes fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes --- Iteration 4 -- -bool(false) -bool(false) +-- Iteration 2 -- bool(false) fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(true) bool(false) --- Iteration 5 -- -bool(false) -bool(false) +-- Iteration 3 -- bool(false) fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(false) diff --git a/ext/standard/tests/file/fputcsv_variation2.phpt b/ext/standard/tests/file/fputcsv_variation2.phpt deleted file mode 100644 index 77b075a5f042f..0000000000000 --- a/ext/standard/tests/file/fputcsv_variation2.phpt +++ /dev/null @@ -1,724 +0,0 @@ ---TEST-- -Test fputcsv() : usage variations - with delimiter as NULL ---FILE-- -getMessage() . \PHP_EOL; - } - // check the file pointer position and eof - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - //close the file - fclose($file_handle); - - // print the file contents - var_dump( file_get_contents($filename) ); - - //delete file - unlink($filename); - } //end of mode loop -} // end of foreach - -echo "Done\n"; -?> ---EXPECT-- -*** Testing fputcsv() : with delimiter as NULL *** - --- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" -Done diff --git a/ext/standard/tests/file/fputcsv_variation3.phpt b/ext/standard/tests/file/fputcsv_variation3.phpt deleted file mode 100644 index eb8771aa4a692..0000000000000 --- a/ext/standard/tests/file/fputcsv_variation3.phpt +++ /dev/null @@ -1,724 +0,0 @@ ---TEST-- -Test fputcsv() : usage variations - with enclosure as NULL ---FILE-- -getMessage() . \PHP_EOL; - } - // check the file pointer position and eof - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - //close the file - fclose($file_handle); - - // print the file contents - var_dump( file_get_contents($filename) ); - - //delete file - unlink($filename); - } //end of mode loop -} // end of foreach - -echo "Done\n"; -?> ---EXPECT-- -*** Testing fputcsv() : with enclosure as NULL *** - --- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character -int(0) -bool(false) -string(0) "" -Done diff --git a/ext/standard/tests/file/fputcsv_variation4.phpt b/ext/standard/tests/file/fputcsv_variation4.phpt deleted file mode 100644 index dc78796158095..0000000000000 --- a/ext/standard/tests/file/fputcsv_variation4.phpt +++ /dev/null @@ -1,724 +0,0 @@ ---TEST-- -Test fputcsv() : usage variations - with delimiter and enclosure as NULL ---FILE-- -getMessage() . \PHP_EOL; - } - // check the file pointer position and eof - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - //close the file - fclose($file_handle); - - // print the file contents - var_dump( file_get_contents($filename) ); - - //delete file - unlink($filename); - } //end of mode loop -} // end of foreach - -echo "Done\n"; -?> ---EXPECT-- -*** Testing fputcsv() : with delimiter and enclosure as NULL *** - --- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" - --- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character -int(0) -bool(false) -string(0) "" -Done diff --git a/ext/standard/tests/file/fscanf_error.phpt b/ext/standard/tests/file/fscanf_error.phpt index c50af50b6d272..da586555be06c 100644 --- a/ext/standard/tests/file/fscanf_error.phpt +++ b/ext/standard/tests/file/fscanf_error.phpt @@ -31,9 +31,7 @@ try { fclose($file_handle); // different invalid format strings -$invalid_formats = array( $undefined_var, - "%", "%h", "%.", "%d%m" - ); +$invalid_formats = array("", "%", "%h", "%.", "%d%m"); // looping to use various invalid formats with fscanf() @@ -57,12 +55,10 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_error.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Testing fscanf() for error conditions *** fscanf(): supplied resource is not a valid File-Handle resource Different numbers of variable names and field specifiers - -Warning: Undefined variable $undefined_var in %s on line %d array(0) { } Bad scan conversion character " diff --git a/ext/standard/tests/file/glob_variation3.phpt b/ext/standard/tests/file/glob_variation3.phpt index 4bf008a9a79a5..891bbb6fa101f 100644 --- a/ext/standard/tests/file/glob_variation3.phpt +++ b/ext/standard/tests/file/glob_variation3.phpt @@ -4,7 +4,7 @@ Test glob() function: ensure no platform difference url_var, $obj->html_var, @@ -83,10 +73,8 @@ foreach($paths as $path) { echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing pathinfo() with miscellaneous input arguments *** - -Warning: Undefined variable $fp in %s on line %d -- Iteration 1 -- array(3) { ["dirname"]=> @@ -240,39 +228,6 @@ string(0) "" string(0) "" string(0) "" -- Iteration 13 -- -array(2) { - ["basename"]=> - string(0) "" - ["filename"]=> - string(0) "" -} -string(0) "" -string(0) "" -string(0) "" -string(0) "" --- Iteration 14 -- -array(2) { - ["basename"]=> - string(0) "" - ["filename"]=> - string(0) "" -} -string(0) "" -string(0) "" -string(0) "" -string(0) "" --- Iteration 15 -- -array(2) { - ["basename"]=> - string(0) "" - ["filename"]=> - string(0) "" -} -string(0) "" -string(0) "" -string(0) "" -string(0) "" --- Iteration 16 -- array(4) { ["dirname"]=> string(1) "." @@ -287,7 +242,7 @@ string(1) "." string(11) "www.foo.com" string(3) "com" string(7) "www.foo" --- Iteration 17 -- +-- Iteration 14 -- array(4) { ["dirname"]=> string(17) "/var/html/testdir" @@ -302,7 +257,7 @@ string(17) "/var/html/testdir" string(12) "example.html" string(4) "html" string(7) "example" --- Iteration 18 -- +-- Iteration 15 -- array(3) { ["dirname"]=> string(12) "/testdir/foo" @@ -315,7 +270,7 @@ string(12) "/testdir/foo" string(4) "test" string(0) "" string(4) "test" --- Iteration 19 -- +-- Iteration 16 -- array(4) { ["dirname"]=> string(4) "/foo" @@ -330,7 +285,7 @@ string(4) "/foo" string(12) "symlink.link" string(4) "link" string(7) "symlink" --- Iteration 20 -- +-- Iteration 17 -- array(3) { ["dirname"]=> string(1) "." @@ -343,7 +298,7 @@ string(1) "." string(5) "12345" string(0) "" string(5) "12345" --- Iteration 21 -- +-- Iteration 18 -- array(4) { ["dirname"]=> string(1) "." @@ -358,7 +313,7 @@ string(1) "." string(15) "www.example.com" string(3) "com" string(11) "www.example" --- Iteration 22 -- +-- Iteration 19 -- array(3) { ["dirname"]=> string(12) "/testdir/foo" @@ -371,7 +326,7 @@ string(12) "/testdir/foo" string(4) "test" string(0) "" string(4) "test" --- Iteration 23 -- +-- Iteration 20 -- array(4) { ["dirname"]=> string(6) "../foo" @@ -386,7 +341,7 @@ string(6) "../foo" string(9) "test.link" string(4) "link" string(4) "test" --- Iteration 24 -- +-- Iteration 21 -- array(4) { ["dirname"]=> string(76) "./test/work/scratch/mydir/yourdir/ourdir/test1/test2/test3/test4/test5/test6" @@ -401,7 +356,7 @@ string(76) "./test/work/scratch/mydir/yourdir/ourdir/test1/test2/test3/test4/tes string(8) "test.tmp" string(3) "tmp" string(4) "test" --- Iteration 25 -- +-- Iteration 22 -- array(4) { ["dirname"]=> string(1) "." diff --git a/ext/standard/tests/file/readfile_error.phpt b/ext/standard/tests/file/readfile_error.phpt index bec5b383d715e..9e47e68fac3c9 100644 --- a/ext/standard/tests/file/readfile_error.phpt +++ b/ext/standard/tests/file/readfile_error.phpt @@ -8,11 +8,6 @@ echo "*** Test readfile(): error conditions ***\n"; echo "\n-- Testing readfile() with invalid arguments --\n"; // invalid arguments -try { - var_dump( readfile(NULL) ); // NULL as $filename -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; -} try { var_dump( readfile('') ); // empty string as $filename } catch (\ValueError $e) { @@ -36,7 +31,6 @@ echo "Done\n"; -- Testing readfile() with invalid arguments -- Path cannot be empty Path cannot be empty -Path cannot be empty -- Testing readfile() with non-existent file -- diff --git a/ext/standard/tests/file/readfile_variation10-win32.phpt b/ext/standard/tests/file/readfile_variation10-win32.phpt index add9afd58ded2..325e47224dccb 100644 --- a/ext/standard/tests/file/readfile_variation10-win32.phpt +++ b/ext/standard/tests/file/readfile_variation10-win32.phpt @@ -19,7 +19,6 @@ $names_arr = array( "-1" => -1, "TRUE" => TRUE, "FALSE" => FALSE, - "NULL" => NULL, "\"\"" => "", "\" \"" => " ", "\\0" => "\0", @@ -54,9 +53,6 @@ Warning: readfile(1): Failed to open stream: No such file or directory in %s on -- Filename: FALSE -- ValueError: Path cannot be empty --- Filename: NULL -- -ValueError: Path cannot be empty - -- Filename: "" -- ValueError: Path cannot be empty diff --git a/ext/standard/tests/file/readfile_variation10.phpt b/ext/standard/tests/file/readfile_variation10.phpt index 99cb0b2d6b923..a2fc2d79cb589 100644 Binary files a/ext/standard/tests/file/readfile_variation10.phpt and b/ext/standard/tests/file/readfile_variation10.phpt differ diff --git a/ext/standard/tests/file/readlink_realpath_variation3.phpt b/ext/standard/tests/file/readlink_realpath_variation3.phpt index f256ffea42876..44a53f0dfb353 100644 --- a/ext/standard/tests/file/readlink_realpath_variation3.phpt +++ b/ext/standard/tests/file/readlink_realpath_variation3.phpt @@ -13,8 +13,6 @@ $link_string = array ( /* empty linkname */ "", '', - NULL, - null ); for($loop_counter = 0; $loop_counter < count($link_string); $loop_counter++) { echo "-- Iteration"; @@ -48,16 +46,6 @@ bool(false) string(%d) "%s" -- Iteration4 -- -Warning: readlink(): %s in %s on line %d -bool(false) -string(%d) "%s" --- Iteration5 -- - -Warning: readlink(): %s in %s on line %d -bool(false) -string(%d) "%s" --- Iteration6 -- - Warning: readlink(): %s in %s on line %d bool(false) string(%d) "%s" diff --git a/ext/standard/tests/file/readlink_variation1.phpt b/ext/standard/tests/file/readlink_variation1.phpt index b129de364f678..6697286de2b9b 100644 --- a/ext/standard/tests/file/readlink_variation1.phpt +++ b/ext/standard/tests/file/readlink_variation1.phpt @@ -17,7 +17,6 @@ $filenames = array( "", TRUE, FALSE, - NULL, /* scalars */ 1234, @@ -55,6 +54,3 @@ bool(false) Warning: readlink(): %s in %s on line %d bool(false) - -Warning: readlink(): %s in %s on line %d -bool(false) diff --git a/ext/standard/tests/file/realpath_variation-win32-mb.phpt b/ext/standard/tests/file/realpath_variation-win32-mb.phpt index a3539f6106ad3..ea2f1c6feca15 100644 --- a/ext/standard/tests/file/realpath_variation-win32-mb.phpt +++ b/ext/standard/tests/file/realpath_variation-win32-mb.phpt @@ -51,8 +51,6 @@ $file_string = array ( /* empty filename */ "", '', - NULL, - null ); for($loop_counter = 0; $loop_counter < count($file_string); $loop_counter++) { echo "-- Iteration"; @@ -91,8 +89,4 @@ bool(false) string(%d) "%s" -- Iteration4 -- string(%d) "%s" --- Iteration5 -- -string(%d) "%s" --- Iteration6 -- -string(%d) "%s" Done diff --git a/ext/standard/tests/file/realpath_variation-win32.phpt b/ext/standard/tests/file/realpath_variation-win32.phpt index 9f46c62e7cf0d..1ea8ced7d0eaa 100644 --- a/ext/standard/tests/file/realpath_variation-win32.phpt +++ b/ext/standard/tests/file/realpath_variation-win32.phpt @@ -51,8 +51,6 @@ $file_string = array ( /* empty filename */ "", '', - NULL, - null ); for($loop_counter = 0; $loop_counter < count($file_string); $loop_counter++) { echo "-- Iteration"; @@ -91,8 +89,4 @@ bool(false) string(%d) "%s" -- Iteration4 -- string(%d) "%s" --- Iteration5 -- -string(%d) "%s" --- Iteration6 -- -string(%d) "%s" Done diff --git a/ext/standard/tests/file/rename_variation13-win32.phpt b/ext/standard/tests/file/rename_variation13-win32.phpt index 65dbdfb8d671d..a2cf9a528d1b3 100644 --- a/ext/standard/tests/file/rename_variation13-win32.phpt +++ b/ext/standard/tests/file/rename_variation13-win32.phpt @@ -17,7 +17,6 @@ $names_arr = array( -1, /* -1 is just a valid filename on windows */ TRUE, /* 1 as well, (string)TRUE > "1" */ FALSE, - NULL, "", // I think both p8 and php are wrong on the messages here //p8 generates different messages to php, php is probably wrong //php has either "File Exists" or "Permission Denied". @@ -80,35 +79,28 @@ bool(false) Warning: rename(,%safile.tmp): %r(Invalid argument|(The parameter is incorrect|The system cannot find the path specified) \(code: \d+\))%r in %srename_variation13-win32.php on line %d bool(false) --- 3 testing '' NULL -- +-- 3 testing '' string -- Warning: rename(%safile.tmp,): %r(Invalid argument|(The parameter is incorrect|The system cannot find the path specified) \(code: \d+\))%r in %srename_variation13-win32.php on line %d bool(false) Warning: rename(,%safile.tmp): %r(Invalid argument|(The parameter is incorrect|The system cannot find the path specified) \(code: \d+\))%r in %srename_variation13-win32.php on line %d bool(false) --- 4 testing '' string -- - -Warning: rename(%safile.tmp,): %r(Invalid argument|(The parameter is incorrect|The system cannot find the path specified) \(code: \d+\))%r in %srename_variation13-win32.php on line %d -bool(false) - -Warning: rename(,%safile.tmp): %r(Invalid argument|(The parameter is incorrect|The system cannot find the path specified) \(code: \d+\))%r in %srename_variation13-win32.php on line %d -bool(false) --- 5 testing ' ' string -- +-- 4 testing ' ' string -- Warning: rename(%s): The filename, directory name, or volume label syntax is incorrect (code: 123) in %srename_variation13-win32.php on line %d bool(false) Warning: rename(%s): The filename, directory name, or volume label syntax is incorrect (code: 123) in %srename_variation13-win32.php on line %d bool(false) --- 6 testing '/no/such/file/dir' string -- +-- 5 testing '/no/such/file/dir' string -- Warning: rename(%safile.tmp,/no/such/file/dir): The system cannot find the path specified (code: 3) in %srename_variation13-win32.php on line %d bool(false) Warning: rename(/no/such/file/dir,%safile.tmp): The system cannot find the path specified (code: 3) in %srename_variation13-win32.php on line %d bool(false) --- 7 testing 'php/php' string -- +-- 6 testing 'php/php' string -- Warning: rename(%safile.tmp,php/php): The system cannot find the path specified (code: 3) in %srename_variation13-win32.php on line %d bool(false) diff --git a/ext/standard/tests/file/rename_variation13.phpt b/ext/standard/tests/file/rename_variation13.phpt index 83de25cd84775..1fa95f37266c2 100644 --- a/ext/standard/tests/file/rename_variation13.phpt +++ b/ext/standard/tests/file/rename_variation13.phpt @@ -23,7 +23,6 @@ $names_arr = array( -1, TRUE, FALSE, - NULL, "", " ", @@ -76,13 +75,6 @@ bool(false) Warning: rename(%s/renameVar13/afile.tmp,): %s in %s on line %d bool(false) -Warning: rename(,%s/renameVar13/afile.tmp): %s in %s on line %d -bool(false) --- testing '' -- - -Warning: rename(%s/renameVar13/afile.tmp,): %s in %s on line %d -bool(false) - Warning: rename(,%s/renameVar13/afile.tmp): %s in %s on line %d bool(false) -- testing ' ' -- diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt index 72737d1a8e6f5..f4035f8f40a2c 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt @@ -19,17 +19,14 @@ $linkname = __DIR__."/symlink_link_linkinfo_is_link_link_error1.tmp"; echo "*** Testing symlink() for error conditions ***\n"; //invalid arguments -var_dump( symlink(NULL, $linkname) ); // NULL as filename var_dump( symlink('', $linkname) ); // empty string as filename var_dump( symlink(false, $linkname) ); // boolean false as filename -var_dump( symlink($filename, NULL) ); // NULL as linkname var_dump( symlink($filename, '') ); // '' as linkname var_dump( symlink($filename, false) ); // false as linkname echo "\n*** Testing linkinfo() for error conditions ***\n"; //invalid arguments -var_dump( linkinfo(NULL) ); // NULL as linkname var_dump( linkinfo('') ); // empty string as linkname var_dump( linkinfo(false) ); // boolean false as linkname @@ -55,20 +52,11 @@ bool(false) Warning: symlink(): %s in %s on line %d bool(false) -Warning: symlink(): %s in %s on line %d -bool(false) - -Warning: symlink(): %s in %s on line %d -bool(false) - *** Testing linkinfo() for error conditions *** Warning: linkinfo(): %s in %s on line %d int(-1) -Warning: linkinfo(): %s in %s on line %d -int(-1) - Warning: linkinfo(): %s in %s on line %d int(-1) Done diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt index c5b21c0d21029..fcc64d409849d 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt @@ -19,18 +19,15 @@ $linkname = __DIR__."/symlink_link_linkinfo_is_link_link_error2.tmp"; echo "*** Testing link() for error conditions ***\n"; //invalid arguments -var_dump( link(NULL, $linkname) ); // NULL as filename var_dump( link('', $linkname) ); // empty string as filename var_dump( link(' ', $linkname) ); // space as filename var_dump( link(false, $linkname) ); // boolean false as filename -var_dump( link($filename, NULL) ); // NULL as linkname var_dump( link($filename, '') ); // '' as linkname var_dump( link($filename, false) ); // false as linkname echo "\n*** Testing is_link() for error conditions ***\n"; //invalid arguments -var_dump( is_link(NULL) ); // NULL as linkname var_dump( is_link('') ); // empty string as linkname var_dump( is_link(' ') ); // space as linkname var_dump( is_link(false) ); // boolean false as linkname @@ -60,16 +57,9 @@ bool(false) Warning: link(): No such file or directory in %s on line %d bool(false) -Warning: link(): No such file or directory in %s on line %d -bool(false) - -Warning: link(): No such file or directory in %s on line %d -bool(false) - *** Testing is_link() for error conditions *** bool(false) bool(false) bool(false) bool(false) -bool(false) Done diff --git a/ext/standard/tests/file/tempnam_variation3-win32.phpt b/ext/standard/tests/file/tempnam_variation3-win32.phpt index 86990f03416a4..5bc4f5ec884d1 100644 --- a/ext/standard/tests/file/tempnam_variation3-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation3-win32.phpt @@ -26,7 +26,6 @@ $names_arr = array( -1, TRUE, FALSE, - NULL, "", " ", "\0", @@ -47,7 +46,6 @@ $res_arr = array( true, true, true, - true, false, /* prefix with path separator of a non existing directory*/ @@ -99,17 +97,15 @@ OK -- Iteration 3 -- OK -- Iteration 4 -- -OK --- Iteration 5 -- Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation3-win32.php on line %d Failed, not created in the correct directory %s vs %s 0 --- Iteration 6 -- +-- Iteration 5 -- tempnam(): Argument #2 ($prefix) must not contain any null bytes --- Iteration 7 -- +-- Iteration 6 -- tempnam(): Argument #2 ($prefix) must be of type string, array given --- Iteration 8 -- +-- Iteration 7 -- OK --- Iteration 9 -- +-- Iteration 8 -- OK diff --git a/ext/standard/tests/file/tempnam_variation3.phpt b/ext/standard/tests/file/tempnam_variation3.phpt index baf0a5a868555..6f20ec140ef42 100644 --- a/ext/standard/tests/file/tempnam_variation3.phpt +++ b/ext/standard/tests/file/tempnam_variation3.phpt @@ -21,7 +21,6 @@ $names_arr = array( -1, TRUE, FALSE, - NULL, "", " ", "\0", @@ -98,18 +97,14 @@ File name is => %s/%s File permissions are => 100600 File created in => directory specified -- Iteration 5 -- -File name is => %s/%s -File permissions are => 100600 -File created in => directory specified --- Iteration 6 -- tempnam(): Argument #2 ($prefix) must not contain any null bytes --- Iteration 7 -- +-- Iteration 6 -- tempnam(): Argument #2 ($prefix) must be of type string, array given --- Iteration 8 -- +-- Iteration 7 -- File name is => %s/dir%s File permissions are => 100600 File created in => directory specified --- Iteration 9 -- +-- Iteration 8 -- File name is => %s/php%s File permissions are => 100600 File created in => directory specified diff --git a/ext/standard/tests/file/tempnam_variation7-win32.phpt b/ext/standard/tests/file/tempnam_variation7-win32.phpt index 0c951e2657ff4..b731c76449127 100644 --- a/ext/standard/tests/file/tempnam_variation7-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation7-win32.phpt @@ -19,7 +19,6 @@ $names_arr = array( -1, TRUE, FALSE, - NULL, "", " ", "\0", @@ -86,26 +85,22 @@ File name is => %s%et%s File permissions are => 100666 File created in => temp dir -- Iteration 4 -- -File name is => %s%et%s -File permissions are => 100666 -File created in => temp dir --- Iteration 5 -- Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation7-win32.php on line %d File name is => %s%et%s File permissions are => 100666 File created in => temp dir --- Iteration 6 -- +-- Iteration 5 -- tempnam(): Argument #1 ($directory) must not contain any null bytes --- Iteration 7 -- +-- Iteration 6 -- tempnam(): Argument #1 ($directory) must be of type string, array given --- Iteration 8 -- +-- Iteration 7 -- Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation7-win32.php on line %d File name is => %s%et%s File permissions are => 100666 File created in => temp dir --- Iteration 9 -- +-- Iteration 8 -- Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation7-win32.php on line %d File name is => %s%et%s diff --git a/ext/standard/tests/file/tempnam_variation7.phpt b/ext/standard/tests/file/tempnam_variation7.phpt index 9a0b1151c6b47..1928da4f89624 100644 --- a/ext/standard/tests/file/tempnam_variation7.phpt +++ b/ext/standard/tests/file/tempnam_variation7.phpt @@ -19,7 +19,6 @@ $names_arr = array( -1, TRUE, FALSE, - NULL, "", " ", "\0", @@ -91,26 +90,22 @@ File name is => %s%etempnam_variation3.tmp%s File permissions are => 100600 File created in => temp dir -- Iteration 4 -- -File name is => %s%etempnam_variation3.tmp%s -File permissions are => 100600 -File created in => temp dir --- Iteration 5 -- Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation7.php on line %d File name is => %s%etempnam_variation3.tmp%s File permissions are => 100600 File created in => temp dir --- Iteration 6 -- +-- Iteration 5 -- tempnam(): Argument #1 ($directory) must not contain any null bytes --- Iteration 7 -- +-- Iteration 6 -- tempnam(): Argument #1 ($directory) must be of type string, array given --- Iteration 8 -- +-- Iteration 7 -- Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation7.php on line %d File name is => %s/tempnam_variation3.tmp%s File permissions are => 100600 File created in => temp dir --- Iteration 9 -- +-- Iteration 8 -- Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation7.php on line %d File name is => %s/tempnam_variation3.tmp%s diff --git a/ext/standard/tests/file/unlink_error-win32-mb.phpt b/ext/standard/tests/file/unlink_error-win32-mb.phpt index e85db00600ffb..df98e2e367356 100644 --- a/ext/standard/tests/file/unlink_error-win32-mb.phpt +++ b/ext/standard/tests/file/unlink_error-win32-mb.phpt @@ -27,9 +27,6 @@ echo "\n-- Testing unlink() on invalid arguments --\n"; var_dump( unlink('') ); // $filename as empty string var_dump( file_exists('') ); // confirm file doesn't exist -var_dump( unlink(NULL) ); // $filename as NULL -var_dump( file_exists(NULL) ); // confirm file doesn't exist - var_dump( unlink(false) ); // $filename as boolean false var_dump( file_exists(false) ); // confirm file doesn't exist @@ -66,10 +63,6 @@ Warning: unlink(): %s in %s on line %d bool(false) bool(false) -Warning: unlink(): %s in %s on line %d -bool(false) -bool(false) - -- Testing unlink() on non-existent file -- Warning: unlink(%s/non_existent_file.tmp): No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/unlink_error-win32.phpt b/ext/standard/tests/file/unlink_error-win32.phpt index af579be58daa2..6bce3d4b80606 100644 --- a/ext/standard/tests/file/unlink_error-win32.phpt +++ b/ext/standard/tests/file/unlink_error-win32.phpt @@ -25,9 +25,6 @@ echo "\n-- Testing unlink() on invalid arguments --\n"; var_dump( unlink('') ); // $filename as empty string var_dump( file_exists('') ); // confirm file doesn't exist -var_dump( unlink(NULL) ); // $filename as NULL -var_dump( file_exists(NULL) ); // confirm file doesn't exist - var_dump( unlink(false) ); // $filename as boolean false var_dump( file_exists(false) ); // confirm file doesn't exist @@ -63,10 +60,6 @@ Warning: unlink(): %s in %s on line %d bool(false) bool(false) -Warning: unlink(): %s in %s on line %d -bool(false) -bool(false) - -- Testing unlink() on non-existent file -- Warning: unlink(%s/non_existent_file.tmp): No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/unlink_error.phpt b/ext/standard/tests/file/unlink_error.phpt index e5f809df056da..1dd8ef1a25c9e 100644 --- a/ext/standard/tests/file/unlink_error.phpt +++ b/ext/standard/tests/file/unlink_error.phpt @@ -25,9 +25,6 @@ echo "\n-- Testing unlink() on invalid arguments --\n"; var_dump( unlink('') ); // $filename as empty string var_dump( file_exists('') ); // confirm file doesn't exist -var_dump( unlink(NULL) ); // $filename as NULL -var_dump( file_exists(NULL) ); // confirm file doesn't exist - var_dump( unlink(false) ); // $filename as boolean false var_dump( file_exists(false) ); // confirm file doesn't exist @@ -62,10 +59,6 @@ Warning: unlink(): %s in %s on line %d bool(false) bool(false) -Warning: unlink(): %s in %s on line %d -bool(false) -bool(false) - -- Testing unlink() on non-existent file -- Warning: unlink(%s/non_existent_file.tmp): No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/windows_mb_path/test_long_path_bug71103.phpt b/ext/standard/tests/file/windows_mb_path/test_long_path_bug71103.phpt index a81ff66dfb5de..3e024c5e56203 100644 --- a/ext/standard/tests/file/windows_mb_path/test_long_path_bug71103.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_long_path_bug71103.phpt @@ -17,7 +17,7 @@ $d = $base . '\\dev\\http\\tproj\\app\\cache\\dev_old\\annotations\\72'; $foo = $d . '\\5b53796d666f6e795c42756e646c655c5477696742756e646c655c436f6e74726f6c6c65725c457863657074696f6e436f6e74726f6c6c657223676574416e64436c65616e4f7574707574427566666572696e67405b416e6e6f745d5d5b.doctrinecache.data'; $bar = $d . '\\5b53796d666f6e795c42756e646c655c5477696742756e646c655c436f6e74726f6c6c65725c457863657074696f6e436f6e74726f6c6c657223676574416e64436c65616e4f7574707574427566666572696e67405b416e6e6f745d5d5b315d.doctrinecache.data'; -mkdir($d, NULL, true); +mkdir($d, 0777, true); foreach (array($foo, $bar) as $f) { touch($f); diff --git a/ext/standard/tests/general_functions/escapeshellarg_variation1-win32.phpt b/ext/standard/tests/general_functions/escapeshellarg_variation1-win32.phpt index c7cab179b481c..752b1dfa7e331 100644 --- a/ext/standard/tests/general_functions/escapeshellarg_variation1-win32.phpt +++ b/ext/standard/tests/general_functions/escapeshellarg_variation1-win32.phpt @@ -10,10 +10,6 @@ if( substr(PHP_OS, 0, 3) != "WIN" ) echo "*** Testing escapeshellarg() : usage variations ***\n"; -//get an unset variable -$unset_var = 10; -unset ($unset_var); - // heredoc string $heredoc = << @$unset_var, - 'undefined var' => @$undefined_var, - 'empty string DQ' => "", - 'empty string SQ' => '', - 'uppercase NULL' => NULL, - 'lowercase null' => null - ); - - -foreach ( $variation_array as $var ) { - var_dump(get_cfg_var( $var ) ); -} -?> ---EXPECT-- -*** Test substituting argument 1 with emptyUnsetUndefNull values *** -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) diff --git a/ext/standard/tests/general_functions/getservbyname_variation10.phpt b/ext/standard/tests/general_functions/getservbyname_variation10.phpt deleted file mode 100644 index db1d47f3ef862..0000000000000 --- a/ext/standard/tests/general_functions/getservbyname_variation10.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Test function getservbyname() by substituting argument 2 with emptyUnsetUndefNull values. ---FILE-- - @$unset_var, - 'undefined var' => @$undefined_var, - 'empty string DQ' => "", - 'empty string SQ' => '', - 'uppercase NULL' => NULL, - 'lowercase null' => null, - ); - - -foreach ( $variation_array as $var ) { - var_dump(getservbyname( $service, $var ) ); -} -?> ---EXPECT-- -*** Test substituting argument 2 with emptyUnsetUndefNull values *** -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) diff --git a/ext/standard/tests/general_functions/getservbyname_variation3.phpt b/ext/standard/tests/general_functions/getservbyname_variation3.phpt deleted file mode 100644 index 6602ce0bfc04a..0000000000000 --- a/ext/standard/tests/general_functions/getservbyname_variation3.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Test function getservbyname() by substituting argument 1 with emptyUnsetUndefNull values. ---FILE-- - @$unset_var, - 'undefined var' => @$undefined_var, - 'empty string DQ' => "", - 'empty string SQ' => '', - 'uppercase NULL' => NULL, - 'lowercase null' => null, - ); - - -foreach ( $variation_array as $var ) { - var_dump(getservbyname( $var , $protocol ) ); -} -?> ---EXPECT-- -*** Test substituting argument 1 with emptyUnsetUndefNull values *** -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) diff --git a/ext/standard/tests/general_functions/getservbyport_variation1.phpt b/ext/standard/tests/general_functions/getservbyport_variation1.phpt index a6358027a5c0b..03cc5b46e9509 100644 --- a/ext/standard/tests/general_functions/getservbyport_variation1.phpt +++ b/ext/standard/tests/general_functions/getservbyport_variation1.phpt @@ -15,16 +15,13 @@ Simone Gentili (sensorario@gmail.com) ?> --FILE-- --EXPECTF-- bool(false) bool(false) bool(false) -bool(false) string(%d) "%s" diff --git a/ext/standard/tests/general_functions/uniqid_basic.phpt b/ext/standard/tests/general_functions/uniqid_basic.phpt index 0e782cdfd11ab..408f72bfdbaa3 100644 --- a/ext/standard/tests/general_functions/uniqid_basic.phpt +++ b/ext/standard/tests/general_functions/uniqid_basic.phpt @@ -6,8 +6,8 @@ echo "*** Testing uniqid() : basic functionality ***\n"; echo "\nuniqid() without a prefix\n"; var_dump(uniqid()); -var_dump(uniqid(null, true)); -var_dump(uniqid(null, false)); +var_dump(uniqid('', true)); +var_dump(uniqid('', false)); echo "\n\n"; echo "uniqid() with a prefix\n"; @@ -17,7 +17,6 @@ $prefix = array ( 99999, "99999", 10.5e2, - null, true, false ); @@ -52,10 +51,6 @@ string(17) "1050%s" string(27) "1050%s.%s" string(17) "1050%s" -string(13) "%s" -string(23) "%s.%s" -string(13) "%s" - string(14) "1%s" string(24) "1%s.%s" string(14) "1%s" @@ -63,4 +58,3 @@ string(14) "1%s" string(13) "%s" string(23) "%s.%s" string(13) "%s" - diff --git a/ext/standard/tests/image/image_type_to_extension.phpt b/ext/standard/tests/image/image_type_to_extension.phpt index 448aac4e99b33..fd60fc454e10b 100644 --- a/ext/standard/tests/image/image_type_to_extension.phpt +++ b/ext/standard/tests/image/image_type_to_extension.phpt @@ -29,7 +29,7 @@ image_type_to_extension() printf("Constant: %s\n\tWith dot: %s\n\tWithout dot: %s\n", $name, image_type_to_extension($constant), image_type_to_extension($constant, false)); } - var_dump(image_type_to_extension(1000000, NULL)); + var_dump(image_type_to_extension(1000000, false)); var_dump(image_type_to_extension(0)); ?> Done diff --git a/ext/standard/tests/math/abs_basic.phpt b/ext/standard/tests/math/abs_basic.phpt index 65120efef6cdd..2b4957b996a81 100644 --- a/ext/standard/tests/math/abs_basic.phpt +++ b/ext/standard/tests/math/abs_basic.phpt @@ -26,7 +26,7 @@ for ($i = 0; $i < count($values); $i++) { var_dump($res); } ?> ---EXPECT-- +--EXPECTF-- *** Testing abs() : basic functionality *** int(23) int(23) @@ -39,6 +39,8 @@ int(23) float(23.45) float(23.45) float(23.45) + +Deprecated: abs(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d int(0) int(1) int(0) diff --git a/ext/standard/tests/math/abs_variation.phpt b/ext/standard/tests/math/abs_variation.phpt index 6b7a184cbd93d..d7f878bc01bbc 100644 --- a/ext/standard/tests/math/abs_variation.phpt +++ b/ext/standard/tests/math/abs_variation.phpt @@ -78,13 +78,17 @@ foreach($inputs as $input) { fclose($fp); ?> ---EXPECT-- +--EXPECTF-- *** Testing abs() : usage variations *** -- Iteration 1 -- + +Deprecated: abs(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d int(0) -- Iteration 2 -- + +Deprecated: abs(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d int(0) -- Iteration 3 -- @@ -121,9 +125,13 @@ abs(): Argument #1 ($num) must be of type int|float, string given abs(): Argument #1 ($num) must be of type int|float, classA given -- Iteration 14 -- + +Deprecated: abs(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d int(0) -- Iteration 15 -- + +Deprecated: abs(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d int(0) -- Iteration 16 -- diff --git a/ext/standard/tests/math/acos_variation.phpt b/ext/standard/tests/math/acos_variation.phpt index 163487d99fd54..1fac4ccc246d5 100644 --- a/ext/standard/tests/math/acos_variation.phpt +++ b/ext/standard/tests/math/acos_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23.45", "2.345e1", "1000", - null, true, false); @@ -42,6 +41,5 @@ float(NAN) float(NAN) float(NAN) float(NAN) -float(1.5707963267948966) float(0) float(1.5707963267948966) diff --git a/ext/standard/tests/math/acosh_variation.phpt b/ext/standard/tests/math/acosh_variation.phpt index 904316a99843d..9335961e637dc 100644 --- a/ext/standard/tests/math/acosh_variation.phpt +++ b/ext/standard/tests/math/acosh_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23.45", "2.345e1", "1000", - null, true, false); @@ -42,6 +41,5 @@ float(3.8281684713331012) float(3.8475627390640357) float(3.8475627390640357) float(7.600902209541989) -float(NAN) float(0) float(NAN) diff --git a/ext/standard/tests/math/asin_variation.phpt b/ext/standard/tests/math/asin_variation.phpt index 323701c51a5d9..d0286894396e0 100644 --- a/ext/standard/tests/math/asin_variation.phpt +++ b/ext/standard/tests/math/asin_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23.45", "2.345e1", "1000", - null, true, false); @@ -42,6 +41,5 @@ float(NAN) float(NAN) float(NAN) float(NAN) -float(0) float(1.5707963267948966) float(0) diff --git a/ext/standard/tests/math/asinh_variation.phpt b/ext/standard/tests/math/asinh_variation.phpt index 4958468064bd5..e7b9fd9c543b5 100644 --- a/ext/standard/tests/math/asinh_variation.phpt +++ b/ext/standard/tests/math/asinh_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23.45", "2.345e1", "1000", - null, true, false); @@ -42,6 +41,5 @@ float(3.829113652) float(3.848471992) float(3.848471992) float(7.60090271) -float(0) float(0.881373587) float(0) diff --git a/ext/standard/tests/math/atan2_basic.phpt b/ext/standard/tests/math/atan2_basic.phpt index 1763795cfa115..1c89cfa1c2fce 100644 --- a/ext/standard/tests/math/atan2_basic.phpt +++ b/ext/standard/tests/math/atan2_basic.phpt @@ -13,7 +13,6 @@ $valuesy = array(23, "23", "23.45", "2.345e1", - null, true, false); @@ -26,7 +25,6 @@ $valuesx = array(23, "23", "23.45", "2.345e1", - null, true, false); @@ -48,7 +46,6 @@ Y:23 X:23 float(0.78539816339745) Y:23 X:23 float(0.78539816339745) Y:23 X:23.45 float(0.77571063007847) Y:23 X:2.345e1 float(0.77571063007847) -Y:23 X: float(1.5707963267949) Y:23 X:1 float(1.5273454314034) Y:23 X: float(1.5707963267949) Y:-23 X:23 float(-0.78539816339745) @@ -60,7 +57,6 @@ Y:-23 X:23 float(-0.78539816339745) Y:-23 X:23 float(-0.78539816339745) Y:-23 X:23.45 float(-0.77571063007847) Y:-23 X:2.345e1 float(-0.77571063007847) -Y:-23 X: float(-1.5707963267949) Y:-23 X:1 float(-1.5273454314034) Y:-23 X: float(-1.5707963267949) Y:23.45 X:23 float(0.79508569671643) @@ -72,7 +68,6 @@ Y:23.45 X:23 float(0.79508569671643) Y:23.45 X:23 float(0.79508569671643) Y:23.45 X:23.45 float(0.78539816339745) Y:23.45 X:2.345e1 float(0.78539816339745) -Y:23.45 X: float(1.5707963267949) Y:23.45 X:1 float(1.5281782247706) Y:23.45 X: float(1.5707963267949) Y:-23.45 X:23 float(-0.79508569671643) @@ -84,7 +79,6 @@ Y:-23.45 X:23 float(-0.79508569671643) Y:-23.45 X:23 float(-0.79508569671643) Y:-23.45 X:23.45 float(-0.78539816339745) Y:-23.45 X:2.345e1 float(-0.78539816339745) -Y:-23.45 X: float(-1.5707963267949) Y:-23.45 X:1 float(-1.5281782247706) Y:-23.45 X: float(-1.5707963267949) Y:23 X:23 float(0.78539816339745) @@ -96,7 +90,6 @@ Y:23 X:23 float(0.78539816339745) Y:23 X:23 float(0.78539816339745) Y:23 X:23.45 float(0.77571063007847) Y:23 X:2.345e1 float(0.77571063007847) -Y:23 X: float(1.5707963267949) Y:23 X:1 float(1.5273454314034) Y:23 X: float(1.5707963267949) Y:23 X:23 float(0.78539816339745) @@ -108,7 +101,6 @@ Y:23 X:23 float(0.78539816339745) Y:23 X:23 float(0.78539816339745) Y:23 X:23.45 float(0.77571063007847) Y:23 X:2.345e1 float(0.77571063007847) -Y:23 X: float(1.5707963267949) Y:23 X:1 float(1.5273454314034) Y:23 X: float(1.5707963267949) Y:23 X:23 float(0.78539816339745) @@ -120,7 +112,6 @@ Y:23 X:23 float(0.78539816339745) Y:23 X:23 float(0.78539816339745) Y:23 X:23.45 float(0.77571063007847) Y:23 X:2.345e1 float(0.77571063007847) -Y:23 X: float(1.5707963267949) Y:23 X:1 float(1.5273454314034) Y:23 X: float(1.5707963267949) Y:23.45 X:23 float(0.79508569671643) @@ -132,7 +123,6 @@ Y:23.45 X:23 float(0.79508569671643) Y:23.45 X:23 float(0.79508569671643) Y:23.45 X:23.45 float(0.78539816339745) Y:23.45 X:2.345e1 float(0.78539816339745) -Y:23.45 X: float(1.5707963267949) Y:23.45 X:1 float(1.5281782247706) Y:23.45 X: float(1.5707963267949) Y:2.345e1 X:23 float(0.79508569671643) @@ -144,21 +134,8 @@ Y:2.345e1 X:23 float(0.79508569671643) Y:2.345e1 X:23 float(0.79508569671643) Y:2.345e1 X:23.45 float(0.78539816339745) Y:2.345e1 X:2.345e1 float(0.78539816339745) -Y:2.345e1 X: float(1.5707963267949) Y:2.345e1 X:1 float(1.5281782247706) Y:2.345e1 X: float(1.5707963267949) -Y: X:23 float(0) -Y: X:-23 float(3.1415926535898) -Y: X:23.45 float(0) -Y: X:-23.45 float(3.1415926535898) -Y: X:23 float(0) -Y: X:23 float(0) -Y: X:23 float(0) -Y: X:23.45 float(0) -Y: X:2.345e1 float(0) -Y: X: float(0) -Y: X:1 float(0) -Y: X: float(0) Y:1 X:23 float(0.043450895391531) Y:1 X:-23 float(3.0981417581983) Y:1 X:23.45 float(0.042618102024328) @@ -168,7 +145,6 @@ Y:1 X:23 float(0.043450895391531) Y:1 X:23 float(0.043450895391531) Y:1 X:23.45 float(0.042618102024328) Y:1 X:2.345e1 float(0.042618102024328) -Y:1 X: float(1.5707963267949) Y:1 X:1 float(0.78539816339745) Y:1 X: float(1.5707963267949) Y: X:23 float(0) @@ -180,6 +156,5 @@ Y: X:23 float(0) Y: X:23 float(0) Y: X:23.45 float(0) Y: X:2.345e1 float(0) -Y: X: float(0) Y: X:1 float(0) Y: X: float(0) diff --git a/ext/standard/tests/math/atan_variation.phpt b/ext/standard/tests/math/atan_variation.phpt index 88593c84debfb..abd3831dddc67 100644 --- a/ext/standard/tests/math/atan_variation.phpt +++ b/ext/standard/tests/math/atan_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23.45", "2.345e1", "1000", - null, true, false); @@ -42,6 +41,5 @@ float(1.5273454314033659) float(1.528178224770569) float(1.528178224770569) float(1.5697963271282298) -float(0) float(0.7853981633974483) float(0) diff --git a/ext/standard/tests/math/atanh_variation.phpt b/ext/standard/tests/math/atanh_variation.phpt index fa71e206c8e0e..f740c1ccc00a4 100644 --- a/ext/standard/tests/math/atanh_variation.phpt +++ b/ext/standard/tests/math/atanh_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23.45", "2.345e1", "1000", - null, true, false); @@ -42,6 +41,5 @@ float(NAN) float(NAN) float(NAN) float(NAN) -float(0) float(INF) float(0) diff --git a/ext/standard/tests/math/base_convert_variation1.phpt b/ext/standard/tests/math/base_convert_variation1.phpt index 8d8e0ff3a295b..fd06465ab574b 100644 --- a/ext/standard/tests/math/base_convert_variation1.phpt +++ b/ext/standard/tests/math/base_convert_variation1.phpt @@ -4,10 +4,6 @@ Test base_convert() function : usage variations - different data types as $numbe ---EXPECT-- +--EXPECTF-- *** Testing ceil() : basic functionality *** float(0) float(0) @@ -54,4 +54,6 @@ float(-3950) float(39) float(1) float(0) + +Deprecated: ceil(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d float(0) diff --git a/ext/standard/tests/math/ceil_variation1.phpt b/ext/standard/tests/math/ceil_variation1.phpt index ce61442f6554c..7751946ea9546 100644 --- a/ext/standard/tests/math/ceil_variation1.phpt +++ b/ext/standard/tests/math/ceil_variation1.phpt @@ -71,13 +71,17 @@ foreach($inputs as $input) { }; fclose($fp); ?> ---EXPECT-- +--EXPECTF-- *** Testing ceil() : usage variations *** -- Iteration 1 -- + +Deprecated: ceil(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d float(0) -- Iteration 2 -- + +Deprecated: ceil(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d float(0) -- Iteration 3 -- @@ -114,9 +118,13 @@ ceil(): Argument #1 ($num) must be of type int|float, string given ceil(): Argument #1 ($num) must be of type int|float, classA given -- Iteration 14 -- + +Deprecated: ceil(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d float(0) -- Iteration 15 -- + +Deprecated: ceil(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d float(0) -- Iteration 16 -- diff --git a/ext/standard/tests/math/cos_variation.phpt b/ext/standard/tests/math/cos_variation.phpt index 23af5e873bc8a..19d72f60a795f 100644 --- a/ext/standard/tests/math/cos_variation.phpt +++ b/ext/standard/tests/math/cos_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23.45", "2.345e1", "1000", - null, true, false); @@ -42,6 +41,5 @@ float(-0.5328330203) float(-0.1117112391) float(-0.1117112391) float(0.5623790763) -float(1) float(0.5403023059) float(1) diff --git a/ext/standard/tests/math/cosh_variation.phpt b/ext/standard/tests/math/cosh_variation.phpt index 1a0a6b69e769a..475c19fd50d6d 100644 --- a/ext/standard/tests/math/cosh_variation.phpt +++ b/ext/standard/tests/math/cosh_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23.45", "2.345e1", "1000", - null, true, false); @@ -42,6 +41,5 @@ float(4872401723) float(7641446995) float(7641446995) float(INF) -float(1) float(1.543080635) float(1) diff --git a/ext/standard/tests/math/decbin_basic.phpt b/ext/standard/tests/math/decbin_basic.phpt index 54b771ca26c20..ff1d5896f6182 100644 --- a/ext/standard/tests/math/decbin_basic.phpt +++ b/ext/standard/tests/math/decbin_basic.phpt @@ -14,7 +14,6 @@ $values = array(10, "0x5F", true, false, - null, ); foreach ($values as $value) { @@ -39,4 +38,3 @@ string(6) "100111" decbin(): Argument #1 ($num) must be of type int, string given string(1) "1" string(1) "0" -string(1) "0" diff --git a/ext/standard/tests/math/decbin_variation1.phpt b/ext/standard/tests/math/decbin_variation1.phpt index fd9addc721c7c..5ac82d41d6a77 100644 --- a/ext/standard/tests/math/decbin_variation1.phpt +++ b/ext/standard/tests/math/decbin_variation1.phpt @@ -9,9 +9,6 @@ if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); --FILE-- ---EXPECT-- +--EXPECTF-- *** Testing floor() : basic functionality *** -- floor 0 -- @@ -94,4 +94,6 @@ float(1) float(0) -- floor -- + +Deprecated: floor(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d float(0) diff --git a/ext/standard/tests/math/floor_variation1.phpt b/ext/standard/tests/math/floor_variation1.phpt index 0b5f09f27dce5..c9ec5e710c512 100644 --- a/ext/standard/tests/math/floor_variation1.phpt +++ b/ext/standard/tests/math/floor_variation1.phpt @@ -71,13 +71,17 @@ foreach($inputs as $input) { }; fclose($fp); ?> ---EXPECT-- +--EXPECTF-- *** Testing floor() : usage variations *** -- Iteration 1 -- + +Deprecated: floor(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d float(0) -- Iteration 2 -- + +Deprecated: floor(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d float(0) -- Iteration 3 -- @@ -114,9 +118,13 @@ floor(): Argument #1 ($num) must be of type int|float, string given floor(): Argument #1 ($num) must be of type int|float, classA given -- Iteration 14 -- + +Deprecated: floor(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d float(0) -- Iteration 15 -- + +Deprecated: floor(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d float(0) -- Iteration 16 -- diff --git a/ext/standard/tests/math/fmod_basic.phpt b/ext/standard/tests/math/fmod_basic.phpt index 731b76adab13e..84cd27125c412 100644 --- a/ext/standard/tests/math/fmod_basic.phpt +++ b/ext/standard/tests/math/fmod_basic.phpt @@ -13,7 +13,6 @@ $values1 = array(234, "234", "234.5", "23.45e1", - null, true, false); @@ -26,7 +25,6 @@ $values2 = array(2, "2", "2.3", "2.3e1", - null, true, false); for ($i = 0; $i < count($values1); $i++) { @@ -49,7 +47,6 @@ float(0) float(0) float(1.700000000000018) float(4) -float(NAN) float(0) float(NAN) @@ -63,7 +60,6 @@ float(-0) float(-0) float(-1.700000000000018) float(-4) -float(NAN) float(-0) float(NAN) @@ -77,7 +73,6 @@ float(0.5) float(0.5) float(2.200000000000018) float(4.5) -float(NAN) float(0.5) float(NAN) @@ -91,7 +86,6 @@ float(-0.5) float(-0.5) float(-2.200000000000018) float(-4.5) -float(NAN) float(-0.5) float(NAN) @@ -105,7 +99,6 @@ float(0) float(0) float(1.700000000000018) float(4) -float(NAN) float(0) float(NAN) @@ -119,7 +112,6 @@ float(0) float(0) float(1.700000000000018) float(4) -float(NAN) float(0) float(NAN) @@ -133,7 +125,6 @@ float(0) float(0) float(1.700000000000018) float(4) -float(NAN) float(0) float(NAN) @@ -147,7 +138,6 @@ float(0.5) float(0.5) float(2.200000000000018) float(4.5) -float(NAN) float(0.5) float(NAN) @@ -161,25 +151,10 @@ float(0.5) float(0.5) float(2.200000000000018) float(4.5) -float(NAN) float(0.5) float(NAN) iteration 9 -float(0) -float(0) -float(0) -float(0) -float(0) -float(0) -float(0) -float(0) -float(0) -float(NAN) -float(0) -float(NAN) - -iteration 10 float(1) float(1) float(1) @@ -189,11 +164,10 @@ float(1) float(1) float(1) float(1) -float(NAN) float(0) float(NAN) -iteration 11 +iteration 10 float(0) float(0) float(0) @@ -203,6 +177,5 @@ float(0) float(0) float(0) float(0) -float(NAN) float(0) float(NAN) diff --git a/ext/standard/tests/math/hexdec_basic.phpt b/ext/standard/tests/math/hexdec_basic.phpt index 748c641a1acf6..2f06b9650aed3 100644 --- a/ext/standard/tests/math/hexdec_basic.phpt +++ b/ext/standard/tests/math/hexdec_basic.phpt @@ -23,7 +23,7 @@ $values = array(0x123abc, '011237', true, false, - null); + ); for ($i = 0; $i < count($values); $i++) { $res = hexdec($values[$i]); var_dump($res); @@ -51,4 +51,3 @@ int(18279) int(70199) int(1) int(0) -int(0) diff --git a/ext/standard/tests/math/hexdec_basic_64bit.phpt b/ext/standard/tests/math/hexdec_basic_64bit.phpt index c7c59451f554f..fd6d53b601982 100644 --- a/ext/standard/tests/math/hexdec_basic_64bit.phpt +++ b/ext/standard/tests/math/hexdec_basic_64bit.phpt @@ -25,7 +25,7 @@ $values = array(0x123abc, '011237', true, false, - null); + ); foreach($values as $value) { echo "\n-- hexdec $value --\n"; @@ -90,6 +90,3 @@ int(1) -- hexdec -- int(0) - --- hexdec -- -int(0) diff --git a/ext/standard/tests/math/hexdec_variation1.phpt b/ext/standard/tests/math/hexdec_variation1.phpt index 703d30f0862b0..65ebbe347b9b6 100644 --- a/ext/standard/tests/math/hexdec_variation1.phpt +++ b/ext/standard/tests/math/hexdec_variation1.phpt @@ -9,9 +9,6 @@ if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); --FILE-- --EXPECT-- NULL @@ -21,4 +20,3 @@ NULL NULL NULL NULL -NULL diff --git a/ext/standard/tests/math/number_format_basic.phpt b/ext/standard/tests/math/number_format_basic.phpt index b82ad5c753885..022e573b01b19 100644 --- a/ext/standard/tests/math/number_format_basic.phpt +++ b/ext/standard/tests/math/number_format_basic.phpt @@ -11,7 +11,6 @@ $values = array(1234.5678, "123456789", "123.456789", "12.3456789e1", - null, true, false); @@ -40,7 +39,7 @@ for ($i = 0; $i < count($values); $i++) { } ?> --EXPECT-- - number_format tests.....default +number_format tests.....default string(5) "1,235" string(6) "-1,235" string(10) "12,346,578" @@ -50,7 +49,6 @@ string(11) "402,653,183" string(11) "123,456,789" string(3) "123" string(3) "123" -string(1) "0" string(1) "1" string(1) "0" @@ -64,7 +62,6 @@ string(14) "402,653,183.00" string(14) "123,456,789.00" string(6) "123.46" string(6) "123.46" -string(4) "0.00" string(4) "1.00" string(4) "0.00" @@ -78,7 +75,6 @@ string(14) "402 653 183.00" string(14) "123 456 789.00" string(6) "123.46" string(6) "123.46" -string(4) "0.00" string(4) "1.00" string(4) "0.00" @@ -92,6 +88,5 @@ string(14) "402 653 183,00" string(14) "123 456 789,00" string(6) "123,46" string(6) "123,46" -string(4) "0,00" string(4) "1,00" string(4) "0,00" diff --git a/ext/standard/tests/math/number_format_multichar.phpt b/ext/standard/tests/math/number_format_multichar.phpt index 5648257e0313a..1ed823042f18e 100644 --- a/ext/standard/tests/math/number_format_multichar.phpt +++ b/ext/standard/tests/math/number_format_multichar.phpt @@ -11,7 +11,6 @@ $values = array(1234.5678, "123456789", "123.456789", "12.3456789e1", - null, true, false); @@ -34,7 +33,7 @@ for ($i = 0; $i < count($values); $i++) { } ?> --EXPECT-- - number_format tests.....multiple character decimal point +number_format tests.....multiple character decimal point string(13) "1 234·57" string(14) "-1 234·57" string(18) "12 346 578·00" @@ -44,7 +43,6 @@ string(19) "402 653 183·00" string(19) "123 456 789·00" string(11) "123·46" string(11) "123·46" -string(9) "0·00" string(9) "1·00" string(9) "0·00" @@ -58,7 +56,6 @@ string(28) "402 653 183.00" string(28) "123 456 789.00" string(6) "123.46" string(6) "123.46" -string(4) "0.00" string(4) "1.00" string(4) "0.00" @@ -72,6 +69,5 @@ string(33) "402 653 183·00" string(33) "123 456 789·00" string(11) "123·46" string(11) "123·46" -string(9) "0·00" string(9) "1·00" string(9) "0·00" diff --git a/ext/standard/tests/math/octdec_basic.phpt b/ext/standard/tests/math/octdec_basic.phpt index 1daf9a4338b34..4c3ffc8b8a91b 100644 --- a/ext/standard/tests/math/octdec_basic.phpt +++ b/ext/standard/tests/math/octdec_basic.phpt @@ -22,7 +22,7 @@ $values = array(01234567, 31.1013e5, true, false, - null); + ); for ($i = 0; $i < count($values); $i++) { $res = octdec($values[$i]); @@ -57,4 +57,3 @@ int(102923) int(823384) int(1) int(0) -int(0) diff --git a/ext/standard/tests/math/octdec_basic_64bit.phpt b/ext/standard/tests/math/octdec_basic_64bit.phpt index bb8f70085d875..4051d9be63230 100644 --- a/ext/standard/tests/math/octdec_basic_64bit.phpt +++ b/ext/standard/tests/math/octdec_basic_64bit.phpt @@ -25,7 +25,7 @@ $values = array(01234567, 31.1013e5, true, false, - null); + ); for ($i = 0; $i < count($values); $i++) { $res = octdec($values[$i]); @@ -62,4 +62,3 @@ int(102923) int(823384) int(1) int(0) -int(0) diff --git a/ext/standard/tests/math/octdec_variation1.phpt b/ext/standard/tests/math/octdec_variation1.phpt index 6ee2b6f91cf55..c24d2e8e6beae 100644 --- a/ext/standard/tests/math/octdec_variation1.phpt +++ b/ext/standard/tests/math/octdec_variation1.phpt @@ -5,9 +5,6 @@ precision=14 --FILE-- float(123456789) ...with precision 3.6-> float(123456789) ...with precision 2.1e1-> float(123456789) -...with precision -> float(123456789) ...with precision 1-> float(123456789) ...with precision -> float(123456789) round: 123.456789 @@ -63,7 +61,6 @@ round: 123.456789 ...with precision 04-> float(123.4568) ...with precision 3.6-> float(123.457) ...with precision 2.1e1-> float(123.456789) -...with precision -> float(123) ...with precision 1-> float(123.5) ...with precision -> float(123) round: -4.5679123 @@ -76,7 +73,6 @@ round: -4.5679123 ...with precision 04-> float(-4.5679) ...with precision 3.6-> float(-4.568) ...with precision 2.1e1-> float(-4.5679123) -...with precision -> float(-5) ...with precision 1-> float(-4.6) ...with precision -> float(-5) round: 12300 @@ -89,7 +85,6 @@ round: 12300 ...with precision 04-> float(12300) ...with precision 3.6-> float(12300) ...with precision 2.1e1-> float(12300) -...with precision -> float(12300) ...with precision 1-> float(12300) ...with precision -> float(12300) round: -4567 @@ -102,7 +97,6 @@ round: -4567 ...with precision 04-> float(-4567) ...with precision 3.6-> float(-4567) ...with precision 2.1e1-> float(-4567) -...with precision -> float(-4567) ...with precision 1-> float(-4567) ...with precision -> float(-4567) round: 2311527 @@ -115,7 +109,6 @@ round: 2311527 ...with precision 04-> float(2311527) ...with precision 3.6-> float(2311527) ...with precision 2.1e1-> float(2311527) -...with precision -> float(2311527) ...with precision 1-> float(2311527) ...with precision -> float(2311527) round: 14680063 @@ -128,7 +121,6 @@ round: 14680063 ...with precision 04-> float(14680063) ...with precision 3.6-> float(14680063) ...with precision 2.1e1-> float(14680063) -...with precision -> float(14680063) ...with precision 1-> float(14680063) ...with precision -> float(14680063) round: 1.234567 @@ -141,7 +133,6 @@ round: 1.234567 ...with precision 04-> float(1.2346) ...with precision 3.6-> float(1.235) ...with precision 2.1e1-> float(1.234567) -...with precision -> float(1) ...with precision 1-> float(1.2) ...with precision -> float(1) round: 2.3456789e8 @@ -154,6 +145,5 @@ round: 2.3456789e8 ...with precision 04-> float(234567890) ...with precision 3.6-> float(234567890) ...with precision 2.1e1-> float(234567890) -...with precision -> float(234567890) ...with precision 1-> float(234567890) ...with precision -> float(234567890) diff --git a/ext/standard/tests/math/round_variation1.phpt b/ext/standard/tests/math/round_variation1.phpt index b6ce56dd4acad..2a2adf27cae09 100644 --- a/ext/standard/tests/math/round_variation1.phpt +++ b/ext/standard/tests/math/round_variation1.phpt @@ -85,7 +85,7 @@ foreach($inputs as $input) { }; fclose($fp); ?> ---EXPECT-- +--EXPECTF-- *** Testing round() : usage variations *** -- Iteration 1 -- @@ -119,9 +119,13 @@ float(1.23457E-9) float(0.5) -- Iteration 11 -- + +Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d float(0) -- Iteration 12 -- + +Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d float(0) -- Iteration 13 -- @@ -158,9 +162,13 @@ round(): Argument #1 ($num) must be of type int|float, string given round(): Argument #1 ($num) must be of type int|float, classA given -- Iteration 24 -- + +Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d float(0) -- Iteration 25 -- + +Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d float(0) -- Iteration 26 -- diff --git a/ext/standard/tests/math/sin_variation.phpt b/ext/standard/tests/math/sin_variation.phpt index 84c5b60c7b324..6cca50a167730 100644 --- a/ext/standard/tests/math/sin_variation.phpt +++ b/ext/standard/tests/math/sin_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23.45", "2.345e1", "1000", - null, true, false); @@ -42,6 +41,5 @@ float(-0.8462204042) float(-0.9937407102) float(-0.9937407102) float(0.8268795405) -float(0) float(0.8414709848) float(0) diff --git a/ext/standard/tests/math/sinh_variation.phpt b/ext/standard/tests/math/sinh_variation.phpt index 4a26efb50a7de..f053e58144ee1 100644 --- a/ext/standard/tests/math/sinh_variation.phpt +++ b/ext/standard/tests/math/sinh_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23.45", "2.345e1", "1000", - null, true, false); @@ -42,6 +41,5 @@ float(4872401723) float(7641446995) float(7641446995) float(INF) -float(0) float(1.175201194) float(0) diff --git a/ext/standard/tests/math/sqrt_variation.phpt b/ext/standard/tests/math/sqrt_variation.phpt index b0683b701a1b0..eb73870d1fc3c 100644 --- a/ext/standard/tests/math/sqrt_variation.phpt +++ b/ext/standard/tests/math/sqrt_variation.phpt @@ -22,7 +22,6 @@ $values = array(23, "23.45", "2.345e1", "1000", - null, true, false); @@ -44,6 +43,5 @@ float(4.795831523312719) float(4.8425200051213) float(4.8425200051213) float(31.622776601683793) -float(0) float(1) float(0) diff --git a/ext/standard/tests/math/srand_basic.phpt b/ext/standard/tests/math/srand_basic.phpt index d3a5447553dce..ce9a4e3f97ad9 100644 --- a/ext/standard/tests/math/srand_basic.phpt +++ b/ext/standard/tests/math/srand_basic.phpt @@ -13,7 +13,6 @@ var_dump(srand("500")); var_dump(srand("500E3")); var_dump(srand(true)); var_dump(srand(false)); -var_dump(srand(NULL)); ?> --EXPECT-- *** Testing srand() : basic functionality *** @@ -24,4 +23,3 @@ NULL NULL NULL NULL -NULL diff --git a/ext/standard/tests/math/tan_variation.phpt b/ext/standard/tests/math/tan_variation.phpt index 602db48e494bb..4394ddcd57a83 100644 --- a/ext/standard/tests/math/tan_variation.phpt +++ b/ext/standard/tests/math/tan_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23.45", "2.345e1", "1000", - null, true, false); @@ -42,6 +41,5 @@ float(1.588153083) float(8.895619796) float(8.895619796) float(1.470324156) -float(0) float(1.557407725) float(0) diff --git a/ext/standard/tests/math/tanh_variation.phpt b/ext/standard/tests/math/tanh_variation.phpt index aab33fea60d9c..d2011f4745727 100644 --- a/ext/standard/tests/math/tanh_variation.phpt +++ b/ext/standard/tests/math/tanh_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23.45", "2.345e1", "1000", - null, true, false); @@ -42,6 +41,5 @@ float(1) float(1) float(1) float(1) -float(0) float(0.7615941559557649) float(0) diff --git a/ext/standard/tests/password/password_verify.phpt b/ext/standard/tests/password/password_verify.phpt index a196763c1362e..5f2ff1230cc63 100644 --- a/ext/standard/tests/password/password_verify.phpt +++ b/ext/standard/tests/password/password_verify.phpt @@ -20,11 +20,13 @@ var_dump(password_verify("foo", "$1")); echo "OK!"; ?> ---EXPECT-- +--EXPECTF-- bool(false) bool(false) bool(false) bool(true) + +Deprecated: password_verify(): Passing null to parameter #2 ($hash) of type string is deprecated in %s on line %d bool(false) bool(true) bool(false) diff --git a/ext/standard/tests/strings/addcslashes_001.phpt b/ext/standard/tests/strings/addcslashes_001.phpt index be6b18559faa6..e8fdf2b69ad28 100644 Binary files a/ext/standard/tests/strings/addcslashes_001.phpt and b/ext/standard/tests/strings/addcslashes_001.phpt differ diff --git a/ext/standard/tests/strings/addcslashes_003.phpt b/ext/standard/tests/strings/addcslashes_003.phpt index f743726301f3b..7736a9f58f99c 100644 Binary files a/ext/standard/tests/strings/addcslashes_003.phpt and b/ext/standard/tests/strings/addcslashes_003.phpt differ diff --git a/ext/standard/tests/strings/basename_variation.phpt b/ext/standard/tests/strings/basename_variation.phpt index eae1f7fa511b6..c34b643600694 100644 --- a/ext/standard/tests/strings/basename_variation.phpt +++ b/ext/standard/tests/strings/basename_variation.phpt @@ -6,13 +6,11 @@ $file_path_variations = array ( /* paths with shortcut home dir char, with suffix variation */ array("~/home/user/bar"), array("~/home/user/bar", ""), - array("~/home/user/bar", NULL), array("~/home/user/bar", ' '), array("~/home/user/bar.tar", ".tar"), array("~/home/user/bar.tar", "~"), array("~/home/user/bar.tar/", "~"), array("~/home/user/bar.tar/", ""), - array("~/home/user/bar.tar", NULL), array("~/home/user/bar.tar", ''), array("~/home/user/bar.tar", " "), @@ -29,7 +27,6 @@ $file_path_variations = array ( array("hostname:/home/user/My Pics.gz/", "Pics.gz"), array("hostname:/home/user/My Pics.gz/", ".gz"), array("hostname:/home/user/My Pics.gz/"), - array("hostname:/home/user/My Pics.gz/", NULL), array("hostname:/home/user/My Pics.gz/", ' '), array("hostname:/home/user/My Pics.gz/", ''), array("hostname:/home/user/My Pics.gz/", "My Pics.gz"), @@ -52,7 +49,6 @@ $file_path_variations = array ( array("/bar.gz/", "/bar.gz/"), array(" ", " "), array(' ', ' '), - array(NULL, NULL), /* path with spaces */ array(" "), @@ -61,7 +57,6 @@ $file_path_variations = array ( /* empty paths */ array(""), array(''), - array(NULL), ); function check_basename( $path_arrays ) { @@ -97,7 +92,7 @@ string(3) "bar" string(3) "bar" --Iteration 5-- -string(3) "bar" +string(7) "bar.tar" --Iteration 6-- string(7) "bar.tar" @@ -118,13 +113,13 @@ string(7) "bar.tar" string(7) "bar.tar" --Iteration 12-- -string(7) "bar.tar" +string(1) "t" --Iteration 13-- -string(7) "bar.tar" +string(7) "tbar.gz" --Iteration 14-- -string(1) "t" +string(7) "tbar.gz" --Iteration 15-- string(7) "tbar.gz" @@ -133,22 +128,22 @@ string(7) "tbar.gz" string(7) "tbar.gz" --Iteration 17-- -string(7) "tbar.gz" +string(10) "My Pics.gz" --Iteration 18-- -string(7) "tbar.gz" +string(10) "My Pics.gz" --Iteration 19-- -string(10) "My Pics.gz" +string(3) "My " --Iteration 20-- -string(10) "My Pics.gz" +string(7) "My Pics" --Iteration 21-- -string(3) "My " +string(10) "My Pics.gz" --Iteration 22-- -string(7) "My Pics" +string(10) "My Pics.gz" --Iteration 23-- string(10) "My Pics.gz" @@ -157,16 +152,16 @@ string(10) "My Pics.gz" string(10) "My Pics.gz" --Iteration 25-- -string(10) "My Pics.gz" +string(4) "10.5" --Iteration 26-- -string(10) "My Pics.gz" +string(2) "10" --Iteration 27-- -string(10) "My Pics.gz" +string(4) "10.5" --Iteration 28-- -string(4) "10.5" +string(2) "10" --Iteration 29-- string(2) "10" @@ -175,56 +170,41 @@ string(2) "10" string(4) "10.5" --Iteration 31-- -string(2) "10" +string(4) "10.5" --Iteration 32-- -string(2) "10" +string(5) "10.gz" --Iteration 33-- -string(4) "10.5" +string(1) "0" --Iteration 34-- -string(4) "10.5" +string(1) "0" --Iteration 35-- -string(5) "10.gz" +string(6) "bar.gz" --Iteration 36-- -string(1) "0" +string(6) "bar.gz" --Iteration 37-- -string(1) "0" +string(6) "bar.gz" --Iteration 38-- -string(6) "bar.gz" +string(1) " " --Iteration 39-- -string(6) "bar.gz" +string(1) " " --Iteration 40-- -string(6) "bar.gz" +string(1) " " --Iteration 41-- string(1) " " --Iteration 42-- -string(1) " " - ---Iteration 43-- string(0) "" ---Iteration 44-- -string(1) " " - ---Iteration 45-- -string(1) " " - ---Iteration 46-- -string(0) "" - ---Iteration 47-- -string(0) "" - ---Iteration 48-- +--Iteration 43-- string(0) "" Done diff --git a/ext/standard/tests/strings/bug21338.phpt b/ext/standard/tests/strings/bug21338.phpt index c118ee18de83a..2809d430896da 100644 --- a/ext/standard/tests/strings/bug21338.phpt +++ b/ext/standard/tests/strings/bug21338.phpt @@ -2,9 +2,7 @@ Bug #20934 (html_entity_decode() crash when "" is passed) --FILE-- --EXPECT-- string(0) "" -string(0) "" diff --git a/ext/standard/tests/strings/bug51899.phpt b/ext/standard/tests/strings/bug51899.phpt index fb430cf30d5a2..55fd535f42a76 100644 --- a/ext/standard/tests/strings/bug51899.phpt +++ b/ext/standard/tests/strings/bug51899.phpt @@ -8,7 +8,6 @@ var_dump(parse_ini_string('a= ')); var_dump(parse_ini_string('a='.PHP_EOL)); var_dump(parse_ini_string('a=b ')); var_dump(parse_ini_string('')); -var_dump(parse_ini_string(NULL)); var_dump(parse_ini_string("\0")); ?> @@ -33,5 +32,3 @@ array(0) { } array(0) { } -array(0) { -} diff --git a/ext/standard/tests/strings/chop_variation5.phpt b/ext/standard/tests/strings/chop_variation5.phpt index c0fe43976fe6b..2b86a9713b77f 100644 --- a/ext/standard/tests/strings/chop_variation5.phpt +++ b/ext/standard/tests/strings/chop_variation5.phpt @@ -10,7 +10,6 @@ echo "*** Testing chop() : with miscellaneous arguments ***\n"; var_dump ( chop("chop test \t\0 ") ); /* without second Argument */ var_dump ( chop("chop test " , "") ); /* no characters in second Argument */ - var_dump ( chop("chop test ", NULL) ); /* with NULL as second Argument */ var_dump ( chop("chop test ", true) ); /* with boolean value as second Argument */ var_dump ( chop("chop test ", " ") ); /* with single space as second Argument */ var_dump ( chop("chop test \t\n\r\0\x0B", "\t\n\r\0\x0B") ); /* with multiple escape sequences as second Argument */ @@ -25,7 +24,6 @@ echo "Done\n"; string(9) "chop test" string(12) "chop test " string(17) "chop test " -string(17) "chop test " string(9) "chop test" string(10) "chop test " string(9) "chop test" diff --git a/ext/standard/tests/strings/chr_variation1.phpt b/ext/standard/tests/strings/chr_variation1.phpt index f9df308a7a77f..13a0636b8af9f 100644 --- a/ext/standard/tests/strings/chr_variation1.phpt +++ b/ext/standard/tests/strings/chr_variation1.phpt @@ -5,10 +5,6 @@ Test chr() function : usage variations - test values for $ascii argument echo "*** Testing chr() function: with unexpected inputs for 'ascii' argument ***\n"; -//get an unset variable -$unset_var = 'string_val'; -unset($unset_var); - //defining a class class sample { public function __toString() { @@ -38,16 +34,6 @@ $inputs = array ( false, TRUE, FALSE, - - // null values -/*15*/ NULL, - null, - - // undefined variable -/*19*/ @$undefined_var, - - // unset variable -/*20*/ @$unset_var ); // loop through with each element of the $inputs array to test chr() function @@ -85,11 +71,3 @@ string(2) "00" string(2) "01" -- Iteration 11 -- string(2) "00" --- Iteration 12 -- -string(2) "00" --- Iteration 13 -- -string(2) "00" --- Iteration 14 -- -string(2) "00" --- Iteration 15 -- -string(2) "00" diff --git a/ext/standard/tests/strings/dirname_variation.phpt b/ext/standard/tests/strings/dirname_variation.phpt index 5b8e22f5ae594..96140b755ec5b 100644 --- a/ext/standard/tests/strings/dirname_variation.phpt +++ b/ext/standard/tests/strings/dirname_variation.phpt @@ -43,8 +43,6 @@ $file_path_variations = array ( /* empty path */ "", '', - NULL, - null ); function check_dirname( $paths ) { @@ -131,10 +129,4 @@ string\(0\) "" --Iteration 22 -- string\(0\) "" - ---Iteration 23 -- -string\(0\) "" - ---Iteration 24 -- -string\(0\) "" Done diff --git a/ext/standard/tests/strings/htmlentities24.phpt b/ext/standard/tests/strings/htmlentities24.phpt index 9ba54680409af..8754257d7fbf4 100644 --- a/ext/standard/tests/strings/htmlentities24.phpt +++ b/ext/standard/tests/strings/htmlentities24.phpt @@ -13,11 +13,9 @@ for($i=0; $i<256; $i++) /* giving arguments as NULL */ echo "\n*** Testing htmlentities() with NULL as first,second and third argument ***\n"; -var_dump( htmlentities("\x82\x86\x99\x9f\x80\x82\x81", NULL, 'cp1252') ); var_dump( htmlentities("\x82\x86\x99\x9f\x80\x82\x81", ENT_QUOTES, NULL) ); /* UTF-8 assumed */ var_dump( htmlentities("\x82\x86\x99\x9f\x80\x82\x81", ENT_NOQUOTES, NULL) ); /* UTF-8 assumed */ var_dump( htmlentities("\x82\x86\x99\x9f\x80\x82\x81", ENT_COMPAT, NULL) ); /* UTF-8 assumed */ -var_dump( htmlentities(NULL, NULL, NULL) ); /* giving long string to check for proper memory re-allocation */ echo "\n*** Checking for proper memory allocation with long string ***\n"; @@ -297,8 +295,6 @@ string(16) "6368722832353429" string(16) "6368722832353529" *** Testing htmlentities() with NULL as first,second and third argument *** -string(42) "‚†™Ÿ€‚" -string(0) "" string(0) "" string(0) "" string(0) "" diff --git a/ext/standard/tests/strings/htmlspecialchars.phpt b/ext/standard/tests/strings/htmlspecialchars.phpt index 5844fdadb04c3..775cb2f4d4b87 100644 --- a/ext/standard/tests/strings/htmlspecialchars.phpt +++ b/ext/standard/tests/strings/htmlspecialchars.phpt @@ -9,11 +9,9 @@ var_dump( bin2hex( htmlspecialchars("chr($i)") ) ); /* giving NULL as the argument */ echo "\n*** Testing htmlspecialchars() with NULL as first, second and third argument ***\n"; -var_dump( htmlspecialchars("
", NULL, 'iso-8859-1') ); var_dump( htmlspecialchars("
", ENT_NOQUOTES, NULL) ); var_dump( htmlspecialchars("
", ENT_QUOTES, NULL) ); var_dump( htmlspecialchars("
", ENT_COMPAT, NULL) ); -var_dump( htmlspecialchars(NULL, NULL, NULL) ); /* giving long string to check for proper memory re-allocation */ echo "\n*** Checking a long string for proper memory allocation ***\n"; @@ -296,8 +294,6 @@ string(16) "6368722832353529" string(10) "<br>" string(10) "<br>" string(10) "<br>" -string(10) "<br>" -string(0) "" *** Checking a long string for proper memory allocation *** string(187) "<br>Testing<p>New file.</p><p><br>File <b><i><u>WORKS!!!</i></u></b></p><br><p>End of file!!!</p>" diff --git a/ext/standard/tests/strings/implode1.phpt b/ext/standard/tests/strings/implode1.phpt index c1c1599eb7b56..ca121102112c5 100644 Binary files a/ext/standard/tests/strings/implode1.phpt and b/ext/standard/tests/strings/implode1.phpt differ diff --git a/ext/standard/tests/strings/join_variation1.phpt b/ext/standard/tests/strings/join_variation1.phpt index 7a806349ce9cb..256f361460b24 100644 --- a/ext/standard/tests/strings/join_variation1.phpt +++ b/ext/standard/tests/strings/join_variation1.phpt @@ -10,10 +10,6 @@ echo "*** Testing join() : usage variations ***\n"; // initialize all required variables $pieces = array("element1", "element2"); -// get an unset variable -$unset_var = 'string_val'; -unset($unset_var); - // get a resource variable $fp = fopen(__FILE__, "r"); @@ -62,18 +58,8 @@ $values = array ( "", '', - // null values - NULL, - null, - // resource variable $fp, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var ); @@ -143,13 +129,5 @@ string(16) "element1element2" -- Iteration 21 -- string(16) "element1element2" -- Iteration 22 -- -string(16) "element1element2" --- Iteration 23 -- -string(16) "element1element2" --- Iteration 24 -- join(): Argument #1 ($separator) must be of type array|string, resource given --- Iteration 25 -- -string(16) "element1element2" --- Iteration 26 -- -string(16) "element1element2" Done diff --git a/ext/standard/tests/strings/join_variation4.phpt b/ext/standard/tests/strings/join_variation4.phpt index 8c8c8b9092d94..314345547cc9d 100644 Binary files a/ext/standard/tests/strings/join_variation4.phpt and b/ext/standard/tests/strings/join_variation4.phpt differ diff --git a/ext/standard/tests/strings/lcfirst.phpt b/ext/standard/tests/strings/lcfirst.phpt index 359d210e7476c..fc0b954199f2a 100644 Binary files a/ext/standard/tests/strings/lcfirst.phpt and b/ext/standard/tests/strings/lcfirst.phpt differ diff --git a/ext/standard/tests/strings/ltrim.phpt b/ext/standard/tests/strings/ltrim.phpt index 8ac57ca92eb44..952ad282c6fe7 100644 --- a/ext/standard/tests/strings/ltrim.phpt +++ b/ext/standard/tests/strings/ltrim.phpt @@ -23,7 +23,6 @@ var_dump( ltrim($str, "\nusi") ); echo "\n *** Output for Normal Behaviour ***\n"; var_dump ( ltrim(" \t\0 ltrim test") ); /* without second Argument */ var_dump ( ltrim(" ltrim test" , "") ); /* no characters in second Argument */ - var_dump ( ltrim(" ltrim test", NULL) ); /* with NULL as second Argument */ var_dump ( ltrim(" ltrim test", true) ); /* with boolean value as second Argument */ var_dump ( ltrim(" ltrim test", " ") ); /* with single space as second Argument */ var_dump ( ltrim("\t\n\r\0\x0B ltrim test", "\t\n\r\0\x0B") ); /* with multiple escape sequences as second Argument */ @@ -32,11 +31,8 @@ var_dump( ltrim($str, "\nusi") ); var_dump ( ltrim("@$#ltrim test", "#@$") ); /* with some special characters as second Argument */ - echo "\n *** Output for scalar argument) ***\n"; - var_dump( ltrim( 12345 ) ); /* Scalar argument */ - - echo "\n *** Output for NULL argument) ***\n"; - var_dump( ltrim(NULL) ); /* NULL Argument */ +echo "\n *** Output for scalar argument) ***\n"; +var_dump( ltrim( 12345 ) ); /* Scalar argument */ echo "\nDone\n"; @@ -51,7 +47,6 @@ string(17) "ng heredoc string" string(10) "ltrim test" string(13) " ltrim test" string(18) " ltrim test" -string(18) " ltrim test" string(10) "ltrim test" string(11) " ltrim test" string(10) "ltrim test" @@ -61,7 +56,4 @@ string(10) "ltrim test" *** Output for scalar argument) *** string(5) "12345" - *** Output for NULL argument) *** -string(0) "" - Done diff --git a/ext/standard/tests/strings/md5_file.phpt b/ext/standard/tests/strings/md5_file.phpt index 26eb03bc5a5b3..c975c85cb7190 100644 Binary files a/ext/standard/tests/strings/md5_file.phpt and b/ext/standard/tests/strings/md5_file.phpt differ diff --git a/ext/standard/tests/strings/nl2br.phpt b/ext/standard/tests/strings/nl2br.phpt index b2ff9cf0900d2..c90788fd66e42 100644 --- a/ext/standard/tests/strings/nl2br.phpt +++ b/ext/standard/tests/strings/nl2br.phpt @@ -4,7 +4,6 @@ nl2br() function " string(7) "
diff --git a/ext/standard/tests/strings/number_format_basic.phpt b/ext/standard/tests/strings/number_format_basic.phpt index 2566f365741b1..2e54eb1f0d5ae 100644 --- a/ext/standard/tests/strings/number_format_basic.phpt +++ b/ext/standard/tests/strings/number_format_basic.phpt @@ -13,7 +13,6 @@ $values = array(1234.5678, "123456789", "123.456789", "12.3456789e1", - null, true, false); @@ -54,7 +53,6 @@ string(11) "402,653,183" string(11) "123,456,789" string(3) "123" string(3) "123" -string(1) "0" string(1) "1" string(1) "0" @@ -68,7 +66,6 @@ string(14) "402,653,183.00" string(14) "123,456,789.00" string(6) "123.46" string(6) "123.46" -string(4) "0.00" string(4) "1.00" string(4) "0.00" @@ -82,7 +79,6 @@ string(14) "402 653 183.00" string(14) "123 456 789.00" string(6) "123.46" string(6) "123.46" -string(4) "0.00" string(4) "1.00" string(4) "0.00" @@ -96,6 +92,5 @@ string(14) "402 653 183,00" string(14) "123 456 789,00" string(6) "123,46" string(6) "123,46" -string(4) "0,00" string(4) "1,00" string(4) "0,00" diff --git a/ext/standard/tests/strings/printf.phpt b/ext/standard/tests/strings/printf.phpt index db47f58c53ba3..8ff95eb5d6519 100644 --- a/ext/standard/tests/strings/printf.phpt +++ b/ext/standard/tests/strings/printf.phpt @@ -50,11 +50,6 @@ try { echo "\n*** Output for scalar argument ***\n"; printf(3); -/* NULL argument */ -echo "\n*** Output for NULL as argument ***\n"; -printf(NULL); - - /* Float type variations */ $counter = 1; @@ -244,8 +239,6 @@ printf() expects at least %d argument, %d given Error found: 5 arguments are required, 3 given *** Output for scalar argument *** 3 -*** Output for NULL as argument *** - *** Output for float type *** diff --git a/ext/standard/tests/strings/printf_64bit.phpt b/ext/standard/tests/strings/printf_64bit.phpt index 2886799cc7ede..a37ad49c3dee1 100644 --- a/ext/standard/tests/strings/printf_64bit.phpt +++ b/ext/standard/tests/strings/printf_64bit.phpt @@ -50,11 +50,6 @@ try { echo "\n*** Output for scalar argument ***\n"; printf(3); -/* NULL argument */ -echo "\n*** Output for NULL as argument ***\n"; -printf(NULL); - - /* Float type variations */ $counter = 1; @@ -244,8 +239,6 @@ printf() expects at least 1 argument, 0 given Error found: 5 arguments are required, 3 given *** Output for scalar argument *** 3 -*** Output for NULL as argument *** - *** Output for float type *** diff --git a/ext/standard/tests/strings/printf_variation1.phpt b/ext/standard/tests/strings/printf_variation1.phpt deleted file mode 100644 index 55237168c56fd..0000000000000 --- a/ext/standard/tests/strings/printf_variation1.phpt +++ /dev/null @@ -1,311 +0,0 @@ ---TEST-- -Test printf() function : usage variations - unexpected values for format argument ---FILE-- - 'red', 'item' => 'pen'), - - // null data -/*15*/ NULL, - null, - - // boolean data -/*17*/ true, - false, - TRUE, - FALSE, - - // empty data -/*21*/ "", - '', - - // object data -/*23*/ new sample(), - - // undefined data -/*24*/ @$undefined_var, - - // unset data -/*25*/ @$unset_var, - - // resource data -/*26*/ $file_handle -); - -// loop through each element of the array for format - -$count = 1; -foreach($values as $value) { - echo "\n-- Iteration $count --\n"; - - // with default argument - try { - $result = printf($value); - echo "\n"; - var_dump($result); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; - } - - // with two arguments - try { - $result = printf($value, $arg1); - echo "\n"; - var_dump($result); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; - } - - // with three arguments - try { - $result = printf($value, $arg1, $arg2); - echo "\n"; - var_dump($result); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; - } - - $count++; -}; - -// close the resource -fclose($file_handle); - -?> ---EXPECT-- -*** Testing printf() : with unexpected values for format argument *** - --- Iteration 1 -- -0 -int(1) -0 -int(1) -0 -int(1) - --- Iteration 2 -- -1 -int(1) -1 -int(1) -1 -int(1) - --- Iteration 3 -- -12345 -int(5) -12345 -int(5) -12345 -int(5) - --- Iteration 4 -- --2345 -int(5) --2345 -int(5) --2345 -int(5) - --- Iteration 5 -- -10.5 -int(4) -10.5 -int(4) -10.5 -int(4) - --- Iteration 6 -- --10.5 -int(5) --10.5 -int(5) --10.5 -int(5) - --- Iteration 7 -- -101234567000 -int(12) -101234567000 -int(12) -101234567000 -int(12) - --- Iteration 8 -- -1.07654321E-9 -int(13) -1.07654321E-9 -int(13) -1.07654321E-9 -int(13) - --- Iteration 9 -- -0.5 -int(3) -0.5 -int(3) -0.5 -int(3) - --- Iteration 10 -- -printf(): Argument #1 ($format) must be of type string, array given -printf(): Argument #1 ($format) must be of type string, array given -printf(): Argument #1 ($format) must be of type string, array given - --- Iteration 11 -- -printf(): Argument #1 ($format) must be of type string, array given -printf(): Argument #1 ($format) must be of type string, array given -printf(): Argument #1 ($format) must be of type string, array given - --- Iteration 12 -- -printf(): Argument #1 ($format) must be of type string, array given -printf(): Argument #1 ($format) must be of type string, array given -printf(): Argument #1 ($format) must be of type string, array given - --- Iteration 13 -- -printf(): Argument #1 ($format) must be of type string, array given -printf(): Argument #1 ($format) must be of type string, array given -printf(): Argument #1 ($format) must be of type string, array given - --- Iteration 14 -- -printf(): Argument #1 ($format) must be of type string, array given -printf(): Argument #1 ($format) must be of type string, array given -printf(): Argument #1 ($format) must be of type string, array given - --- Iteration 15 -- - -int(0) - -int(0) - -int(0) - --- Iteration 16 -- - -int(0) - -int(0) - -int(0) - --- Iteration 17 -- -1 -int(1) -1 -int(1) -1 -int(1) - --- Iteration 18 -- - -int(0) - -int(0) - -int(0) - --- Iteration 19 -- -1 -int(1) -1 -int(1) -1 -int(1) - --- Iteration 20 -- - -int(0) - -int(0) - -int(0) - --- Iteration 21 -- - -int(0) - -int(0) - -int(0) - --- Iteration 22 -- - -int(0) - -int(0) - -int(0) - --- Iteration 23 -- -Object -int(6) -Object -int(6) -Object -int(6) - --- Iteration 24 -- - -int(0) - -int(0) - -int(0) - --- Iteration 25 -- - -int(0) - -int(0) - -int(0) - --- Iteration 26 -- -printf(): Argument #1 ($format) must be of type string, resource given -printf(): Argument #1 ($format) must be of type string, resource given -printf(): Argument #1 ($format) must be of type string, resource given diff --git a/ext/standard/tests/strings/quoted_printable_encode_001.phpt b/ext/standard/tests/strings/quoted_printable_encode_001.phpt index df26d5cf4b26a..a1e0ec1338aa2 100644 --- a/ext/standard/tests/strings/quoted_printable_encode_001.phpt +++ b/ext/standard/tests/strings/quoted_printable_encode_001.phpt @@ -7,7 +7,6 @@ var_dump(quoted_printable_encode("")); var_dump(quoted_printable_encode("test")); var_dump(quoted_printable_encode(1)); -var_dump(quoted_printable_encode(NULL)); var_dump(quoted_printable_encode(false)); echo "Done\n"; @@ -17,5 +16,4 @@ string(0) "" string(4) "test" string(1) "1" string(0) "" -string(0) "" Done diff --git a/ext/standard/tests/strings/rtrim.phpt b/ext/standard/tests/strings/rtrim.phpt index 2fc531faada71..b4cd2ac6acd51 100644 Binary files a/ext/standard/tests/strings/rtrim.phpt and b/ext/standard/tests/strings/rtrim.phpt differ diff --git a/ext/standard/tests/strings/sha1_file.phpt b/ext/standard/tests/strings/sha1_file.phpt index 55130cb98a7f8..62419d708f220 100644 --- a/ext/standard/tests/strings/sha1_file.phpt +++ b/ext/standard/tests/strings/sha1_file.phpt @@ -87,6 +87,8 @@ Warning: sha1_file(12): Failed to open stream: No such file or directory in %s o bool(false) -- NULL as filename -- + +Deprecated: sha1_file(): Passing null to parameter #1 ($filename) of type string is deprecated in %s on line %d Path cannot be empty -- Hexadecimal Output for Empty file as Argument -- diff --git a/ext/standard/tests/strings/sprintf_variation1.phpt b/ext/standard/tests/strings/sprintf_variation1.phpt index a75e67b96e39a..6b9430e38666f 100644 --- a/ext/standard/tests/strings/sprintf_variation1.phpt +++ b/ext/standard/tests/strings/sprintf_variation1.phpt @@ -12,10 +12,6 @@ echo "*** Testing sprintf() : with unexpected values for format argument ***\n"; $arg1 = "second arg"; $arg2 = "third arg"; -//get an unset variable -$unset_var = 10; -unset ($unset_var); - // declaring class class sample { @@ -50,10 +46,6 @@ $values = array( array(1, 2), array('color' => 'red', 'item' => 'pen'), - // null data - NULL, - null, - // boolean data true, false, @@ -67,12 +59,6 @@ $values = array( // object data new sample(), - // undefined data - @$undefined_var, - - // unset data - @$unset_var, - // resource data $file_handle ); @@ -186,9 +172,9 @@ sprintf(): Argument #1 ($format) must be of type string, array given sprintf(): Argument #1 ($format) must be of type string, array given -- Iteration 15 -- -string(0) "" -string(0) "" -string(0) "" +string(1) "1" +string(1) "1" +string(1) "1" -- Iteration 16 -- string(0) "" @@ -206,41 +192,21 @@ string(0) "" string(0) "" -- Iteration 19 -- -string(1) "1" -string(1) "1" -string(1) "1" - --- Iteration 20 -- -string(0) "" -string(0) "" -string(0) "" - --- Iteration 21 -- string(0) "" string(0) "" string(0) "" --- Iteration 22 -- +-- Iteration 20 -- string(0) "" string(0) "" string(0) "" --- Iteration 23 -- +-- Iteration 21 -- string(6) "Object" string(6) "Object" string(6) "Object" --- Iteration 24 -- -string(0) "" -string(0) "" -string(0) "" - --- Iteration 25 -- -string(0) "" -string(0) "" -string(0) "" - --- Iteration 26 -- +-- Iteration 22 -- sprintf(): Argument #1 ($format) must be of type string, resource given sprintf(): Argument #1 ($format) must be of type string, resource given sprintf(): Argument #1 ($format) must be of type string, resource given diff --git a/ext/standard/tests/strings/str_getcsv_001.phpt b/ext/standard/tests/strings/str_getcsv_001.phpt index becff2163badc..8bad30b2be562 100644 --- a/ext/standard/tests/strings/str_getcsv_001.phpt +++ b/ext/standard/tests/strings/str_getcsv_001.phpt @@ -24,8 +24,6 @@ var_dump(str_getcsv('.foo . . bar .', ' ', '.', '')); print "-----\n"; var_dump(str_getcsv('" "" "', ' ')); print "-----\n"; -var_dump(str_getcsv(NULL)); -print "-----\n"; var_dump(str_getcsv('')); print "-----\n"; @@ -108,8 +106,3 @@ array(1) { NULL } ----- -array(1) { - [0]=> - NULL -} ------ diff --git a/ext/standard/tests/strings/str_pad.phpt b/ext/standard/tests/strings/str_pad.phpt index bcb03237c0a93..278db455f8d55 100644 --- a/ext/standard/tests/strings/str_pad.phpt +++ b/ext/standard/tests/strings/str_pad.phpt @@ -21,7 +21,6 @@ echo "\n#### variations with input string and pad-length ####\n"; $input_strings = array( "variation", // normal string "", // empty string - NULL, // NULL true, // boolean 15, // numeric 15.55, // numeric @@ -63,13 +62,7 @@ foreach ( $pad_strings as $pad_string ) { echo "\n#### error conditions ####\n"; -echo "\n--- padding string as null ---\n"; - -try { - str_pad($input_string, 12, NULL); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; -} +echo "\n--- empty padding string ---\n"; try { str_pad($input_string, 12, ""); @@ -155,36 +148,6 @@ string(16) "================" string(16) "================" string(16) "================" string(16) "================" -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(9) " " -string(9) "=========" -string(9) "=========" -string(9) "=========" -string(9) "=========" -string(10) " " -string(10) "==========" -string(10) "==========" -string(10) "==========" -string(10) "==========" -string(16) " " -string(16) "================" -string(16) "================" -string(16) "================" -string(16) "================" string(1) "1" string(1) "1" string(1) "1" @@ -338,7 +301,6 @@ string(16) "\t\variation\t\t" #### error conditions #### ---- padding string as null --- -str_pad(): Argument #3 ($pad_string) must be a non-empty string +--- empty padding string --- str_pad(): Argument #3 ($pad_string) must be a non-empty string str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH diff --git a/ext/standard/tests/strings/str_repeat.phpt b/ext/standard/tests/strings/str_repeat.phpt index 3069f6bfe97f9..6eef67ae5786a 100644 Binary files a/ext/standard/tests/strings/str_repeat.phpt and b/ext/standard/tests/strings/str_repeat.phpt differ diff --git a/ext/standard/tests/strings/str_replace_variation1.phpt b/ext/standard/tests/strings/str_replace_variation1.phpt index aa7360a7f1c97..00ed1a8babe35 100644 --- a/ext/standard/tests/strings/str_replace_variation1.phpt +++ b/ext/standard/tests/strings/str_replace_variation1.phpt @@ -271,6 +271,8 @@ int(2) -- Iteration 8 -- +Deprecated: str_replace(): Passing null to parameter #1 ($search) of type array|string is deprecated in %s on line %d + Warning: Array to string conversion in %s on line %d array(12) { [0]=> diff --git a/ext/standard/tests/strings/str_replace_variation2.phpt b/ext/standard/tests/strings/str_replace_variation2.phpt index 1e92ff2bd2221..77dc6ae822626 100644 Binary files a/ext/standard/tests/strings/str_replace_variation2.phpt and b/ext/standard/tests/strings/str_replace_variation2.phpt differ diff --git a/ext/standard/tests/strings/str_word_count.phpt b/ext/standard/tests/strings/str_word_count.phpt index deb9fe986d929..a8c2af9255f0d 100644 --- a/ext/standard/tests/strings/str_word_count.phpt +++ b/ext/standard/tests/strings/str_word_count.phpt @@ -36,10 +36,10 @@ try { var_dump($str); $str2 = "F0o B4r 1s bar foo"; -var_dump(str_word_count($str2, NULL, "04")); -var_dump(str_word_count($str2, NULL, "01")); -var_dump(str_word_count($str2, NULL, "014")); -var_dump(str_word_count($str2, NULL, "")); +var_dump(str_word_count($str2, 0, "04")); +var_dump(str_word_count($str2, 0, "01")); +var_dump(str_word_count($str2, 0, "014")); +var_dump(str_word_count($str2, 0, "")); var_dump(str_word_count($str2, 1, "04")); var_dump(str_word_count($str2, 1, "01")); var_dump(str_word_count($str2, 1, "014")); diff --git a/ext/standard/tests/strings/strcasecmp.phpt b/ext/standard/tests/strings/strcasecmp.phpt index 95a25bd6994a7..3c07539bd559a 100644 Binary files a/ext/standard/tests/strings/strcasecmp.phpt and b/ext/standard/tests/strings/strcasecmp.phpt differ diff --git a/ext/standard/tests/strings/strcmp.phpt b/ext/standard/tests/strings/strcmp.phpt index 824d7ed1010a2..d5f338844eab2 100644 Binary files a/ext/standard/tests/strings/strcmp.phpt and b/ext/standard/tests/strings/strcmp.phpt differ diff --git a/ext/standard/tests/strings/stripos_variation1.phpt b/ext/standard/tests/strings/stripos_variation1.phpt index 47a0b10b5e39d..e205913fcfb00 100644 --- a/ext/standard/tests/strings/stripos_variation1.phpt +++ b/ext/standard/tests/strings/stripos_variation1.phpt @@ -24,8 +24,6 @@ $needle = array( //nulls "\0", - NULL, - null, //boolean false FALSE, @@ -121,93 +119,87 @@ int(12) int(0) int(13) -- Iteration 15 -- -int(0) -int(14) --- Iteration 16 -- -int(0) -int(15) --- Iteration 17 -- int(10) int(47) --- Iteration 18 -- +-- Iteration 16 -- int(12) bool(false) --- Iteration 19 -- +-- Iteration 17 -- int(11) bool(false) --- Iteration 20 -- +-- Iteration 18 -- int(13) bool(false) --- Iteration 21 -- +-- Iteration 19 -- int(14) bool(false) --- Iteration 22 -- +-- Iteration 20 -- int(16) bool(false) --- Iteration 23 -- +-- Iteration 21 -- int(17) bool(false) --- Iteration 24 -- +-- Iteration 22 -- int(20) bool(false) --- Iteration 25 -- +-- Iteration 23 -- int(22) -bool(false) --- Iteration 26 -- +int(22) +-- Iteration 24 -- int(23) -bool(false) --- Iteration 27 -- +int(23) +-- Iteration 25 -- int(24) -bool(false) --- Iteration 28 -- +int(24) +-- Iteration 26 -- int(25) -bool(false) --- Iteration 29 -- +int(25) +-- Iteration 27 -- bool(false) bool(false) --- Iteration 30 -- +-- Iteration 28 -- int(27) -bool(false) --- Iteration 31 -- +int(27) +-- Iteration 29 -- int(28) -bool(false) --- Iteration 32 -- +int(28) +-- Iteration 30 -- int(29) -bool(false) --- Iteration 33 -- +int(29) +-- Iteration 31 -- int(31) -bool(false) --- Iteration 34 -- +int(31) +-- Iteration 32 -- int(30) bool(false) --- Iteration 35 -- +-- Iteration 33 -- int(32) -bool(false) --- Iteration 36 -- +int(32) +-- Iteration 34 -- int(33) -bool(false) --- Iteration 37 -- +int(33) +-- Iteration 35 -- int(33) bool(false) --- Iteration 38 -- +-- Iteration 36 -- int(39) int(39) --- Iteration 39 -- +-- Iteration 37 -- int(15) int(48) --- Iteration 40 -- +-- Iteration 38 -- int(15) int(48) --- Iteration 41 -- +-- Iteration 39 -- int(51) int(51) --- Iteration 42 -- +-- Iteration 40 -- int(51) int(51) --- Iteration 43 -- +-- Iteration 41 -- bool(false) bool(false) --- Iteration 44 -- +-- Iteration 42 -- int(0) bool(false) *** Done *** diff --git a/ext/standard/tests/strings/stripos_variation10.phpt b/ext/standard/tests/strings/stripos_variation10.phpt deleted file mode 100644 index 156023c728113..0000000000000 --- a/ext/standard/tests/strings/stripos_variation10.phpt +++ /dev/null @@ -1,173 +0,0 @@ ---TEST-- -Test stripos() function : usage variations - unexpected inputs for 'needle' argument ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new sample(), - - // empty string - "", - '', - - // null values - NULL, - null, - - // resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - -// loop through each element of the 'needle' array to check the working of stripos() -$counter = 1; -for($index = 0; $index < count($needles); $index ++) { - echo "\n-- Iteration $counter --\n"; - try { - var_dump( stripos($haystack, $needles[$index]) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - $counter ++; -} - -fclose($file_handle); //closing the file handle - -echo "*** Done ***"; -?> ---EXPECT-- -*** Testing stripos() function with unexpected values for needle *** - --- Iteration 1 -- -int(7) - --- Iteration 2 -- -int(9) - --- Iteration 3 -- -bool(false) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -int(16) - --- Iteration 6 -- -int(21) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -int(17) - --- Iteration 10 -- -stripos(): Argument #2 ($needle) must be of type string, array given - --- Iteration 11 -- -stripos(): Argument #2 ($needle) must be of type string, array given - --- Iteration 12 -- -stripos(): Argument #2 ($needle) must be of type string, array given - --- Iteration 13 -- -stripos(): Argument #2 ($needle) must be of type string, array given - --- Iteration 14 -- -stripos(): Argument #2 ($needle) must be of type string, array given - --- Iteration 15 -- -int(9) - --- Iteration 16 -- -int(0) - --- Iteration 17 -- -int(9) - --- Iteration 18 -- -int(0) - --- Iteration 19 -- -int(64) - --- Iteration 20 -- -int(0) - --- Iteration 21 -- -int(0) - --- Iteration 22 -- -int(0) - --- Iteration 23 -- -int(0) - --- Iteration 24 -- -stripos(): Argument #2 ($needle) must be of type string, resource given - --- Iteration 25 -- -int(0) - --- Iteration 26 -- -int(0) -*** Done *** diff --git a/ext/standard/tests/strings/stripos_variation11.phpt b/ext/standard/tests/strings/stripos_variation11.phpt deleted file mode 100644 index 6d9df2bd2ea03..0000000000000 --- a/ext/standard/tests/strings/stripos_variation11.phpt +++ /dev/null @@ -1,174 +0,0 @@ ---TEST-- -Test stripos() function : usage variations - unexpected inputs for 'haystack' and 'needle' arguments ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new sample(), - - // empty string - "", - '', - - // null values - NULL, - null, - - // resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - - -// loop through each element of the array and check the working of stripos() -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - $haystack = $values[$index]; - try { - var_dump( stripos($values[$index], $values[$index]) ); - } catch (Error $e) { - echo get_class($e) . ": " . $e->getMessage(), "\n"; - } - try { - var_dump( stripos($values[$index], $values[$index], 1) ); - } catch (Error $e) { - echo get_class($e) . ": " . $e->getMessage(), "\n"; - } - $counter ++; -} - -echo "*** Done ***"; -?> ---EXPECT-- -*** Testing stripos() function with unexpected values for haystack and needle *** --- Iteration 1 -- -int(0) -bool(false) --- Iteration 2 -- -int(0) -bool(false) --- Iteration 3 -- -int(0) -bool(false) --- Iteration 4 -- -int(0) -bool(false) --- Iteration 5 -- -int(0) -bool(false) --- Iteration 6 -- -int(0) -bool(false) --- Iteration 7 -- -int(0) -bool(false) --- Iteration 8 -- -int(0) -bool(false) --- Iteration 9 -- -int(0) -bool(false) --- Iteration 10 -- -TypeError: stripos(): Argument #1 ($haystack) must be of type string, array given -TypeError: stripos(): Argument #1 ($haystack) must be of type string, array given --- Iteration 11 -- -TypeError: stripos(): Argument #1 ($haystack) must be of type string, array given -TypeError: stripos(): Argument #1 ($haystack) must be of type string, array given --- Iteration 12 -- -TypeError: stripos(): Argument #1 ($haystack) must be of type string, array given -TypeError: stripos(): Argument #1 ($haystack) must be of type string, array given --- Iteration 13 -- -TypeError: stripos(): Argument #1 ($haystack) must be of type string, array given -TypeError: stripos(): Argument #1 ($haystack) must be of type string, array given --- Iteration 14 -- -TypeError: stripos(): Argument #1 ($haystack) must be of type string, array given -TypeError: stripos(): Argument #1 ($haystack) must be of type string, array given --- Iteration 15 -- -int(0) -bool(false) --- Iteration 16 -- -int(0) -ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --- Iteration 17 -- -int(0) -bool(false) --- Iteration 18 -- -int(0) -ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --- Iteration 19 -- -int(0) -bool(false) --- Iteration 20 -- -int(0) -ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --- Iteration 21 -- -int(0) -ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --- Iteration 22 -- -int(0) -ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --- Iteration 23 -- -int(0) -ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --- Iteration 24 -- -TypeError: stripos(): Argument #1 ($haystack) must be of type string, resource given -TypeError: stripos(): Argument #1 ($haystack) must be of type string, resource given --- Iteration 25 -- -int(0) -ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --- Iteration 26 -- -int(0) -ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -*** Done *** diff --git a/ext/standard/tests/strings/stripos_variation2.phpt b/ext/standard/tests/strings/stripos_variation2.phpt index bc176eecfecca..2f95822645bfa 100644 --- a/ext/standard/tests/strings/stripos_variation2.phpt +++ b/ext/standard/tests/strings/stripos_variation2.phpt @@ -24,8 +24,6 @@ $needle = array( //nulls '\0', - NULL, - null, //boolean false FALSE, @@ -123,99 +121,93 @@ int(12) int(0) int(13) -- Iteration 15 -- -int(0) int(14) --- Iteration 16 -- -int(0) -int(15) --- Iteration 17 -- int(14) -int(51) --- Iteration 18 -- +-- Iteration 16 -- int(16) -bool(false) --- Iteration 19 -- +int(16) +-- Iteration 17 -- int(15) bool(false) --- Iteration 20 -- +-- Iteration 18 -- int(17) -bool(false) --- Iteration 21 -- +int(17) +-- Iteration 19 -- int(18) -bool(false) --- Iteration 22 -- +int(18) +-- Iteration 20 -- int(20) -bool(false) --- Iteration 23 -- +int(20) +-- Iteration 21 -- int(21) -bool(false) --- Iteration 24 -- +int(21) +-- Iteration 22 -- int(24) int(24) --- Iteration 25 -- +-- Iteration 23 -- int(26) int(26) --- Iteration 26 -- +-- Iteration 24 -- int(27) int(27) --- Iteration 27 -- +-- Iteration 25 -- int(28) int(28) --- Iteration 28 -- +-- Iteration 26 -- int(29) int(29) --- Iteration 29 -- +-- Iteration 27 -- bool(false) bool(false) --- Iteration 30 -- +-- Iteration 28 -- bool(false) bool(false) --- Iteration 31 -- +-- Iteration 29 -- int(31) int(31) --- Iteration 32 -- +-- Iteration 30 -- int(32) int(32) --- Iteration 33 -- +-- Iteration 31 -- int(33) int(33) --- Iteration 34 -- +-- Iteration 32 -- int(35) int(35) --- Iteration 35 -- +-- Iteration 33 -- int(34) int(34) --- Iteration 36 -- +-- Iteration 34 -- int(36) int(36) --- Iteration 37 -- +-- Iteration 35 -- int(37) int(37) --- Iteration 38 -- +-- Iteration 36 -- int(37) int(37) --- Iteration 39 -- +-- Iteration 37 -- int(43) int(43) --- Iteration 40 -- +-- Iteration 38 -- int(52) int(52) --- Iteration 41 -- +-- Iteration 39 -- int(19) bool(false) --- Iteration 42 -- +-- Iteration 40 -- int(58) int(58) --- Iteration 43 -- +-- Iteration 41 -- bool(false) bool(false) --- Iteration 44 -- +-- Iteration 42 -- bool(false) bool(false) --- Iteration 45 -- +-- Iteration 43 -- bool(false) bool(false) --- Iteration 46 -- +-- Iteration 44 -- int(0) bool(false) *** Done *** diff --git a/ext/standard/tests/strings/stripos_variation7.phpt b/ext/standard/tests/strings/stripos_variation7.phpt deleted file mode 100644 index b9aa7db1181ad..0000000000000 --- a/ext/standard/tests/strings/stripos_variation7.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Test stripos() function : usage variations - empty heredoc string for 'haystack' argument ---FILE-- -getMessage() . "\n"; -} -var_dump( stripos($empty_string, FALSE) ); -var_dump( stripos($empty_string, NULL) ); - -echo "*** Done ***"; -?> ---EXPECT-- -*** Testing stripos() function: with heredoc strings *** --- With empty heredoc string -- -int(0) -stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -int(0) -int(0) -*** Done *** diff --git a/ext/standard/tests/strings/stristr_variation2.phpt b/ext/standard/tests/strings/stristr_variation2.phpt index fdc48a0922e6f..72d5a93df8a63 100644 --- a/ext/standard/tests/strings/stristr_variation2.phpt +++ b/ext/standard/tests/strings/stristr_variation2.phpt @@ -5,10 +5,6 @@ Test stristr() function : usage variations - test values for $needle argument echo "*** Testing stristr() function: with unexpected inputs for 'needle' argument ***\n"; -//get an unset variable -$unset_var = 'string_val'; -unset($unset_var); - //defining a class class sample { public function __toString() { @@ -44,21 +40,11 @@ $inputs = array ( TRUE, FALSE, - // null values -/*15*/ NULL, - null, - // objects /*17*/ new sample(), // resource /*18*/ $file_handle, - - // undefined variable -/*19*/ @$undefined_var, - - // unset variable -/*20*/ @$unset_var ); //defining '$pad_length' argument @@ -110,14 +96,6 @@ bool(false) -- Iteration 14 -- string(11) "Hello World" -- Iteration 15 -- -string(11) "Hello World" --- Iteration 16 -- -string(11) "Hello World" --- Iteration 17 -- bool(false) --- Iteration 18 -- +-- Iteration 16 -- stristr(): Argument #2 ($needle) must be of type string, resource given --- Iteration 19 -- -string(11) "Hello World" --- Iteration 20 -- -string(11) "Hello World" diff --git a/ext/standard/tests/strings/strlen.phpt b/ext/standard/tests/strings/strlen.phpt index 468dd9acfec9a..374001eed986c 100644 Binary files a/ext/standard/tests/strings/strlen.phpt and b/ext/standard/tests/strings/strlen.phpt differ diff --git a/ext/standard/tests/strings/strpos.phpt b/ext/standard/tests/strings/strpos.phpt index 135030544e046..267bc590c5be3 100644 Binary files a/ext/standard/tests/strings/strpos.phpt and b/ext/standard/tests/strings/strpos.phpt differ diff --git a/ext/standard/tests/strings/strrchr_variation1.phpt b/ext/standard/tests/strings/strrchr_variation1.phpt index 9617f5fff2040..a913a2045a496 100644 Binary files a/ext/standard/tests/strings/strrchr_variation1.phpt and b/ext/standard/tests/strings/strrchr_variation1.phpt differ diff --git a/ext/standard/tests/strings/strrchr_variation10.phpt b/ext/standard/tests/strings/strrchr_variation10.phpt deleted file mode 100644 index 4f28ad4e6b038..0000000000000 --- a/ext/standard/tests/strings/strrchr_variation10.phpt +++ /dev/null @@ -1,185 +0,0 @@ ---TEST-- -Test strrchr() function : usage variations - unexpected inputs for needle ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // null values - NULL, - null, - - // objects - new sample(), - - // empty string - "", - '', - - // resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - -// loop through each element of the array and check the working of strrchr() -$count = 1; -for($index = 0; $index < count($haystacks); $index++) { - echo "-- Iteration $count --\n"; - try { - var_dump( strrchr($haystacks[$index], $needles[$index]) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - $count ++; -} - -fclose($file_handle); //closing the file handle - -echo "*** Done ***"; -?> ---EXPECT-- -*** Testing strrchr() function with unexpected inputs for needle *** --- Iteration 1 -- -string(1) "0" --- Iteration 2 -- -string(1) "1" --- Iteration 3 -- -bool(false) --- Iteration 4 -- -string(2) "-2" --- Iteration 5 -- -string(4) "10.5" --- Iteration 6 -- -string(5) "-10.5" --- Iteration 7 -- -string(2) "10" --- Iteration 8 -- -string(2) "10" --- Iteration 9 -- -bool(false) --- Iteration 10 -- -strrchr(): Argument #2 ($needle) must be of type string, array given --- Iteration 11 -- -strrchr(): Argument #2 ($needle) must be of type string, array given --- Iteration 12 -- -strrchr(): Argument #2 ($needle) must be of type string, array given --- Iteration 13 -- -strrchr(): Argument #2 ($needle) must be of type string, array given --- Iteration 14 -- -strrchr(): Argument #2 ($needle) must be of type string, array given --- Iteration 15 -- -bool(false) --- Iteration 16 -- -bool(false) --- Iteration 17 -- -bool(false) --- Iteration 18 -- -bool(false) --- Iteration 19 -- -bool(false) --- Iteration 20 -- -bool(false) --- Iteration 21 -- -string(6) "object" --- Iteration 22 -- -bool(false) --- Iteration 23 -- -bool(false) --- Iteration 24 -- -strrchr(): Argument #2 ($needle) must be of type string, resource given --- Iteration 25 -- -bool(false) --- Iteration 26 -- -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strrchr_variation11.phpt b/ext/standard/tests/strings/strrchr_variation11.phpt deleted file mode 100644 index 287d81c11c976..0000000000000 --- a/ext/standard/tests/strings/strrchr_variation11.phpt +++ /dev/null @@ -1,144 +0,0 @@ ---TEST-- -Test strrchr() function : usage variations - unexpected inputs for haystack and needle ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new sample(), - - // empty string - "", - '', - - // null values - NULL, - null, - - // resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - - -// loop through each element of the array and check the working of strrchr() -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - try { - var_dump( strrchr($values[$index], $values[$index]) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - $counter ++; -} - -fclose($file_handle); //closing the file handle - -echo "*** Done ***"; -?> ---EXPECT-- -*** Testing strrchr() function: with unexpected inputs for haystack and needle *** --- Iteration 1 -- -string(1) "0" --- Iteration 2 -- -string(1) "1" --- Iteration 3 -- -string(5) "12345" --- Iteration 4 -- -string(5) "-2345" --- Iteration 5 -- -string(4) "10.5" --- Iteration 6 -- -string(5) "-10.5" --- Iteration 7 -- -string(10) "1234567000" --- Iteration 8 -- -string(4) "1E-9" --- Iteration 9 -- -string(3) "0.5" --- Iteration 10 -- -strrchr(): Argument #1 ($haystack) must be of type string, array given --- Iteration 11 -- -strrchr(): Argument #1 ($haystack) must be of type string, array given --- Iteration 12 -- -strrchr(): Argument #1 ($haystack) must be of type string, array given --- Iteration 13 -- -strrchr(): Argument #1 ($haystack) must be of type string, array given --- Iteration 14 -- -strrchr(): Argument #1 ($haystack) must be of type string, array given --- Iteration 15 -- -string(1) "1" --- Iteration 16 -- -bool(false) --- Iteration 17 -- -string(1) "1" --- Iteration 18 -- -bool(false) --- Iteration 19 -- -string(6) "object" --- Iteration 20 -- -bool(false) --- Iteration 21 -- -bool(false) --- Iteration 22 -- -bool(false) --- Iteration 23 -- -bool(false) --- Iteration 24 -- -strrchr(): Argument #1 ($haystack) must be of type string, resource given --- Iteration 25 -- -bool(false) --- Iteration 26 -- -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strrchr_variation12.phpt b/ext/standard/tests/strings/strrchr_variation12.phpt index 972ff3e703bf4..abe5bfae650ea 100644 Binary files a/ext/standard/tests/strings/strrchr_variation12.phpt and b/ext/standard/tests/strings/strrchr_variation12.phpt differ diff --git a/ext/standard/tests/strings/strrchr_variation2.phpt b/ext/standard/tests/strings/strrchr_variation2.phpt index 72bb3fb0d3e3a..646f13a702e4d 100644 --- a/ext/standard/tests/strings/strrchr_variation2.phpt +++ b/ext/standard/tests/strings/strrchr_variation2.phpt @@ -24,8 +24,6 @@ $needle = array( //nulls '\0', - NULL, - null, //boolean false FALSE, @@ -121,95 +119,89 @@ bool(false) bool(false) -- Iteration 15 -- -bool(false) +string(1) " " -- Iteration 16 -- -bool(false) +string(47) "$&!#%\o,()*+-./:;<=>?@hello123456he \x234 \101 " -- Iteration 17 -- string(1) " " -- Iteration 18 -- -string(47) "$&!#%\o,()*+-./:;<=>?@hello123456he \x234 \101 " +string(46) "&!#%\o,()*+-./:;<=>?@hello123456he \x234 \101 " -- Iteration 19 -- -string(1) " " +string(45) "!#%\o,()*+-./:;<=>?@hello123456he \x234 \101 " -- Iteration 20 -- -string(46) "&!#%\o,()*+-./:;<=>?@hello123456he \x234 \101 " +string(43) "%\o,()*+-./:;<=>?@hello123456he \x234 \101 " -- Iteration 21 -- -string(45) "!#%\o,()*+-./:;<=>?@hello123456he \x234 \101 " +string(5) "\101 " -- Iteration 22 -- -string(43) "%\o,()*+-./:;<=>?@hello123456he \x234 \101 " +string(39) "()*+-./:;<=>?@hello123456he \x234 \101 " -- Iteration 23 -- -string(5) "\101 " +string(37) "*+-./:;<=>?@hello123456he \x234 \101 " -- Iteration 24 -- -string(39) "()*+-./:;<=>?@hello123456he \x234 \101 " +string(36) "+-./:;<=>?@hello123456he \x234 \101 " -- Iteration 25 -- -string(37) "*+-./:;<=>?@hello123456he \x234 \101 " +string(35) "-./:;<=>?@hello123456he \x234 \101 " -- Iteration 26 -- -string(36) "+-./:;<=>?@hello123456he \x234 \101 " +string(34) "./:;<=>?@hello123456he \x234 \101 " -- Iteration 27 -- -string(35) "-./:;<=>?@hello123456he \x234 \101 " +string(34) "./:;<=>?@hello123456he \x234 \101 " -- Iteration 28 -- -string(34) "./:;<=>?@hello123456he \x234 \101 " +string(32) ":;<=>?@hello123456he \x234 \101 " -- Iteration 29 -- -string(34) "./:;<=>?@hello123456he \x234 \101 " +string(31) ";<=>?@hello123456he \x234 \101 " -- Iteration 30 -- -string(32) ":;<=>?@hello123456he \x234 \101 " +string(30) "<=>?@hello123456he \x234 \101 " -- Iteration 31 -- -string(31) ";<=>?@hello123456he \x234 \101 " +string(28) ">?@hello123456he \x234 \101 " -- Iteration 32 -- -string(30) "<=>?@hello123456he \x234 \101 " +string(29) "=>?@hello123456he \x234 \101 " -- Iteration 33 -- -string(28) ">?@hello123456he \x234 \101 " +string(27) "?@hello123456he \x234 \101 " -- Iteration 34 -- -string(29) "=>?@hello123456he \x234 \101 " +string(26) "@hello123456he \x234 \101 " -- Iteration 35 -- -string(27) "?@hello123456he \x234 \101 " +string(26) "@hello123456he \x234 \101 " -- Iteration 36 -- -string(26) "@hello123456he \x234 \101 " +string(2) "1 " -- Iteration 37 -- -string(26) "@hello123456he \x234 \101 " +string(5) "\101 " -- Iteration 38 -- -string(2) "1 " +string(44) "#%\o,()*+-./:;<=>?@hello123456he \x234 \101 " -- Iteration 39 -- string(5) "\101 " -- Iteration 40 -- -string(44) "#%\o,()*+-./:;<=>?@hello123456he \x234 \101 " - --- Iteration 41 -- -string(5) "\101 " - --- Iteration 42 -- bool(false) --- Iteration 43 -- +-- Iteration 41 -- string(7) "4 \101 " --- Iteration 44 -- +-- Iteration 42 -- string(7) "4 \101 " --- Iteration 45 -- +-- Iteration 43 -- string(63) "Hello,\t\n\0\n $&!#%\o,()*+-./:;<=>?@hello123456he \x234 \101 " *** Done *** diff --git a/ext/standard/tests/strings/strrchr_variation8.phpt b/ext/standard/tests/strings/strrchr_variation8.phpt deleted file mode 100644 index 826db29dfd40c..0000000000000 --- a/ext/standard/tests/strings/strrchr_variation8.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Test strrchr() function : usage variations - empty heredoc string for 'haystack' ---FILE-- - ---EXPECT-- -*** Testing strrchr() function: with heredoc strings *** -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strrev.phpt b/ext/standard/tests/strings/strrev.phpt index 6303fccc20a01..15cf248f55f3a 100644 --- a/ext/standard/tests/strings/strrev.phpt +++ b/ext/standard/tests/strings/strrev.phpt @@ -2,18 +2,16 @@ strrev() function --FILE-- --EXPECT-- string(32) "ec6df70f2569891eae50321a9179eb82" string(0) "" -string(0) "" diff --git a/ext/standard/tests/strings/strripos_variation1.phpt b/ext/standard/tests/strings/strripos_variation1.phpt index 75330184ffb9f..57ae8dd11a65f 100644 --- a/ext/standard/tests/strings/strripos_variation1.phpt +++ b/ext/standard/tests/strings/strripos_variation1.phpt @@ -24,8 +24,6 @@ $needles = array( //nulls /*11*/ "\0", - NULL, - null, //boolean false /*14*/ FALSE, @@ -141,106 +139,96 @@ int(44) int(44) int(43) -- Iteration 15 -- -int(44) -int(44) -int(44) int(43) --- Iteration 16 -- -int(44) -int(44) -int(44) -int(43) --- Iteration 17 -- int(43) int(43) int(43) -int(43) --- Iteration 18 -- +-- Iteration 16 -- int(12) int(12) bool(false) int(12) --- Iteration 19 -- +-- Iteration 17 -- int(11) int(11) bool(false) int(11) --- Iteration 20 -- +-- Iteration 18 -- int(13) int(13) bool(false) int(13) --- Iteration 21 -- +-- Iteration 19 -- int(14) int(14) bool(false) int(14) --- Iteration 22 -- +-- Iteration 20 -- int(17) int(17) bool(false) int(17) --- Iteration 23 -- +-- Iteration 21 -- int(20) int(20) int(20) int(20) --- Iteration 24 -- +-- Iteration 22 -- int(22) int(22) int(22) int(22) --- Iteration 25 -- +-- Iteration 23 -- int(21) int(21) int(21) int(21) --- Iteration 26 -- +-- Iteration 24 -- int(23) int(23) int(23) int(23) --- Iteration 27 -- +-- Iteration 25 -- int(24) int(24) int(24) int(24) --- Iteration 28 -- +-- Iteration 26 -- int(24) int(24) int(24) int(24) --- Iteration 29 -- +-- Iteration 27 -- int(30) int(30) int(30) int(30) --- Iteration 30 -- +-- Iteration 28 -- int(39) int(39) int(39) int(39) --- Iteration 31 -- +-- Iteration 29 -- int(39) int(39) int(39) int(39) --- Iteration 32 -- +-- Iteration 30 -- int(42) int(42) int(42) int(42) --- Iteration 33 -- +-- Iteration 31 -- int(42) int(42) int(42) int(42) --- Iteration 34 -- +-- Iteration 32 -- bool(false) bool(false) bool(false) bool(false) --- Iteration 35 -- +-- Iteration 33 -- int(0) bool(false) bool(false) diff --git a/ext/standard/tests/strings/strripos_variation2.phpt b/ext/standard/tests/strings/strripos_variation2.phpt index 5a409c28d1256..12bcc2d22bb69 100644 --- a/ext/standard/tests/strings/strripos_variation2.phpt +++ b/ext/standard/tests/strings/strripos_variation2.phpt @@ -24,8 +24,6 @@ $needles = array( //nulls /*11*/ '\0', - NULL, - null, //boolean false /*14*/ FALSE, @@ -142,111 +140,101 @@ int(54) int(54) int(53) -- Iteration 15 -- -int(54) -int(54) -int(54) -int(53) --- Iteration 16 -- -int(54) -int(54) -int(54) -int(53) --- Iteration 17 -- int(53) int(53) int(53) int(53) --- Iteration 18 -- +-- Iteration 16 -- int(16) int(16) bool(false) int(16) --- Iteration 19 -- +-- Iteration 17 -- int(15) int(15) bool(false) int(15) --- Iteration 20 -- +-- Iteration 18 -- int(17) int(17) bool(false) int(17) --- Iteration 21 -- +-- Iteration 19 -- int(18) int(18) bool(false) int(18) --- Iteration 22 -- +-- Iteration 20 -- int(21) int(21) int(21) int(21) --- Iteration 23 -- +-- Iteration 21 -- int(24) int(24) int(24) int(24) --- Iteration 24 -- +-- Iteration 22 -- int(26) int(26) int(26) int(26) --- Iteration 25 -- +-- Iteration 23 -- int(25) int(25) int(25) int(25) --- Iteration 26 -- +-- Iteration 24 -- int(27) int(27) int(27) int(27) --- Iteration 27 -- +-- Iteration 25 -- int(28) int(28) int(28) int(28) --- Iteration 28 -- +-- Iteration 26 -- int(28) int(28) int(28) int(28) --- Iteration 29 -- +-- Iteration 27 -- int(34) int(34) int(34) int(34) --- Iteration 30 -- +-- Iteration 28 -- int(43) int(43) int(43) int(43) --- Iteration 31 -- +-- Iteration 29 -- int(19) int(19) bool(false) int(19) --- Iteration 32 -- +-- Iteration 30 -- int(49) int(49) int(49) int(49) --- Iteration 33 -- +-- Iteration 31 -- bool(false) bool(false) bool(false) bool(false) --- Iteration 34 -- +-- Iteration 32 -- bool(false) bool(false) bool(false) bool(false) --- Iteration 35 -- +-- Iteration 33 -- bool(false) bool(false) bool(false) bool(false) --- Iteration 36 -- +-- Iteration 34 -- int(0) bool(false) bool(false) diff --git a/ext/standard/tests/strings/strrpos_variation1.phpt b/ext/standard/tests/strings/strrpos_variation1.phpt deleted file mode 100644 index 509c015e54879..0000000000000 --- a/ext/standard/tests/strings/strrpos_variation1.phpt +++ /dev/null @@ -1,177 +0,0 @@ ---TEST-- -Test strrpos() function : usage variations - double quoted strings for 'haystack' & 'needle' arguments ---FILE-- -?@hello123456he \x234 \101 "; -$needle = array( - //regular strings - "l", - "L", - "HELLO", - "hEllo", - - //escape characters - "\t", - "\T", //invalid input - " ", - "\n", - "\N", //invalid input - " -", //new line - - //nulls - "\0", - NULL, - null, - - //boolean false - FALSE, - false, - - //empty string - "", - - //special chars - " ", - "$", - " $", - "&", - "!#", - "()", - "<=>", - ">", - "=>", - "?", - "@", - "@hEllo", - - "12345", //decimal numeric string - "\x23", //hexadecimal numeric string - "#", //respective ASCII char of \x23 - "\101", //octal numeric string - "A", //respective ASCII char of \101 - "456HEE", //numerics + chars - $haystack //haystack as needle -); - -/* loop through to get the position of the needle in haystack string */ -$count = 1; -for($index=0; $index ---EXPECT-- -*** Testing strrpos() function: with double quoted strings *** --- Iteration 1 -- -int(28) -int(28) --- Iteration 2 -- -bool(false) -bool(false) --- Iteration 3 -- -bool(false) -bool(false) --- Iteration 4 -- -bool(false) -bool(false) --- Iteration 5 -- -int(6) -int(6) --- Iteration 6 -- -bool(false) -bool(false) --- Iteration 7 -- -bool(false) -bool(false) --- Iteration 8 -- -int(9) -int(9) --- Iteration 9 -- -bool(false) -bool(false) --- Iteration 10 -- -int(9) -int(9) --- Iteration 11 -- -int(8) -bool(false) --- Iteration 12 -- -int(44) -int(44) --- Iteration 13 -- -int(44) -int(44) --- Iteration 14 -- -int(44) -int(44) --- Iteration 15 -- -int(44) -int(44) --- Iteration 16 -- -int(44) -int(44) --- Iteration 17 -- -int(43) -int(43) --- Iteration 18 -- -int(12) -bool(false) --- Iteration 19 -- -int(11) -bool(false) --- Iteration 20 -- -int(13) -bool(false) --- Iteration 21 -- -int(14) -bool(false) --- Iteration 22 -- -int(17) -bool(false) --- Iteration 23 -- -int(20) -bool(false) --- Iteration 24 -- -int(22) -bool(false) --- Iteration 25 -- -int(21) -bool(false) --- Iteration 26 -- -int(23) -bool(false) --- Iteration 27 -- -int(24) -bool(false) --- Iteration 28 -- -bool(false) -bool(false) --- Iteration 29 -- -int(30) -int(30) --- Iteration 30 -- -int(39) -int(39) --- Iteration 31 -- -int(39) -int(39) --- Iteration 32 -- -int(42) -int(42) --- Iteration 33 -- -int(42) -int(42) --- Iteration 34 -- -bool(false) -bool(false) --- Iteration 35 -- -int(0) -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strrpos_variation10.phpt b/ext/standard/tests/strings/strrpos_variation10.phpt deleted file mode 100644 index a59827981e55d..0000000000000 --- a/ext/standard/tests/strings/strrpos_variation10.phpt +++ /dev/null @@ -1,147 +0,0 @@ ---TEST-- -Test strrpos() function : usage variations - unexpected inputs for 'needle' argument ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new sample(), - - // empty string - "", - '', - - // null values - NULL, - null, - - // resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - -// loop through each element of the 'needle' array to check the working of strrpos() -$counter = 1; -for($index = 0; $index < count($needles); $index ++) { - echo "-- Iteration $counter --\n"; - try { - var_dump( strrpos($haystack, $needles[$index]) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - $counter ++; -} - -fclose($file_handle); //closing the file handle - -echo "*** Done ***"; -?> ---EXPECT-- -*** Testing strrpos() function with unexpected values for needle *** --- Iteration 1 -- -int(42) --- Iteration 2 -- -int(41) --- Iteration 3 -- -bool(false) --- Iteration 4 -- -bool(false) --- Iteration 5 -- -int(27) --- Iteration 6 -- -int(21) --- Iteration 7 -- -bool(false) --- Iteration 8 -- -bool(false) --- Iteration 9 -- -int(28) --- Iteration 10 -- -strrpos(): Argument #2 ($needle) must be of type string, array given --- Iteration 11 -- -strrpos(): Argument #2 ($needle) must be of type string, array given --- Iteration 12 -- -strrpos(): Argument #2 ($needle) must be of type string, array given --- Iteration 13 -- -strrpos(): Argument #2 ($needle) must be of type string, array given --- Iteration 14 -- -strrpos(): Argument #2 ($needle) must be of type string, array given --- Iteration 15 -- -int(41) --- Iteration 16 -- -int(87) --- Iteration 17 -- -int(41) --- Iteration 18 -- -int(87) --- Iteration 19 -- -int(64) --- Iteration 20 -- -int(87) --- Iteration 21 -- -int(87) --- Iteration 22 -- -int(87) --- Iteration 23 -- -int(87) --- Iteration 24 -- -strrpos(): Argument #2 ($needle) must be of type string, resource given --- Iteration 25 -- -int(87) --- Iteration 26 -- -int(87) -*** Done *** diff --git a/ext/standard/tests/strings/strrpos_variation11.phpt b/ext/standard/tests/strings/strrpos_variation11.phpt deleted file mode 100644 index da33a21dc5365..0000000000000 --- a/ext/standard/tests/strings/strrpos_variation11.phpt +++ /dev/null @@ -1,175 +0,0 @@ ---TEST-- -Test strrpos() function : usage variations - unexpected inputs for 'haystack' and 'needle' arguments ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new sample(), - - // empty string - "", - '', - - // null values - NULL, - null, - - // resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - - -// loop through each element of the array and check the working of strrpos() -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - $haystack = $values[$index]; - try { - var_dump( strrpos($values[$index], $values[$index]) ); - } catch (Error $e) { - echo get_class($e) . ": " . $e->getMessage(), "\n"; - } - - try { - var_dump( strrpos($values[$index], $values[$index], 1) ); - } catch (Error $e) { - echo get_class($e) . ": " . $e->getMessage(), "\n"; - } - $counter ++; -} - -echo "*** Done ***"; -?> ---EXPECT-- -*** Testing strrpos() function with unexpected values for haystack and needle *** --- Iteration 1 -- -int(0) -bool(false) --- Iteration 2 -- -int(0) -bool(false) --- Iteration 3 -- -int(0) -bool(false) --- Iteration 4 -- -int(0) -bool(false) --- Iteration 5 -- -int(0) -bool(false) --- Iteration 6 -- -int(0) -bool(false) --- Iteration 7 -- -int(0) -bool(false) --- Iteration 8 -- -int(0) -bool(false) --- Iteration 9 -- -int(0) -bool(false) --- Iteration 10 -- -TypeError: strrpos(): Argument #1 ($haystack) must be of type string, array given -TypeError: strrpos(): Argument #1 ($haystack) must be of type string, array given --- Iteration 11 -- -TypeError: strrpos(): Argument #1 ($haystack) must be of type string, array given -TypeError: strrpos(): Argument #1 ($haystack) must be of type string, array given --- Iteration 12 -- -TypeError: strrpos(): Argument #1 ($haystack) must be of type string, array given -TypeError: strrpos(): Argument #1 ($haystack) must be of type string, array given --- Iteration 13 -- -TypeError: strrpos(): Argument #1 ($haystack) must be of type string, array given -TypeError: strrpos(): Argument #1 ($haystack) must be of type string, array given --- Iteration 14 -- -TypeError: strrpos(): Argument #1 ($haystack) must be of type string, array given -TypeError: strrpos(): Argument #1 ($haystack) must be of type string, array given --- Iteration 15 -- -int(0) -bool(false) --- Iteration 16 -- -int(0) -ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --- Iteration 17 -- -int(0) -bool(false) --- Iteration 18 -- -int(0) -ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --- Iteration 19 -- -int(0) -bool(false) --- Iteration 20 -- -int(0) -ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --- Iteration 21 -- -int(0) -ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --- Iteration 22 -- -int(0) -ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --- Iteration 23 -- -int(0) -ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --- Iteration 24 -- -TypeError: strrpos(): Argument #1 ($haystack) must be of type string, resource given -TypeError: strrpos(): Argument #1 ($haystack) must be of type string, resource given --- Iteration 25 -- -int(0) -ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --- Iteration 26 -- -int(0) -ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -*** Done *** diff --git a/ext/standard/tests/strings/strrpos_variation2.phpt b/ext/standard/tests/strings/strrpos_variation2.phpt index b6b7cb149d87e..0022d0e2c3f38 100644 --- a/ext/standard/tests/strings/strrpos_variation2.phpt +++ b/ext/standard/tests/strings/strrpos_variation2.phpt @@ -24,8 +24,6 @@ $needle = array( //nulls '\0', - NULL, - null, //boolean false FALSE, @@ -113,69 +111,63 @@ int(54) int(54) int(54) -- Iteration 15 -- -int(54) -int(54) --- Iteration 16 -- -int(54) -int(54) --- Iteration 17 -- int(53) int(53) --- Iteration 18 -- +-- Iteration 16 -- int(16) -bool(false) --- Iteration 19 -- +int(16) +-- Iteration 17 -- int(15) bool(false) --- Iteration 20 -- +-- Iteration 18 -- int(17) -bool(false) --- Iteration 21 -- +int(17) +-- Iteration 19 -- int(18) -bool(false) --- Iteration 22 -- +int(18) +-- Iteration 20 -- int(21) int(21) --- Iteration 23 -- +-- Iteration 21 -- int(24) int(24) --- Iteration 24 -- +-- Iteration 22 -- int(26) int(26) --- Iteration 25 -- +-- Iteration 23 -- int(25) int(25) --- Iteration 26 -- +-- Iteration 24 -- int(27) int(27) --- Iteration 27 -- +-- Iteration 25 -- int(28) int(28) --- Iteration 28 -- +-- Iteration 26 -- bool(false) bool(false) --- Iteration 29 -- +-- Iteration 27 -- int(34) int(34) --- Iteration 30 -- +-- Iteration 28 -- int(43) int(43) --- Iteration 31 -- +-- Iteration 29 -- int(19) bool(false) --- Iteration 32 -- +-- Iteration 30 -- int(49) int(49) --- Iteration 33 -- +-- Iteration 31 -- bool(false) bool(false) --- Iteration 34 -- +-- Iteration 32 -- bool(false) bool(false) --- Iteration 35 -- +-- Iteration 33 -- bool(false) bool(false) --- Iteration 36 -- +-- Iteration 34 -- int(0) bool(false) *** Done *** diff --git a/ext/standard/tests/strings/strrpos_variation7.phpt b/ext/standard/tests/strings/strrpos_variation7.phpt index 884a9021127f5..f73d4129d5c4d 100644 --- a/ext/standard/tests/strings/strrpos_variation7.phpt +++ b/ext/standard/tests/strings/strrpos_variation7.phpt @@ -17,7 +17,6 @@ try { echo $exception->getMessage() . "\n"; } var_dump( strrpos($empty_string, FALSE) ); -var_dump( strrpos($empty_string, NULL) ); echo "*** Done ***"; ?> @@ -27,5 +26,4 @@ echo "*** Done ***"; int(0) strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) int(0) -int(0) *** Done *** diff --git a/ext/standard/tests/strings/strstr.phpt b/ext/standard/tests/strings/strstr.phpt index da2aa1e22eb14..52088fb88ba3c 100644 Binary files a/ext/standard/tests/strings/strstr.phpt and b/ext/standard/tests/strings/strstr.phpt differ diff --git a/ext/standard/tests/strings/strtolower-win32.phpt b/ext/standard/tests/strings/strtolower-win32.phpt index b16e55cc50568..368a81ad93b3f 100644 Binary files a/ext/standard/tests/strings/strtolower-win32.phpt and b/ext/standard/tests/strings/strtolower-win32.phpt differ diff --git a/ext/standard/tests/strings/strtolower.phpt b/ext/standard/tests/strings/strtolower.phpt index 0f9b4299cf0db..3a685880571e0 100644 Binary files a/ext/standard/tests/strings/strtolower.phpt and b/ext/standard/tests/strings/strtolower.phpt differ diff --git a/ext/standard/tests/strings/strtoupper1-win32.phpt b/ext/standard/tests/strings/strtoupper1-win32.phpt index de26ca5400975..98a314a7b411e 100644 Binary files a/ext/standard/tests/strings/strtoupper1-win32.phpt and b/ext/standard/tests/strings/strtoupper1-win32.phpt differ diff --git a/ext/standard/tests/strings/strtoupper1.phpt b/ext/standard/tests/strings/strtoupper1.phpt index bff3f97d96bb4..864053d22dee2 100644 Binary files a/ext/standard/tests/strings/strtoupper1.phpt and b/ext/standard/tests/strings/strtoupper1.phpt differ diff --git a/ext/standard/tests/strings/strtr_variation4.phpt b/ext/standard/tests/strings/strtr_variation4.phpt index 21e5cab773228..f89ff654a1869 100644 --- a/ext/standard/tests/strings/strtr_variation4.phpt +++ b/ext/standard/tests/strings/strtr_variation4.phpt @@ -19,8 +19,6 @@ EOD; $str_arr = array( "", '', - NULL, - null, FALSE, false, $heredoc_str @@ -64,10 +62,4 @@ string(0) "" -- Iteration 5 -- string(0) "" string(0) "" --- Iteration 6 -- -string(0) "" -string(0) "" --- Iteration 7 -- -string(0) "" -string(0) "" *** Done *** diff --git a/ext/standard/tests/strings/strtr_variation6.phpt b/ext/standard/tests/strings/strtr_variation6.phpt index fcc903d6377f4..438eb168fae55 100644 --- a/ext/standard/tests/strings/strtr_variation6.phpt +++ b/ext/standard/tests/strings/strtr_variation6.phpt @@ -8,10 +8,6 @@ Test strtr() function : usage variations - unexpected inputs for 'from' argument echo "*** Testing strtr() function: with unexpected inputs for 'from' ***\n"; -//get an unset variable -$unset_var = 'string_val'; -unset($unset_var); - //defining a class class sample { public function __toString() { @@ -58,12 +54,6 @@ $from_arr = array ( // resource /*17*/ $file_handle, - - // undefined variable -/*18*/ @$undefined_var, - - // unset variable -/*19*/ @$unset_var ); //defining 'to' argument @@ -84,7 +74,7 @@ for($index = 0; $index < count($from_arr); $index++) { fclose($file_handle); //closing the file handle ?> ---EXPECT-- +--EXPECTF-- *** Testing strtr() function: with unexpected inputs for 'from' *** -- Iteration 1 -- string(6) "a12atm" @@ -113,14 +103,14 @@ string(6) "0a2atm" -- Iteration 13 -- string(6) "012atm" -- Iteration 14 -- + +Deprecated: strtr(): Passing null to parameter #2 ($from) of type array|string is deprecated in %s on line %d string(6) "012atm" -- Iteration 15 -- + +Deprecated: strtr(): Passing null to parameter #2 ($from) of type array|string is deprecated in %s on line %d string(6) "012atm" -- Iteration 16 -- string(6) "012ttm" -- Iteration 17 -- strtr(): Argument #2 ($from) must be of type array|string, resource given --- Iteration 18 -- -string(6) "012atm" --- Iteration 19 -- -string(6) "012atm" diff --git a/ext/standard/tests/strings/strtr_variation8.phpt b/ext/standard/tests/strings/strtr_variation8.phpt index 7ac60532f8b5b..d68c6f04e75bb 100644 --- a/ext/standard/tests/strings/strtr_variation8.phpt +++ b/ext/standard/tests/strings/strtr_variation8.phpt @@ -8,10 +8,6 @@ Test strtr() function : usage variations - unexpected inputs for 'replace_pairs' echo "*** Testing strtr() function: with unexpected inputs for 'replace_pairs' ***\n"; -//get an unset variable -$unset_var = 'string_val'; -unset($unset_var); - //defining a class class sample { public function __toString() { @@ -58,12 +54,6 @@ $replace_pairs_arr = array ( // resource $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var ); // loop through with each element of the $replace_pairs array to test strtr() function @@ -84,7 +74,7 @@ fclose($file_handle); //closing the file handle echo "*** Done ***"; ?> ---EXPECT-- +--EXPECTF-- *** Testing strtr() function: with unexpected inputs for 'replace_pairs' *** -- Iteration 1 -- @@ -127,9 +117,13 @@ strtr(): Argument #2 ($from) must be of type array, string given strtr(): Argument #2 ($from) must be of type array, string given -- Iteration 14 -- + +Deprecated: strtr(): Passing null to parameter #2 ($from) of type array|string is deprecated in %s on line %d strtr(): Argument #2 ($from) must be of type array, string given -- Iteration 15 -- + +Deprecated: strtr(): Passing null to parameter #2 ($from) of type array|string is deprecated in %s on line %d strtr(): Argument #2 ($from) must be of type array, string given -- Iteration 16 -- @@ -137,10 +131,4 @@ strtr(): Argument #2 ($from) must be of type array, string given -- Iteration 17 -- strtr(): Argument #2 ($from) must be of type array|string, resource given - --- Iteration 18 -- -strtr(): Argument #2 ($from) must be of type array, string given - --- Iteration 19 -- -strtr(): Argument #2 ($from) must be of type array, string given *** Done *** diff --git a/ext/standard/tests/strings/substr.phpt b/ext/standard/tests/strings/substr.phpt index 99dcd2bf2f0c0..8f172cee611b3 100644 Binary files a/ext/standard/tests/strings/substr.phpt and b/ext/standard/tests/strings/substr.phpt differ diff --git a/ext/standard/tests/strings/substr_count_variation_001.phpt b/ext/standard/tests/strings/substr_count_variation_001.phpt index abfecac0977dd..d76c56d60fb21 100644 --- a/ext/standard/tests/strings/substr_count_variation_001.phpt +++ b/ext/standard/tests/strings/substr_count_variation_001.phpt @@ -9,10 +9,6 @@ $str = "this is a string"; var_dump( substr_count($str, "t", "5") ); var_dump( substr_count($str, "t", "5", "10") ); -echo "\n-- 3rd or 4th arg as NULL --\n"; -var_dump( substr_count($str, "I", NULL) ); -var_dump( substr_count($str, "i", NULL, 10) ); - echo "\n-- overlapped substrings --\n"; var_dump( substr_count("abcabcabcabcabc", "abca") ); var_dump( substr_count("abcabcabcabcabc", "abca", 2) ); @@ -53,10 +49,6 @@ echo "Done\n"; int(1) int(1) --- 3rd or 4th arg as NULL -- -int(0) -int(2) - -- overlapped substrings -- int(2) int(2) diff --git a/ext/standard/tests/strings/trim1.phpt b/ext/standard/tests/strings/trim1.phpt index e4601db7ac187..849b972c117ab 100644 Binary files a/ext/standard/tests/strings/trim1.phpt and b/ext/standard/tests/strings/trim1.phpt differ diff --git a/ext/standard/tests/strings/ucfirst.phpt b/ext/standard/tests/strings/ucfirst.phpt index a54b984b882ee..1d8ecd7630c21 100644 Binary files a/ext/standard/tests/strings/ucfirst.phpt and b/ext/standard/tests/strings/ucfirst.phpt differ diff --git a/ext/standard/tests/strings/vprintf_variation1.phpt b/ext/standard/tests/strings/vprintf_variation1.phpt deleted file mode 100644 index 18cf1a7c0442a..0000000000000 --- a/ext/standard/tests/strings/vprintf_variation1.phpt +++ /dev/null @@ -1,200 +0,0 @@ ---TEST-- -Test vprintf() function : usage variations - unexpected values for the format argument ---FILE-- - 'red', 'item' => 'pen'), - - // null data -/*15*/ NULL, - null, - - // boolean data -/*17*/ true, - false, - TRUE, - FALSE, - - // empty data -/*21*/ "", - '', - - // object data -/*23*/ new sample(), - - // undefined data -/*24*/ @$undefined_var, - - // unset data -/*25*/ @$unset_var, - - // resource data -/*26*/ $file_handle -); - -// loop through each element of the array for format - -$counter = 1; -foreach($values as $value) { - echo "\n -- Iteration $counter --\n"; - try { - $result = vprintf($value, $args); - echo "\n"; - var_dump($result); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; - } - - $counter++; -} - -// closing the resource -fclose($file_handle); - -?> ---EXPECT-- -*** Testing vprintf() : with unexpected values for format argument *** - - -- Iteration 1 -- -0 -int(1) - - -- Iteration 2 -- -1 -int(1) - - -- Iteration 3 -- -12345 -int(5) - - -- Iteration 4 -- --2345 -int(5) - - -- Iteration 5 -- -10.5 -int(4) - - -- Iteration 6 -- --10.5 -int(5) - - -- Iteration 7 -- -101234567000 -int(12) - - -- Iteration 8 -- -1.07654321E-9 -int(13) - - -- Iteration 9 -- -0.5 -int(3) - - -- Iteration 10 -- -vprintf(): Argument #1 ($format) must be of type string, array given - - -- Iteration 11 -- -vprintf(): Argument #1 ($format) must be of type string, array given - - -- Iteration 12 -- -vprintf(): Argument #1 ($format) must be of type string, array given - - -- Iteration 13 -- -vprintf(): Argument #1 ($format) must be of type string, array given - - -- Iteration 14 -- -vprintf(): Argument #1 ($format) must be of type string, array given - - -- Iteration 15 -- - -int(0) - - -- Iteration 16 -- - -int(0) - - -- Iteration 17 -- -1 -int(1) - - -- Iteration 18 -- - -int(0) - - -- Iteration 19 -- -1 -int(1) - - -- Iteration 20 -- - -int(0) - - -- Iteration 21 -- - -int(0) - - -- Iteration 22 -- - -int(0) - - -- Iteration 23 -- -object -int(6) - - -- Iteration 24 -- - -int(0) - - -- Iteration 25 -- - -int(0) - - -- Iteration 26 -- -vprintf(): Argument #1 ($format) must be of type string, resource given diff --git a/ext/xmlreader/tests/015-get-errors.phpt b/ext/xmlreader/tests/015-get-errors.phpt index 7ea081c82f0bc..7bcb2ef9bd734 100644 --- a/ext/xmlreader/tests/015-get-errors.phpt +++ b/ext/xmlreader/tests/015-get-errors.phpt @@ -45,6 +45,7 @@ $reader->close(); ---EXPECT-- +--EXPECTF-- +Deprecated: XMLReader::getAttributeNs(): Passing null to parameter #2 ($namespace) of type string is deprecated in %s on line %d XMLReader::getAttributeNs(): Argument #2 ($namespace) cannot be empty ns1:num: 1 diff --git a/ext/xmlreader/tests/015-move-errors.phpt b/ext/xmlreader/tests/015-move-errors.phpt index 303d5c63e45ea..1c29b6983f29a 100644 --- a/ext/xmlreader/tests/015-move-errors.phpt +++ b/ext/xmlreader/tests/015-move-errors.phpt @@ -40,5 +40,6 @@ $reader->close(); ---EXPECT-- +--EXPECTF-- +Deprecated: XMLReader::moveToAttributeNs(): Passing null to parameter #2 ($namespace) of type string is deprecated in %s on line %d XMLReader::moveToAttributeNs(): Argument #2 ($namespace) cannot be empty diff --git a/ext/xmlwriter/tests/bug39504.phpt b/ext/xmlwriter/tests/bug39504.phpt index 267c5331de31f..da30c8e375e9e 100644 --- a/ext/xmlwriter/tests/bug39504.phpt +++ b/ext/xmlwriter/tests/bug39504.phpt @@ -21,7 +21,7 @@ $xw = new XMLWriter(); $xw->openMemory(); $xw->startDocument(NULL, "UTF-8"); $xw->startDtd("root"); -$xw->writeDtdEntity("c", NULL, 0, "-//W3C//TEXT copyright//EN", "http://www.w3.org/xmlspec/copyright.xml"); +$xw->writeDtdEntity("c", "", 0, "-//W3C//TEXT copyright//EN", "http://www.w3.org/xmlspec/copyright.xml"); $xw->endDtd(); $xw->startElement("root"); $xw->endDocument(); diff --git a/ext/zlib/tests/gzfile_variation3.phpt b/ext/zlib/tests/gzfile_variation3.phpt deleted file mode 100644 index 276c839468839..0000000000000 --- a/ext/zlib/tests/gzfile_variation3.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Test function gzfile() by substituting argument 1 with emptyUnsetUndefNull values. ---SKIPIF-- - ---FILE-- - @$unset_var, - 'undefined var' => @$undefined_var, - 'empty string DQ' => "", - 'empty string SQ' => '', - 'uppercase NULL' => NULL, - 'lowercase null' => null, - ); - - -foreach ( $variation as $var ) { - try { - var_dump(gzfile( $var , $use_include_path ) ); - } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; - } -} -?> ---EXPECT-- -Path cannot be empty -Path cannot be empty -Path cannot be empty -Path cannot be empty -Path cannot be empty -Path cannot be empty diff --git a/ext/zlib/tests/readgzfile_variation3.phpt b/ext/zlib/tests/readgzfile_variation3.phpt deleted file mode 100644 index 4a7fcecf08fbb..0000000000000 --- a/ext/zlib/tests/readgzfile_variation3.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Test function readgzfile() by substituting argument 1 with emptyUnsetUndefNull values. ---SKIPIF-- - ---FILE-- - @$unset_var, - 'undefined var' => @$undefined_var, - 'empty string DQ' => "", - 'empty string SQ' => '', - 'uppercase NULL' => NULL, - 'lowercase null' => null, - ); - - -foreach ( $variation as $var ) { - try { - var_dump(readgzfile( $var , $use_include_path ) ); - } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; - } -} -?> ---EXPECT-- -Path cannot be empty -Path cannot be empty -Path cannot be empty -Path cannot be empty -Path cannot be empty -Path cannot be empty diff --git a/run-tests.php b/run-tests.php index fb270f0adf4d3..c6e27e42ea9d6 100755 --- a/run-tests.php +++ b/run-tests.php @@ -3385,7 +3385,7 @@ function clear_show_test(): void // Parallel testing global $workerID; - if (!$workerID) { + if (!$workerID && isset($line_length)) { // Write over the last line to avoid random trailing chars on next echo echo str_repeat(" ", $line_length), "\r"; }