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"; if (class_exists('ReflectionClass')) { $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++) { $reflectionClass = new ReflectionClass($foo); $reflectionClass->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
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 66
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 35
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
2 jumps found. (Code = 44) Position 1 = 61, Position 2 = 52
Branch analysis from position: 61
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 52
2 jumps found. (Code = 44) Position 1 = 61, Position 2 = 52
Branch analysis from position: 61
Branch analysis from position: 52
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 35
Branch analysis from position: 40
Branch analysis from position: 35
Branch analysis from position: 66
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/us5oD
function name:  (null)
number of ops:  67
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        INIT_FCALL                                               'class_exists'
         22        SEND_VAL                                                 'ReflectionClass'
         23        DO_ICALL                                         $17     
         24      > JMPZ                                                     $17, ->66
   18    25    >   NEW                                              $18     'ReflectionClass'
         26        SEND_VAR_EX                                              !0
         27        DO_FCALL                                      0          
         28        ASSIGN                                                   !4, $18
   19    29        INIT_FCALL                                               'microtime'
         30        SEND_VAL                                                 <true>
         31        DO_ICALL                                         $21     
         32        ASSIGN                                                   !2, $21
   20    33        ASSIGN                                                   !3, 0
         34      > JMP                                                      ->38
   21    35    >   INIT_METHOD_CALL                                         !4, 'getName'
         36        DO_FCALL                                      0          
   20    37        PRE_INC                                                  !3
         38    >   IS_SMALLER                                               !3, !1
         39      > JMPNZ                                                    ~26, ->35
   23    40    >   INIT_FCALL                                               'microtime'
         41        SEND_VAL                                                 <true>
         42        DO_ICALL                                         $27     
         43        SUB                                              ~28     $27, !2
         44        ECHO                                                     ~28
   25    45        ECHO                                                     '%0A'
   27    46        INIT_FCALL                                               'microtime'
         47        SEND_VAL                                                 <true>
         48        DO_ICALL                                         $29     
         49        ASSIGN                                                   !2, $29
   28    50        ASSIGN                                                   !3, 0
         51      > JMP                                                      ->59
   29    52    >   NEW                                              $32     'ReflectionClass'
         53        SEND_VAR_EX                                              !0
         54        DO_FCALL                                      0          
         55        ASSIGN                                                   !4, $32
   30    56        INIT_METHOD_CALL                                         !4, 'getName'
         57        DO_FCALL                                      0          
   28    58        PRE_INC                                                  !3
         59    >   IS_SMALLER                                               !3, !1
         60      > JMPNZ                                                    ~37, ->52
   32    61    >   INIT_FCALL                                               'microtime'
         62        SEND_VAL                                                 <true>
         63        DO_ICALL                                         $38     
         64        SUB                                              ~39     $38, !2
         65        ECHO                                                     ~39
   33    66    > > RETURN                                                   1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.83 ms | 1400 KiB | 17 Q