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 { a::bar insteadof bar; bar as bat; } } (new b)->bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qOS5T
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'
   18     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/qOS5T
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/qOS5T
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: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.97 ms | 2128 KiB | 13 Q