3v4l.org

run code in 300+ PHP versions simultaneously
<?php $r = new ReflectionFunction(function (?int $a): ?int {}); var_dump((string) $r->getParameters()[0]->getType()); var_dump((string) $r->getReturnType());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c21Nq
function name:  (null)
number of ops:  21
compiled vars:  !0 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $1      'ReflectionFunction'
          1        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          2        SEND_VAL_EX                                              ~2
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
    4     5        INIT_FCALL                                               'var_dump'
          6        INIT_METHOD_CALL                                         !0, 'getParameters'
          7        DO_FCALL                                      0  $5      
          8        FETCH_DIM_R                                      ~6      $5, 0
          9        INIT_METHOD_CALL                                         ~6, 'getType'
         10        DO_FCALL                                      0  $7      
         11        CAST                                          6  ~8      $7
         12        SEND_VAL                                                 ~8
         13        DO_ICALL                                                 
    5    14        INIT_FCALL                                               'var_dump'
         15        INIT_METHOD_CALL                                         !0, 'getReturnType'
         16        DO_FCALL                                      0  $10     
         17        CAST                                          6  ~11     $10
         18        SEND_VAL                                                 ~11
         19        DO_ICALL                                                 
         20      > RETURN                                                   1


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

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.36 ms | 1072 KiB | 14 Q