3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,100]; $result = []; foreach($array as $num){ if(strlen($num) < 2){ $result[] = $num; }else{ $parts = str_split($num); $result = array_merge($result,$parts); } } print_r($result); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 20
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/QXRrW
function name:  (null)
number of ops:  25
compiled vars:  !0 = $array, !1 = $result, !2 = $num, !3 = $parts
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
    3     1        ASSIGN                                                       !1, <array>
    4     2      > FE_RESET_R                                           $6      !0, ->20
          3    > > FE_FETCH_R                                                   $6, !2, ->20
    5     4    >   STRLEN                                               ~7      !2
          5        IS_SMALLER                                                   ~7, 2
          6      > JMPZ                                                         ~8, ->10
    6     7    >   ASSIGN_DIM                                                   !1
          8        OP_DATA                                                      !2
    5     9      > JMP                                                          ->19
    8    10    >   INIT_FCALL                                                   'str_split'
         11        SEND_VAR                                                     !2
         12        DO_ICALL                                             $10     
         13        ASSIGN                                                       !3, $10
    9    14        INIT_FCALL                                                   'array_merge'
         15        SEND_VAR                                                     !1
         16        SEND_VAR                                                     !3
         17        DO_ICALL                                             $12     
         18        ASSIGN                                                       !1, $12
    4    19    > > JMP                                                          ->3
         20    >   FE_FREE                                                      $6
   13    21        INIT_FCALL                                                   'print_r'
         22        SEND_VAR                                                     !1
         23        DO_ICALL                                                     
   14    24      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
155.09 ms | 2185 KiB | 16 Q