3v4l.org

run code in 500+ PHP versions simultaneously
<?php trait foo { public function bar() { echo 'trait'; } } class a { public function bar() { echo 'parent'; } } class b extends a { use foo { bar as bat; } public function bar() { parent::bar(); } } (new b)->bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s9i4N
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                                'b', 'a'
   19     1        NEW                                                  $0      'b'
          2        DO_FCALL                                          0          
          3        INIT_METHOD_CALL                                             $0, 'bar'
          4        DO_FCALL                                          0          
          5      > RETURN                                                       1

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

End of function bar

End of class foo.

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

End of function bar

End of class a.

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

End of function bar

End of class b.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.46 ms | 2681 KiB | 13 Q