File tree 3 files changed +7
-1
lines changed
3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ PHP NEWS
25
25
- SimpleXML:
26
26
. Apply iterator fixes only on master. (nielsdos)
27
27
28
+ - Standard:
29
+ . Fixed str_decrement() on "1". (ilutov)
30
+
28
31
- XSL:
29
32
. Fix type error on XSLTProcessor::transformToDoc return value with
30
33
SimpleXML. (nielsdos)
Original file line number Diff line number Diff line change @@ -1289,7 +1289,7 @@ PHP_FUNCTION(str_decrement)
1289
1289
}
1290
1290
} while (carry && position -- > 0 );
1291
1291
1292
- if (UNEXPECTED (carry || ZSTR_VAL (decremented )[0 ] == '0' )) {
1292
+ if (UNEXPECTED (carry || ( ZSTR_VAL (decremented )[0 ] == '0' && ZSTR_LEN ( decremented ) > 1 ) )) {
1293
1293
if (ZSTR_LEN (decremented ) == 1 ) {
1294
1294
zend_string_release_ex (decremented , /* persistent */ false);
1295
1295
zend_argument_value_error (1 , "\"%s\" is out of decrement range" , ZSTR_VAL (str ));
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ $strictlyAlphaNumeric = [
28
28
"d " ,
29
29
"D " ,
30
30
"4 " ,
31
+ "1 " ,
31
32
];
32
33
33
34
foreach ($ strictlyAlphaNumeric as $ s ) {
@@ -77,3 +78,5 @@ string(1) "C"
77
78
string(1) "D"
78
79
string(1) "3"
79
80
string(1) "4"
81
+ string(1) "0"
82
+ string(1) "1"
You can’t perform that action at this time.
0 commit comments