3v4l.org

run code in 300+ PHP versions simultaneously
<?php $num = 2; $array = array(1,2,3,4,5,6,7); foreach($array as $key) { if($key === $num) var_dump(key(prev($array))); break; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
Branch analysis from position: 17
Branch analysis from position: 17
filename:       /in/FCbqk
function name:  (null)
number of ops:  19
compiled vars:  !0 = $num, !1 = $array, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 2
    3     1        ASSIGN                                                   !1, <array>
    4     2      > FE_RESET_R                                       $5      !1, ->17
          3    > > FE_FETCH_R                                               $5, !2, ->17
    5     4    >   IS_IDENTICAL                                             !2, !0
          5      > JMPZ                                                     ~6, ->15
          6    >   INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'key'
          8        INIT_FCALL                                               'prev'
          9        SEND_REF                                                 !1
         10        DO_ICALL                                         $7      
         11        SEND_VAR                                                 $7
         12        DO_ICALL                                         $8      
         13        SEND_VAR                                                 $8
         14        DO_ICALL                                                 
    6    15    > > JMP                                                      ->17
    4    16*       JMP                                                      ->3
         17    >   FE_FREE                                                  $5
    7    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.39 ms | 1395 KiB | 19 Q