3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static function callMeh(Foo $foo) { $foo->meh(); } public function meh() { var_dump('Calling in base class'); } } trait Bar { public function meh() { var_dump('Calling in trait'); } } class Baz extends Foo { use Bar; } Foo::callMeh(new Baz());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oLhC7
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   DECLARE_CLASS                                            'baz', 'foo'
   29     1        INIT_STATIC_METHOD_CALL                                  'Foo', 'callMeh'
          2        NEW                                              $0      'Baz'
          3        DO_FCALL                                      0          
          4        SEND_VAR                                                 $0
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class Foo:
Function callmeh:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oLhC7
function name:  callMeh
number of ops:  4
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        INIT_METHOD_CALL                                         !0, 'meh'
          2        DO_FCALL                                      0          
    8     3      > RETURN                                                   null

End of function callmeh

Function meh:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oLhC7
function name:  meh
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'Calling+in+base+class'
          2        DO_ICALL                                                 
   13     3      > RETURN                                                   null

End of function meh

End of class Foo.

Class Bar:
Function meh:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oLhC7
function name:  meh
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'Calling+in+trait'
          2        DO_ICALL                                                 
   21     3      > RETURN                                                   null

End of function meh

End of class Bar.

Class Baz: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.93 ms | 1388 KiB | 15 Q