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(), $param[0]->getDefaultValue());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CDdLZ
function name:  (null)
number of ops:  22
compiled vars:  !0 = $r, !1 = $params, !2 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $3      'ReflectionFunction'
          1        SEND_VAL_EX                                              'a'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    5     4        INIT_METHOD_CALL                                         !0, 'getParameters'
          5        DO_FCALL                                      0  $6      
          6        ASSIGN                                                   !1, $6
    7     7        INIT_FCALL                                               'var_dump'
          8        FETCH_DIM_R                                      ~8      !1, 0
          9        INIT_METHOD_CALL                                         ~8, 'isOptional'
         10        DO_FCALL                                      0  $9      
         11        SEND_VAR                                                 $9
         12        FETCH_DIM_R                                      ~10     !1, 0
         13        INIT_METHOD_CALL                                         ~10, 'isDefaultValueAvailable'
         14        DO_FCALL                                      0  $11     
         15        SEND_VAR                                                 $11
         16        FETCH_DIM_R                                      ~12     !2, 0
         17        INIT_METHOD_CALL                                         ~12, 'getDefaultValue'
         18        DO_FCALL                                      0  $13     
         19        SEND_VAR                                                 $13
         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/CDdLZ
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:
156.74 ms | 1400 KiB | 15 Q