3v4l.org

run code in 500+ PHP versions simultaneously
<?php class CoalesceTest { public function __isset(string $key): bool { return false; } public function __get(string $key): mixed { throw new \Exception(); } } $test = new CoalesceTest(); var_dump($test->bar ?? 'fallback');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GBCfS
function name:  (null)
number of ops:  10
compiled vars:  !0 = $test
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   NEW                                                  $1      'CoalesceTest'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   17     3        INIT_FCALL                                                   'var_dump'
          4        FETCH_OBJ_IS                                         ~4      !0, 'bar'
          5        COALESCE                                             ~5      ~4
          6        QM_ASSIGN                                            ~5      'fallback'
          7        SEND_VAL                                                     ~5
          8        DO_ICALL                                                     
          9      > RETURN                                                       1

Class CoalesceTest:
Function __isset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GBCfS
function name:  __isset
number of ops:  4
compiled vars:  !0 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
    7     1      > RETURN                                                       <false>
    8     2*       VERIFY_RETURN_TYPE                                           
          3*     > RETURN                                                       null

End of function __isset

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/GBCfS
function name:  __get
number of ops:  6
compiled vars:  !0 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
   12     1        NEW                                                  $1      'Exception'
          2        DO_FCALL                                          0          
          3      > THROW                                             0          $1
   13     4*       VERIFY_RETURN_TYPE                                           
          5*     > RETURN                                                       null

End of function __get

End of class CoalesceTest.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.05 ms | 1710 KiB | 14 Q