3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $bar; public function __get($property) { switch ($property) { case 'bar': return $this->bar; //etc. } } public function __set($property, $value) { switch ($property) { case 'bar': $this->bar = $value; break; //etc. } } } $foo = new Foo(); $foo->bar = 1; $foo->bar++; $baz = &$foo->bar;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sPWGd
function name:  (null)
number of ops:  9
compiled vars:  !0 = $foo, !1 = $baz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   30     3        ASSIGN_OBJ                                               !0, 'bar'
          4        OP_DATA                                                  1
   31     5        PRE_INC_OBJ                                              !0, 'bar'
   32     6        FETCH_OBJ_W                                      $7      !0, 'bar'
          7        ASSIGN_REF                                               !1, $7
          8      > RETURN                                                   1

Class Foo:
Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sPWGd
function name:  __get
number of ops:  7
compiled vars:  !0 = $property
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
   11     1        IS_EQUAL                                                 !0, 'bar'
          2      > JMPNZ                                                    ~1, ->4
          3    > > JMP                                                      ->6
   12     4    >   FETCH_OBJ_R                                      ~2      'bar'
          5      > RETURN                                                   ~2
   15     6    > > RETURN                                                   null

End of function __get

Function __set:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
filename:       /in/sPWGd
function name:  __set
number of ops:  9
compiled vars:  !0 = $property, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   21     2        IS_EQUAL                                                 !0, 'bar'
          3      > JMPNZ                                                    ~2, ->5
          4    > > JMP                                                      ->8
   22     5    >   ASSIGN_OBJ                                               'bar'
          6        OP_DATA                                                  !1
   23     7      > JMP                                                      ->8
   26     8    > > RETURN                                                   null

End of function __set

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.49 ms | 935 KiB | 14 Q