3v4l.org

run code in 300+ PHP versions simultaneously
<?php define("K", 11); function a($a = 1, $b = 'hi', $c = K) { } $r = new ReflectionFunction('a'); foreach($r->getParameters() as $key=>$val) { var_dump($val->getDefaultValueConstantName()); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 19
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/lGLlf
function name:  (null)
number of ops:  21
compiled vars:  !0 = $r, !1 = $val, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'K'
          2        SEND_VAL                                                 11
          3        DO_ICALL                                                 
    7     4        NEW                                              $4      'ReflectionFunction'
          5        SEND_VAL_EX                                              'a'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $4
    9     8        INIT_METHOD_CALL                                         !0, 'getParameters'
          9        DO_FCALL                                      0  $7      
         10      > FE_RESET_R                                       $8      $7, ->19
         11    > > FE_FETCH_R                                       ~9      $8, !1, ->19
         12    >   ASSIGN                                                   !2, ~9
   10    13        INIT_FCALL                                               'var_dump'
         14        INIT_METHOD_CALL                                         !1, 'getDefaultValueConstantName'
         15        DO_FCALL                                      0  $11     
         16        SEND_VAR                                                 $11
         17        DO_ICALL                                                 
    9    18      > JMP                                                      ->11
         19    >   FE_FREE                                                  $8
   11    20      > RETURN                                                   1

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

End of function a

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.08 ms | 1004 KiB | 15 Q