3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = microtime(true); while (microtime(true) != $start + 1); // Wait a second to start up $loops = 10; $avg = 0; for ($i = 0; $i < $loops; $i++) { $start = microtime(true); for ($c = 0; $c < 1000; $c++) { // the 1000 may vary depending on the function } $end = microtime(true); echo "Take $i: " . ($end-$start) . "s\n"; $avg *= $i; $avg += $end - $start; $avg /= $i + 1; } echo "Average: " . $avg . "s\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 5
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 15
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 21
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 15
Branch analysis from position: 43
Branch analysis from position: 15
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 21
Branch analysis from position: 24
Branch analysis from position: 21
Branch analysis from position: 5
filename:       /in/pFoH7
function name:  (null)
number of ops:  47
compiled vars:  !0 = $start, !1 = $loops, !2 = $avg, !3 = $i, !4 = $c, !5 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $6      
          3        ASSIGN                                                   !0, $6
    3     4      > JMP                                                      ->5
          5    >   INIT_FCALL                                               'microtime'
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $8      
          8        ADD                                              ~9      !0, 1
          9        IS_NOT_EQUAL                                             $8, ~9
         10      > JMPNZ                                                    ~10, ->5
    5    11    >   ASSIGN                                                   !1, 10
    6    12        ASSIGN                                                   !2, 0
    7    13        ASSIGN                                                   !3, 0
         14      > JMP                                                      ->41
    8    15    >   INIT_FCALL                                               'microtime'
         16        SEND_VAL                                                 <true>
         17        DO_ICALL                                         $14     
         18        ASSIGN                                                   !0, $14
    9    19        ASSIGN                                                   !4, 0
         20      > JMP                                                      ->22
         21    >   PRE_INC                                                  !4
         22    >   IS_SMALLER                                               !4, 1000
         23      > JMPNZ                                                    ~18, ->21
   12    24    >   INIT_FCALL                                               'microtime'
         25        SEND_VAL                                                 <true>
         26        DO_ICALL                                         $19     
         27        ASSIGN                                                   !5, $19
   14    28        ROPE_INIT                                     3  ~22     'Take+'
         29        ROPE_ADD                                      1  ~22     ~22, !3
         30        ROPE_END                                      2  ~21     ~22, '%3A+'
         31        SUB                                              ~24     !5, !0
         32        CONCAT                                           ~25     ~21, ~24
         33        CONCAT                                           ~26     ~25, 's%0A'
         34        ECHO                                                     ~26
   16    35        ASSIGN_OP                                     3          !2, !3
   17    36        SUB                                              ~28     !5, !0
         37        ASSIGN_OP                                     1          !2, ~28
   18    38        ADD                                              ~30     !3, 1
         39        ASSIGN_OP                                     4          !2, ~30
    7    40        PRE_INC                                                  !3
         41    >   IS_SMALLER                                               !3, !1
         42      > JMPNZ                                                    ~33, ->15
   21    43    >   CONCAT                                           ~34     'Average%3A+', !2
         44        CONCAT                                           ~35     ~34, 's%0A'
         45        ECHO                                                     ~35
         46      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.14 ms | 1400 KiB | 15 Q