3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a=array(); $b=null; $e=null; $l=100; $i=0; while($i++ < $l){ $b=microtime(true); $e=microtime(true); $a[] = $e - $b; } $an = (array_sum($a) / count($a))*1000; $i = 0; $a=array(); $b=null; $e=null; while($i++ < $l){ $b=microtime(true); microtime(true); microtime(true); $e=microtime(true); $a[] = e - $b; } $am = (array_sum($a) / count($a))*1000; echo "Average empty time measure: " . $an .'sec\n'; echo "Average filled time measure: " . $am .'sec\n'; echo "Average 2 microtime calls: " . ($am - $an) . 'sec';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 6
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 32
Branch analysis from position: 53
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 32
Branch analysis from position: 53
Branch analysis from position: 32
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 6
Branch analysis from position: 20
Branch analysis from position: 6
filename:       /in/327DZ
function name:  (null)
number of ops:  71
compiled vars:  !0 = $a, !1 = $b, !2 = $e, !3 = $l, !4 = $i, !5 = $an, !6 = $am
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, null
    4     2        ASSIGN                                                   !2, null
    5     3        ASSIGN                                                   !3, 100
    6     4        ASSIGN                                                   !4, 0
    7     5      > JMP                                                      ->17
    8     6    >   INIT_FCALL                                               'microtime'
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $12     
          9        ASSIGN                                                   !1, $12
    9    10        INIT_FCALL                                               'microtime'
         11        SEND_VAL                                                 <true>
         12        DO_ICALL                                         $14     
         13        ASSIGN                                                   !2, $14
   10    14        SUB                                              ~17     !2, !1
         15        ASSIGN_DIM                                               !0
         16        OP_DATA                                                  ~17
    7    17    >   POST_INC                                         ~18     !4
         18        IS_SMALLER                                               ~18, !3
         19      > JMPNZ                                                    ~19, ->6
   12    20    >   INIT_FCALL                                               'array_sum'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                         $20     
         23        COUNT                                            ~21     !0
         24        DIV                                              ~22     $20, ~21
         25        MUL                                              ~23     ~22, 1000
         26        ASSIGN                                                   !5, ~23
   13    27        ASSIGN                                                   !4, 0
   14    28        ASSIGN                                                   !0, <array>
   15    29        ASSIGN                                                   !1, null
   16    30        ASSIGN                                                   !2, null
   17    31      > JMP                                                      ->50
   18    32    >   INIT_FCALL                                               'microtime'
         33        SEND_VAL                                                 <true>
         34        DO_ICALL                                         $29     
         35        ASSIGN                                                   !1, $29
   19    36        INIT_FCALL                                               'microtime'
         37        SEND_VAL                                                 <true>
         38        DO_ICALL                                                 
   20    39        INIT_FCALL                                               'microtime'
         40        SEND_VAL                                                 <true>
         41        DO_ICALL                                                 
   21    42        INIT_FCALL                                               'microtime'
         43        SEND_VAL                                                 <true>
         44        DO_ICALL                                         $33     
         45        ASSIGN                                                   !2, $33
   22    46        FETCH_CONSTANT                                   ~36     'e'
         47        SUB                                              ~37     ~36, !1
         48        ASSIGN_DIM                                               !0
         49        OP_DATA                                                  ~37
   17    50    >   POST_INC                                         ~38     !4
         51        IS_SMALLER                                               ~38, !3
         52      > JMPNZ                                                    ~39, ->32
   24    53    >   INIT_FCALL                                               'array_sum'
         54        SEND_VAR                                                 !0
         55        DO_ICALL                                         $40     
         56        COUNT                                            ~41     !0
         57        DIV                                              ~42     $40, ~41
         58        MUL                                              ~43     ~42, 1000
         59        ASSIGN                                                   !6, ~43
   25    60        CONCAT                                           ~45     'Average+empty+time+measure%3A+', !5
         61        CONCAT                                           ~46     ~45, 'sec%5Cn'
         62        ECHO                                                     ~46
   26    63        CONCAT                                           ~47     'Average+filled+time+measure%3A+', !6
         64        CONCAT                                           ~48     ~47, 'sec%5Cn'
         65        ECHO                                                     ~48
   27    66        SUB                                              ~49     !6, !5
         67        CONCAT                                           ~50     'Average+2+microtime+calls%3A+', ~49
         68        CONCAT                                           ~51     ~50, 'sec'
         69        ECHO                                                     ~51
         70      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.88 ms | 1400 KiB | 17 Q