3v4l.org

run code in 300+ PHP versions simultaneously
<?php $stack = array("orange", "banana", "apple", "raspberry"); $fruit = array_shift($stack); print_r($stack); $_room = array(); for($i = 2; $i < 8; $i++) { $_room[] = array_shift($stack); } print_r($_room); $_otherArray = array(); foreach($_room as $key => $g) { print "key=$key g=$g\n"; if ($key == "banana") { unset($_room[$key]); $_otherArray[] = $g; } } print_r($_room); print_r($_otherArray); foreach($_room as $value){ print "value=".$value."\n"; }?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 11
Branch analysis from position: 19
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 38
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 38
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 37
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 37
Branch analysis from position: 38
2 jumps found. (Code = 77) Position 1 = 46, Position 2 = 51
Branch analysis from position: 46
2 jumps found. (Code = 78) Position 1 = 47, Position 2 = 51
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 51
Branch analysis from position: 38
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 11
Branch analysis from position: 19
Branch analysis from position: 11
filename:       /in/I8GHv
function name:  (null)
number of ops:  53
compiled vars:  !0 = $stack, !1 = $fruit, !2 = $_room, !3 = $i, !4 = $_otherArray, !5 = $g, !6 = $key, !7 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ASSIGN                                                   !0, <array>
          1        INIT_FCALL                                               'array_shift'
          2        SEND_REF                                                 !0
          3        DO_ICALL                                         $9      
          4        ASSIGN                                                   !1, $9
          5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
          8        ASSIGN                                                   !2, <array>
          9        ASSIGN                                                   !3, 2
         10      > JMP                                                      ->17
         11    >   INIT_FCALL                                               'array_shift'
         12        SEND_REF                                                 !0
         13        DO_ICALL                                         $15     
         14        ASSIGN_DIM                                               !2
         15        OP_DATA                                                  $15
         16        PRE_INC                                                  !3
         17    >   IS_SMALLER                                               !3, 8
         18      > JMPNZ                                                    ~17, ->11
         19    >   INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                                 
         22        ASSIGN                                                   !4, <array>
         23      > FE_RESET_R                                       $20     !2, ->38
         24    > > FE_FETCH_R                                       ~21     $20, !5, ->38
         25    >   ASSIGN                                                   !6, ~21
         26        ROPE_INIT                                     5  ~24     'key%3D'
         27        ROPE_ADD                                      1  ~24     ~24, !6
         28        ROPE_ADD                                      2  ~24     ~24, '+g%3D'
         29        ROPE_ADD                                      3  ~24     ~24, !5
         30        ROPE_END                                      4  ~23     ~24, '%0A'
         31        ECHO                                                     ~23
         32        IS_EQUAL                                                 !6, 'banana'
         33      > JMPZ                                                     ~27, ->37
         34    >   UNSET_DIM                                                !2, !6
         35        ASSIGN_DIM                                               !4
         36        OP_DATA                                                  !5
         37    > > JMP                                                      ->24
         38    >   FE_FREE                                                  $20
         39        INIT_FCALL                                               'print_r'
         40        SEND_VAR                                                 !2
         41        DO_ICALL                                                 
         42        INIT_FCALL                                               'print_r'
         43        SEND_VAR                                                 !4
         44        DO_ICALL                                                 
         45      > FE_RESET_R                                       $31     !2, ->51
         46    > > FE_FETCH_R                                               $31, !7, ->51
         47    >   CONCAT                                           ~32     'value%3D', !7
         48        CONCAT                                           ~33     ~32, '%0A'
         49        ECHO                                                     ~33
         50      > JMP                                                      ->46
         51    >   FE_FREE                                                  $31
         52      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.67 ms | 945 KiB | 18 Q