|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-01-15 02:22 UTC] requinix@php.net
-Status: Open
+Status: Feedback
-Package: Regexps related
+Package: mbstring related
[2020-01-15 02:22 UTC] requinix@php.net
[2020-01-15 03:29 UTC] minhlt82 at gmail dot com
[2020-01-15 04:43 UTC] requinix@php.net
-Status: Feedback
+Status: Not a bug
[2020-01-15 04:43 UTC] requinix@php.net
[2020-01-15 06:21 UTC] minhlt82 at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 10:00:01 2025 UTC |
Description: ------------ The mb_ereg_replace function cannot replace strings that contain some characters with the SJIS encoding. In these cases, the result is NULL. It works well with PHP versions < 7.1 but fails with PHP 7.1 and above. Test script: --------------- mb_regex_encoding('SJIS'); $string = "hello ここに文を入れる。"; $pattern = "hello"; $replacement = 'hi'; //expected result: hi ここに文を入れる。 //but it returns NULL var_dump(mb_ereg_replace($pattern, $replacement, $string)); //Similar error for binary strings, you can test more here. //http://sandbox.onlinephpfunctions.com/code/1a741afb48b299c6f335d9175be730a5ec3854d5