Skip to content

Commit b3668aa

Browse files
committed
Deprecate convert_cyr_string()
1 parent e41b7f6 commit b3668aa

File tree

4 files changed

+30
-38
lines changed

4 files changed

+30
-38
lines changed

ext/standard/basic_functions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3005,7 +3005,7 @@ static const zend_function_entry basic_functions[] = { /* {{{ */
30053005

30063006
PHP_FE(quoted_printable_decode, arginfo_quoted_printable_decode)
30073007
PHP_FE(quoted_printable_encode, arginfo_quoted_printable_encode)
3008-
PHP_FE(convert_cyr_string, arginfo_convert_cyr_string)
3008+
PHP_DEP_FE(convert_cyr_string, arginfo_convert_cyr_string)
30093009
PHP_FE(get_current_user, arginfo_get_current_user)
30103010
PHP_FE(set_time_limit, arginfo_set_time_limit)
30113011
PHP_FE(header_register_callback, arginfo_header_register_callback)

ext/standard/tests/strings/convert_cyr_string.phpt

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ basic convert_cyr_string() tests
33
--FILE--
44
<?php
55

6-
var_dump(convert_cyr_string());
7-
var_dump(convert_cyr_string(""));
8-
var_dump(convert_cyr_string("", ""));
96
var_dump(convert_cyr_string("", "", ""));
107
var_dump(convert_cyr_string(array(), array(), array()));
118

@@ -20,31 +17,40 @@ var_dump(convert_cyr_string("", "d", "i"));
2017
echo "Done\n";
2118
?>
2219
--EXPECTF--
23-
Warning: convert_cyr_string() expects exactly 3 parameters, 0 given in %s on line %d
24-
NULL
25-
26-
Warning: convert_cyr_string() expects exactly 3 parameters, 1 given in %s on line %d
27-
NULL
28-
29-
Warning: convert_cyr_string() expects exactly 3 parameters, 2 given in %s on line %d
30-
NULL
20+
Deprecated: Function convert_cyr_string() is deprecated in %s on line %d
3121

3222
Warning: convert_cyr_string(): Unknown source charset: in %s on line %d
3323

3424
Warning: convert_cyr_string(): Unknown destination charset: in %s on line %d
3525
string(0) ""
3626

27+
Deprecated: Function convert_cyr_string() is deprecated in %s on line %d
28+
3729
Warning: convert_cyr_string() expects parameter 1 to be string, array given in %s on line %d
3830
NULL
3931

32+
Deprecated: Function convert_cyr_string() is deprecated in %s on line %d
33+
4034
Warning: convert_cyr_string(): Unknown source charset: q in %s on line %d
4135
string(6) "[[[[[["
36+
37+
Deprecated: Function convert_cyr_string() is deprecated in %s on line %d
4238
string(6) "[[[[[["
39+
40+
Deprecated: Function convert_cyr_string() is deprecated in %s on line %d
4341
string(6) "[[[[[["
42+
43+
Deprecated: Function convert_cyr_string() is deprecated in %s on line %d
4444
string(6) "[[[[[["
45+
46+
Deprecated: Function convert_cyr_string() is deprecated in %s on line %d
4547
string(6) "[[[[[["
4648

49+
Deprecated: Function convert_cyr_string() is deprecated in %s on line %d
50+
4751
Warning: convert_cyr_string(): Unknown destination charset: q in %s on line %d
4852
string(6) "[[[[[["
53+
54+
Deprecated: Function convert_cyr_string() is deprecated in %s on line %d
4955
string(0) ""
5056
Done

ext/standard/tests/strings/convert_cyr_string_basic.phpt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,20 @@ echo "\n-- Now try some of characters in 128-255 range --\n";
2121

2222
for ($i = 128; $i < 256; $i++) {
2323
$str = chr($i);
24-
echo "$i: " . bin2hex(convert_cyr_string($str, 'w', 'k')) . "\n";
24+
echo "$i: " . bin2hex(@convert_cyr_string($str, 'w', 'k')) . "\n";
2525
}
2626

2727
?>
2828
===DONE===
29-
--EXPECT--
29+
--EXPECTF--
3030
*** Testing convert_cyr_string() : basic functionality ***
3131

3232
-- First try some simple English text --
33+
34+
Deprecated: Function convert_cyr_string() is deprecated in %s on line %d
3335
string(102) "436f6e766572742066726f6d206f6e6520437972696c6c6963206368617261637465722073657420746f20616e6f746865722e"
36+
37+
Deprecated: Function convert_cyr_string() is deprecated in %s on line %d
3438
string(102) "436f6e766572742066726f6d206f6e6520437972696c6c6963206368617261637465722073657420746f20616e6f746865722e"
3539

3640
-- Now try some of characters in 128-255 range --

ext/standard/tests/strings/convert_cyr_string_error.phpt

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,6 @@ $extra_arg = 10;
1515

1616
echo "*** Testing convert_cyr_string() : error conditions ***\n";
1717

18-
echo "\n-- Testing convert_cyr_string() function with no arguments --\n";
19-
var_dump( convert_cyr_string() );
20-
21-
echo "\n-- Testing convert_cyr_string() function with no 'to' character set --\n";
22-
var_dump( convert_cyr_string($str, $from) );
23-
24-
echo "\n-- Testing convert_cyr_string() function with more than expected no. of arguments --\n";
25-
var_dump( convert_cyr_string($str, $from, $to, $extra_arg) );
26-
2718
echo "\n-- Testing convert_cyr_string() function with invalid 'from' character set --\n";
2819
var_dump(bin2hex( convert_cyr_string($str, "?", $to) ));
2920

@@ -38,33 +29,24 @@ var_dump(bin2hex( convert_cyr_string($str, ">", "?")) );
3829
--EXPECTF--
3930
*** Testing convert_cyr_string() : error conditions ***
4031

41-
-- Testing convert_cyr_string() function with no arguments --
42-
43-
Warning: convert_cyr_string() expects exactly 3 parameters, 0 given in %s on line %d
44-
NULL
45-
46-
-- Testing convert_cyr_string() function with no 'to' character set --
47-
48-
Warning: convert_cyr_string() expects exactly 3 parameters, 2 given in %s on line %d
49-
NULL
50-
51-
-- Testing convert_cyr_string() function with more than expected no. of arguments --
52-
53-
Warning: convert_cyr_string() expects exactly 3 parameters, 4 given in %s on line %d
54-
NULL
55-
5632
-- Testing convert_cyr_string() function with invalid 'from' character set --
5733

34+
Deprecated: Function convert_cyr_string() is deprecated in %s on line %d
35+
5836
Warning: convert_cyr_string(): Unknown source charset: ? in %s on line %d
5937
string(10) "68656c6c6f"
6038

6139
-- Testing convert_cyr_string() function with invalid 'to' character set --
6240

41+
Deprecated: Function convert_cyr_string() is deprecated in %s on line %d
42+
6343
Warning: convert_cyr_string(): Unknown destination charset: ? in %s on line %d
6444
string(10) "68656c6c6f"
6545

6646
-- Testing convert_cyr_string() function with invalid 'from' and 'to' character set --
6747

48+
Deprecated: Function convert_cyr_string() is deprecated in %s on line %d
49+
6850
Warning: convert_cyr_string(): Unknown source charset: > in %s on line %d
6951

7052
Warning: convert_cyr_string(): Unknown destination charset: ? in %s on line %d

0 commit comments

Comments
 (0)