3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected $data; protected $foo = ''; public function a() { (new B())->foo($this); var_dump($this); if (isset($this->data['test'])) { $this->foo = $this->data['test']; } } } 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/E5oPQ
function name:  (null)
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   26     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
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 17
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/E5oPQ
function name:  a
number of ops:  18
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $0      'B'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'foo'
          3        FETCH_THIS                                       $2      
          4        SEND_VAR_EX                                              $2
          5        DO_FCALL                                      0          
   11     6        INIT_FCALL                                               'var_dump'
          7        FETCH_THIS                                       ~4      
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                                 
   12    10        FETCH_OBJ_IS                                     ~6      'data'
         11        ISSET_ISEMPTY_DIM_OBJ                         0          ~6, 'test'
         12      > JMPZ                                                     ~7, ->17
   13    13    >   FETCH_OBJ_R                                      ~9      'data'
         14        FETCH_DIM_R                                      ~10     ~9, 'test'
         15        ASSIGN_OBJ                                               'foo'
         16        OP_DATA                                                  ~10
   15    17    > > 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/E5oPQ
function name:  foo
number of ops:  3
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        ASSIGN                                                   !0, 1
   22     2      > RETURN                                                   null

End of function foo

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.76 ms | 1006 KiB | 14 Q