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 = 26
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 26
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 11
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 11
Branch analysis from position: 25
Branch analysis from position: 11
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/kGTYi
function name:  (null)
number of ops:  31
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, ->26
          8    > > FE_FETCH_R                                               $10, !3, ->26
    8     9    >   ASSIGN                                                   !4, 2
         10      > JMP                                                      ->22
    9    11    >   INIT_FCALL                                               'str_split'
         12        SEND_VAR                                                 !3
         13        SEND_VAR                                                 !4
         14        DO_ICALL                                         $12     
         15        ASSIGN                                                   !5, $12
   10    16        INIT_FCALL                                               'array_shift'
         17        SEND_REF                                                 !5
         18        DO_ICALL                                         $15     
         19        ASSIGN_DIM                                               !1
         20        OP_DATA                                                  $15
    8    21        PRE_INC                                                  !4
         22    >   STRLEN                                           ~17     !3
         23        IS_SMALLER                                               !4, ~17
         24      > JMPNZ                                                    ~18, ->11
    5    25    > > JMP                                                      ->8
         26    >   FE_FREE                                                  $10
   13    27        INIT_FCALL                                               'print_r'
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.49 ms | 1396 KiB | 21 Q