3v4l.org

run code in 300+ PHP versions simultaneously
<?php // For with brackets $results = []; $aHash = []; $i = 0; $tmp = ''; while ($i < 10000) { $tmp .= 'a'; ++$i; } $aHash = array_fill(100000000000000000000000, 100, $tmp); unset($i, $tmp); $t = microtime(true); $key = array_keys($aHash); $size = count($key); for ($i = 0; $i < $size; $i++) { $aHash[$key[$i]] .= "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
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 29
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 29
Branch analysis from position: 35
Branch analysis from position: 29
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/9j6Up
function name:  (null)
number of ops:  42
compiled vars:  !0 = $results, !1 = $aHash, !2 = $i, !3 = $tmp, !4 = $t, !5 = $key, !6 = $size
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        INIT_FCALL                                               'array_keys'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $18     
         24        ASSIGN                                                   !5, $18
   19    25        COUNT                                            ~20     !5
         26        ASSIGN                                                   !6, ~20
   20    27        ASSIGN                                                   !2, 0
         28      > JMP                                                      ->33
   21    29    >   FETCH_DIM_R                                      ~23     !5, !2
         30        ASSIGN_DIM_OP                .=               8          !1, ~23
         31        OP_DATA                                                  'a'
   20    32        PRE_INC                                                  !2
         33    >   IS_SMALLER                                               !2, !6
         34      > JMPNZ                                                    ~26, ->29
   24    35    >   INIT_FCALL                                               'microtime'
         36        SEND_VAL                                                 <true>
         37        DO_ICALL                                         $27     
         38        SUB                                              ~28     $27, !4
         39        MUL                                              ~29     ~28, 1000000
         40        ECHO                                                     ~29
         41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.39 ms | 945 KiB | 20 Q