3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $bar = 'baz'; } class FooProxy extends Foo { private $wrapped; public function __construct(Foo $foo) { $this->wrapped = $foo; unset($this->bar); } public function & __get($name) { var_dump(__METHOD__); return $this->wrapped->$name; } public function __set($name, $value) { var_dump(__METHOD__); $this->wrapped->$name = $value; } public function __isset($name) { var_dump(__METHOD__); return isset($this->wrapped->$name); } public function __unset($name) { var_dump(__METHOD__); unset($this->wrapped->$name); } } $foo = new FooProxy(new Foo()); $foo->bar; $foo->bar = 'baz'; isset($foo->bar); unset($foo->bar);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FWNG5
function name:  (null)
number of ops:  14
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   NEW                                              $1      'FooProxy'
          1        NEW                                              $2      'Foo'
          2        DO_FCALL                                      0          
          3        SEND_VAR_NO_REF_EX                                       $2
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   44     6        FETCH_OBJ_R                                      ~6      !0, 'bar'
          7        FREE                                                     ~6
   45     8        ASSIGN_OBJ                                               !0, 'bar'
          9        OP_DATA                                                  'baz'
   46    10        ISSET_ISEMPTY_PROP_OBJ                           ~8      !0, 'bar'
         11        FREE                                                     ~8
   47    12        UNSET_OBJ                                                !0, 'bar'
         13      > RETURN                                                   1

Class Foo: [no user functions]
Class FooProxy:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FWNG5
function name:  __construct
number of ops:  5
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        ASSIGN_OBJ                                               'wrapped'
          2        OP_DATA                                                  !0
   14     3        UNSET_OBJ                                                'bar'
   15     4      > RETURN                                                   null

End of function __construct

Function __get:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/FWNG5
function name:  __get
number of ops:  8
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 'FooProxy%3A%3A__get'
          3        DO_ICALL                                                 
   20     4        FETCH_OBJ_W                                      $2      'wrapped'
          5        FETCH_OBJ_W                                      $3      $2, !0
          6      > RETURN_BY_REF                                            $3
   21     7*     > RETURN_BY_REF                                            null

End of function __get

Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FWNG5
function name:  __set
number of ops:  9
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   25     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAL                                                 'FooProxy%3A%3A__set'
          4        DO_ICALL                                                 
   26     5        FETCH_OBJ_W                                      $3      'wrapped'
          6        ASSIGN_OBJ                                               $3, !0
          7        OP_DATA                                                  !1
   27     8      > RETURN                                                   null

End of function __set

Function __isset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FWNG5
function name:  __isset
number of ops:  8
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV                                             !0      
   31     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 'FooProxy%3A%3A__isset'
          3        DO_ICALL                                                 
   32     4        FETCH_OBJ_IS                                     ~2      'wrapped'
          5        ISSET_ISEMPTY_PROP_OBJ                           ~3      ~2, !0
          6      > RETURN                                                   ~3
   33     7*     > RETURN                                                   null

End of function __isset

Function __unset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FWNG5
function name:  __unset
number of ops:  7
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   RECV                                             !0      
   37     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 'FooProxy%3A%3A__unset'
          3        DO_ICALL                                                 
   38     4        FETCH_OBJ_UNSET                                  $2      'wrapped'
          5        UNSET_OBJ                                                $2, !0
   39     6      > RETURN                                                   null

End of function __unset

End of class FooProxy.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.39 ms | 1400 KiB | 15 Q