3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait FooTrait { public function foo() { return "foo"; } } trait BarTrait { use FooTrait; public function bar() { return "bar"; } } dd((new class { use BarTrait; })->foo());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GYkLa
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_CLASS                                            'bartrait'
   25     1        INIT_FCALL_BY_NAME                                       'dd'
          2        DECLARE_ANON_CLASS                               <unknown> 
          3        NEW                                              $1      $0
          4        DO_FCALL                                      0          
   27     5        INIT_METHOD_CALL                                         $1, 'foo'
          6        DO_FCALL                                      0  $3      
          7        SEND_VAR_NO_REF_EX                                       $3
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

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

End of function foo

End of class FooTrait.

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

End of function bar

End of class BarTrait.

Class class@anonymous: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.34 ms | 1398 KiB | 13 Q