3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(); for ($i = 0; $i < 10000; $i++) { $a[] = $i; } $start = microtime(true); foreach ($a as $k => $v) { $a[$k] = $v + 1; } echo "Completed in ", microtime(true) - $start, " Seconds\n"; $start = microtime(true); foreach ($a as $k => &$v) { $v = $v + 1; } echo "Completed in ", microtime(true) - $start, " Seconds\n"; $start = microtime(true); foreach ($a as $k => $v) {} echo "Completed in ", microtime(true) - $start, " Seconds\n"; $start = microtime(true); foreach ($a as $k => &$v) {} echo "Completed in ", microtime(true) - $start, " Seconds\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 19
2 jumps found. (Code = 125) Position 1 = 32, Position 2 = 37
Branch analysis from position: 32
2 jumps found. (Code = 126) Position 1 = 33, Position 2 = 37
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 37
2 jumps found. (Code = 77) Position 1 = 50, Position 2 = 53
Branch analysis from position: 50
2 jumps found. (Code = 78) Position 1 = 51, Position 2 = 53
Branch analysis from position: 51
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
Branch analysis from position: 53
2 jumps found. (Code = 125) Position 1 = 66, Position 2 = 69
Branch analysis from position: 66
2 jumps found. (Code = 126) Position 1 = 67, Position 2 = 69
Branch analysis from position: 67
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
Branch analysis from position: 69
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 69
Branch analysis from position: 53
Branch analysis from position: 37
Branch analysis from position: 19
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
Branch analysis from position: 3
filename:       /in/QPe5L
function name:  (null)
number of ops:  78
compiled vars:  !0 = $a, !1 = $i, !2 = $start, !3 = $v, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->6
    4     3    >   ASSIGN_DIM                                               !0
          4        OP_DATA                                                  !1
    3     5        PRE_INC                                                  !1
          6    >   IS_SMALLER                                               !1, 10000
          7      > JMPNZ                                                    ~9, ->3
    7     8    >   INIT_FCALL                                               'microtime'
          9        SEND_VAL                                                 <true>
         10        DO_ICALL                                         $10     
         11        ASSIGN                                                   !2, $10
    8    12      > FE_RESET_R                                       $12     !0, ->19
         13    > > FE_FETCH_R                                       ~13     $12, !3, ->19
         14    >   ASSIGN                                                   !4, ~13
    9    15        ADD                                              ~16     !3, 1
         16        ASSIGN_DIM                                               !0, !4
         17        OP_DATA                                                  ~16
    8    18      > JMP                                                      ->13
         19    >   FE_FREE                                                  $12
   11    20        ECHO                                                     'Completed+in+'
         21        INIT_FCALL                                               'microtime'
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $17     
         24        SUB                                              ~18     $17, !2
         25        ECHO                                                     ~18
         26        ECHO                                                     '+Seconds%0A'
   13    27        INIT_FCALL                                               'microtime'
         28        SEND_VAL                                                 <true>
         29        DO_ICALL                                         $19     
         30        ASSIGN                                                   !2, $19
   14    31      > FE_RESET_RW                                      $21     !0, ->37
         32    > > FE_FETCH_RW                                      ~22     $21, !3, ->37
         33    >   ASSIGN                                                   !4, ~22
   15    34        ADD                                              ~24     !3, 1
         35        ASSIGN                                                   !3, ~24
   14    36      > JMP                                                      ->32
         37    >   FE_FREE                                                  $21
   17    38        ECHO                                                     'Completed+in+'
         39        INIT_FCALL                                               'microtime'
         40        SEND_VAL                                                 <true>
         41        DO_ICALL                                         $26     
         42        SUB                                              ~27     $26, !2
         43        ECHO                                                     ~27
         44        ECHO                                                     '+Seconds%0A'
   19    45        INIT_FCALL                                               'microtime'
         46        SEND_VAL                                                 <true>
         47        DO_ICALL                                         $28     
         48        ASSIGN                                                   !2, $28
   20    49      > FE_RESET_R                                       $30     !0, ->53
         50    > > FE_FETCH_R                                       ~31     $30, !3, ->53
         51    >   ASSIGN                                                   !4, ~31
         52      > JMP                                                      ->50
         53    >   FE_FREE                                                  $30
   21    54        ECHO                                                     'Completed+in+'
         55        INIT_FCALL                                               'microtime'
         56        SEND_VAL                                                 <true>
         57        DO_ICALL                                         $33     
         58        SUB                                              ~34     $33, !2
         59        ECHO                                                     ~34
         60        ECHO                                                     '+Seconds%0A'
   23    61        INIT_FCALL                                               'microtime'
         62        SEND_VAL                                                 <true>
         63        DO_ICALL                                         $35     
         64        ASSIGN                                                   !2, $35
   24    65      > FE_RESET_RW                                      $37     !0, ->69
         66    > > FE_FETCH_RW                                      ~38     $37, !3, ->69
         67    >   ASSIGN                                                   !4, ~38
         68      > JMP                                                      ->66
         69    >   FE_FREE                                                  $37
   25    70        ECHO                                                     'Completed+in+'
         71        INIT_FCALL                                               'microtime'
         72        SEND_VAL                                                 <true>
         73        DO_ICALL                                         $40     
         74        SUB                                              ~41     $40, !2
         75        ECHO                                                     ~41
         76        ECHO                                                     '+Seconds%0A'
         77      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.94 ms | 1404 KiB | 15 Q