56
56
57
57
try {
58
58
var_dump ( range ("a " , "j " , "z " ) );
59
- } catch (TypeError $ e ) {
60
- echo $ e ->getMessage (), "\n" ;
61
- } catch (\ValueError $ e ) {
59
+ } catch (\TypeError $ e ) {
62
60
echo $ e ->getMessage (), "\n" ;
63
61
}
64
62
@@ -80,47 +78,43 @@ $step_arr = array( "string", NULL, FALSE, "", "\0" );
80
78
foreach ( $ step_arr as $ step ) {
81
79
try {
82
80
var_dump ( range ( 1 , 5 , $ step ) );
83
- } catch (\TypeError $ e ) {
84
- echo $ e ->getMessage (), "\n" ;
85
- } catch (\ValueError $ e ) {
81
+ } catch (\TypeError | \ValueError $ e ) {
86
82
echo $ e ->getMessage (), "\n" ;
87
83
}
88
84
}
89
85
90
- echo "Done \n" ;
91
86
?>
92
87
--EXPECTF--
93
88
*** Testing error conditions ***
94
89
95
90
-- 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
98
93
99
94
100
95
-- 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
103
98
104
99
105
100
-- Testing ( (low < high) && (high-low < step) ) --
106
- step exceeds the specified range
101
+ Step exceeds the specified range
107
102
108
103
109
104
-- Testing ( (low > high) && (low-high < step) ) --
110
- step exceeds the specified range
105
+ Step exceeds the specified range
111
106
112
107
-- Testing other conditions --
113
- step exceeds the specified range
108
+ Step exceeds the specified range
114
109
range() expects parameter 3 to be int or float, string given
115
- step exceeds the specified range
110
+ Step exceeds the specified range
116
111
117
112
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
119
114
120
115
-- Testing Invalid steps --
121
116
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
124
119
range() expects parameter 3 to be int or float, string given
125
120
range() expects parameter 3 to be int or float, string given
126
- Done
0 commit comments