3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = []; if (@$array[$elm]) { echo 'foo'; } if (!empty($array[$elm])) { echo 'foo'; } if ($array[$elm] ?? false) { echo 'foo'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
Branch analysis from position: 10
Branch analysis from position: 6
filename:       /in/1Z4Od
function name:  (null)
number of ops:  16
compiled vars:  !0 = $array, !1 = $elm
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        BEGIN_SILENCE                                    ~3      
          2        FETCH_DIM_R                                      ~4      !0, !1
          3        END_SILENCE                                              ~3
          4      > JMPZ                                                     ~4, ->6
    6     5    >   ECHO                                                     'foo'
    9     6    >   ISSET_ISEMPTY_DIM_OBJ                         1  ~5      !0, !1
          7        BOOL_NOT                                         ~6      ~5
          8      > JMPZ                                                     ~6, ->10
   10     9    >   ECHO                                                     'foo'
   13    10    >   FETCH_DIM_IS                                     ~7      !0, !1
         11        COALESCE                                         ~8      ~7
         12        QM_ASSIGN                                        ~8      <false>
         13      > JMPZ                                                     ~8, ->15
   14    14    >   ECHO                                                     'foo'
   15    15    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.58 ms | 1393 KiB | 13 Q