3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { function foo(T $t) {} } $r = new ReflectionClass('C'); $m = $r->getMethod('foo'); $p = $m->getParameters(); $c = $p[0]->getClass(); var_export($c);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aHUHU
function name:  (null)
number of ops:  19
compiled vars:  !0 = $r, !1 = $m, !2 = $p, !3 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $4      'ReflectionClass'
          1        SEND_VAL_EX                                              'C'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
    8     4        INIT_METHOD_CALL                                         !0, 'getMethod'
          5        SEND_VAL_EX                                              'foo'
          6        DO_FCALL                                      0  $7      
          7        ASSIGN                                                   !1, $7
    9     8        INIT_METHOD_CALL                                         !1, 'getParameters'
          9        DO_FCALL                                      0  $9      
         10        ASSIGN                                                   !2, $9
   10    11        FETCH_DIM_R                                      ~11     !2, 0
         12        INIT_METHOD_CALL                                         ~11, 'getClass'
         13        DO_FCALL                                      0  $12     
         14        ASSIGN                                                   !3, $12
   11    15        INIT_FCALL                                               'var_export'
         16        SEND_VAR                                                 !3
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

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

End of function foo

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.08 ms | 1395 KiB | 15 Q