|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2019-06-20 15:09 UTC] mvachette at adequasys dot com
 Description:
------------
It seems that something changes in 7.2.18 when using mb_split on ISO string.
On at least 7.2.16 & 7.2.17, using this function with ISO encoding string containing accents works fine.
On a new env with version 7.2.18, the same code now return "false" (new undocumented behaviour)
Test script:
---------------
var_dump(mb_split('-', 'e-a'));
//works fine on any version
var_dump(mb_split('-', 'é-a'));
// works if string is UTF8 encoded
// return "false" with an ISO encoded string on PHP 7.2.18
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 08:00:01 2025 UTC | 
Hello, In the case of failure to perform preg_split due to invalid inputs, preg_split will return false. Example- $string = array("sdasds"); // Invalid string $array=preg_split('/[\s,]+/',$string); var_dump($array); //false $string = "sdasds"; $array=preg_split('j',$string); // Invalid pattern var_dump($array); //false (https://www.mycenturahealth.me/)github.com