3v4l.org

run code in 500+ PHP versions simultaneously
<?php // words inside string with umlaute, later add http://zahnstocher47.de instead of "zahnstocher" as the correct solution $string = "apfelsaft siebenundvierzig zahnstocher gelb ethereum österreich"; // get length of string $l = mb_strlen($string); $chars = mb_str_split($string); $f = ''; // loop through length and output each letter by itself for ($i = 0; $i <= $l; $i++){ // umlaute buggy when there is a concatenation $f .= $chars[$i] . " "; } var_dump($f);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.4, 8.3.6 - 8.3.30, 8.4.1 - 8.4.21, 8.5.0 - 8.5.7
Warning: Undefined array key 63 in /in/JIQoE on line 14 string(128) "a p f e l s a f t s i e b e n u n d v i e r z i g z a h n s t o c h e r g e l b e t h e r e u m ö s t e r r e i c h "
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Warning: Undefined array key 63 in /in/JIQoE on line 14 string(128) "a p f e l s a f t s i e b e n u n d v i e r z i g z a h n s t o c h e r g e l b e t h e r e u m ö s t e r r e i c h "
Output for 7.4.0 - 7.4.33
Notice: Undefined offset: 63 in /in/JIQoE on line 14 string(128) "a p f e l s a f t s i e b e n u n d v i e r z i g z a h n s t o c h e r g e l b e t h e r e u m ö s t e r r e i c h "
Output for 7.3.0 - 7.3.33
Fatal error: Uncaught Error: Call to undefined function mb_str_split() in /in/JIQoE:8 Stack trace: #0 {main} thrown in /in/JIQoE on line 8
Process exited with code 255.

preferences:
101.76 ms | 1430 KiB | 4 Q