3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar{ function __isset($a){ return isset($this->{$a}); // I shouldn't be forced to implement this, // since it looks exactly like the default isset() handler } function __get($a){ throw new Error("no prop error\n"); } } $bar = new Bar; var_dump(isset($bar->foo) ? $bar->foo : "qux"); // also works without errors
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4EPXm
function name:  (null)
number of ops:  13
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'Bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        INIT_FCALL                                               'var_dump'
          4        ISSET_ISEMPTY_PROP_OBJ                                   !0, 'foo'
          5      > JMPZ                                                     ~4, ->9
          6    >   FETCH_OBJ_R                                      ~5      !0, 'foo'
          7        QM_ASSIGN                                        ~6      ~5
          8      > JMP                                                      ->10
          9    >   QM_ASSIGN                                        ~6      'qux'
         10    >   SEND_VAL                                                 ~6
         11        DO_ICALL                                                 
   16    12      > RETURN                                                   1

Class Bar:
Function __isset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4EPXm
function name:  __isset
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        ISSET_ISEMPTY_PROP_OBJ                           ~1      !0
          2      > RETURN                                                   ~1
    8     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/4EPXm
function name:  __get
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        NEW                                              $1      'Error'
          2        SEND_VAL_EX                                              'no+prop+error%0A'
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $1
   11     5*     > RETURN                                                   null

End of function __get

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.35 ms | 1388 KiB | 15 Q