3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface PhoneInterface { public function add(): self; } trait PhoneTrait { public function add(): self { return $this; } } class A implements PhoneInterface { use PhoneTrait; } var_dump(new A());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SJCf2
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   DECLARE_CLASS                                            'a'
   21     1        INIT_FCALL                                               'var_dump'
          2        NEW                                              $0      'A'
          3        DO_FCALL                                      0          
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

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

End of function add

End of class PhoneInterface.

Class PhoneTrait:
Function add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SJCf2
function name:  add
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_THIS                                       ~0      
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   13     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function add

End of class PhoneTrait.

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.48 ms | 999 KiB | 14 Q