3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait T { private function test() { echo "a"; } } trait T2{ use T; } class A { use T2; } class B extends A{ public function f(){ $this->test(); } } $a = new B; $a->f();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gBJtW
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            't2'
   15     1        DECLARE_CLASS                                            'a'
   20     2        DECLARE_CLASS                                            'b', 'a'
   26     3        NEW                                              $1      'B'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   27     6        INIT_METHOD_CALL                                         !0, 'f'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Class T:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gBJtW
function name:  test
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ECHO                                                     'a'
    8     1      > RETURN                                                   null

End of function test

End of class T.

Class T2: [no user functions]
Class A: [no user functions]
Class B:
Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gBJtW
function name:  f
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_METHOD_CALL                                         'test'
          1        DO_FCALL                                      0          
   23     2      > RETURN                                                   null

End of function f

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.92 ms | 1393 KiB | 13 Q