3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface IX {} class X implements IX {} class Y {} function foo(IX $x) {} $rf = new \ReflectionFunction('foo'); $rp = $rf->getParameter('x'); $x = new X; var_dump($rp->getType(), $rp->getClass());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UddWm
function name:  (null)
number of ops:  21
compiled vars:  !0 = $rf, !1 = $rp, !2 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_CLASS                                            'x'
    9     1        NEW                                              $3      'ReflectionFunction'
          2        SEND_VAL_EX                                              'foo'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
   10     5        INIT_METHOD_CALL                                         !0, 'getParameter'
          6        SEND_VAL_EX                                              'x'
          7        DO_FCALL                                      0  $6      
          8        ASSIGN                                                   !1, $6
   11     9        NEW                                              $8      'X'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $8
   13    12        INIT_FCALL                                               'var_dump'
         13        INIT_METHOD_CALL                                         !1, 'getType'
         14        DO_FCALL                                      0  $11     
         15        SEND_VAR                                                 $11
         16        INIT_METHOD_CALL                                         !1, 'getClass'
         17        DO_FCALL                                      0  $12     
         18        SEND_VAR                                                 $12
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

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

End of function foo

Class IX: [no user functions]
Class X: [no user functions]
Class Y: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
362.08 ms | 1395 KiB | 16 Q