Skip to content

Commit 388a678

Browse files
committed
mbstring: deprecated mb_internal_encoding() and mb_http_output()
1 parent 1c664e1 commit 388a678

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+537
-69
lines changed

ext/mbstring/mbstring.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "php.h"
2525
#include "php_ini.h"
2626
#include "php_variables.h"
27+
#include "zend_attributes.h"
2728
#include "mbstring.h"
2829
#include "ext/standard/php_string.h"
2930
#include "ext/standard/php_mail.h"

ext/mbstring/mbstring.stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
function mb_language(?string $language = null): string|bool {}
5656

5757
/** @refcount 1 */
58+
#[\Deprecated(since: '8.5', message: 'use internal_encoding INI settings instead')]
5859
function mb_internal_encoding(?string $encoding = null): string|bool {}
5960

6061
/**
@@ -64,6 +65,7 @@ function mb_internal_encoding(?string $encoding = null): string|bool {}
6465
function mb_http_input(?string $type = null): array|string|false {}
6566

6667
/** @refcount 1 */
68+
#[\Deprecated(since: '8.5', message: 'use output_encoding INI settings instead')]
6769
function mb_http_output(?string $encoding = null): string|bool {}
6870

6971
/**

ext/mbstring/mbstring_arginfo.h

Lines changed: 18 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/mbstring/tests/bug45239.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ mb_internal_encoding("utf-8");
1212
mb_parse_str("a=%fc", $dummy);
1313
var_dump(mb_http_input());
1414
?>
15-
--EXPECT--
15+
--EXPECTF--
16+
Deprecated: Function mb_internal_encoding() is deprecated since 8.5, use internal_encoding INI settings instead in %s on line %d
1617
string(5) "UTF-8"

ext/mbstring/tests/bug48697.phpt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,22 @@ var_dump(mb_internal_encoding());
1818
?>
1919
--EXPECTF--
2020
Deprecated: ini_set(): Use of mbstring.internal_encoding is deprecated in %s on line %d
21+
22+
Deprecated: Function mb_internal_encoding() is deprecated since 8.5, use internal_encoding INI settings instead in %s on line %d
2123
string(11) "ISO-8859-15"
24+
25+
Deprecated: Function mb_internal_encoding() is deprecated since 8.5, use internal_encoding INI settings instead in %s on line %d
26+
27+
Deprecated: Function mb_internal_encoding() is deprecated since 8.5, use internal_encoding INI settings instead in %s on line %d
2228
string(5) "UTF-8"
29+
30+
Deprecated: Function mb_internal_encoding() is deprecated since 8.5, use internal_encoding INI settings instead in %s on line %d
2331
string(5) "UTF-8"
32+
33+
Deprecated: Function mb_internal_encoding() is deprecated since 8.5, use internal_encoding INI settings instead in %s on line %d
34+
35+
Deprecated: Function mb_internal_encoding() is deprecated since 8.5, use internal_encoding INI settings instead in %s on line %d
2436
string(5) "UTF-8"
37+
38+
Deprecated: Function mb_internal_encoding() is deprecated since 8.5, use internal_encoding INI settings instead in %s on line %d
2539
string(5) "UTF-8"

ext/mbstring/tests/bug69079.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Bug #69079 (enhancement for mb_substitute_character)
33
--EXTENSIONS--
44
mbstring
5+
--INI--
6+
error_reporting=E_ALL & ~E_DEPRECATED
57
--FILE--
68
<?php
79

ext/mbstring/tests/bug69086.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Request #69086 (enhancement for mb_convert_encoding)
33
--EXTENSIONS--
44
mbstring
5+
--INI--
6+
error_reporting=E_ALL & ~E_DEPRECATED
57
--FILE--
68
<?php
79
mb_substitute_character(0xfffd);

ext/mbstring/tests/casefold.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ output_handler=
1212
print mb_strtoupper( "äëï\n" );
1313
print mb_convert_case( "äëï\n", MB_CASE_TITLE );
1414
?>
15-
--EXPECT--
15+
--EXPECTF--
16+
Deprecated: Function mb_internal_encoding() is deprecated since 8.5, use internal_encoding INI settings instead in %s on line %d
1617
abcdefghijklmnopqrstuvwxyz
1718
ABCDEFGHIJKLMNOPQRSTUVWXYZ
1819
ÄËÏ

ext/mbstring/tests/casemapping.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ echo mb_convert_case("ΚΑΛΗΣΠΕΡΑ ΣΑΣ", MB_CASE_LOWER, "UTF-8"), "\n";
6565
echo mb_convert_case("ΚΑΛΗΣΠΕΡΑ ΣΑΣ", MB_CASE_LOWER_SIMPLE, "UTF-8"), "\n";
6666

6767
?>
68-
--EXPECT--
68+
--EXPECTF--
6969
String: ß
7070
Lower: ß
7171
Lower Simple: ß
@@ -96,6 +96,8 @@ Title Simple: İ
9696
Fold: i̇
9797
Fold Simple: İ
9898

99+
100+
Deprecated: Function mb_internal_encoding() is deprecated since 8.5, use internal_encoding INI settings instead in %s on line %d
99101
69
100102
69
101103
69

ext/mbstring/tests/gh13815.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ $strSjis = mb_convert_encoding($strUtf8, 'Shift_JIS', 'UTF-8');
1313
var_dump(mb_strlen(mb_trim($strSjis)));
1414
var_dump(mb_strlen(mb_trim($strSjis, encoding: 'Shift_JIS')));
1515
?>
16-
--EXPECT--
16+
--EXPECTF--
1717
int(1)
1818
int(1)
19+
20+
Deprecated: Function mb_internal_encoding() is deprecated since 8.5, use internal_encoding INI settings instead in %s on line %d
1921
int(1)
2022
int(1)

0 commit comments

Comments
 (0)