3v4l.org

run code in 500+ 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', 'seven' => 'siete', ]; $result = []; foreach ($a + $b as $k => $notUsed) { $result[] = [$a[$k] ?? null, $b[$k] ?? null]; } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 18
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 18
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/2PUa2
function name:  (null)
number of ops:  23
compiled vars:  !0 = $a, !1 = $b, !2 = $result, !3 = $notUsed, !4 = $k
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   11     1        ASSIGN                                                       !1, <array>
   20     2        ASSIGN                                                       !2, <array>
   21     3        ADD                                                  ~8      !0, !1
          4      > FE_RESET_R                                           $9      ~8, ->18
          5    > > FE_FETCH_R                                           ~10     $9, !3, ->18
          6    >   ASSIGN                                                       !4, ~10
   22     7        FETCH_DIM_IS                                         ~13     !0, !4
          8        COALESCE                                             ~14     ~13
          9        QM_ASSIGN                                            ~14     null
         10        INIT_ARRAY                                           ~15     ~14
         11        FETCH_DIM_IS                                         ~16     !1, !4
         12        COALESCE                                             ~17     ~16
         13        QM_ASSIGN                                            ~17     null
         14        ADD_ARRAY_ELEMENT                                    ~15     ~17
         15        ASSIGN_DIM                                                   !2
         16        OP_DATA                                                      ~15
   21    17      > JMP                                                          ->5
         18    >   FE_FREE                                                      $9
   24    19        INIT_FCALL                                                   'var_export'
         20        SEND_VAR                                                     !2
         21        DO_ICALL                                                     
         22      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
148.88 ms | 1943 KiB | 14 Q