3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { function poop (self $a): self { } } $refMethod = new ReflectionMethod('Foo', 'poop'); $refParam = $refMethod->getParameters()[0]; print_r(array( 'paramType' => $refParam->getType()->getName(), 'returnType' => $refMethod->getReturnType()->getName(), ));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7loMl
function name:  (null)
number of ops:  23
compiled vars:  !0 = $refMethod, !1 = $refParam
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   NEW                                                  $2      'ReflectionMethod'
          1        SEND_VAL_EX                                                  'Foo'
          2        SEND_VAL_EX                                                  'poop'
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !0, $2
   12     5        INIT_METHOD_CALL                                             !0, 'getParameters'
          6        DO_FCALL                                          0  $5      
          7        FETCH_DIM_R                                          ~6      $5, 0
          8        ASSIGN                                                       !1, ~6
   14     9        INIT_FCALL                                                   'print_r'
   15    10        INIT_METHOD_CALL                                             !1, 'getType'
         11        DO_FCALL                                          0  $8      
         12        INIT_METHOD_CALL                                             $8, 'getName'
         13        DO_FCALL                                          0  $9      
         14        INIT_ARRAY                                           ~10     $9, 'paramType'
   16    15        INIT_METHOD_CALL                                             !0, 'getReturnType'
         16        DO_FCALL                                          0  $11     
         17        INIT_METHOD_CALL                                             $11, 'getName'
         18        DO_FCALL                                          0  $12     
         19        ADD_ARRAY_ELEMENT                                    ~10     $12, 'returnType'
         20        SEND_VAL                                                     ~10
   14    21        DO_ICALL                                                     
   17    22      > RETURN                                                       1

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

End of function poop

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
127.97 ms | 480 KiB | 8 Q