3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a1 = ['a', 'b']; $a2 = ['foo' => 'a', 'bar' => 'b']; $a3 = ['c', 'd']; $a4 = ['zip' => 'c', 'qux' => 'd']; $as = ['a1' => $a1, 'a2' => $a2, 'a3' => $a3, 'a4' => $a4]; foreach ($as as $kx => $ax) { foreach ($as as $ky => $ay) { printf('%s + %s : %s', $kx, $ky, print_r($ax + $ay, true)); echo PHP_EOL; printf('array_merge(%s, %s) : %s', $kx, $ky, print_r(array_merge($ax, $ay), true)); echo PHP_EOL; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 45
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 45
Branch analysis from position: 11
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 43
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 43
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 43
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
filename:       /in/LHl0q
function name:  (null)
number of ops:  47
compiled vars:  !0 = $a1, !1 = $a2, !2 = $a3, !3 = $a4, !4 = $as, !5 = $ax, !6 = $kx, !7 = $ay, !8 = $ky
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, <array>
    6     3        ASSIGN                                                   !3, <array>
    8     4        INIT_ARRAY                                       ~13     !0, 'a1'
          5        ADD_ARRAY_ELEMENT                                ~13     !1, 'a2'
          6        ADD_ARRAY_ELEMENT                                ~13     !2, 'a3'
          7        ADD_ARRAY_ELEMENT                                ~13     !3, 'a4'
          8        ASSIGN                                                   !4, ~13
   10     9      > FE_RESET_R                                       $15     !4, ->45
         10    > > FE_FETCH_R                                       ~16     $15, !5, ->45
         11    >   ASSIGN                                                   !6, ~16
   12    12      > FE_RESET_R                                       $18     !4, ->43
         13    > > FE_FETCH_R                                       ~19     $18, !7, ->43
         14    >   ASSIGN                                                   !8, ~19
   14    15        INIT_FCALL                                               'printf'
         16        SEND_VAL                                                 '%25s+%2B+%25s+%3A+%25s'
         17        SEND_VAR                                                 !6
         18        SEND_VAR                                                 !8
         19        INIT_FCALL                                               'print_r'
         20        ADD                                              ~21     !5, !7
         21        SEND_VAL                                                 ~21
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $22     
         24        SEND_VAR                                                 $22
         25        DO_ICALL                                                 
   15    26        ECHO                                                     '%0A'
   16    27        INIT_FCALL                                               'printf'
         28        SEND_VAL                                                 'array_merge%28%25s%2C+%25s%29+%3A+%25s'
         29        SEND_VAR                                                 !6
         30        SEND_VAR                                                 !8
         31        INIT_FCALL                                               'print_r'
         32        INIT_FCALL                                               'array_merge'
         33        SEND_VAR                                                 !5
         34        SEND_VAR                                                 !7
         35        DO_ICALL                                         $24     
         36        SEND_VAR                                                 $24
         37        SEND_VAL                                                 <true>
         38        DO_ICALL                                         $25     
         39        SEND_VAR                                                 $25
         40        DO_ICALL                                                 
   17    41        ECHO                                                     '%0A'
   12    42      > JMP                                                      ->13
         43    >   FE_FREE                                                  $18
   10    44      > JMP                                                      ->10
         45    >   FE_FREE                                                  $15
   19    46      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.68 ms | 1400 KiB | 19 Q