3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { public \stdClass $x; public function __construct() { $this->x = new \stdClass(); } public function foo() { print "->foo()\n"; var_export($this->x); } } class D extends C { public function __get($name) { print "\n"; print "__get($name)\n"; var_export($this->$name); } } $c = new D(); // $c->x = NULL; print "\$c->x\n"; var_export($c->x); print "\n\n-----------------\n"; print "\$c->x after unset()\n"; unset($c->x); var_export($c->x); print "\n\n-----------------\n"; $c->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sY96q
function name:  (null)
number of ops:  19
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $1      'D'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   28     3        ECHO                                                     '%24c-%3Ex%0A'
   29     4        INIT_FCALL                                               'var_export'
          5        FETCH_OBJ_R                                      ~4      !0, 'x'
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                                 
   31     8        ECHO                                                     '%0A%0A-----------------%0A'
   32     9        ECHO                                                     '%24c-%3Ex+after+unset%28%29%0A'
   33    10        UNSET_OBJ                                                !0, 'x'
   34    11        INIT_FCALL                                               'var_export'
         12        FETCH_OBJ_R                                      ~6      !0, 'x'
         13        SEND_VAL                                                 ~6
         14        DO_ICALL                                                 
   36    15        ECHO                                                     '%0A%0A-----------------%0A'
   37    16        INIT_METHOD_CALL                                         !0, 'foo'
         17        DO_FCALL                                      0          
         18      > RETURN                                                   1

Class C:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sY96q
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $1      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'x'
          3        OP_DATA                                                  $1
    8     4      > RETURN                                                   null

End of function __construct

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sY96q
function name:  foo
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ECHO                                                     '-%3Efoo%28%29%0A'
   12     1        INIT_FCALL                                               'var_export'
          2        FETCH_OBJ_R                                      ~0      'x'
          3        SEND_VAL                                                 ~0
          4        DO_ICALL                                                 
   13     5      > RETURN                                                   null

End of function foo

End of class C.

Class D:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sY96q
function name:  __get
number of ops:  11
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        ECHO                                                     '%0A'
   20     2        ROPE_INIT                                     3  ~2      '__get%28'
          3        ROPE_ADD                                      1  ~2      ~2, !0
          4        ROPE_END                                      2  ~1      ~2, '%29%0A'
          5        ECHO                                                     ~1
   21     6        INIT_FCALL                                               'var_export'
          7        FETCH_OBJ_R                                      ~4      !0
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                                 
   22    10      > RETURN                                                   null

End of function __get

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sY96q
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $1      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'x'
          3        OP_DATA                                                  $1
    8     4      > RETURN                                                   null

End of function __construct

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sY96q
function name:  foo
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ECHO                                                     '-%3Efoo%28%29%0A'
   12     1        INIT_FCALL                                               'var_export'
          2        FETCH_OBJ_R                                      ~0      'x'
          3        SEND_VAL                                                 ~0
          4        DO_ICALL                                                 
   13     5      > RETURN                                                   null

End of function foo

End of class D.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.5 ms | 1400 KiB | 15 Q