PHP Array Addition

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

The + operator returns the right-hand array appended to the left-hand array; for keys that exist in both arrays, the elements from the left-hand array will be used, and the matching elements from the right-hand array will be ignored.

Options

exec is denied

rejudge feature is enabled

now post-mortem time, all source codes will be revealed

Sample input:_

[] + [4, 2, 1, 0, 3, 0, 6]
[3, 9, 1, 6] + [4, 1, 0, 1, 0, 4, 8]
[] + [6]
[2] + []
[5, 0, 3] + []
[8, 9, 4, 7, 6, 1] + []
[9, 9, 6, 6, 2] + [1, 6, 4, 1, 9, 3, 2, 4]
[] + [3, 1, 0, 4, 7, 6]
[6, 1, 0, 5, 7, 2, 3] + [2]
[5, 1, 5, 3, 6, 6] + [1, 1, 5, 1, 8, 7, 5, 6]
[8, 5, 6] + [0, 8, 2]
[7, 1, 7, 2, 4, 9, 2, 2, 8, 0] + [8, 2, 6, 1, 0, 4, 6]
[2, 5, 2, 1, 2, 7, 3, 6, 2] + [0, 5, 0]
[5] + [2, 8, 0, 2, 8, 5, 3, 0, 4, 7]
[] + []
[0, 6, 9, 0, 3, 0, 0, 3, 0] + [0, 2]
[0, 3, 1, 0, 0, 4, 0, 0, 0, 3] + [0, 5, 2, 3, 0, 4, 7, 3]
[9, 0, 7, 6, 4, 9, 4, 6, 1, 5] + [3, 3]
[8] + [7, 4, 2, 7, 9, 2, 1, 3]
[5, 9, 9, 0, 2, 3, 3, 0, 2] + [2]
[8, 1, 8, 1, 4, 7, 5, 2, 2, 3] + []
[4, 8, 2, 5, 1, 0, 4, 1] + [1, 1, 4, 6, 5, 4, 5, 5, 0]
[9, 0, 0] + [1, 7, 5]
[5, 2, 8] + [5, 2, 5, 5, 7, 7, 1, 6, 2]
[6, 2, 3, 0, 4, 4, 9] + []

Sample output:

[4, 2, 1, 0, 3, 0, 6]
[3, 9, 1, 6, 0, 4, 8]
[6]
[2]
[5, 0, 3]
[8, 9, 4, 7, 6, 1]
[9, 9, 6, 6, 2, 3, 2, 4]
[3, 1, 0, 4, 7, 6]
[6, 1, 0, 5, 7, 2, 3]
[5, 1, 5, 3, 6, 6, 5, 6]
[8, 5, 6]
[7, 1, 7, 2, 4, 9, 2, 2, 8, 0]
[2, 5, 2, 1, 2, 7, 3, 6, 2]
[5, 8, 0, 2, 8, 5, 3, 0, 4, 7]
[]
[0, 6, 9, 0, 3, 0, 0, 3, 0]
[0, 3, 1, 0, 0, 4, 0, 0, 0, 3]
[9, 0, 7, 6, 4, 9, 4, 6, 1, 5]
[8, 4, 2, 7, 9, 2, 1, 3]
[5, 9, 9, 0, 2, 3, 3, 0, 2]
[8, 1, 8, 1, 4, 7, 5, 2, 2, 3]
[4, 8, 2, 5, 1, 0, 4, 1, 0]
[9, 0, 0]
[5, 2, 8, 5, 7, 7, 1, 6, 2]
[6, 2, 3, 0, 4, 4, 9]

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1kaki370.01882024/12/09 13:22:430B / 10B / 24B
2rotary-o370.01932024/12/09 22:40:270B / 10B / 24B

Ruby2 _

RankUserSizeTimeDateStatistics
1kaki360.05872024/12/09 13:22:530B / 9B / 24B
2rotary-o360.05732024/12/09 22:39:470B / 9B / 24B

Perl _

RankUserSizeTimeDateStatistics
1tails310.01782024/11/26 15:38:480B / 7B / 22B

Python3 _

RankUserSizeTimeDateStatistics
1xnor530.15282024/11/27 05:14:480B / 28B / 23B
2hallvabo580.04802024/11/27 08:25:160B / 29B / 28B
3fuzzylojik590.04832024/11/29 21:44:160B / 29B / 27B

Scheme _

RankUserSizeTimeDateStatistics
1kaki830.08762024/12/09 13:40:240B / 46B / 34B

iogii _

RankUserSizeTimeDateStatistics
1darrenks150.15502024/11/28 01:15:210B / ?B / ?B
2darrenks(tails,0.2)120.02232025/01/10 02:28:110B / 3B / 9B

C _

RankUserSizeTimeDateStatistics
1tails640.00762024/12/09 12:00:260B / 34B / 30B
2rotary-o640.00862024/12/09 18:38:530B / 34B / 30B

Java _

RankUserSizeTimeDateStatistics
1rotary-o1270.09032024/12/09 20:40:320B / 74B / 49B

C# _

RankUserSizeTimeDateStatistics
1rotary-o1340.04252024/12/08 10:11:550B / 82B / 47B

sed _

RankUserSizeTimeDateStatistics
1tails440.01462024/11/28 09:47:310B / 6B / 31B
2McBusLuck440.01162024/12/07 17:59:220B / 5B / 34B
3kaki490.01492024/12/09 14:58:360B / 6B / 37B
4tails390.01592024/12/10 14:19:110B / 6B / 29B

Bash (builtins) _

RankUserSizeTimeDateStatistics
1tails410.02012024/12/10 09:56:580B / 17B / 19B
2McBusLuck700.03802024/12/10 08:33:160B / 19B / 42B

Whitespace _

RankUserSizeTimeDateStatistics
1rotary-o1090.01642024/12/09 23:55:000B / 0B / 0B
2%201240.02302024/12/09 23:33:450B / 0B / 0B

GolfScript _

RankUserSizeTimeDateStatistics
1tails220.02642024/11/26 14:51:370B / 4B / 17B

gs2 _

RankUserSizeTimeDateStatistics
1tails120.07052024/11/26 12:54:113B / 5B / 4B
2whio120.06852024/12/07 00:20:323B / 5B / 4B

Nibbles _

RankUserSizeTimeDateStatistics
1tails90.02242024/11/26 14:30:206B / 1B / 2B

Lazy-K _

RankUserSizeTimeDateStatistics
1tails4920.02652024/11/29 11:39:350B / 265B / 227B

Universal Lambda _

RankUserSizeTimeDateStatistics
1tails470.04252024/11/29 11:22:3736B / 5B / 4B

Scala _

RankUserSizeTimeDateStatistics
1rotary-o714.20402024/11/28 23:23:090B / 47B / 22B

Language Ranking_

RankLangUserSizeScore
1Nibblestails910000
2gs2tails127500
3iogiidarrenks(tails,0.2)127500
4GolfScripttails224090
5Perltails312903
6Ruby2kaki362500
7Rubykaki372432
8sedtails392307
9Bash (builtins)tails412195
10Universal Lambdatails471914
11Python3xnor531698
12Ctails641406
13Scalarotary-o711267
14Schemekaki831084
15Whitespacerotary-o109825
16Javarotary-o127708
17C#rotary-o134671
18Lazy-Ktails492182

return to the top page