Skip to content

Commit 1dc278c

Browse files
committed
Fix deprecated mbregex
1 parent 85af33c commit 1dc278c

6 files changed

Lines changed: 45 additions & 9 deletions

ext/mbstring/tests/mb_ereg_search_named_subpatterns_1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set_error_handler(function($errno, $errstr, $errfile, $errline) {
99
switch ($errno) {
1010
case E_DEPRECATED:
1111
if (str_contains($errfile, "skip.php")) {
12-
die("skip deprecated oniguruma");
12+
return;
1313
}
1414
}
1515
});

ext/mbstring/tests/mb_ereg_search_named_subpatterns_2.phpt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set_error_handler(function($errno, $errstr, $errfile, $errline) {
99
switch ($errno) {
1010
case E_DEPRECATED:
1111
if (str_contains($errfile, "skip.php")) {
12-
die("skip deprecated oniguruma");
12+
return;
1313
}
1414
}
1515
});
@@ -22,7 +22,14 @@ version_compare(MB_ONIGURUMA_VERSION, '6.9.4', '>=') or die("skip requires onigu
2222
mb_ereg_search('(?<wsp>\s*)(?<word>\w+)(?<punct>[?!])');
2323
var_dump(mb_ereg_search_getregs());
2424
?>
25-
--EXPECT--
25+
--EXPECTF--
26+
Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
27+
28+
Deprecated: Function mb_ereg_search_init() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
29+
30+
Deprecated: Function mb_ereg_search() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
31+
32+
Deprecated: Function mb_ereg_search_getregs() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
2633
array(7) {
2734
[0]=>
2835
string(11) " 中国?"

ext/mbstring/tests/mb_ereg_variation3.phpt

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set_error_handler(function($errno, $errstr, $errfile, $errline) {
99
switch ($errno) {
1010
case E_DEPRECATED:
1111
if (str_contains($errfile, "skip.php")) {
12-
die("skip deprecated oniguruma");
12+
return;
1313
}
1414
}
1515
});
@@ -74,87 +74,113 @@ function base64_encode_var_dump($regs) {
7474

7575
echo "Done";
7676
?>
77-
--EXPECT--
77+
--EXPECTF--
7878
*** Testing mb_ereg() : variation ***
7979

80+
Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
81+
8082
-- Iteration 1 --
83+
84+
Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
8185
bool(true)
8286
array(1) {
8387
[0]=>
8488
string(4) "YUIx"
8589
}
8690

8791
-- Iteration 2 --
92+
93+
Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
8894
bool(true)
8995
array(1) {
9096
[0]=>
9197
string(8) "YUJjRA=="
9298
}
9399

94100
-- Iteration 3 --
101+
102+
Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
95103
bool(true)
96104
array(1) {
97105
[0]=>
98106
string(8) "YWIvPQ=="
99107
}
100108

101109
-- Iteration 4 --
110+
111+
Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
102112
bool(true)
103113
array(1) {
104114
[0]=>
105115
string(4) "IAk="
106116
}
107117

108118
-- Iteration 5 --
119+
120+
Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
109121
bool(true)
110122
array(1) {
111123
[0]=>
112124
string(4) "MjM0"
113125
}
114126

115127
-- Iteration 6 --
128+
129+
Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
116130
bool(true)
117131
array(1) {
118132
[0]=>
119133
string(12) "5pel5pys6Kqe"
120134
}
121135

122136
-- Iteration 7 --
137+
138+
Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
123139
bool(true)
124140
array(1) {
125141
[0]=>
126142
string(8) "Zmpkcw=="
127143
}
128144

129145
-- Iteration 8 --
146+
147+
Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
130148
bool(true)
131149
array(1) {
132150
[0]=>
133151
string(12) "5pel5pys6Kqe"
134152
}
135153

136154
-- Iteration 9 --
155+
156+
Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
137157
bool(true)
138158
array(1) {
139159
[0]=>
140160
string(8) "LiEiKkA="
141161
}
142162

143163
-- Iteration 10 --
164+
165+
Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
144166
bool(true)
145167
array(1) {
146168
[0]=>
147169
string(4) "CQ=="
148170
}
149171

150172
-- Iteration 11 --
173+
174+
Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
151175
bool(true)
152176
array(1) {
153177
[0]=>
154178
string(8) "SURTSlY="
155179
}
156180

157181
-- Iteration 12 --
182+
183+
Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
158184
bool(true)
159185
array(1) {
160186
[0]=>

ext/mbstring/tests/mbregex_stack_limit.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set_error_handler(function($errno, $errstr, $errfile, $errline) {
99
switch ($errno) {
1010
case E_DEPRECATED:
1111
if (str_contains($errfile, "skip.php")) {
12-
die("skip deprecated oniguruma");
12+
return;
1313
}
1414
}
1515
});

ext/mbstring/tests/mbregex_stack_limit2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set_error_handler(function($errno, $errstr, $errfile, $errline) {
1010
switch ($errno) {
1111
case E_DEPRECATED:
1212
if (str_contains($errfile, "skip.php")) {
13-
die("skip deprecated oniguruma");
13+
return;
1414
}
1515
}
1616
});

ext/mbstring/tests/retry_limit.phpt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set_error_handler(function($errno, $errstr, $errfile, $errline) {
99
switch ($errno) {
1010
case E_DEPRECATED:
1111
if (str_contains($errfile, "skip.php")) {
12-
die("skip deprecated oniguruma");
12+
return;
1313
}
1414
}
1515
});
@@ -27,6 +27,9 @@ ini_set('mbstring.regex_retry_limit', '100000');
2727
var_dump(mb_ereg($regex, $str));
2828

2929
?>
30-
--EXPECT--
30+
--EXPECTF--
31+
Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
3132
bool(true)
33+
34+
Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
3235
bool(false)

0 commit comments

Comments
 (0)