3v4l.org

run code in 300+ PHP versions simultaneously
<?php $inStr = 'Hey you guys'; $tokens = array(); $tokenList = explode(' ',$inStr); foreach($tokenList as $bigToken) { // $tokens[] = $bigToken; //take care of individual words $tokens = array_merge($tokens, str_split($bigToken)); //take care of single letters for($i = 2; $i < strlen($bigToken); $i++) { $tempArr = str_split($bigToken, $i); $tokens[] = array_shift($tempArr); //only need the first element here. } } print_r($tokens);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 34
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 34
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 19
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 19
Branch analysis from position: 33
Branch analysis from position: 19
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
filename:       /in/5LDJ1
function name:  (null)
number of ops:  39
compiled vars:  !0 = $inStr, !1 = $tokens, !2 = $tokenList, !3 = $bigToken, !4 = $i, !5 = $tempArr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Hey+you+guys'
    3     1        ASSIGN                                                   !1, <array>
    4     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '+'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $8      
          6        ASSIGN                                                   !2, $8
    5     7      > FE_RESET_R                                       $10     !2, ->34
          8    > > FE_FETCH_R                                               $10, !3, ->34
    7     9    >   INIT_FCALL                                               'array_merge'
         10        SEND_VAR                                                 !1
         11        INIT_FCALL                                               'str_split'
         12        SEND_VAR                                                 !3
         13        DO_ICALL                                         $11     
         14        SEND_VAR                                                 $11
         15        DO_ICALL                                         $12     
         16        ASSIGN                                                   !1, $12
    8    17        ASSIGN                                                   !4, 2
         18      > JMP                                                      ->30
    9    19    >   INIT_FCALL                                               'str_split'
         20        SEND_VAR                                                 !3
         21        SEND_VAR                                                 !4
         22        DO_ICALL                                         $15     
         23        ASSIGN                                                   !5, $15
   10    24        INIT_FCALL                                               'array_shift'
         25        SEND_REF                                                 !5
         26        DO_ICALL                                         $18     
         27        ASSIGN_DIM                                               !1
         28        OP_DATA                                                  $18
    8    29        PRE_INC                                                  !4
         30    >   STRLEN                                           ~20     !3
         31        IS_SMALLER                                               !4, ~20
         32      > JMPNZ                                                    ~21, ->19
    5    33    > > JMP                                                      ->8
         34    >   FE_FREE                                                  $10
   13    35        INIT_FCALL                                               'print_r'
         36        SEND_VAR                                                 !1
         37        DO_ICALL                                                 
         38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.98 ms | 1400 KiB | 23 Q