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 = ' . (1000*($s - microtime(true)))); $s = microtime(true); foreach ($b as $x) { $a[] = $x; } var_dump('foreach = ' . (1000*($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 = 43, Position 2 = 47
Branch analysis from position: 43
2 jumps found. (Code = 78) Position 1 = 44, Position 2 = 47
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
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/Do9fR
function name:  (null)
number of ops:  62
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        MUL                                              ~25     ~24, 1000
         35        CONCAT                                           ~26     'merge+%2B+values+%3D+', ~25
         36        SEND_VAL                                                 ~26
         37        DO_ICALL                                                 
   14    38        INIT_FCALL                                               'microtime'
         39        SEND_VAL                                                 <true>
         40        DO_ICALL                                         $28     
         41        ASSIGN                                                   !4, $28
   15    42      > FE_RESET_R                                       $30     !2, ->47
         43    > > FE_FETCH_R                                               $30, !6, ->47
         44    >   ASSIGN_DIM                                               !1
         45        OP_DATA                                                  !6
         46      > JMP                                                      ->43
         47    >   FE_FREE                                                  $30
   16    48        INIT_FCALL                                               'var_dump'
         49        INIT_FCALL                                               'microtime'
         50        SEND_VAL                                                 <true>
         51        DO_ICALL                                         $32     
         52        SUB                                              ~33     !4, $32
         53        MUL                                              ~34     ~33, 1000
         54        CONCAT                                           ~35     'foreach+%3D+', ~34
         55        SEND_VAL                                                 ~35
         56        DO_ICALL                                                 
   18    57        INIT_FCALL                                               'var_dump'
         58        IS_IDENTICAL                                     ~37     !5, !1
         59        SEND_VAL                                                 ~37
         60        DO_ICALL                                                 
         61      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.83 ms | 1400 KiB | 23 Q