3v4l.org

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

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.36 ms | 1400 KiB | 15 Q