3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rc = new ReflectionClass('DateTime'); $rps = $rc->getMethod('__construct')->getParameters(); foreach ($rps as $rp) { echo ' $'.$rp->getName()."\n"; echo '$rp->isOptional()'."\n"; var_dump($rp->isOptional()); echo '$rp->isDefaultValueAvailable()'."\n"; var_dump($rp->isDefaultValueAvailable()); echo "\n\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 31
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 31
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/rsKDW
function name:  (null)
number of ops:  33
compiled vars:  !0 = $rc, !1 = $rps, !2 = $rp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $3      'ReflectionClass'
          1        SEND_VAL_EX                                              'DateTime'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    3     4        INIT_METHOD_CALL                                         !0, 'getMethod'
          5        SEND_VAL_EX                                              '__construct'
          6        DO_FCALL                                      0  $6      
          7        INIT_METHOD_CALL                                         $6, 'getParameters'
          8        DO_FCALL                                      0  $7      
          9        ASSIGN                                                   !1, $7
    4    10      > FE_RESET_R                                       $9      !1, ->31
         11    > > FE_FETCH_R                                               $9, !2, ->31
    5    12    >   INIT_METHOD_CALL                                         !2, 'getName'
         13        DO_FCALL                                      0  $10     
         14        CONCAT                                           ~11     '++%24', $10
         15        CONCAT                                           ~12     ~11, '%0A'
         16        ECHO                                                     ~12
    6    17        ECHO                                                     '%24rp-%3EisOptional%28%29%0A'
    7    18        INIT_FCALL                                               'var_dump'
         19        INIT_METHOD_CALL                                         !2, 'isOptional'
         20        DO_FCALL                                      0  $13     
         21        SEND_VAR                                                 $13
         22        DO_ICALL                                                 
    8    23        ECHO                                                     '%24rp-%3EisDefaultValueAvailable%28%29%0A'
    9    24        INIT_FCALL                                               'var_dump'
         25        INIT_METHOD_CALL                                         !2, 'isDefaultValueAvailable'
         26        DO_FCALL                                      0  $15     
         27        SEND_VAR                                                 $15
         28        DO_ICALL                                                 
   10    29        ECHO                                                     '%0A%0A'
    4    30      > JMP                                                      ->11
         31    >   FE_FREE                                                  $9
   11    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164 ms | 1396 KiB | 15 Q