3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
199.8 ms | 2944 KiB | 18 Q