diff --git a/Zend/tests/bug71300.phpt b/Zend/tests/bug71300.phpt index 40734b054933b..abf9ebc5307cd 100644 --- a/Zend/tests/bug71300.phpt +++ b/Zend/tests/bug71300.phpt @@ -22,7 +22,22 @@ function test2() { var_dump(test2()); ?> --EXPECTF-- +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(4) "test" +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d + Warning: Array to string conversion in %s on line %d string(9) "Arraytest" diff --git a/Zend/tests/dynamic_call/variable_variables_curly_syntax.phpt b/Zend/tests/dynamic_call/variable_variables_curly_syntax.phpt index a862d689e1a84..217ad5a3a304e 100644 --- a/Zend/tests/dynamic_call/variable_variables_curly_syntax.phpt +++ b/Zend/tests/dynamic_call/variable_variables_curly_syntax.phpt @@ -17,6 +17,8 @@ $strtoupper = 'strtolower'; var_dump(${${++$a}}('FOO') == 'foo'); ?> ---EXPECT-- +--EXPECTF-- bool(true) + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d bool(true) diff --git a/Zend/tests/enum/backed-from-unknown-hash.phpt b/Zend/tests/enum/backed-from-unknown-hash.phpt index eb5938d0d6532..bc82a8d63350c 100644 --- a/Zend/tests/enum/backed-from-unknown-hash.phpt +++ b/Zend/tests/enum/backed-from-unknown-hash.phpt @@ -13,5 +13,6 @@ $s++; var_dump(Foo::from($s)); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d enum(Foo::Bar) diff --git a/Zend/tests/enum/backed-tryFrom-unknown-hash.phpt b/Zend/tests/enum/backed-tryFrom-unknown-hash.phpt index 80ffe1dc3908e..133144edfac6e 100644 --- a/Zend/tests/enum/backed-tryFrom-unknown-hash.phpt +++ b/Zend/tests/enum/backed-tryFrom-unknown-hash.phpt @@ -13,5 +13,6 @@ $s++; var_dump(Foo::tryFrom($s)); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d enum(Foo::Bar) diff --git a/Zend/tests/in-de-crement/incdec_strings.phpt b/Zend/tests/in-de-crement/incdec_strings.phpt index 9df89536140b2..65b8adf7ee12a 100644 --- a/Zend/tests/in-de-crement/incdec_strings.phpt +++ b/Zend/tests/in-de-crement/incdec_strings.phpt @@ -57,11 +57,11 @@ foreach ($values as $value) { Using increment: Initial value:string(0) "" -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d Result value:string(1) "1" Initial value:string(1) " " -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d Result value:string(1) " " Initial value:string(1) "0" Result value:int(1) @@ -70,20 +70,28 @@ Result value:float(16.5) Initial value:string(4) "1e10" Result value:float(10000000001) Initial value:string(4) "199A" + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d Result value:string(4) "199B" Initial value:string(4) "A199" + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d Result value:string(4) "A200" Initial value:string(4) "199Z" + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d Result value:string(4) "200A" Initial value:string(4) "Z199" + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d Result value:string(4) "Z200" Initial value:string(11) "Hello world" -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d Result value:string(11) "Hello worle" Initial value:string(4) "🐘" -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d Result value:string(4) "🐘" Using decrement: Initial value:string(0) "" diff --git a/Zend/tests/in-de-crement/incdec_strings_exception.phpt b/Zend/tests/in-de-crement/incdec_strings_exception.phpt index 4214a6a45878a..5acbb1041222a 100644 --- a/Zend/tests/in-de-crement/incdec_strings_exception.phpt +++ b/Zend/tests/in-de-crement/incdec_strings_exception.phpt @@ -41,31 +41,35 @@ foreach ($values as $value) { } ?> --EXPECT-- -Deprecated: Increment on non-alphanumeric string is deprecated +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead string(0) "" Deprecated: Decrement on empty string is deprecated as non-numeric string(0) "" -Deprecated: Increment on non-alphanumeric string is deprecated +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead string(1) " " Deprecated: Decrement on non-numeric string has no effect and is deprecated string(1) " " -string(4) "199B" +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead +string(4) "199A" Deprecated: Decrement on non-numeric string has no effect and is deprecated -string(4) "199B" -string(4) "A200" +string(4) "199A" +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead +string(4) "A199" Deprecated: Decrement on non-numeric string has no effect and is deprecated -string(4) "A200" -string(4) "200A" +string(4) "A199" +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead +string(4) "199Z" Deprecated: Decrement on non-numeric string has no effect and is deprecated -string(4) "200A" -string(4) "Z200" +string(4) "199Z" +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead +string(4) "Z199" Deprecated: Decrement on non-numeric string has no effect and is deprecated -string(4) "Z200" -Deprecated: Increment on non-alphanumeric string is deprecated +string(4) "Z199" +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead string(11) "Hello world" Deprecated: Decrement on non-numeric string has no effect and is deprecated string(11) "Hello world" -Deprecated: Increment on non-alphanumeric string is deprecated +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead string(4) "🐘" Deprecated: Decrement on non-numeric string has no effect and is deprecated string(4) "🐘" diff --git a/Zend/tests/in-de-crement/incdec_types.phpt b/Zend/tests/in-de-crement/incdec_types.phpt index dfd850965146a..755b63957ef33 100644 --- a/Zend/tests/in-de-crement/incdec_types.phpt +++ b/Zend/tests/in-de-crement/incdec_types.phpt @@ -63,11 +63,11 @@ Initial value:float(0) Result value:float(1) Initial value:string(0) "" -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d Result value:string(1) "1" Initial value:string(1) " " -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d Result value:string(1) " " Initial value:string(1) "0" Result value:int(1) diff --git a/Zend/tests/in-de-crement/increment_diagnostic_change_type.phpt b/Zend/tests/in-de-crement/increment_diagnostic_change_type.phpt index e124bfe907ebc..11a0edac19171 100644 --- a/Zend/tests/in-de-crement/increment_diagnostic_change_type.phpt +++ b/Zend/tests/in-de-crement/increment_diagnostic_change_type.phpt @@ -31,8 +31,8 @@ var_dump($x); DONE --EXPECT-- string(1) "1" -string(50) "Increment on non-alphanumeric string is deprecated" +string(74) "Increment on non-numeric string is deprecated, use str_increment() instead" string(4) "foo!" -string(50) "Increment on non-alphanumeric string is deprecated" +string(74) "Increment on non-numeric string is deprecated, use str_increment() instead" string(1) "!" DONE diff --git a/Zend/tests/in-de-crement/increment_diagnostic_change_type_do_operator.phpt b/Zend/tests/in-de-crement/increment_diagnostic_change_type_do_operator.phpt index e20159a578cd9..8e63ad6aeed46 100644 --- a/Zend/tests/in-de-crement/increment_diagnostic_change_type_do_operator.phpt +++ b/Zend/tests/in-de-crement/increment_diagnostic_change_type_do_operator.phpt @@ -23,8 +23,8 @@ var_dump($x); ?> DONE --EXPECT-- -string(50) "Increment on non-alphanumeric string is deprecated" +string(74) "Increment on non-numeric string is deprecated, use str_increment() instead" string(4) "foo!" -string(50) "Increment on non-alphanumeric string is deprecated" +string(74) "Increment on non-numeric string is deprecated, use str_increment() instead" string(1) "!" DONE diff --git a/Zend/tests/in-de-crement/oss-fuzz-62294_globals_unset_after_string_warning.phpt b/Zend/tests/in-de-crement/oss-fuzz-62294_globals_unset_after_string_warning.phpt index 7ca1100fbdde0..f52dff52e6315 100644 --- a/Zend/tests/in-de-crement/oss-fuzz-62294_globals_unset_after_string_warning.phpt +++ b/Zend/tests/in-de-crement/oss-fuzz-62294_globals_unset_after_string_warning.phpt @@ -31,8 +31,8 @@ PRE DEC Decrement on non-numeric string has no effect and is deprecated string(1) " " POST INC -Increment on non-alphanumeric string is deprecated +Increment on non-numeric string is deprecated, use str_increment() instead string(1) " " PRE INC -Increment on non-alphanumeric string is deprecated +Increment on non-numeric string is deprecated, use str_increment() instead string(1) " " diff --git a/Zend/tests/in-de-crement/string_increment_various.phpt b/Zend/tests/in-de-crement/string_increment_various.phpt index 8499d823042b6..d1dd79a03f1be 100644 --- a/Zend/tests/in-de-crement/string_increment_various.phpt +++ b/Zend/tests/in-de-crement/string_increment_various.phpt @@ -53,55 +53,72 @@ var_dump(++$s); // string(3) "5e0" var_dump(++$s); // float(6) ?> --EXPECTF-- +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(2) "Ba" + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(2) "bA" + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(2) "B0" + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(2) "b0" + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(3) "AAa" + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(3) "aaA" + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(3) "10a" + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(3) "10A" -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(1) "1" -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(3) "-cd" -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(2) "Z " -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(2) " A" -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(2) "é" -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(15) "あいうえお" -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(2) "α" -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(2) "ω" -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(2) "Α" -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(2) "Ω" -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(8) "foo1.txu" -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(4) "1f.6" -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(9) "foo.1.txu" -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(5) "1.f.6" + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(3) "5e0" float(6) diff --git a/Zend/tests/in-de-crement/unset_globals_in_error_handler.phpt b/Zend/tests/in-de-crement/unset_globals_in_error_handler.phpt index d2f27ed323249..31ffea22467be 100644 --- a/Zend/tests/in-de-crement/unset_globals_in_error_handler.phpt +++ b/Zend/tests/in-de-crement/unset_globals_in_error_handler.phpt @@ -85,23 +85,23 @@ Decrement on type null has no effect, this will change in the next major version NULL Empty string POST INC -Increment on non-alphanumeric string is deprecated +Increment on non-numeric string is deprecated, use str_increment() instead string(0) "" POST DEC Decrement on empty string is deprecated as non-numeric string(0) "" PRE INC -Increment on non-alphanumeric string is deprecated +Increment on non-numeric string is deprecated, use str_increment() instead string(1) "1" PRE DEC Decrement on empty string is deprecated as non-numeric int(-1) Non fill ASCII (only ++) POST INC -Increment on non-alphanumeric string is deprecated +Increment on non-numeric string is deprecated, use str_increment() instead string(4) " ad " PRE INC -Increment on non-alphanumeric string is deprecated +Increment on non-numeric string is deprecated, use str_increment() instead string(4) " ad " Bool POST INC diff --git a/Zend/tests/in-de-crement/unset_object_property_in_error_handler.phpt b/Zend/tests/in-de-crement/unset_object_property_in_error_handler.phpt index 33d18b9a62797..4d2a4705588aa 100644 --- a/Zend/tests/in-de-crement/unset_object_property_in_error_handler.phpt +++ b/Zend/tests/in-de-crement/unset_object_property_in_error_handler.phpt @@ -98,23 +98,23 @@ string(87) "Decrement on type null has no effect, this will change in the next m NULL Empty string POST INC -string(50) "Increment on non-alphanumeric string is deprecated" +string(74) "Increment on non-numeric string is deprecated, use str_increment() instead" string(0) "" POST DEC string(54) "Decrement on empty string is deprecated as non-numeric" string(0) "" PRE INC -string(50) "Increment on non-alphanumeric string is deprecated" +string(74) "Increment on non-numeric string is deprecated, use str_increment() instead" string(1) "1" PRE DEC string(54) "Decrement on empty string is deprecated as non-numeric" int(-1) Non fill ASCII (only ++) POST INC -string(50) "Increment on non-alphanumeric string is deprecated" +string(74) "Increment on non-numeric string is deprecated, use str_increment() instead" string(4) " ad " PRE INC -string(50) "Increment on non-alphanumeric string is deprecated" +string(74) "Increment on non-numeric string is deprecated, use str_increment() instead" string(4) " ad " Bool POST INC diff --git a/Zend/tests/operator_unsupported_types.phpt b/Zend/tests/operator_unsupported_types.phpt index ef169bb39fc29..a08032226e5db 100644 --- a/Zend/tests/operator_unsupported_types.phpt +++ b/Zend/tests/operator_unsupported_types.phpt @@ -2104,6 +2104,7 @@ Cannot increment stdClass Cannot decrement stdClass Cannot increment resource Cannot decrement resource +Warning: Increment on non-numeric string is deprecated, use str_increment() instead No error for fop++ Warning: Decrement on non-numeric string has no effect and is deprecated No error for foo-- diff --git a/Zend/tests/temporary_cleaning/temporary_cleaning_013.phpt b/Zend/tests/temporary_cleaning/temporary_cleaning_013.phpt index e5f4b73bb14a2..6e6dc58baad0e 100644 --- a/Zend/tests/temporary_cleaning/temporary_cleaning_013.phpt +++ b/Zend/tests/temporary_cleaning/temporary_cleaning_013.phpt @@ -320,5 +320,7 @@ caught Exception 27 caught Exception 28 caught Exception 29 caught Exception 30 + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d caught Exception 31 caught Exception 32 diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 957d93f984967..e6e0c82c79f20 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -2558,29 +2558,23 @@ static bool ZEND_FASTCALL increment_string(zval *str) /* {{{ */ int last=0; /* Shut up the compiler warning */ int ch; + zend_string *zstr = Z_STR_P(str); + zend_string_addref(zstr); + zend_error(E_DEPRECATED, "Increment on non-numeric string is deprecated, use str_increment() instead"); + if (EG(exception)) { + zend_string_release(zstr); + return false; + } + /* A userland error handler can change the type from string to something else */ + zval_ptr_dtor(str); + ZVAL_STR(str, zstr); + if (UNEXPECTED(Z_STRLEN_P(str) == 0)) { - zend_error(E_DEPRECATED, "Increment on non-alphanumeric string is deprecated"); - if (EG(exception)) { - return false; - } - /* A userland error handler can change the type from string to something else */ zval_ptr_dtor(str); ZVAL_CHAR(str, '1'); return true; } - if (UNEXPECTED(!zend_string_only_has_ascii_alphanumeric(Z_STR_P(str)))) { - zend_string *zstr = Z_STR_P(str); - zend_string_addref(zstr); - zend_error(E_DEPRECATED, "Increment on non-alphanumeric string is deprecated"); - if (EG(exception)) { - zend_string_release(zstr); - return false; - } - zval_ptr_dtor(str); - ZVAL_STR(str, zstr); - } - if (!Z_REFCOUNTED_P(str)) { Z_STR_P(str) = zend_string_init(Z_STRVAL_P(str), Z_STRLEN_P(str), 0); Z_TYPE_INFO_P(str) = IS_STRING_EX; diff --git a/ext/ffi/tests/025.phpt b/ext/ffi/tests/025.phpt index b1cdab9463e68..817d12806deac 100644 --- a/ext/ffi/tests/025.phpt +++ b/ext/ffi/tests/025.phpt @@ -39,6 +39,8 @@ object(FFI\CData:char)#%d (1) { ["cdata"]=> string(1) "a" } + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d object(FFI\CData:char)#%d (1) { ["cdata"]=> string(1) "b" diff --git a/ext/opcache/tests/jit/inc_022.phpt b/ext/opcache/tests/jit/inc_022.phpt index 9b13f51dc23da..2c091d98d4086 100644 --- a/ext/opcache/tests/jit/inc_022.phpt +++ b/ext/opcache/tests/jit/inc_022.phpt @@ -22,7 +22,8 @@ var_dump(inc(1.1)); var_dump(dec("5")); var_dump(dec(1.1)); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(3) "abd" int(6) float(2.1) diff --git a/ext/opcache/tests/jit/inc_023.phpt b/ext/opcache/tests/jit/inc_023.phpt index ef832c096ae7d..516e5a45aa7d6 100644 --- a/ext/opcache/tests/jit/inc_023.phpt +++ b/ext/opcache/tests/jit/inc_023.phpt @@ -19,7 +19,11 @@ var_dump(++$test->prop); var_dump(--$test->prop); ?> --EXPECTF-- +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d + Deprecated: Decrement on non-numeric string has no effect and is deprecated in %s on line %d + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(1) "c" Deprecated: Decrement on non-numeric string has no effect and is deprecated in %s on line %d diff --git a/ext/opcache/tests/jit/inc_024.phpt b/ext/opcache/tests/jit/inc_024.phpt index e125f9b084df6..5e6e2bbfe75f2 100644 --- a/ext/opcache/tests/jit/inc_024.phpt +++ b/ext/opcache/tests/jit/inc_024.phpt @@ -23,52 +23,52 @@ function test($b) { test("0"); ?> --EXPECTF-- -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d Deprecated: Decrement on non-numeric string has no effect and is deprecated in %s on line %d -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(5) "-INF0" string(260) "0-2-12-112-1112-11112-111112-1111112-11111112-111111112-1111111112-11111111112-111111111112-1111111111112-11111111111112-111111111111112-1111111111111112-11111111111111112-111111111111111112-1111111111111111112-1.1111111111111E+20-1.1111111111111E+191-ING-INF1" diff --git a/ext/opcache/tests/opt/gh11245_2.phpt b/ext/opcache/tests/opt/gh11245_2.phpt index f42da12c52743..ade810c453b13 100644 --- a/ext/opcache/tests/opt/gh11245_2.phpt +++ b/ext/opcache/tests/opt/gh11245_2.phpt @@ -34,3 +34,5 @@ $_main: 0006 RETURN int(1) LIVE RANGES: 1: 0001 - 0005 (tmp/var) + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d diff --git a/ext/opcache/tests/opt/sccp_038.phpt b/ext/opcache/tests/opt/sccp_038.phpt index 165206056c6e5..b2d7e79c5fe05 100644 --- a/ext/opcache/tests/opt/sccp_038.phpt +++ b/ext/opcache/tests/opt/sccp_038.phpt @@ -15,5 +15,5 @@ foo(); ?> DONE --EXPECTF-- -Deprecated: Increment on non-alphanumeric string is deprecated in %ssccp_038.php on line 5 +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %ssccp_038.php on line 5 DONE diff --git a/ext/standard/tests/strings/str_increment_polyfill.phpt b/ext/standard/tests/strings/str_increment_polyfill.phpt index 36ad262598f4e..1f9f948aa200b 100644 --- a/ext/standard/tests/strings/str_increment_polyfill.phpt +++ b/ext/standard/tests/strings/str_increment_polyfill.phpt @@ -10,9 +10,9 @@ function polyfill(string $s): string { /* Using increment operator would cast the string to float * Therefore we manually increment it to convert it to an "f"/"F" that doesn't get affected */ $c = $s[$offset]; - $c++; + @$c++; $s[$offset] = $c; - $s++; + @$s++; $s[$offset] = match ($s[$offset]) { 'f' => 'e', 'F' => 'E', @@ -22,7 +22,7 @@ function polyfill(string $s): string { return $s; } } - return ++$s; + return @++$s; } $strictlyAlphaNumeric = [ diff --git a/tests/lang/operators/postinc_variationStr.phpt b/tests/lang/operators/postinc_variationStr.phpt index a064b49835333..d5eb58d4ecac7 100644 --- a/tests/lang/operators/postinc_variationStr.phpt +++ b/tests/lang/operators/postinc_variationStr.phpt @@ -28,30 +28,36 @@ float(2.2) --- testing: '-7.7' --- float(-6.7) --- testing: 'abc' --- + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(3) "abd" --- testing: '123abc' --- + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(6) "123abd" --- testing: '123e5' --- float(12300001) --- testing: '123e5xyz' --- + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(8) "123e5xza" --- testing: ' 123abc' --- -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(7) " 123abd" --- testing: '123 abc' --- -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(7) "123 abd" --- testing: '123abc ' --- -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(7) "123abc " --- testing: '3.4a' --- -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(4) "3.4b" --- testing: 'a5.9' --- -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(4) "a5.0" diff --git a/tests/lang/operators/preinc_variationStr.phpt b/tests/lang/operators/preinc_variationStr.phpt index bcae316d8f9b7..9b58a95573d7a 100644 --- a/tests/lang/operators/preinc_variationStr.phpt +++ b/tests/lang/operators/preinc_variationStr.phpt @@ -28,48 +28,72 @@ float(2.2) --- testing: '-7.7' --- float(-6.7) --- testing: 'abc' --- + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(3) "abd" --- testing: '123abc' --- + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(6) "123abd" --- testing: '123e5' --- float(12300001) --- testing: '123e5xyz' --- + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(8) "123e5xza" --- testing: ' 123abc' --- -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(7) " 123abd" --- testing: '123 abc' --- -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(7) "123 abd" --- testing: '123abc ' --- -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(7) "123abc " --- testing: '3.4a' --- -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(4) "3.4b" --- testing: 'a5.9' --- -Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(4) "a5.0" --- testing: 'z' --- + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(2) "aa" --- testing: 'az' --- + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(2) "ba" --- testing: 'zz' --- + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(3) "aaa" --- testing: 'Z' --- + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(2) "AA" --- testing: 'AZ' --- + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(2) "BA" --- testing: 'ZZ' --- + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(3) "AAA" --- testing: '9z' --- + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(3) "10a" --- testing: '19z' --- + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(3) "20a" --- testing: '99z' --- + +Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in %s on line %d string(4) "100a"