3v4l.org

run code in 500+ PHP versions simultaneously
<?php $lookup = [ null, "Good", "Bad", "Ugly" ]; foreach (range(0, 5) as $test) { echo $test , ' : ' , ($lookup[$test] ?? $lookup[0]) , "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 16
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 16
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/9NL6n
function name:  (null)
number of ops:  18
compiled vars:  !0 = $lookup, !1 = $test
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
    9     1        INIT_FCALL                                                   'range'
          2        SEND_VAL                                                     0
          3        SEND_VAL                                                     5
          4        DO_ICALL                                             $3      
          5      > FE_RESET_R                                           $4      $3, ->16
          6    > > FE_FETCH_R                                                   $4, !1, ->16
   10     7    >   ECHO                                                         !1
          8        ECHO                                                         '+%3A+'
          9        FETCH_DIM_IS                                         ~5      !0, !1
         10        COALESCE                                             ~6      ~5
         11        FETCH_DIM_R                                          ~7      !0, 0
         12        QM_ASSIGN                                            ~6      ~7
         13        ECHO                                                         ~6
         14        ECHO                                                         '%0A'
    9    15      > JMP                                                          ->6
         16    >   FE_FREE                                                      $4
   11    17      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
168.76 ms | 2308 KiB | 14 Q