3v4l.org

run code in 500+ PHP versions simultaneously
<?php interface I { public function go(iterable $x): void; } final class Test implements I { public function go(iterable|Generator $x): void { echo 'It\'s work!'; } } (new Test())->go([]); echo "\n"; (new Test())->go((static fn() => yield 1)());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SENSO
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                                'test'
   15     1        NEW                                                  $0      'Test'
          2        DO_FCALL                                          0          
          3        INIT_METHOD_CALL                                             $0, 'go'
          4        SEND_VAL_EX                                                  <array>
          5        DO_FCALL                                          0          
   17     6        ECHO                                                         '%0A'
   19     7        NEW                                                  $3      'Test'
          8        DO_FCALL                                          0          
          9        INIT_METHOD_CALL                                             $3, 'go'
         10        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
         11        INIT_DYNAMIC_CALL                                            ~5
         12        DO_FCALL                                          0  $6      
         13        SEND_VAR_NO_REF_EX                                           $6
         14        DO_FCALL                                          0          
         15      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/SENSO
function name:  {closure:/in/SENSO:19}
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
          0  E >   GENERATOR_CREATE                                             
          1        YIELD                                                $0      1
          2      > GENERATOR_RETURN                                             
          3*     > GENERATOR_RETURN                                             

End of Dynamic Function 0

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

End of function go

End of class I.

Class Test:
Function go:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SENSO
function name:  go
number of ops:  3
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   RECV                                                 !0      
   11     1        ECHO                                                         'It%27s+work%21'
   12     2      > RETURN                                                       null

End of function go

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
155.93 ms | 1460 KiB | 13 Q