3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $foo = 1; function setFoo($foo) { $this->foo = $foo; } } class B { function f(A $a) { $a->setFoo(5); } } $a = new A(); $b = new B(); echo $a->foo; $b->f($a); echo $a->foo;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cEHbU
function name:  (null)
number of ops:  14
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   16     3        NEW                                              $5      'B'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   17     6        FETCH_OBJ_R                                      ~8      !0, 'foo'
          7        ECHO                                                     ~8
   18     8        INIT_METHOD_CALL                                         !1, 'f'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0          
   19    11        FETCH_OBJ_R                                      ~10     !0, 'foo'
         12        ECHO                                                     ~10
         13      > RETURN                                                   1

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

End of function setfoo

End of class A.

Class B:
Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cEHbU
function name:  f
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INIT_METHOD_CALL                                         !0, 'setFoo'
          2        SEND_VAL_EX                                              5
          3        DO_FCALL                                      0          
   12     4      > RETURN                                                   null

End of function f

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.23 ms | 1395 KiB | 13 Q