3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ln = 1000; $a = array(); $b = array(); for ($i = 0; $i < $ln; $i++) { $a[] = 10000 + $i; $b[md5($i)] = 20000 + $i; } $s = microtime(true); $r1 = array_merge($a, array_values($b)); var_dump('merge + values = ' . ($s - microtime(true))); $s = microtime(true); foreach ($b as $x) { $a[] = $x; } var_dump('foreach = ' . ($s - microtime(true))); var_dump($r1 === $a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 5
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 42, Position 2 = 46
Branch analysis from position: 42
2 jumps found. (Code = 78) Position 1 = 43, Position 2 = 46
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 5
Branch analysis from position: 17
Branch analysis from position: 5
filename:       /in/GPJjO
function name:  (null)
number of ops:  60
compiled vars:  !0 = $ln, !1 = $a, !2 = $b, !3 = $i, !4 = $s, !5 = $r1, !6 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 1000
    3     1        ASSIGN                                                   !1, <array>
          2        ASSIGN                                                   !2, <array>
    4     3        ASSIGN                                                   !3, 0
          4      > JMP                                                      ->15
    5     5    >   ADD                                              ~12     10000, !3
          6        ASSIGN_DIM                                               !1
          7        OP_DATA                                                  ~12
    6     8        INIT_FCALL                                               'md5'
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                         $13     
         11        ADD                                              ~15     20000, !3
         12        ASSIGN_DIM                                               !2, $13
         13        OP_DATA                                                  ~15
    4    14        PRE_INC                                                  !3
         15    >   IS_SMALLER                                               !3, !0
         16      > JMPNZ                                                    ~17, ->5
   10    17    >   INIT_FCALL                                               'microtime'
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $18     
         20        ASSIGN                                                   !4, $18
   11    21        INIT_FCALL                                               'array_merge'
         22        SEND_VAR                                                 !1
         23        INIT_FCALL                                               'array_values'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                         $20     
         26        SEND_VAR                                                 $20
         27        DO_ICALL                                         $21     
         28        ASSIGN                                                   !5, $21
   12    29        INIT_FCALL                                               'var_dump'
         30        INIT_FCALL                                               'microtime'
         31        SEND_VAL                                                 <true>
         32        DO_ICALL                                         $23     
         33        SUB                                              ~24     !4, $23
         34        CONCAT                                           ~25     'merge+%2B+values+%3D+', ~24
         35        SEND_VAL                                                 ~25
         36        DO_ICALL                                                 
   14    37        INIT_FCALL                                               'microtime'
         38        SEND_VAL                                                 <true>
         39        DO_ICALL                                         $27     
         40        ASSIGN                                                   !4, $27
   15    41      > FE_RESET_R                                       $29     !2, ->46
         42    > > FE_FETCH_R                                               $29, !6, ->46
         43    >   ASSIGN_DIM                                               !1
         44        OP_DATA                                                  !6
         45      > JMP                                                      ->42
         46    >   FE_FREE                                                  $29
   16    47        INIT_FCALL                                               'var_dump'
         48        INIT_FCALL                                               'microtime'
         49        SEND_VAL                                                 <true>
         50        DO_ICALL                                         $31     
         51        SUB                                              ~32     !4, $31
         52        CONCAT                                           ~33     'foreach+%3D+', ~32
         53        SEND_VAL                                                 ~33
         54        DO_ICALL                                                 
   18    55        INIT_FCALL                                               'var_dump'
         56        IS_IDENTICAL                                     ~35     !5, !1
         57        SEND_VAL                                                 ~35
         58        DO_ICALL                                                 
         59      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.72 ms | 1400 KiB | 23 Q