3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MetaReflectionClass extends ReflectionClass { // Deliberately chose IS_PRIVATE to demonstrate that it is not used by default public function getMethods($foo = ReflectionMethod::IS_PRIVATE) { $args = func_get_args(); return call_user_func_array( array('parent', 'getMethods'), $args ); } } $mrc = new MetaReflectionClass('DateTime'); printf("Number of methods (no filter): %s\n", count($mrc->getMethods())); printf("Number of static methods: %s\n", count($mrc->getMethods(ReflectionMethod::IS_STATIC)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YKMKW
function name:  (null)
number of ops:  20
compiled vars:  !0 = $mrc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'MetaReflectionClass'
          1        SEND_VAL_EX                                              'DateTime'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   19     4        INIT_FCALL                                               'printf'
          5        SEND_VAL                                                 'Number+of+methods+%28no+filter%29%3A+%25s%0A'
          6        INIT_METHOD_CALL                                         !0, 'getMethods'
          7        DO_FCALL                                      0  $4      
          8        COUNT                                            ~5      $4
          9        SEND_VAL                                                 ~5
         10        DO_ICALL                                                 
   20    11        INIT_FCALL                                               'printf'
         12        SEND_VAL                                                 'Number+of+static+methods%3A+%25s%0A'
         13        INIT_METHOD_CALL                                         !0, 'getMethods'
         14        SEND_VAL_EX                                              16
         15        DO_FCALL                                      0  $7      
         16        COUNT                                            ~8      $7
         17        SEND_VAL                                                 ~8
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Class MetaReflectionClass:
Function getmethods:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YKMKW
function name:  getMethods
number of ops:  9
compiled vars:  !0 = $foo, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV_INIT                                        !0      <const ast>
    8     1        FUNC_GET_ARGS                                    ~2      
          2        ASSIGN                                                   !1, ~2
   11     3        INIT_USER_CALL                                0          'call_user_func_array', <array>
   12     4        SEND_ARRAY                                               !1
          5        CHECK_UNDEF_ARGS                                         
          6        DO_FCALL                                      0  $4      
          7      > RETURN                                                   $4
   14     8*     > RETURN                                                   null

End of function getmethods

End of class MetaReflectionClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.26 ms | 1396 KiB | 15 Q