3v4l.org

run code in 300+ PHP versions simultaneously
<?php $t0 = microtime(true); foreach(range(0,10000) as $i); $t1 = microtime(true); for($i = 0; $i < 10000; ++$i); $t2 = microtime(true); $t_range = $t1 - $t0; $t_no_range = $t2 - $t1; $ratio = $t_range/$t_no_range; echo "Results: Range is {$ratio} times slower. --- With range: {$t_range}ms Without range: {$t_no_range}ms ";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 18
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 18
Branch analysis from position: 21
Branch analysis from position: 18
Branch analysis from position: 11
filename:       /in/COc0o
function name:  (null)
number of ops:  40
compiled vars:  !0 = $t0, !1 = $i, !2 = $t1, !3 = $t2, !4 = $t_range, !5 = $t_no_range, !6 = $ratio
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $7      
          3        ASSIGN                                                   !0, $7
    4     4        INIT_FCALL                                               'range'
          5        SEND_VAL                                                 0
          6        SEND_VAL                                                 10000
          7        DO_ICALL                                         $9      
          8      > FE_RESET_R                                       $10     $9, ->11
          9    > > FE_FETCH_R                                               $10, !1, ->11
         10    > > JMP                                                      ->9
         11    >   FE_FREE                                                  $10
    5    12        INIT_FCALL                                               'microtime'
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $11     
         15        ASSIGN                                                   !2, $11
    6    16        ASSIGN                                                   !1, 0
         17      > JMP                                                      ->19
         18    >   PRE_INC                                                  !1
         19    >   IS_SMALLER                                               !1, 10000
         20      > JMPNZ                                                    ~15, ->18
    7    21    >   INIT_FCALL                                               'microtime'
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $16     
         24        ASSIGN                                                   !3, $16
    9    25        SUB                                              ~18     !2, !0
         26        ASSIGN                                                   !4, ~18
   10    27        SUB                                              ~20     !3, !2
         28        ASSIGN                                                   !5, ~20
   11    29        DIV                                              ~22     !4, !5
         30        ASSIGN                                                   !6, ~22
   13    31        ROPE_INIT                                     7  ~25     'Results%3A%0ARange+is+'
   14    32        ROPE_ADD                                      1  ~25     ~25, !6
         33        ROPE_ADD                                      2  ~25     ~25, '+times+slower.%0A---%0AWith+range%3A+'
   16    34        ROPE_ADD                                      3  ~25     ~25, !4
         35        ROPE_ADD                                      4  ~25     ~25, 'ms%0AWithout+range%3A+'
   17    36        ROPE_ADD                                      5  ~25     ~25, !5
         37        ROPE_END                                      6  ~24     ~25, 'ms%0A'
         38        ECHO                                                     ~24
   18    39      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.19 ms | 1016 KiB | 15 Q