3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Rofl\Quack{ const BAR = "bar"; } namespace Bar\Qux{ use const \Rofl\Quack\BAR; const FOO = 1; function whatever( int $p0 = FOO, int $p1 = BAR, string $p2 = \Rofl\Quack\BAR . 'lit' ){} } namespace{ $RF = new ReflectionFunction(\Bar\Qux\whatever::CLASS); var_dump($RF->getParameters()[0]->getDefaultValueConstantName()); var_dump($RF->getParameters()[1]->getDefaultValueConstantName()); var_dump($RF->getParameters()[2]->getDefaultValueConstantName()); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PGN2a
function name:  (null)
number of ops:  31
compiled vars:  !0 = $RF
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CONST                                            'Rofl%5CQuack%5CBAR', 'bar'
    7     1        DECLARE_CONST                                            'Bar%5CQux%5CFOO', 1
   15     2        NEW                                              $1      'ReflectionFunction'
          3        SEND_VAL_EX                                              'Bar%5CQux%5Cwhatever'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   16     6        INIT_FCALL                                               'var_dump'
          7        INIT_METHOD_CALL                                         !0, 'getParameters'
          8        DO_FCALL                                      0  $4      
          9        FETCH_DIM_R                                      ~5      $4, 0
         10        INIT_METHOD_CALL                                         ~5, 'getDefaultValueConstantName'
         11        DO_FCALL                                      0  $6      
         12        SEND_VAR                                                 $6
         13        DO_ICALL                                                 
   17    14        INIT_FCALL                                               'var_dump'
         15        INIT_METHOD_CALL                                         !0, 'getParameters'
         16        DO_FCALL                                      0  $8      
         17        FETCH_DIM_R                                      ~9      $8, 1
         18        INIT_METHOD_CALL                                         ~9, 'getDefaultValueConstantName'
         19        DO_FCALL                                      0  $10     
         20        SEND_VAR                                                 $10
         21        DO_ICALL                                                 
   18    22        INIT_FCALL                                               'var_dump'
         23        INIT_METHOD_CALL                                         !0, 'getParameters'
         24        DO_FCALL                                      0  $12     
         25        FETCH_DIM_R                                      ~13     $12, 2
         26        INIT_METHOD_CALL                                         ~13, 'getDefaultValueConstantName'
         27        DO_FCALL                                      0  $14     
         28        SEND_VAR                                                 $14
         29        DO_ICALL                                                 
   19    30      > RETURN                                                   1

Function bar%5Cqux%5Cwhatever:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PGN2a
function name:  Bar\Qux\whatever
number of ops:  4
compiled vars:  !0 = $p0, !1 = $p1, !2 = $p2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV_INIT                                        !0      <const ast>
   10     1        RECV_INIT                                        !1      <const ast>
   11     2        RECV_INIT                                        !2      <const ast>
   12     3      > RETURN                                                   null

End of function bar%5Cqux%5Cwhatever

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.49 ms | 1001 KiB | 14 Q