3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { use Some; function bar () { echo "this is bar" . PHP_EOL; } } trait Some { function useBar() { echo "using parent bar function" . PHP_EOL; $this->bar(); } } (new Foo())->useBar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KkRcm
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'foo'
   19     1        NEW                                                  $0      'Foo'
          2        DO_FCALL                                          0          
          3        INIT_METHOD_CALL                                             $0, 'useBar'
          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/KkRcm
function name:  bar
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   ECHO                                                         'this+is+bar%0A'
    8     1      > RETURN                                                       null

End of function bar

End of class Foo.

Class Some:
Function usebar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KkRcm
function name:  useBar
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   ECHO                                                         'using+parent+bar+function%0A'
   15     1        INIT_METHOD_CALL                                             'bar'
          2        DO_FCALL                                          0          
   16     3      > RETURN                                                       null

End of function usebar

End of class Some.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
141.26 ms | 483 KiB | 9 Q