3v4l.org

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

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

End of function foo

End of class a.

Class b: [no user functions]
Class c:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WfW28
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ECHO                                                     'c'
   16     1      > RETURN                                                   null

End of function foo

End of class c.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.17 ms | 1394 KiB | 13 Q