3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isset_or(&$check, $alternate = NULL) { return (isset($check)) ? $check : $alternate; } $orig = ['alpha' => 1]; $tested = $orig; echo 'isset_or($tested["beta"]): ', isset_or($tested['beta'], 'nope'); var_export([ '$orig' => $orig, '$tested' => $tested, 'array_key_exists("beta")' => [ '$orig' => array_key_exists('beta', $orig), '$tested' => array_key_exists('beta', $tested), ], ]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9vmFR
function name:  (null)
number of ops:  20
compiled vars:  !0 = $orig, !1 = $tested
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   8     0  E >   QM_ASSIGN                                                !0
   9     1        QM_ASSIGN                                                !1
  11     2        ASSIGN_OBJ                                               'isset_or%28%24tested%5B%22beta%22%5D%29%3A+'
         3        INIT_FCALL                                               'isset_or'
         4        FETCH_DIM_W                                      $4      !1, 'beta'
         5        SEND_REF                                                 $4
         6        SEND_VAL                                                 'nope'
         7        DO_FCALL                                      0  $5      
         8        ASSIGN_OBJ                                               $5
  13     9        INIT_FCALL                                               'var_export'
  14    10        INIT_ARRAY                                       ~6      !0, '%24orig'
  15    11        ADD_ARRAY_ELEMENT                                ~6      !1, '%24tested'
  17    12        FUNC_NUM_ARGS                                    ~7      'beta', !0
        13        INIT_ARRAY                                       ~8      ~7, '%24orig'
  18    14        FUNC_NUM_ARGS                                    ~9      'beta', !1
        15        ADD_ARRAY_ELEMENT                                ~8      ~9, '%24tested'
        16        ADD_ARRAY_ELEMENT                                ~6      ~8, 'array_key_exists%28%22beta%22%29'
        17        SEND_VAL                                                 ~6
        18        DO_ICALL                                                 
  20    19      > RETURN                                                   1

Function isset_or:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9vmFR
function name:  isset_or
number of ops:  9
compiled vars:  !0 = $check, !1 = $alternate
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   RECV                                             !0      
         1        RECV_INIT                                        !1      null
   5     2        ADD_TRAIT                                        ~2      !0
         3      > JMPZ                                                     ~2, ->6
         4    >   ASSIGN_BW_OR                                  0  ~3      !0
         5      > JMP                                                      ->7
         6    >   ASSIGN_BW_OR                                  0  ~3      !1
         7    > > RETURN                                                   ~3
   6     8*     > RETURN                                                   null

End of function isset_or

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
14.25 ms | 463 KiB | 7 Q