3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = ['this','is', 1, 'array', 'for', 1, 'example']; $str = array(); $int = array(); foreach($arr as $k => $val) { if(gettype($arr[$k]) == 'string'){ $str[] = $arr[$k]; } else { $int[] = $arr[$k]; } } print_r($str); print_r($int);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 18
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/UXsR8
function name:  (null)
number of ops:  26
compiled vars:  !0 = $arr, !1 = $str, !2 = $int, !3 = $val, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
    6     2        ASSIGN                                                   !2, <array>
    8     3      > FE_RESET_R                                       $8      !0, ->18
          4    > > FE_FETCH_R                                       ~9      $8, !3, ->18
          5    >   ASSIGN                                                   !4, ~9
    9     6        FETCH_DIM_R                                      ~11     !0, !4
          7        GET_TYPE                                         ~12     ~11
          8        IS_EQUAL                                                 ~12, 'string'
          9      > JMPZ                                                     ~13, ->14
   10    10    >   FETCH_DIM_R                                      ~15     !0, !4
         11        ASSIGN_DIM                                               !1
         12        OP_DATA                                                  ~15
    9    13      > JMP                                                      ->17
   12    14    >   FETCH_DIM_R                                      ~17     !0, !4
         15        ASSIGN_DIM                                               !2
         16        OP_DATA                                                  ~17
    8    17    > > JMP                                                      ->4
         18    >   FE_FREE                                                  $8
   15    19        INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                                 
   16    22        INIT_FCALL                                               'print_r'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.54 ms | 1001 KiB | 14 Q