Skip to content

Fix bug #65785 (mbstring.func_overload should be deprecated) #1757

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ext/mbstring/mbstring.c
Original file line number Diff line number Diff line change
Expand Up @@ -1621,6 +1621,10 @@ PHP_RINIT_FUNCTION(mbstring)
if (MBSTRG(func_overload)){
p = &(mb_ovld[0]);

if (p > 0) {
php_error_docref("ref.mbstring", E_DEPRECATED, "Use of mbstring.func_overload is deprecated");
}

CG(compiler_options) |= ZEND_COMPILE_NO_BUILTIN_STRLEN;
while (p->type > 0) {
if ((MBSTRG(func_overload) & p->type) == p->type &&
Expand Down
1 change: 1 addition & 0 deletions ext/mbstring/tests/bug52931.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Bug #52931 (strripos not overloaded with function overloading enabled)
--SKIPIF--
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
--INI--
error_reporting=E_ALL ^ E_DEPRECATED
mbstring.func_overload = 7
mbstring.internal_encoding = utf-8
--FILE--
Expand Down
10 changes: 10 additions & 0 deletions ext/mbstring/tests/bug65785.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--TEST--
Bug #65785 (mbstring.func_overload should be depreciated)
--INI--
mbstring.func_overload=2
--FILE--
<?php
echo ini_get('mbstring.func_overload');?>
--EXPECTF--
Deprecated: Unknown: Use of mbstring.func_overload is deprecated in Unknown on line 0
2
1 change: 1 addition & 0 deletions ext/mbstring/tests/mb_get_info.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Test mb_get_info() function
--SKIPIF--
<?php extension_loaded('mbstring') or die('skip'); ?>
--INI--
error_reporting=E_ALL ^ E_DEPRECATED
mbstring.encoding_translation=1
mbstring.language=Korean
mbstring.internal_encoding=UTF-8
Expand Down
1 change: 1 addition & 0 deletions ext/mbstring/tests/overload01.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Function overloading test 1
}
?>
--INI--
error_reporting=E_ALL ^ E_DEPRECATED
output_handler=
mbstring.func_overload=7
mbstring.internal_encoding=EUC-JP
Expand Down
1 change: 1 addition & 0 deletions ext/mbstring/tests/overload02.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Function overloading test 2
}
?>
--INI--
error_reporting=E_ALL ^ E_DEPRECATED
output_handler=
mbstring.func_overload=7
mbstring.internal_encoding=EUC-JP
Expand Down