3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait foo { function bar() { echo 'foo->bar'; } } trait baz { use foo { foo::bar as foo_bar; } function bar() { foo_bar(); echo 'baz->bar'; } } class bar { use baz; function call_bar() { bar(); } } $obj=new bar(); $obj->call_bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k5aPa
function name:  (null)
number of ops:  8
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'baz'
   25     1        DECLARE_CLASS                                            'bar'
   33     2        NEW                                              $1      'bar'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   34     5        INIT_METHOD_CALL                                         !0, 'call_bar'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

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

End of function bar

End of class foo.

Class baz:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k5aPa
function name:  bar
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL_BY_NAME                                       'foo_bar'
          1        DO_FCALL                                      0          
   20     2        ECHO                                                     'baz-%3Ebar'
   21     3      > RETURN                                                   null

End of function bar

End of class baz.

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

End of function call_bar

End of class bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.21 ms | 1385 KiB | 13 Q