3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function f(...$args){ echo "see? arguments are optional.\n"; } f(); $ref = new ReflectionFunction('f'); var_dump($ref->getParameters()[0]->getDefaultValue());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gHhJ2
function name:  (null)
number of ops:  15
compiled vars:  !0 = $ref
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'f'
          1        DO_FCALL                                      0          
    7     2        NEW                                              $2      'ReflectionFunction'
          3        SEND_VAL_EX                                              'f'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
    8     6        INIT_FCALL                                               'var_dump'
          7        INIT_METHOD_CALL                                         !0, 'getParameters'
          8        DO_FCALL                                      0  $5      
          9        FETCH_DIM_R                                      ~6      $5, 0
         10        INIT_METHOD_CALL                                         ~6, 'getDefaultValue'
         11        DO_FCALL                                      0  $7      
         12        SEND_VAR                                                 $7
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gHhJ2
function name:  f
number of ops:  3
compiled vars:  !0 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_VARIADIC                                    !0      
    4     1        ECHO                                                     'see%3F+arguments+are+optional.%0A'
    5     2      > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
259.39 ms | 1003 KiB | 16 Q