3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { public function f($p1, $p2 = null) {} } $class = new ReflectionClass('C'); $method = $class->getMethod('f'); $params = $method->getParameters(); foreach ($params as $param) { echo "[$param]"; echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/FVUkK
function name:  (null)
number of ops:  21
compiled vars:  !0 = $class, !1 = $method, !2 = $params, !3 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                                              $4      'ReflectionClass'
          1        SEND_VAL_EX                                              'C'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
    7     4        INIT_METHOD_CALL                                         !0, 'getMethod'
          5        SEND_VAL_EX                                              'f'
          6        DO_FCALL                                      0  $7      
          7        ASSIGN                                                   !1, $7
    8     8        INIT_METHOD_CALL                                         !1, 'getParameters'
          9        DO_FCALL                                      0  $9      
         10        ASSIGN                                                   !2, $9
   10    11      > FE_RESET_R                                       $11     !2, ->19
         12    > > FE_FETCH_R                                               $11, !3, ->19
   11    13    >   ROPE_INIT                                     3  ~13     '%5B'
         14        ROPE_ADD                                      1  ~13     ~13, !3
         15        ROPE_END                                      2  ~12     ~13, '%5D'
         16        ECHO                                                     ~12
   12    17        ECHO                                                     '%0A'
   10    18      > JMP                                                      ->12
         19    >   FE_FREE                                                  $11
   13    20      > RETURN                                                   1

Class C:
Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FVUkK
function name:  f
number of ops:  3
compiled vars:  !0 = $p1, !1 = $p2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
          2      > RETURN                                                   null

End of function f

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.64 ms | 1395 KiB | 13 Q