3v4l.org

run code in 300+ PHP versions simultaneously
<?php const START=0; const NUM=1000; const NEST=1000; for($i = START; $i < NUM; $i += 1) { $a[$i] = TRUE; } $start = microtime(TRUE); for($n = 0; $n < NEST; $n++) { for($i = START; $i < NUM; $i += 1) { $a[$i]; } } echo 'Time: '.(microtime(TRUE) - $start).PHP_EOL; $start = microtime(TRUE); for($n = 0; $n < NEST; $n++) { for($i = START; $i < NUM; $i += 1) { //$a[$i]; } } echo 'Time: '.(microtime(TRUE) - $start).PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 6
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 18
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
2 jumps found. (Code = 44) Position 1 = 55, Position 2 = 44
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 47
Branch analysis from position: 51
2 jumps found. (Code = 44) Position 1 = 55, Position 2 = 44
Branch analysis from position: 55
Branch analysis from position: 44
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 47
Branch analysis from position: 51
Branch analysis from position: 47
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 21
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 18
Branch analysis from position: 31
Branch analysis from position: 18
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 21
Branch analysis from position: 27
Branch analysis from position: 21
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 6
Branch analysis from position: 12
Branch analysis from position: 6
filename:       /in/TQd6c
function name:  (null)
number of ops:  63
compiled vars:  !0 = $i, !1 = $a, !2 = $start, !3 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CONST                                            'START', 0
    4     1        DECLARE_CONST                                            'NUM', 1000
    5     2        DECLARE_CONST                                            'NEST', 1000
    8     3        FETCH_CONSTANT                                   ~4      'START'
          4        ASSIGN                                                   !0, ~4
          5      > JMP                                                      ->9
    9     6    >   ASSIGN_DIM                                               !1, !0
          7        OP_DATA                                                  <true>
    8     8        ASSIGN_OP                                     1          !0, 1
          9    >   FETCH_CONSTANT                                   ~8      'NUM'
         10        IS_SMALLER                                               !0, ~8
         11      > JMPNZ                                                    ~9, ->6
   13    12    >   INIT_FCALL                                               'microtime'
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $10     
         15        ASSIGN                                                   !2, $10
   14    16        ASSIGN                                                   !3, 0
         17      > JMP                                                      ->28
   15    18    >   FETCH_CONSTANT                                   ~13     'START'
         19        ASSIGN                                                   !0, ~13
         20      > JMP                                                      ->24
   16    21    >   FETCH_DIM_R                                      ~15     !1, !0
         22        FREE                                                     ~15
   15    23        ASSIGN_OP                                     1          !0, 1
         24    >   FETCH_CONSTANT                                   ~17     'NUM'
         25        IS_SMALLER                                               !0, ~17
         26      > JMPNZ                                                    ~18, ->21
   14    27    >   PRE_INC                                                  !3
         28    >   FETCH_CONSTANT                                   ~20     'NEST'
         29        IS_SMALLER                                               !3, ~20
         30      > JMPNZ                                                    ~21, ->18
   19    31    >   INIT_FCALL                                               'microtime'
         32        SEND_VAL                                                 <true>
         33        DO_ICALL                                         $22     
         34        SUB                                              ~23     $22, !2
         35        CONCAT                                           ~24     'Time%3A+', ~23
         36        CONCAT                                           ~25     ~24, '%0A'
         37        ECHO                                                     ~25
   21    38        INIT_FCALL                                               'microtime'
         39        SEND_VAL                                                 <true>
         40        DO_ICALL                                         $26     
         41        ASSIGN                                                   !2, $26
   22    42        ASSIGN                                                   !3, 0
         43      > JMP                                                      ->52
   23    44    >   FETCH_CONSTANT                                   ~29     'START'
         45        ASSIGN                                                   !0, ~29
         46      > JMP                                                      ->48
         47    >   ASSIGN_OP                                     1          !0, 1
         48    >   FETCH_CONSTANT                                   ~32     'NUM'
         49        IS_SMALLER                                               !0, ~32
         50      > JMPNZ                                                    ~33, ->47
   22    51    >   PRE_INC                                                  !3
         52    >   FETCH_CONSTANT                                   ~35     'NEST'
         53        IS_SMALLER                                               !3, ~35
         54      > JMPNZ                                                    ~36, ->44
   27    55    >   INIT_FCALL                                               'microtime'
         56        SEND_VAL                                                 <true>
         57        DO_ICALL                                         $37     
         58        SUB                                              ~38     $37, !2
         59        CONCAT                                           ~39     'Time%3A+', ~38
         60        CONCAT                                           ~40     ~39, '%0A'
         61        ECHO                                                     ~40
         62      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.74 ms | 1003 KiB | 14 Q