3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected $bar = 10; public function foo(A $other) { $other->bar = 10; } public function getBar() { return $this->bar; } } class B extends A { public function frobnicate(A $other) { $other->bar = 10; } } $a = new A(); $b = new B(); $b->frobnicate($a); print $a->getBar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v7Wbt
function name:  (null)
number of ops:  13
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   28     3        NEW                                              $5      'B'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   29     6        INIT_METHOD_CALL                                         !1, 'frobnicate'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
   30     9        INIT_METHOD_CALL                                         !0, 'getBar'
         10        DO_FCALL                                      0  $9      
         11        ECHO                                                     $9
         12      > RETURN                                                   1

Class A:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v7Wbt
function name:  foo
number of ops:  4
compiled vars:  !0 = $other
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN_OBJ                                               !0, 'bar'
          2        OP_DATA                                                  10
   10     3      > RETURN                                                   null

End of function foo

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

End of function getbar

End of class A.

Class B:
Function frobnicate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v7Wbt
function name:  frobnicate
number of ops:  4
compiled vars:  !0 = $other
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   22     1        ASSIGN_OBJ                                               !0, 'bar'
          2        OP_DATA                                                  10
   23     3      > RETURN                                                   null

End of function frobnicate

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v7Wbt
function name:  foo
number of ops:  4
compiled vars:  !0 = $other
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN_OBJ                                               !0, 'bar'
          2        OP_DATA                                                  10
   10     3      > RETURN                                                   null

End of function foo

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

End of function getbar

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.98 ms | 1399 KiB | 13 Q