3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Foo { public function bar( ...$many ); } $reflector = new ReflectionClass('Foo'); foreach ($reflector->getMethods() as $method) { echo "\nmethod {$method->getName()}:\n"; foreach ($method->getParameters() as $param) { echo " - name: " . $param->getName() . "\n"; echo " hasType: " . ( $param->hasType() ? 'true' : 'false' ) . "\n"; echo " type: " . $param->getType() . "\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 40
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 40
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 38
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 38
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 38
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
filename:       /in/1spSX
function name:  (null)
number of ops:  42
compiled vars:  !0 = $reflector, !1 = $method, !2 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $3      'ReflectionClass'
          1        SEND_VAL_EX                                              'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    8     4        INIT_METHOD_CALL                                         !0, 'getMethods'
          5        DO_FCALL                                      0  $6      
          6      > FE_RESET_R                                       $7      $6, ->40
          7    > > FE_FETCH_R                                               $7, !1, ->40
    9     8    >   ROPE_INIT                                     3  ~10     '%0Amethod+'
          9        INIT_METHOD_CALL                                         !1, 'getName'
         10        DO_FCALL                                      0  $8      
         11        ROPE_ADD                                      1  ~10     ~10, $8
         12        ROPE_END                                      2  ~9      ~10, '%3A%0A'
         13        ECHO                                                     ~9
   10    14        INIT_METHOD_CALL                                         !1, 'getParameters'
         15        DO_FCALL                                      0  $12     
         16      > FE_RESET_R                                       $13     $12, ->38
         17    > > FE_FETCH_R                                               $13, !2, ->38
   11    18    >   INIT_METHOD_CALL                                         !2, 'getName'
         19        DO_FCALL                                      0  $14     
         20        CONCAT                                           ~15     '+-+name%3A+', $14
         21        CONCAT                                           ~16     ~15, '%0A'
         22        ECHO                                                     ~16
   12    23        INIT_METHOD_CALL                                         !2, 'hasType'
         24        DO_FCALL                                      0  $17     
         25      > JMPZ                                                     $17, ->28
         26    >   QM_ASSIGN                                        ~18     'true'
         27      > JMP                                                      ->29
         28    >   QM_ASSIGN                                        ~18     'false'
         29    >   CONCAT                                           ~19     '+++hasType%3A+', ~18
         30        CONCAT                                           ~20     ~19, '%0A'
         31        ECHO                                                     ~20
   13    32        INIT_METHOD_CALL                                         !2, 'getType'
         33        DO_FCALL                                      0  $21     
         34        CONCAT                                           ~22     '+++type%3A+', $21
         35        CONCAT                                           ~23     ~22, '%0A'
         36        ECHO                                                     ~23
   10    37      > JMP                                                      ->17
         38    >   FE_FREE                                                  $13
    8    39      > JMP                                                      ->7
         40    >   FE_FREE                                                  $7
   15    41      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1spSX
function name:  bar
number of ops:  2
compiled vars:  !0 = $many
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_VARIADIC                                    !0      
          1      > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.79 ms | 1403 KiB | 13 Q