3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $b; public function A() { $this->b = new B(); } public function get_b() {return $this->b;} public function print_b() {echo $this->b->str;} } class B { public $str = "Not modified\n"; } $a = new A(); $a->print_b(); $b = $a->get_b(); $b->str = "Your ownership is useless.\n"; $a->print_b();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aAEmZ
function name:  (null)
number of ops:  13
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   21     3        INIT_METHOD_CALL                                         !0, 'print_b'
          4        DO_FCALL                                      0          
   22     5        INIT_METHOD_CALL                                         !0, 'get_b'
          6        DO_FCALL                                      0  $6      
          7        ASSIGN                                                   !1, $6
   23     8        ASSIGN_OBJ                                               !1, 'str'
          9        OP_DATA                                                  'Your+ownership+is+useless.%0A'
   24    10        INIT_METHOD_CALL                                         !0, 'print_b'
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

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

End of function a

Function get_b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aAEmZ
function name:  get_b
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_OBJ_R                                      ~0      'b'
          1      > RETURN                                                   ~0
          2*     > RETURN                                                   null

End of function get_b

Function print_b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aAEmZ
function name:  print_b
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_OBJ_R                                      ~0      'b'
          1        FETCH_OBJ_R                                      ~1      ~0, 'str'
          2        ECHO                                                     ~1
          3      > RETURN                                                   null

End of function print_b

End of class A.

Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.58 ms | 1395 KiB | 13 Q