3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo {} $foo = new Foo; $rounds = 1000000; $start = microtime(true); for($i=0; $i<$rounds; $i++) { get_class($foo); } echo (microtime(true) - $start); echo "\n"; $reflectionClass = new ReflectionClass($foo); $start = microtime(true); for($i=0; $i<$rounds; $i++) { $reflectionClass->getName(); } echo (microtime(true) - $start); echo "\n"; $start = microtime(true); for($i=0; $i<$rounds; $i++) { (new ReflectionClass($foo))->getName(); } echo (microtime(true) - $start);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 10
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 31
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 48
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 48
Branch analysis from position: 56
Branch analysis from position: 48
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 31
Branch analysis from position: 36
Branch analysis from position: 31
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 10
Branch analysis from position: 15
Branch analysis from position: 10
filename:       /in/33CgB
function name:  (null)
number of ops:  62
compiled vars:  !0 = $foo, !1 = $rounds, !2 = $start, !3 = $i, !4 = $reflectionClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $5      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $5
    7     3        ASSIGN                                                   !1, 1000000
    9     4        INIT_FCALL                                               'microtime'
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $9      
          7        ASSIGN                                                   !2, $9
   10     8        ASSIGN                                                   !3, 0
          9      > JMP                                                      ->13
   11    10    >   GET_CLASS                                        ~12     !0
         11        FREE                                                     ~12
   10    12        PRE_INC                                                  !3
         13    >   IS_SMALLER                                               !3, !1
         14      > JMPNZ                                                    ~14, ->10
   13    15    >   INIT_FCALL                                               'microtime'
         16        SEND_VAL                                                 <true>
         17        DO_ICALL                                         $15     
         18        SUB                                              ~16     $15, !2
         19        ECHO                                                     ~16
   15    20        ECHO                                                     '%0A'
   17    21        NEW                                              $17     'ReflectionClass'
         22        SEND_VAR_EX                                              !0
         23        DO_FCALL                                      0          
         24        ASSIGN                                                   !4, $17
   18    25        INIT_FCALL                                               'microtime'
         26        SEND_VAL                                                 <true>
         27        DO_ICALL                                         $20     
         28        ASSIGN                                                   !2, $20
   19    29        ASSIGN                                                   !3, 0
         30      > JMP                                                      ->34
   20    31    >   INIT_METHOD_CALL                                         !4, 'getName'
         32        DO_FCALL                                      0          
   19    33        PRE_INC                                                  !3
         34    >   IS_SMALLER                                               !3, !1
         35      > JMPNZ                                                    ~25, ->31
   22    36    >   INIT_FCALL                                               'microtime'
         37        SEND_VAL                                                 <true>
         38        DO_ICALL                                         $26     
         39        SUB                                              ~27     $26, !2
         40        ECHO                                                     ~27
   24    41        ECHO                                                     '%0A'
   26    42        INIT_FCALL                                               'microtime'
         43        SEND_VAL                                                 <true>
         44        DO_ICALL                                         $28     
         45        ASSIGN                                                   !2, $28
   27    46        ASSIGN                                                   !3, 0
         47      > JMP                                                      ->54
   28    48    >   NEW                                              $31     'ReflectionClass'
         49        SEND_VAR_EX                                              !0
         50        DO_FCALL                                      0          
         51        INIT_METHOD_CALL                                         $31, 'getName'
         52        DO_FCALL                                      0          
   27    53        PRE_INC                                                  !3
         54    >   IS_SMALLER                                               !3, !1
         55      > JMPNZ                                                    ~35, ->48
   30    56    >   INIT_FCALL                                               'microtime'
         57        SEND_VAL                                                 <true>
         58        DO_ICALL                                         $36     
         59        SUB                                              ~37     $36, !2
         60        ECHO                                                     ~37
         61      > RETURN                                                   1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.52 ms | 1388 KiB | 15 Q