3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.87 ms | 1400 KiB | 19 Q