3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public function __toString() { return 'my_class'; } } $reflection = new ReflectionClass(MyClass::class); echo $reflection->getMethods()[0]->getReturnType();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JKj9f
function name:  (null)
number of ops:  12
compiled vars:  !0 = $reflection
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'myclass'
    9     1        NEW                                              $1      'ReflectionClass'
          2        SEND_VAL_EX                                              'MyClass'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   11     5        INIT_METHOD_CALL                                         !0, 'getMethods'
          6        DO_FCALL                                      0  $4      
          7        FETCH_DIM_R                                      ~5      $4, 0
          8        INIT_METHOD_CALL                                         ~5, 'getReturnType'
          9        DO_FCALL                                      0  $6      
         10        ECHO                                                     $6
         11      > RETURN                                                   1

Class MyClass:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JKj9f
function name:  __toString
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   'my_class'
    6     1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function __tostring

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.1 ms | 1393 KiB | 13 Q