Skip to content

Commit 516ebd0

Browse files
committed
Fix error capitalization
1 parent 07c2595 commit 516ebd0

File tree

2 files changed

+14
-20
lines changed

2 files changed

+14
-20
lines changed

ext/standard/array.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2909,7 +2909,7 @@ PHP_FUNCTION(range)
29092909
}
29102910
err:
29112911
if (err) {
2912-
zend_value_error("step exceeds the specified range");
2912+
zend_value_error("Step exceeds the specified range");
29132913
return;
29142914
}
29152915
}

ext/standard/tests/array/range_errors.phpt

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ try {
5656

5757
try {
5858
var_dump( range("a", "j", "z") );
59-
} catch (TypeError $e) {
60-
echo $e->getMessage(), "\n";
61-
} catch (\ValueError $e) {
59+
} catch (\TypeError $e) {
6260
echo $e->getMessage(), "\n";
6361
}
6462

@@ -80,47 +78,43 @@ $step_arr = array( "string", NULL, FALSE, "", "\0" );
8078
foreach( $step_arr as $step ) {
8179
try {
8280
var_dump( range( 1, 5, $step ) );
83-
} catch (\TypeError $e) {
84-
echo $e->getMessage(), "\n";
85-
} catch (\ValueError $e) {
81+
} catch (\TypeError | \ValueError $e) {
8682
echo $e->getMessage(), "\n";
8783
}
8884
}
8985

90-
echo "Done\n";
9186
?>
9287
--EXPECTF--
9388
*** Testing error conditions ***
9489

9590
-- Testing ( (low < high) && (step = 0) ) --
96-
step exceeds the specified range
97-
step exceeds the specified range
91+
Step exceeds the specified range
92+
Step exceeds the specified range
9893

9994

10095
-- Testing ( (low > high) && (step = 0) ) --
101-
step exceeds the specified range
102-
step exceeds the specified range
96+
Step exceeds the specified range
97+
Step exceeds the specified range
10398

10499

105100
-- Testing ( (low < high) && (high-low < step) ) --
106-
step exceeds the specified range
101+
Step exceeds the specified range
107102

108103

109104
-- Testing ( (low > high) && (low-high < step) ) --
110-
step exceeds the specified range
105+
Step exceeds the specified range
111106

112107
-- Testing other conditions --
113-
step exceeds the specified range
108+
Step exceeds the specified range
114109
range() expects parameter 3 to be int or float, string given
115-
step exceeds the specified range
110+
Step exceeds the specified range
116111

117112
Notice: A non well formed numeric value encountered in %s on line %d
118-
step exceeds the specified range
113+
Step exceeds the specified range
119114

120115
-- Testing Invalid steps --
121116
range() expects parameter 3 to be int or float, string given
122-
step exceeds the specified range
123-
step exceeds the specified range
117+
Step exceeds the specified range
118+
Step exceeds the specified range
124119
range() expects parameter 3 to be int or float, string given
125120
range() expects parameter 3 to be int or float, string given
126-
Done

0 commit comments

Comments
 (0)