3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = microtime(true); foreach (range(0, 10000) as $i) { } printf ('%.4f'.PHP_EOL, microtime(true) - $start); $start = microtime(true); for ($i = 0; $i < 10000; $i++) { } printf ('%.4f'.PHP_EOL, microtime(true) - $start);
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 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 26
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 26
Branch analysis from position: 29
Branch analysis from position: 26
Branch analysis from position: 11
filename:       /in/7BMWe
function name:  (null)
number of ops:  38
compiled vars:  !0 = $start, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !0, $2
    4     4        INIT_FCALL                                               'range'
          5        SEND_VAL                                                 0
          6        SEND_VAL                                                 10000
          7        DO_ICALL                                         $4      
          8      > FE_RESET_R                                       $5      $4, ->11
          9    > > FE_FETCH_R                                               $5, !1, ->11
         10    > > JMP                                                      ->9
         11    >   FE_FREE                                                  $5
    6    12        INIT_FCALL                                               'printf'
         13        SEND_VAL                                                 '%25.4f%0A'
         14        INIT_FCALL                                               'microtime'
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $6      
         17        SUB                                              ~7      $6, !0
         18        SEND_VAL                                                 ~7
         19        DO_ICALL                                                 
    8    20        INIT_FCALL                                               'microtime'
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $9      
         23        ASSIGN                                                   !0, $9
    9    24        ASSIGN                                                   !1, 0
         25      > JMP                                                      ->27
         26    >   PRE_INC                                                  !1
         27    >   IS_SMALLER                                               !1, 10000
         28      > JMPNZ                                                    ~13, ->26
   11    29    >   INIT_FCALL                                               'printf'
         30        SEND_VAL                                                 '%25.4f%0A'
         31        INIT_FCALL                                               'microtime'
         32        SEND_VAL                                                 <true>
         33        DO_ICALL                                         $14     
         34        SUB                                              ~15     $14, !0
         35        SEND_VAL                                                 ~15
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.53 ms | 1392 KiB | 19 Q