3v4l.org

run code in 500+ PHP versions simultaneously
<?php trait myTrait { function foo() { echo __TRAIT__, PHP_EOL; echo __METHOD__, PHP_EOL; } } class Foo { use myTrait; } $obj = new Foo; $obj->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KZKXo
function name:  (null)
number of ops:  7
compiled vars:  !0 = $obj
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     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 myTrait:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KZKXo
function name:  foo
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                         'myTrait'
          1        ECHO                                                         '%0A'
    5     2        ECHO                                                         'myTrait%3A%3Afoo'
          3        ECHO                                                         '%0A'
    6     4      > RETURN                                                       null

End of function foo

End of class myTrait.

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
245.38 ms | 2808 KiB | 13 Q