3v4l.org

run code in 500+ PHP versions simultaneously
<?php $trucks = ['Serial' => 12345, 'Wheels' => 4, 'Color' => 'Black']; $trailers = ['Serial' =>4321, 'Length'=>42]; $forklifts = ['Serial' =>5678, 'ForkLength'=>24]; $columns = array_keys(array_merge($trucks, $trailers, $forklifts)); $template = array_fill_keys($columns, null); foreach ([$trucks, $trailers, $forklifts] as $array) { $result[] = array_merge($template, $array); } var_dump($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 29
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 29
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/S0shX
function name:  (null)
number of ops:  34
compiled vars:  !0 = $trucks, !1 = $trailers, !2 = $forklifts, !3 = $columns, !4 = $template, !5 = $array, !6 = $result
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    5     1        ASSIGN                                                       !1, <array>
    7     2        ASSIGN                                                       !2, <array>
    9     3        INIT_FCALL                                                   'array_keys'
          4        INIT_FCALL                                                   'array_merge'
          5        SEND_VAR                                                     !0
          6        SEND_VAR                                                     !1
          7        SEND_VAR                                                     !2
          8        DO_ICALL                                             $10     
          9        SEND_VAR                                                     $10
         10        DO_ICALL                                             $11     
         11        ASSIGN                                                       !3, $11
   11    12        INIT_FCALL                                                   'array_fill_keys'
         13        SEND_VAR                                                     !3
         14        SEND_VAL                                                     null
         15        DO_ICALL                                             $13     
         16        ASSIGN                                                       !4, $13
   13    17        INIT_ARRAY                                           ~15     !0
         18        ADD_ARRAY_ELEMENT                                    ~15     !1
         19        ADD_ARRAY_ELEMENT                                    ~15     !2
         20      > FE_RESET_R                                           $16     ~15, ->29
         21    > > FE_FETCH_R                                                   $16, !5, ->29
   14    22    >   INIT_FCALL                                                   'array_merge'
         23        SEND_VAR                                                     !4
         24        SEND_VAR                                                     !5
         25        DO_ICALL                                             $18     
         26        ASSIGN_DIM                                                   !6
         27        OP_DATA                                                      $18
   13    28      > JMP                                                          ->21
         29    >   FE_FREE                                                      $16
   17    30        INIT_FCALL                                                   'var_dump'
         31        SEND_VAR                                                     !6
         32        DO_ICALL                                                     
         33      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
220.35 ms | 2166 KiB | 17 Q