3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Test { function method($a = self::UNDEFINED) { } } $rp = new ReflectionParameter(['Test', 'method'], 'a'); try { $val = $rp->getDefaultValue(); } catch (Error $ex) { var_dump($ex); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 9
Branch analysis from position: 9
2 jumps found. (Code = 107) Position 1 = 10, Position 2 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hAdkZ
function name:  (null)
number of ops:  14
compiled vars:  !0 = $rp, !1 = $val, !2 = $ex
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   NEW                                                  $3      'ReflectionParameter'
          1        SEND_VAL_EX                                                  <array>
          2        SEND_VAL_EX                                                  'a'
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !0, $3
   12     5        INIT_METHOD_CALL                                             !0, 'getDefaultValue'
          6        DO_FCALL                                          0  $6      
          7        ASSIGN                                                       !1, $6
          8      > JMP                                                          ->13
   13     9  E > > CATCH                                           last         'Error'
   14    10    >   INIT_FCALL                                                   'var_dump'
         11        SEND_VAR                                                     !2
         12        DO_ICALL                                                     
   15    13    > > RETURN                                                       1

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

End of function method

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.21 ms | 2242 KiB | 14 Q