3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(): iterable { return []; } function bar(): iterable|bool { return []; } echo (new ReflectionFunction('foo'))->getReturnType()->__toString(); echo ", "; echo (new ReflectionFunction('bar'))->getReturnType()->__toString();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JGM9D
function name:  (null)
number of ops:  18
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $0      'ReflectionFunction'
          1        SEND_VAL_EX                                              'foo'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'getReturnType'
          4        DO_FCALL                                      0  $2      
          5        INIT_METHOD_CALL                                         $2, '__toString'
          6        DO_FCALL                                      0  $3      
          7        ECHO                                                     $3
   12     8        ECHO                                                     '%2C+'
   13     9        NEW                                              $4      'ReflectionFunction'
         10        SEND_VAL_EX                                              'bar'
         11        DO_FCALL                                      0          
         12        INIT_METHOD_CALL                                         $4, 'getReturnType'
         13        DO_FCALL                                      0  $6      
         14        INIT_METHOD_CALL                                         $6, '__toString'
         15        DO_FCALL                                      0  $7      
         16        ECHO                                                     $7
         17      > RETURN                                                   1

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

End of function foo

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

End of function bar

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.2 ms | 944 KiB | 13 Q