3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [ 'one' => 1, 'two' => 2, 'three' => 3, 'four' => 4, 'five' => 5, 'six' => 6 ]; $b = [ 'one' => 'uno', 'three' => 'tres', 'two' => 'dos', 'four' => 'cuatro', 'five' => 'cinco' ]; $result = []; foreach ($a as $k => $v) { $result[] = [$v, $b[$k] ?? null]; } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 14
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/QaOnp
function name:  (null)
number of ops:  19
compiled vars:  !0 = $a, !1 = $b, !2 = $result, !3 = $v, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        ASSIGN                                                   !1, <array>
   19     2        ASSIGN                                                   !2, <array>
   20     3      > FE_RESET_R                                       $8      !0, ->14
          4    > > FE_FETCH_R                                       ~9      $8, !3, ->14
          5    >   ASSIGN                                                   !4, ~9
   21     6        INIT_ARRAY                                       ~12     !3
          7        FETCH_DIM_IS                                     ~13     !1, !4
          8        COALESCE                                         ~14     ~13
          9        QM_ASSIGN                                        ~14     null
         10        ADD_ARRAY_ELEMENT                                ~12     ~14
         11        ASSIGN_DIM                                               !2
         12        OP_DATA                                                  ~12
   20    13      > JMP                                                      ->4
         14    >   FE_FREE                                                  $8
   23    15        INIT_FCALL                                               'var_export'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
255.17 ms | 1004 KiB | 14 Q