3v4l.org

run code in 300+ PHP versions simultaneously
<?php $classmap1 = array(); for ($i=1; $i<=10000; $i++) { $classmap1['a'.$i] = $i+1; } $classmap2 = array(); for ($i=1; $i<=10000; $i++) { $classmap2['b'.$i] = $i+1; } $startTimeForeach = microtime(true); foreach ($classmap2 as $k => $v) { $classmap1[$k] = $v; } $endTimeForeach = microtime(true); echo "Foreach took " . (($endTimeForeach - $startTimeForeach)*1000) ." microseconds<br />\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 13
Branch analysis from position: 20
2 jumps found. (Code = 77) Position 1 = 25, Position 2 = 30
Branch analysis from position: 25
2 jumps found. (Code = 78) Position 1 = 26, Position 2 = 30
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 13
Branch analysis from position: 20
Branch analysis from position: 13
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
Branch analysis from position: 3
filename:       /in/f6ois
function name:  (null)
number of ops:  41
compiled vars:  !0 = $classmap1, !1 = $i, !2 = $classmap2, !3 = $startTimeForeach, !4 = $v, !5 = $k, !6 = $endTimeForeach
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 1
          2      > JMP                                                      ->8
    5     3    >   CONCAT                                           ~9      'a', !1
          4        ADD                                              ~11     !1, 1
          5        ASSIGN_DIM                                               !0, ~9
          6        OP_DATA                                                  ~11
    4     7        PRE_INC                                                  !1
          8    >   IS_SMALLER_OR_EQUAL                                      !1, 10000
          9      > JMPNZ                                                    ~13, ->3
    7    10    >   ASSIGN                                                   !2, <array>
    9    11        ASSIGN                                                   !1, 1
         12      > JMP                                                      ->18
   10    13    >   CONCAT                                           ~16     'b', !1
         14        ADD                                              ~18     !1, 1
         15        ASSIGN_DIM                                               !2, ~16
         16        OP_DATA                                                  ~18
    9    17        PRE_INC                                                  !1
         18    >   IS_SMALLER_OR_EQUAL                                      !1, 10000
         19      > JMPNZ                                                    ~20, ->13
   13    20    >   INIT_FCALL                                               'microtime'
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $21     
         23        ASSIGN                                                   !3, $21
   14    24      > FE_RESET_R                                       $23     !2, ->30
         25    > > FE_FETCH_R                                       ~24     $23, !4, ->30
         26    >   ASSIGN                                                   !5, ~24
   15    27        ASSIGN_DIM                                               !0, !5
         28        OP_DATA                                                  !4
   14    29      > JMP                                                      ->25
         30    >   FE_FREE                                                  $23
   17    31        INIT_FCALL                                               'microtime'
         32        SEND_VAL                                                 <true>
         33        DO_ICALL                                         $27     
         34        ASSIGN                                                   !6, $27
   19    35        SUB                                              ~29     !6, !3
         36        MUL                                              ~30     ~29, 1000
         37        CONCAT                                           ~31     'Foreach+took+', ~30
         38        CONCAT                                           ~32     ~31, '+microseconds%3Cbr+%2F%3E%0A'
         39        ECHO                                                     ~32
         40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.81 ms | 1400 KiB | 15 Q