3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Herp { function foo() { $this->bar(); } function bar() { var_dump('in trait'); } } class Derp { use Herp; function bar() { var_dump('in class'); Herp::bar(); } } (new Derp())->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ODZCF
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_CLASS                                            'derp'
   20     1        NEW                                              $0      'Derp'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'foo'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

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

End of function foo

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

End of function bar

End of class Herp.

Class Derp:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ODZCF
function name:  bar
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'in+class'
          2        DO_ICALL                                                 
   17     3        INIT_STATIC_METHOD_CALL                                  'Herp', 'bar'
          4        DO_FCALL                                      0          
   18     5      > RETURN                                                   null

End of function bar

End of class Derp.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.45 ms | 1396 KiB | 15 Q