3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static $b; } class B { public function __get($name) { $this->__set($name, new C); return $this->$name; } public function __set($name, $value) { $this->$name = $value; } } class C { public function test() { return new D; } } class D { public $d; } A::$b = new B; A::$b->c->test()->d = 'waa'; A::$b->c->test()->d = 'waa';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LoXRg
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN_STATIC_PROP                                       'b', 'A'
          3        OP_DATA                                                  $1
   37     4        FETCH_STATIC_PROP_R          unknown             ~3      'b'
          5        FETCH_OBJ_R                                      ~4      ~3, 'c'
          6        INIT_METHOD_CALL                                         ~4, 'test'
          7        DO_FCALL                                      0  $5      
          8        SEPARATE                                         $5      $5
          9        ASSIGN_OBJ                                               $5, 'd'
         10        OP_DATA                                                  'waa'
   39    11        FETCH_STATIC_PROP_R          unknown             ~7      'b'
         12        FETCH_OBJ_R                                      ~8      ~7, 'c'
         13        INIT_METHOD_CALL                                         ~8, 'test'
         14        DO_FCALL                                      0  $9      
         15        SEPARATE                                         $9      $9
         16        ASSIGN_OBJ                                               $9, 'd'
         17        OP_DATA                                                  'waa'
         18      > RETURN                                                   1

Class A: [no user functions]
Class B:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LoXRg
function name:  __get
number of ops:  10
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        INIT_METHOD_CALL                                         '__set'
          2        SEND_VAR_EX                                              !0
          3        NEW                                              $1      'C'
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $1
          6        DO_FCALL                                      0          
   13     7        FETCH_OBJ_R                                      ~4      !0
          8      > RETURN                                                   ~4
   14     9*     > RETURN                                                   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/LoXRg
function name:  __set
number of ops:  5
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   18     2        ASSIGN_OBJ                                               !0
          3        OP_DATA                                                  !1
   19     4      > RETURN                                                   null

End of function __set

End of class B.

Class C:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LoXRg
function name:  test
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $0      'D'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
   27     3*     > RETURN                                                   null

End of function test

End of class C.

Class D: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.46 ms | 1390 KiB | 13 Q