3v4l.org

run code in 300+ PHP versions simultaneously
<?php function mb_str_split($string) { return preg_split('/(?<!^)(?!$)/u', $string ); } $string = 'My string &lsquo;to parse&rsquo;'; $string = utf8_encode($string); $string_decoded = html_entity_decode($string, ENT_QUOTES, 'utf-8'); $string_array = mb_str_split($string_decoded); var_dump($string_array);
Output for 8.5.0 - 8.5.1
Fatal error: Cannot redeclare function mb_str_split() in /in/3FRmG on line 2 Stack trace: #0 {main}
Process exited with code 255.
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.4.1 - 8.4.14
Fatal error: Cannot redeclare function mb_str_split() in /in/3FRmG on line 2
Process exited with code 255.
Output for 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.18, 8.2.0 - 8.2.5, 8.2.26 - 8.2.29, 8.3.14 - 8.3.28
Fatal error: Cannot redeclare mb_str_split() in /in/3FRmG on line 2
Process exited with code 255.
Output for 8.1.19 - 8.1.33, 8.2.6 - 8.2.25, 8.3.0 - 8.3.13
Fatal error: Cannot redeclare mb_str_split() in /in/3FRmG on line 3
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
array(20) { [0]=> string(1) "M" [1]=> string(1) "y" [2]=> string(1) " " [3]=> string(1) "s" [4]=> string(1) "t" [5]=> string(1) "r" [6]=> string(1) "i" [7]=> string(1) "n" [8]=> string(1) "g" [9]=> string(1) " " [10]=> string(3) "‘" [11]=> string(1) "t" [12]=> string(1) "o" [13]=> string(1) " " [14]=> string(1) "p" [15]=> string(1) "a" [16]=> string(1) "r" [17]=> string(1) "s" [18]=> string(1) "e" [19]=> string(3) "’" }

preferences:
165.91 ms | 415 KiB | 5 Q