3v4l.org

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

Class a: [no user functions]
Class b:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/abVRT
function name:  foo
number of ops:  8
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'c'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   13     3        INIT_METHOD_CALL                                         !0, 'foo'
          4        FETCH_THIS                                       $4      
          5        SEND_VAR_EX                                              $4
          6        DO_FCALL                                      0          
   14     7      > RETURN                                                   null

End of function foo

End of class b.

Class c:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/abVRT
function name:  foo
number of ops:  6
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   21     1        INIT_FCALL                                               'print_r'
          2        FETCH_OBJ_R                                      ~1      !0, 'aa'
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                                 
   22     5      > RETURN                                                   null

End of function foo

End of class c.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.86 ms | 998 KiB | 14 Q