3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rc = new ReflectionClass('ArrayIterator'); foreach ($rc->getMethods() as $method) { if ($method->isAbstract() || $method->isStatic()) continue; foreach ($method->getParameters() as $param) { var_dump($method->name, $method->getDeclaringClass()->name); foreach ($method->getParameters() as $param) { if ($param->isOptional()) var_dump([$param->name, $param->getDefaultValue()]); } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 48
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 48
Branch analysis from position: 8
2 jumps found. (Code = 47) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 16
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 46
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 46
Branch analysis from position: 20
2 jumps found. (Code = 77) Position 1 = 31, Position 2 = 44
Branch analysis from position: 31
2 jumps found. (Code = 78) Position 1 = 32, Position 2 = 44
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 43
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 43
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 44
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 46
Branch analysis from position: 14
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 48
filename:       /in/MCRBm
function name:  (null)
number of ops:  50
compiled vars:  !0 = $rc, !1 = $method, !2 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'ReflectionClass'
          1        SEND_VAL_EX                                              'ArrayIterator'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    5     4        INIT_METHOD_CALL                                         !0, 'getMethods'
          5        DO_FCALL                                      0  $6      
          6      > FE_RESET_R                                       $7      $6, ->48
          7    > > FE_FETCH_R                                               $7, !1, ->48
    7     8    >   INIT_METHOD_CALL                                         !1, 'isAbstract'
          9        DO_FCALL                                      0  $8      
         10      > JMPNZ_EX                                         ~9      $8, ->14
         11    >   INIT_METHOD_CALL                                         !1, 'isStatic'
         12        DO_FCALL                                      0  $10     
         13        BOOL                                             ~9      $10
         14    > > JMPZ                                                     ~9, ->16
    8    15    > > JMP                                                      ->7
   10    16    >   INIT_METHOD_CALL                                         !1, 'getParameters'
         17        DO_FCALL                                      0  $11     
         18      > FE_RESET_R                                       $12     $11, ->46
         19    > > FE_FETCH_R                                               $12, !2, ->46
   12    20    >   INIT_FCALL                                               'var_dump'
         21        FETCH_OBJ_R                                      ~13     !1, 'name'
         22        SEND_VAL                                                 ~13
         23        INIT_METHOD_CALL                                         !1, 'getDeclaringClass'
         24        DO_FCALL                                      0  $14     
         25        FETCH_OBJ_R                                      ~15     $14, 'name'
         26        SEND_VAL                                                 ~15
         27        DO_ICALL                                                 
   14    28        INIT_METHOD_CALL                                         !1, 'getParameters'
         29        DO_FCALL                                      0  $17     
         30      > FE_RESET_R                                       $18     $17, ->44
         31    > > FE_FETCH_R                                               $18, !2, ->44
   16    32    >   INIT_METHOD_CALL                                         !2, 'isOptional'
         33        DO_FCALL                                      0  $19     
         34      > JMPZ                                                     $19, ->43
   17    35    >   INIT_FCALL                                               'var_dump'
         36        FETCH_OBJ_R                                      ~20     !2, 'name'
         37        INIT_ARRAY                                       ~21     ~20
         38        INIT_METHOD_CALL                                         !2, 'getDefaultValue'
         39        DO_FCALL                                      0  $22     
         40        ADD_ARRAY_ELEMENT                                ~21     $22
         41        SEND_VAL                                                 ~21
         42        DO_ICALL                                                 
   14    43    > > JMP                                                      ->31
         44    >   FE_FREE                                                  $18
   10    45      > JMP                                                      ->19
         46    >   FE_FREE                                                  $12
    5    47      > JMP                                                      ->7
         48    >   FE_FREE                                                  $7
   20    49      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.69 ms | 1405 KiB | 15 Q