3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected $data; protected $foo = ''; public function a() { $a = $this; (new B())->foo($a); var_dump($a); } } class B { public function foo(&$var) { $var = 1; } } $a = new A(); $a->a();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3rASP
function name:  (null)
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     3        INIT_METHOD_CALL                                         !0, 'a'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class A:
Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3rASP
function name:  a
number of ops:  11
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_THIS                                       ~1      
          1        ASSIGN                                                   !0, ~1
   11     2        NEW                                              $3      'B'
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $3, 'foo'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   12     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   13    10      > RETURN                                                   null

End of function a

End of class A.

Class B:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3rASP
function name:  foo
number of ops:  3
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        ASSIGN                                                   !0, 1
   20     2      > RETURN                                                   null

End of function foo

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
215.11 ms | 1005 KiB | 14 Q