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) { echo $key; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/UG5Ht
function name:  (null)
number of ops:  17
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, ->15
         11    > > FE_FETCH_R                                       ~9      $8, !1, ->15
         12    >   ASSIGN                                                   !2, ~9
   10    13        ECHO                                                     !2
    9    14      > JMP                                                      ->11
         15    >   FE_FREE                                                  $8
   11    16      > RETURN                                                   1

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UG5Ht
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:
154.14 ms | 1395 KiB | 15 Q