Skip to content

Commit ba5d2e6

Browse files
committed
Merge branch 'PHP-7.4'
2 parents e237591 + e366cee commit ba5d2e6

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

ext/mbstring/php_mbregex.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,10 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
10501050
arg_pattern = Z_STRVAL_P(arg_pattern_zval);
10511051
arg_pattern_len = Z_STRLEN_P(arg_pattern_zval);
10521052
} else {
1053+
php_error_docref(NULL, E_DEPRECATED,
1054+
"Non-string patterns will be interpreted as strings in the future. "
1055+
"Use an explicit chr() call to preserve the current behavior");
1056+
10531057
/* FIXME: this code is not multibyte aware! */
10541058
convert_to_long_ex(arg_pattern_zval);
10551059
pat_buf[0] = (char)Z_LVAL_P(arg_pattern_zval);

ext/mbstring/tests/bug72994.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ var_dump($var1);
1414
--EXPECTF--
1515
Notice: Undefined variable: var in %s on line %d
1616

17+
Deprecated: mb_ereg_replace(): Non-string patterns will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
18+
1719
Warning: mb_ereg_replace(): mbregex compile err: invalid code point value in %sbug72994.php on line %d
1820
bool(false)
1921
===DONE===

ext/mbstring/tests/mb_ereg_replace_variation1.phpt

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,52 +100,82 @@ echo "Done";
100100
*** Testing mb_ereg_replace() : usage variations ***
101101

102102
-- Iteration 1 --
103+
104+
Deprecated: mb_ereg_replace(): Non-string patterns will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
103105
string(10) "string_val"
104106

105107
-- Iteration 2 --
108+
109+
Deprecated: mb_ereg_replace(): Non-string patterns will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
106110
string(10) "string_val"
107111

108112
-- Iteration 3 --
113+
114+
Deprecated: mb_ereg_replace(): Non-string patterns will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
109115
string(10) "string_val"
110116

111117
-- Iteration 4 --
112118

113-
Warning: mb_ereg_replace(): mbregex compile err: invalid code point value in %smb_ereg_replace_variation1.php on line %d
119+
Deprecated: mb_ereg_replace(): Non-string patterns will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
120+
121+
Warning: mb_ereg_replace(): mbregex compile err: invalid code point value in %s on line %d
114122
bool(false)
115123

116124
-- Iteration 5 --
125+
126+
Deprecated: mb_ereg_replace(): Non-string patterns will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
117127
string(10) "string_val"
118128

119129
-- Iteration 6 --
120130

121-
Warning: mb_ereg_replace(): mbregex compile err: invalid code point value in %smb_ereg_replace_variation1.php on line %d
131+
Deprecated: mb_ereg_replace(): Non-string patterns will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
132+
133+
Warning: mb_ereg_replace(): mbregex compile err: invalid code point value in %s on line %d
122134
bool(false)
123135

124136
-- Iteration 7 --
137+
138+
Deprecated: mb_ereg_replace(): Non-string patterns will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
125139
string(10) "string_val"
126140

127141
-- Iteration 8 --
142+
143+
Deprecated: mb_ereg_replace(): Non-string patterns will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
128144
string(10) "string_val"
129145

130146
-- Iteration 9 --
147+
148+
Deprecated: mb_ereg_replace(): Non-string patterns will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
131149
string(10) "string_val"
132150

133151
-- Iteration 10 --
152+
153+
Deprecated: mb_ereg_replace(): Non-string patterns will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
134154
string(10) "string_val"
135155

136156
-- Iteration 11 --
157+
158+
Deprecated: mb_ereg_replace(): Non-string patterns will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
137159
string(10) "string_val"
138160

139161
-- Iteration 12 --
162+
163+
Deprecated: mb_ereg_replace(): Non-string patterns will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
140164
string(10) "string_val"
141165

142166
-- Iteration 13 --
167+
168+
Deprecated: mb_ereg_replace(): Non-string patterns will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
143169
string(10) "string_val"
144170

145171
-- Iteration 14 --
172+
173+
Deprecated: mb_ereg_replace(): Non-string patterns will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
146174
string(10) "string_val"
147175

148176
-- Iteration 15 --
177+
178+
Deprecated: mb_ereg_replace(): Non-string patterns will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
149179
string(10) "string_val"
150180

151181
-- Iteration 16 --
@@ -164,11 +194,17 @@ string(10) "string_val"
164194
string(10) "string_val"
165195

166196
-- Iteration 21 --
197+
198+
Deprecated: mb_ereg_replace(): Non-string patterns will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
167199
string(10) "string_val"
168200

169201
-- Iteration 22 --
202+
203+
Deprecated: mb_ereg_replace(): Non-string patterns will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
170204
string(10) "string_val"
171205

172206
-- Iteration 23 --
207+
208+
Deprecated: mb_ereg_replace(): Non-string patterns will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
173209
string(10) "string_val"
174210
Done

0 commit comments

Comments
 (0)