3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Foreach with brackets $results = []; $aHash = []; $i = 0; $tmp = ''; while ($i < 10000) { $tmp .= 'a'; ++$i; } $aHash = array_fill(100000000000000000000000, 100, $tmp); unset($i, $tmp); /* The Test */ $t = microtime(true); foreach ($aHash as $key => $val) { $aHash[$key] .= "a"; } echo (microtime(true) - $t) * 1000000;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 5
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 27
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 27
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 5
Branch analysis from position: 9
Branch analysis from position: 5
filename:       /in/m60pT
function name:  (null)
number of ops:  35
compiled vars:  !0 = $results, !1 = $aHash, !2 = $i, !3 = $tmp, !4 = $t, !5 = $val, !6 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        ASSIGN                                                   !2, 0
    7     3        ASSIGN                                                   !3, ''
    8     4      > JMP                                                      ->7
    9     5    >   ASSIGN_OP                                     8          !3, 'a'
   10     6        PRE_INC                                                  !2
    8     7    >   IS_SMALLER                                               !2, 10000
          8      > JMPNZ                                                    ~13, ->5
   13     9    >   INIT_FCALL                                               'array_fill'
         10        SEND_VAL                                                 1.0e+23
         11        SEND_VAL                                                 100
         12        SEND_VAR                                                 !3
         13        DO_ICALL                                         $14     
         14        ASSIGN                                                   !1, $14
   14    15        UNSET_CV                                                 !2
         16        UNSET_CV                                                 !3
   17    17        INIT_FCALL                                               'microtime'
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $16     
         20        ASSIGN                                                   !4, $16
   18    21      > FE_RESET_R                                       $18     !1, ->27
         22    > > FE_FETCH_R                                       ~19     $18, !5, ->27
         23    >   ASSIGN                                                   !6, ~19
   19    24        ASSIGN_DIM_OP                .=               8          !1, !6
         25        OP_DATA                                                  'a'
   18    26      > JMP                                                      ->22
         27    >   FE_FREE                                                  $18
   22    28        INIT_FCALL                                               'microtime'
         29        SEND_VAL                                                 <true>
         30        DO_ICALL                                         $22     
         31        SUB                                              ~23     $22, !4
         32        MUL                                              ~24     ~23, 1000000
         33        ECHO                                                     ~24
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.79 ms | 1388 KiB | 17 Q