3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public $baz = 'bar'; function __get($name) { if ($name == 'bar') return $this->baz; } } $o = new foo; var_dump($o->bazz); var_dump($o->bar); var_dump(isset($o->bar));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FsRsE
function name:  (null)
number of ops:  16
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   14     3        INIT_FCALL                                               'var_dump'
          4        FETCH_OBJ_R                                      ~4      !0, 'bazz'
          5        SEND_VAL                                                 ~4
          6        DO_ICALL                                                 
   15     7        INIT_FCALL                                               'var_dump'
          8        FETCH_OBJ_R                                      ~6      !0, 'bar'
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                                 
   16    11        INIT_FCALL                                               'var_dump'
         12        ISSET_ISEMPTY_PROP_OBJ                           ~8      !0, 'bar'
         13        SEND_VAL                                                 ~8
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Class foo:
Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FsRsE
function name:  __get
number of ops:  6
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        IS_EQUAL                                                 !0, 'bar'
          2      > JMPZ                                                     ~1, ->5
    9     3    >   FETCH_OBJ_R                                      ~2      'baz'
          4      > RETURN                                                   ~2
   10     5    > > RETURN                                                   null

End of function __get

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.57 ms | 1395 KiB | 15 Q