|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-03-21 15:32 UTC] cmb@php.net
-Status: Open
+Status: Verified
[2018-03-21 15:32 UTC] cmb@php.net
[2019-03-19 12:59 UTC] nikic@php.net
[2019-03-19 12:59 UTC] nikic@php.net
-Status: Verified
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 08:00:01 2025 UTC |
Description: ------------ preg_match and preg_replace return false and set the last error to PREG_BAD_UTF8_ERROR when the u modifier is specified and the subject is invalid UTF-8. However, preg_split does not behave consistently in this regard. Test script: --------------- var_dump(preg_split("/a/u", "a\xff")); Expected result: ---------------- preg_split should return false and set the last error PREG_BAD_UTF8_ERROR just like the other preg_ functions. Actual result: -------------- preg_split returns an array with the subject string.