3v4l.org

run code in 500+ PHP versions simultaneously
<?php interface I { public function a(int $a): string; } Class C implements I { public function a(int|string $a): string { return "foo"; } } function test(I $subject) { print $subject->a('beep'); } test(new C());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5YPdg
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                                'c'
   19     1        INIT_FCALL                                                   'test'
          2        NEW                                                  $0      'C'
          3        DO_FCALL                                          0          
          4        SEND_VAR                                                     $0
          5        DO_FCALL                                          0          
          6      > RETURN                                                       1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5YPdg
function name:  test
number of ops:  6
compiled vars:  !0 = $subject
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   RECV                                                 !0      
   16     1        INIT_METHOD_CALL                                             !0, 'a'
          2        SEND_VAL_EX                                                  'beep'
          3        DO_FCALL                                          0  $1      
          4        ECHO                                                         $1
   17     5      > RETURN                                                       null

End of function test

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

End of function a

End of class I.

Class C:
Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5YPdg
function name:  a
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   RECV                                                 !0      
   10     1      > RETURN                                                       'foo'
   11     2*       VERIFY_RETURN_TYPE                                           
          3*     > RETURN                                                       null

End of function a

End of class C.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
155.46 ms | 1445 KiB | 14 Q