3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function method() { } } $obj = new Test; $ref = new ReflectionMethod($obj, 'method'); $closure = $ref->getClosure($obj); echo "Starting loop..."; $start = microtime(true); for ($i=0; $i<1e6; $i++) { $closure(array()); } echo "Took ", number_format((microtime(true)-$start)*1e3, 3), " ms";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 19
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 19
Branch analysis from position: 25
Branch analysis from position: 19
filename:       /in/MV5kW
function name:  (null)
number of ops:  38
compiled vars:  !0 = $obj, !1 = $ref, !2 = $closure, !3 = $start, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $5      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $5
    8     3        NEW                                              $8      'ReflectionMethod'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAL_EX                                              'method'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $8
    9     8        INIT_METHOD_CALL                                         !1, 'getClosure'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0  $11     
         11        ASSIGN                                                   !2, $11
   11    12        ECHO                                                     'Starting+loop...'
   12    13        INIT_FCALL                                               'microtime'
         14        SEND_VAL                                                 <true>
         15        DO_ICALL                                         $13     
         16        ASSIGN                                                   !3, $13
   13    17        ASSIGN                                                   !4, 0
         18      > JMP                                                      ->23
   14    19    >   INIT_DYNAMIC_CALL                                        !2
         20        SEND_VAL_EX                                              <array>
         21        DO_FCALL                                      0          
   13    22        PRE_INC                                                  !4
         23    >   IS_SMALLER                                               !4, 1.0e+6
         24      > JMPNZ                                                    ~18, ->19
   16    25    >   ECHO                                                     'Took+'
         26        INIT_FCALL                                               'number_format'
         27        INIT_FCALL                                               'microtime'
         28        SEND_VAL                                                 <true>
         29        DO_ICALL                                         $19     
         30        SUB                                              ~20     $19, !3
         31        MUL                                              ~21     ~20, 1000
         32        SEND_VAL                                                 ~21
         33        SEND_VAL                                                 3
         34        DO_ICALL                                         $22     
         35        ECHO                                                     $22
         36        ECHO                                                     '+ms'
         37      > RETURN                                                   1

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

End of function method

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.96 ms | 1400 KiB | 17 Q