3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait A { public function foo() { echo "foo"; } } trait B { use A { foo as foobar; } public function foo() { foobar(); echo "bar"; } } class AB { use A; public function run() { $this->foo(); } } class ABC extends AB { use B; } $me = new ABC(); $me->run();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PkLeQ
function name:  (null)
number of ops:  9
compiled vars:  !0 = $me
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'b'
   12     1        DECLARE_CLASS                                            'ab'
   19     2        DECLARE_CLASS                                            'abc', 'ab'
   23     3        NEW                                              $1      'ABC'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   24     6        INIT_METHOD_CALL                                         !0, 'run'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

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

End of function foo

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/PkLeQ
function name:  foo
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL_BY_NAME                                       'foobar'
          1        DO_FCALL                                      0          
          2        ECHO                                                     'bar'
          3      > RETURN                                                   null

End of function foo

End of class B.

Class AB:
Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PkLeQ
function name:  run
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_METHOD_CALL                                         'foo'
          1        DO_FCALL                                      0          
   16     2      > RETURN                                                   null

End of function run

End of class AB.

Class ABC: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.98 ms | 1395 KiB | 13 Q