3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(); $arr['b'] = 'book'; foreach($arr as $key=>$val) { print "key=>$key\n"; if(!isset($arr['a'])) $arr['a'] = 'apple'; } echo '<pre>'; print_r($arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 16
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 15
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/Odmvr
function name:  (null)
number of ops:  22
compiled vars:  !0 = $arr, !1 = $val, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN_DIM                                               !0, 'b'
          2        OP_DATA                                                  'book'
    5     3      > FE_RESET_R                                       $5      !0, ->16
          4    > > FE_FETCH_R                                       ~6      $5, !1, ->16
          5    >   ASSIGN                                                   !2, ~6
    6     6        ROPE_INIT                                     3  ~9      'key%3D%3E'
          7        ROPE_ADD                                      1  ~9      ~9, !2
          8        ROPE_END                                      2  ~8      ~9, '%0A'
          9        ECHO                                                     ~8
    7    10        ISSET_ISEMPTY_DIM_OBJ                         0  ~11     !0, 'a'
         11        BOOL_NOT                                         ~12     ~11
         12      > JMPZ                                                     ~12, ->15
    8    13    >   ASSIGN_DIM                                               !0, 'a'
         14        OP_DATA                                                  'apple'
    5    15    > > JMP                                                      ->4
         16    >   FE_FREE                                                  $5
   11    17        ECHO                                                     '%3Cpre%3E'
   12    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.92 ms | 1395 KiB | 15 Q