3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Hello { function sayHello() { return "Hello"; } } trait World { function sayWorld() { return "World"; } } class MyWorld { use Hello, World; } $world = new MyWorld(); echo $world->sayHello() . " " . $world->sayWorld(); //Hello World
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gt8FC
function name:  (null)
number of ops:  12
compiled vars:  !0 = $world
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   DECLARE_CLASS                                            'myworld'
   16     1        NEW                                              $1      'MyWorld'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   17     4        INIT_METHOD_CALL                                         !0, 'sayHello'
          5        DO_FCALL                                      0  $4      
          6        CONCAT                                           ~5      $4, '+'
          7        INIT_METHOD_CALL                                         !0, 'sayWorld'
          8        DO_FCALL                                      0  $6      
          9        CONCAT                                           ~7      ~5, $6
         10        ECHO                                                     ~7
         11      > RETURN                                                   1

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

End of function sayhello

End of class Hello.

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

End of function sayworld

End of class World.

Class MyWorld: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.98 ms | 1394 KiB | 13 Q