3v4l.org

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

Class foo:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CpccE
function name:  __get
number of ops:  6
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                               !0
          2        OP_DATA                                                  'foo'
    9     3        FETCH_OBJ_R                                      ~2      !0
          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:
169.6 ms | 1395 KiB | 15 Q