3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(mb_split(" ", "split string with invalid utf-8 \xa0\xa1")); var_dump(mb_split("\xa0\xa1", "split string with invalid utf-8"));
Output for 7.1.28 - 7.1.33, 7.2.18 - 7.2.34, 7.3.5 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.29, 8.2.0 - 8.2.20, 8.3.0 - 8.3.8
bool(false) Warning: mb_split(): Pattern is not valid under UTF-8 encoding in /in/dN6pD on line 4 bool(false)
Output for 7.2.0 - 7.2.17, 7.3.0 - 7.3.4
array(6) { [0]=> string(5) "split" [1]=> string(6) "string" [2]=> string(4) "with" [3]=> string(7) "invalid" [4]=> string(5) "utf-8" [5]=> string(2) "��" } Warning: mb_split(): mbregex compile err: invalid code point value in /in/dN6pD on line 4 bool(false)
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.27
array(6) { [0]=> string(5) "split" [1]=> string(6) "string" [2]=> string(4) "with" [3]=> string(7) "invalid" [4]=> string(5) "utf-8" [5]=> string(2) "��" } array(1) { [0]=> string(31) "split string with invalid utf-8" }
Output for 4.3.4 - 4.3.11, 4.4.0 - 4.4.9
array(6) { [0]=> string(5) "split" [1]=> string(6) "string" [2]=> string(4) "with" [3]=> string(7) "invalid" [4]=> string(5) "utf-8" [5]=> string(2) "��" } Warning: mb_split(): mbregex compile err: premature end of regular expression in /in/dN6pD on line 4 bool(false)
Output for 4.3.2 - 4.3.3
Fatal error: Call to undefined function: mb_split() in /in/dN6pD on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: mb_split() in /in/dN6pD on line 3

preferences:
226.06 ms | 401 KiB | 473 Q