3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array( array("email" => "user1@mail", "login" => "user1", "phone" => "123", "color" => "red"), array("email" => "user2@mail", "login" => "user2", "phone" => "456", "color" => "blue"), ); $array2 = array( array("email" => "user3@mail", "login" => "user3"), array("email" => "user4@mail", "login" => "user4"), ); foreach ($array2 as &$record) { if (!isset($record["phone"])) { $record["phone"] = null; } if (!isset($record["color"])) { $record["color"] = null; } } $merged = array_merge($array1, $array2); var_export($merged);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 126) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 14
Branch analysis from position: 9
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/eSKMo
function name:  (null)
number of ops:  25
compiled vars:  !0 = $array1, !1 = $array2, !2 = $record, !3 = $merged
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, <array>
   13     2      > FE_RESET_RW                                      $6      !1, ->15
          3    > > FE_FETCH_RW                                              $6, !2, ->15
   15     4    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~7      !2, 'phone'
          5        BOOL_NOT                                         ~8      ~7
          6      > JMPZ                                                     ~8, ->9
   16     7    >   ASSIGN_DIM                                               !2, 'phone'
          8        OP_DATA                                                  null
   18     9    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~10     !2, 'color'
         10        BOOL_NOT                                         ~11     ~10
         11      > JMPZ                                                     ~11, ->14
   19    12    >   ASSIGN_DIM                                               !2, 'color'
         13        OP_DATA                                                  null
   13    14    > > JMP                                                      ->3
         15    >   FE_FREE                                                  $6
   24    16        INIT_FCALL                                               'array_merge'
         17        SEND_VAR                                                 !0
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $13     
         20        ASSIGN                                                   !3, $13
   26    21        INIT_FCALL                                               'var_export'
         22        SEND_VAR                                                 !3
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.28 ms | 1007 KiB | 15 Q