3v4l.org

run code in 300+ 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"; } } class D implements I { public function a(int $a): string { return "foo"; } } function test(I $subject) { print $subject->a('beep'); } test(new C()); test(new D());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WUTv4
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'c'
   14     1        DECLARE_CLASS                                            'd'
   24     2        INIT_FCALL                                               'test'
          3        NEW                                              $0      'C'
          4        DO_FCALL                                      0          
          5        SEND_VAR                                                 $0
          6        DO_FCALL                                      0          
   25     7        INIT_FCALL                                               'test'
          8        NEW                                              $3      'D'
          9        DO_FCALL                                      0          
         10        SEND_VAR                                                 $3
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WUTv4
function name:  test
number of ops:  6
compiled vars:  !0 = $subject
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        INIT_METHOD_CALL                                         !0, 'a'
          2        SEND_VAL_EX                                              'beep'
          3        DO_FCALL                                      0  $1      
          4        ECHO                                                     $1
   22     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/WUTv4
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/WUTv4
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.

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

End of function a

End of class D.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.54 ms | 1003 KiB | 15 Q