3v4l.org

run code in 500+ PHP versions simultaneously
<?php var_export( key_exists( 'foo', $obj?->does[123]?->not?->exist[678] ?? [] ) ? 'yep' : 'nope' ); echo "\n---\n"; var_export( property_exists( $obj?->does[123]?->not?->exist[678] ?? (object) [], 'foo' ) ? 'yep' : 'nope' );
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 38
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 38
Branch analysis from position: 36
Branch analysis from position: 38
filename:       /in/pZcDF
function name:  (null)
number of ops:  42
compiled vars:  !0 = $obj
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'var_export'
    4     1        INIT_FCALL                                                   'key_exists'
    5     2        SEND_VAL                                                     'foo'
    6     3        JMP_NULL                                             ~5      !0
          4        FETCH_OBJ_IS                                         ~1      !0, 'does'
          5        FETCH_DIM_IS                                         ~2      ~1, 123
          6        JMP_NULL                                             ~5      ~2
          7        FETCH_OBJ_IS                                         ~3      ~2, 'not'
          8        JMP_NULL                                             ~5      ~3
          9        FETCH_OBJ_IS                                         ~4      ~3, 'exist'
         10        FETCH_DIM_IS                                         ~5      ~4, 678
         11        COALESCE                                             ~6      ~5
         12        QM_ASSIGN                                            ~6      <array>
         13        SEND_VAL                                                     ~6
    4    14        DO_ICALL                                             $7      
    6    15      > JMPZ                                                         $7, ->18
    8    16    >   QM_ASSIGN                                            ~8      'yep'
         17      > JMP                                                          ->19
    9    18    >   QM_ASSIGN                                            ~8      'nope'
         19    >   SEND_VAL                                                     ~8
    3    20        DO_ICALL                                                     
   12    21        ECHO                                                         '%0A---%0A'
   14    22        INIT_FCALL                                                   'var_export'
   16    23        JMP_NULL                                             ~14     !0
         24        FETCH_OBJ_IS                                         ~10     !0, 'does'
         25        FETCH_DIM_IS                                         ~11     ~10, 123
         26        JMP_NULL                                             ~14     ~11
         27        FETCH_OBJ_IS                                         ~12     ~11, 'not'
         28        JMP_NULL                                             ~14     ~12
         29        FETCH_OBJ_IS                                         ~13     ~12, 'exist'
         30        FETCH_DIM_IS                                         ~14     ~13, 678
         31        COALESCE                                             ~15     ~14
         32        CAST                                              8  ~16     <array>
         33        QM_ASSIGN                                            ~15     ~16
   15    34        FRAMELESS_ICALL_2                property_exists      ~17     ~15, 'foo'
   17    35      > JMPZ                                                         ~17, ->38
   19    36    >   QM_ASSIGN                                            ~18     'yep'
         37      > JMP                                                          ->39
   20    38    >   QM_ASSIGN                                            ~18     'nope'
         39    >   SEND_VAL                                                     ~18
   14    40        DO_ICALL                                                     
   21    41      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.23 ms | 1634 KiB | 15 Q