Skip to content

Commit 714d9fc

Browse files
committed
Make chr ZPP failure message consistent with ext/standard
1 parent 256100a commit 714d9fc

File tree

5 files changed

+7
-30
lines changed

5 files changed

+7
-30
lines changed

ext/standard/string.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2792,11 +2792,7 @@ PHP_FUNCTION(chr)
27922792
{
27932793
zend_long c;
27942794

2795-
if (ZEND_NUM_ARGS() != 1) {
2796-
WRONG_PARAM_COUNT;
2797-
}
2798-
2799-
ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_QUIET, 1, 1)
2795+
ZEND_PARSE_PARAMETERS_START(1, 1)
28002796
Z_PARAM_LONG(c)
28012797
ZEND_PARSE_PARAMETERS_END_EX(c = 0);
28022798

ext/standard/tests/array/array_filter_variation9.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ array(6) {
4545
[5]=>
4646
int(1000)
4747
}
48+
49+
Warning: chr() expects parameter 1 to be int, string given in %s on line %d
4850
array(8) {
4951
[0]=>
5052
int(0)
40 Bytes
Binary file not shown.
-3.1 KB
Binary file not shown.

ext/standard/tests/strings/chr_variation1.phpt

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ $inputs = array (
3838
-20.5,
3939
1.1234e6,
4040

41-
// array values
42-
/*8*/ array(),
43-
array(0),
44-
array(1, 2),
45-
4641
// boolean values
4742
/*11*/ true,
4843
false,
@@ -53,12 +48,6 @@ $inputs = array (
5348
/*15*/ NULL,
5449
null,
5550

56-
// objects
57-
/*17*/ new sample(),
58-
59-
// resource
60-
/*18*/ $file_handle,
61-
6251
// undefined variable
6352
/*19*/ @$undefined_var,
6453

@@ -95,29 +84,19 @@ string(2) "ec"
9584
-- Iteration 7 --
9685
string(2) "48"
9786
-- Iteration 8 --
98-
string(2) "00"
87+
string(2) "01"
9988
-- Iteration 9 --
10089
string(2) "00"
10190
-- Iteration 10 --
102-
string(2) "00"
103-
-- Iteration 11 --
10491
string(2) "01"
92+
-- Iteration 11 --
93+
string(2) "00"
10594
-- Iteration 12 --
10695
string(2) "00"
10796
-- Iteration 13 --
108-
string(2) "01"
97+
string(2) "00"
10998
-- Iteration 14 --
11099
string(2) "00"
111100
-- Iteration 15 --
112101
string(2) "00"
113-
-- Iteration 16 --
114-
string(2) "00"
115-
-- Iteration 17 --
116-
string(2) "00"
117-
-- Iteration 18 --
118-
string(2) "00"
119-
-- Iteration 19 --
120-
string(2) "00"
121-
-- Iteration 20 --
122-
string(2) "00"
123102
===DONE===

0 commit comments

Comments
 (0)