3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ar = []; $i = 0; while($i < 2){ $ar['fluits'][$i][] = [ 'name' => 'apple', 'color' => 'red' ]; $ar['fluits'][$i][] = [ 'name' => 'kiwi', 'color' => 'green' ]; $ar['drinks'][$i][] = [ 'name' => 'coffee', 'taste' => 'bitter' ]; // これだと「apple」の配列には「2」が追加されるが、kiwiの配列に「2」が追加されない。 $add = 'on'; if( $add == 'on' ){ $ar['drinks'][$i][0]['id'] = '1'; $ar['fluits'][$i][0]['id'] = '2'; } $i++; } var_dump($ar);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 3
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 28
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 3
Branch analysis from position: 31
Branch analysis from position: 3
Branch analysis from position: 28
filename:       /in/JV9fb
function name:  (null)
number of ops:  35
compiled vars:  !0 = $ar, !1 = $i, !2 = $add
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 0
    5     2      > JMP                                                      ->29
    7     3    >   FETCH_DIM_W                                      $5      !0, 'fluits'
          4        FETCH_DIM_W                                      $6      $5, !1
          5        ASSIGN_DIM                                               $6
    8     6        OP_DATA                                                  <array>
   12     7        FETCH_DIM_W                                      $8      !0, 'fluits'
          8        FETCH_DIM_W                                      $9      $8, !1
          9        ASSIGN_DIM                                               $9
   13    10        OP_DATA                                                  <array>
   17    11        FETCH_DIM_W                                      $11     !0, 'drinks'
         12        FETCH_DIM_W                                      $12     $11, !1
         13        ASSIGN_DIM                                               $12
   18    14        OP_DATA                                                  <array>
   23    15        ASSIGN                                                   !2, 'on'
   24    16        IS_EQUAL                                                 !2, 'on'
         17      > JMPZ                                                     ~15, ->28
   25    18    >   FETCH_DIM_W                                      $16     !0, 'drinks'
         19        FETCH_DIM_W                                      $17     $16, !1
         20        FETCH_DIM_W                                      $18     $17, 0
         21        ASSIGN_DIM                                               $18, 'id'
         22        OP_DATA                                                  '1'
   26    23        FETCH_DIM_W                                      $20     !0, 'fluits'
         24        FETCH_DIM_W                                      $21     $20, !1
         25        FETCH_DIM_W                                      $22     $21, 0
         26        ASSIGN_DIM                                               $22, 'id'
         27        OP_DATA                                                  '2'
   29    28    >   PRE_INC                                                  !1
    5    29    >   IS_SMALLER                                               !1, 2
         30      > JMPNZ                                                    ~25, ->3
   32    31    >   INIT_FCALL                                               'var_dump'
         32        SEND_VAR                                                 !0
         33        DO_ICALL                                                 
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.4 ms | 999 KiB | 14 Q