3v4l.org

run code in 300+ 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);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 12
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 12
Branch analysis from position: 18
Branch analysis from position: 12
filename:       /in/JIQoE
function name:  (null)
number of ops:  22
compiled vars:  !0 = $string, !1 = $l, !2 = $chars, !3 = $f, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'apfelsaft+siebenundvierzig+zahnstocher+gelb+ethereum+%C3%B6sterreich'
    7     1        INIT_FCALL                                               'mb_strlen'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
    8     5        INIT_FCALL                                               'mb_str_split'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !2, $8
   10     9        ASSIGN                                                   !3, ''
   12    10        ASSIGN                                                   !4, 0
         11      > JMP                                                      ->16
   14    12    >   FETCH_DIM_R                                      ~12     !2, !4
         13        CONCAT                                           ~13     ~12, '+'
         14        ASSIGN_OP                                     8          !3, ~13
   12    15        PRE_INC                                                  !4
         16    >   IS_SMALLER_OR_EQUAL                                      !4, !1
         17      > JMPNZ                                                    ~16, ->12
   17    18    >   INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
11.88 ms | 462 KiB | 7 Q