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++) { (new ReflectionClass($foo))->getName(); } echo (microtime(true) - $start); echo "\n"; $start = microtime(true); for($i=0; $i<$rounds; $i++) { get_class($foo); } echo (microtime(true) - $start);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 10
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 30
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 30
Branch analysis from position: 35
Branch analysis from position: 30
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 10
Branch analysis from position: 18
Branch analysis from position: 10
filename:       /in/4FeDV
function name:  (null)
number of ops:  41
compiled vars:  !0 = $foo, !1 = $rounds, !2 = $start, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $4      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
    7     3        ASSIGN                                                   !1, 1000000
    9     4        INIT_FCALL                                               'microtime'
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $8      
          7        ASSIGN                                                   !2, $8
   10     8        ASSIGN                                                   !3, 0
          9      > JMP                                                      ->16
   11    10    >   NEW                                              $11     'ReflectionClass'
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0          
         13        INIT_METHOD_CALL                                         $11, 'getName'
         14        DO_FCALL                                      0          
   10    15        PRE_INC                                                  !3
         16    >   IS_SMALLER                                               !3, !1
         17      > JMPNZ                                                    ~15, ->10
   13    18    >   INIT_FCALL                                               'microtime'
         19        SEND_VAL                                                 <true>
         20        DO_ICALL                                         $16     
         21        SUB                                              ~17     $16, !2
         22        ECHO                                                     ~17
   15    23        ECHO                                                     '%0A'
   18    24        INIT_FCALL                                               'microtime'
         25        SEND_VAL                                                 <true>
         26        DO_ICALL                                         $18     
         27        ASSIGN                                                   !2, $18
   19    28        ASSIGN                                                   !3, 0
         29      > JMP                                                      ->33
   20    30    >   GET_CLASS                                        ~21     !0
         31        FREE                                                     ~21
   19    32        PRE_INC                                                  !3
         33    >   IS_SMALLER                                               !3, !1
         34      > JMPNZ                                                    ~23, ->30
   22    35    >   INIT_FCALL                                               'microtime'
         36        SEND_VAL                                                 <true>
         37        DO_ICALL                                         $24     
         38        SUB                                              ~25     $24, !2
         39        ECHO                                                     ~25
         40      > RETURN                                                   1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.33 ms | 1400 KiB | 15 Q