3v4l.org

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

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

End of function a

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.97 ms | 1395 KiB | 15 Q