3v4l.org

run code in 300+ PHP versions simultaneously
<?php $types = array( "text" => 2, "image" => 2, "audio" => 2, ); $result = []; while ($types) { foreach ($types as $key => $value) { $result[] = $key; if ($value == 1) { unset($types[$key]); } else { --$types[$key]; } } } var_export($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 3
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 3
Branch analysis from position: 17
Branch analysis from position: 3
Branch analysis from position: 15
filename:       /in/qlGnY
function name:  (null)
number of ops:  21
compiled vars:  !0 = $types, !1 = $result, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, <array>
   10     2      > JMP                                                      ->16
   11     3    > > FE_RESET_R                                       $6      !0, ->15
          4    > > FE_FETCH_R                                       ~7      $6, !2, ->15
          5    >   ASSIGN                                                   !3, ~7
   12     6        ASSIGN_DIM                                               !1
          7        OP_DATA                                                  !3
   13     8        IS_EQUAL                                                 !2, 1
          9      > JMPZ                                                     ~10, ->12
   14    10    >   UNSET_DIM                                                !0, !3
   13    11      > JMP                                                      ->14
   16    12    >   FETCH_DIM_RW                                     $11     !0, !3
         13        PRE_DEC                                                  $11
   11    14    > > JMP                                                      ->4
         15    >   FE_FREE                                                  $6
   10    16    > > JMPNZ                                                    !0, ->3
   20    17    >   INIT_FCALL                                               'var_export'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.95 ms | 999 KiB | 14 Q