3v4l.org

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

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

End of function foo

End of class FooTrait.

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

End of function foo

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.18 ms | 1395 KiB | 15 Q