I
I
Ilya2019-11-24 14:30:35
PHP
Ilya, 2019-11-24 14:30:35

Why might mbstring.func_overload not work in php 7.3?

php works as an apache module.
I set mbstring.func_overload in httpd.conf to 2.
Check:

var_dump(phpversion());
var_dump(ini_get('default_charset'));
var_dump(ini_get('mbstring.func_overload'));

$str = 'Тестовая строка';

var_dump(mb_substr($str, 0, 6));

var_dump(substr($str, 0, 6));

It seems ok, it showed up. But, in different versions of php, the functions work as if the overload does not work at all.
This is the output in 7.1.33:
string(6) "7.1.33"
string(5) "UTF-8"
string(1) "2"
string(12) "Тестов"
string(12) "Тестов"

This is the output in 7.3.12:
string(6) "7.3.12"
string(5) "UTF-8"
string(1) "2"
string(12) "Тестов"
string(6) "Тес"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lazy @BojackHorseman PHP, 2019-11-24
Tag

Warning
This functionality has been DEPRECATED as of PHP 7.2.0 and its use is highly discouraged.
Here it is in 7.3 and does not work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question