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5,6,7,9,8,1,2,3,4,5,6,7,9,8,1,2,3,4,5,6,7,9,8,1,2,3,4,5,6,7,9,8,1,2,3,4,5,6,7,9,8,1,2,3,4,5,6,7,9,8,1,2,3,4,5,6,7,9,8,1,2,3,4,5,6,7,9,8,1,2,3,4,5,6,7,9,8,1,2,3,4,5,6,7,9,8,1,2,3,4,5,6,7,9,8); $c = array(1,2,3,4); $d = array(2,4); //print_r($x); //print_r($y); $x = array_flip($a); $y = array_flip($b); $x = array_intersect_key($x, $y); // 2 4 $x = array_flip($x); //$y = array_flip($y); $x = array_intersect($a,$b); //print_r($result2); print_r($x); //print_r($result3); ?>
based on AMTf1
Output for 5.1.0 - 7.2.0
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 9 [8] => 8 [9] => 1 [10] => 2 [11] => 3 [12] => 4 [13] => 5 [14] => 6 [15] => 7 [16] => 9 [17] => 8 [18] => 1 [19] => 2 [20] => 3 [21] => 4 [22] => 5 [23] => 6 [24] => 7 [25] => 9 [26] => 8 [27] => 1 [28] => 2 [29] => 3 [30] => 4 [31] => 5 [32] => 6 [33] => 7 [34] => 9 [35] => 8 [36] => 1 [37] => 2 [38] => 3 [39] => 4 [40] => 5 [41] => 6 [42] => 7 [43] => 9 [44] => 8 [45] => 1 [46] => 2 [47] => 3 [48] => 4 [49] => 5 [50] => 6 [51] => 7 [52] => 9 [53] => 8 [54] => 1 [55] => 2 [56] => 3 [57] => 4 [58] => 5 [59] => 6 [60] => 7 [61] => 9 [62] => 8 [63] => 1 [64] => 2 [65] => 3 [66] => 4 [67] => 5 [68] => 6 [69] => 7 [70] => 9 [71] => 8 [72] => 1 [73] => 2 [74] => 3 [75] => 4 [76] => 5 [77] => 6 [78] => 7 [79] => 9 [80] => 8 [81] => 1 [82] => 2 [83] => 3 [84] => 4 [85] => 5 [86] => 6 [87] => 7 [88] => 9 [89] => 8 [90] => 1 [91] => 2 [92] => 3 [93] => 4 [94] => 5 [95] => 6 [96] => 7 [97] => 9 [98] => 8 [99] => 1 [100] => 2 [101] => 3 [102] => 4 [103] => 5 [104] => 6 [105] => 7 [106] => 9 [107] => 8 [108] => 1 [109] => 2 [110] => 3 [111] => 4 [112] => 5 [113] => 6 [114] => 7 [115] => 9 [116] => 8 [117] => 1 [118] => 2 [119] => 3 [120] => 4 [121] => 5 [122] => 6 [123] => 7 [124] => 9 [125] => 8 [126] => 1 [127] => 2 [128] => 3 [129] => 4 [130] => 5 [131] => 6 [132] => 7 [133] => 9 [134] => 8 [135] => 1 [136] => 2 [137] => 3 [138] => 4 [139] => 5 [140] => 6 [141] => 7 [142] => 9 [143] => 8 [144] => 1 [145] => 2 [146] => 3 [147] => 4 [148] => 5 [149] => 6 [150] => 7 [151] => 9 [152] => 8 [153] => 1 [154] => 2 [155] => 3 [156] => 4 [157] => 5 [158] => 6 [159] => 7 [160] => 9 [161] => 8 [162] => 1 [163] => 2 [164] => 3 [165] => 4 [166] => 5 [167] => 6 [168] => 7 [169] => 9 [170] => 8 [171] => 1 [172] => 2 [173] => 3 [174] => 4 [175] => 5 [176] => 6 [177] => 7 [178] => 9 [179] => 8 [180] => 1 [181] => 2 [182] => 3 [183] => 4 [184] => 5 [185] => 6 [186] => 7 [187] => 9 [188] => 8 [189] => 1 [190] => 2 [191] => 3 [192] => 4 [193] => 5 [194] => 6 [195] => 7 [196] => 9 [197] => 8 [198] => 1 [199] => 2 [200] => 3 [201] => 4 [202] => 5 [203] => 6 [204] => 7 [205] => 9 [206] => 8 [207] => 1 [208] => 2 [209] => 3 [210] => 4 [211] => 5 [212] => 6 [213] => 7 [214] => 9 [215] => 8 [216] => 1 [217] => 2 [218] => 3 [219] => 4 [220] => 5 [221] => 6 [222] => 7 [223] => 9 [224] => 8 [225] => 1 [226] => 2 [227] => 3 [228] => 4 [229] => 5 [230] => 6 [231] => 7 [232] => 9 [233] => 8 [234] => 1 [235] => 2 [236] => 3 [237] => 4 [238] => 5 [239] => 6 [240] => 7 [241] => 9 [242] => 8 [243] => 1 [244] => 2 [245] => 3 [246] => 4 [247] => 5 [248] => 6 [249] => 7 [250] => 9 [251] => 8 [252] => 1 [253] => 2 [254] => 3 [255] => 4 [256] => 5 [257] => 6 [258] => 7 [259] => 9 [260] => 8 [261] => 1 [262] => 2 [263] => 3 [264] => 4 [265] => 5 [266] => 6 [267] => 7 [268] => 9 [269] => 8 [270] => 1 [271] => 2 [272] => 3 [273] => 4 [274] => 5 [275] => 6 [276] => 7 [277] => 9 [278] => 8 [279] => 1 [280] => 2 [281] => 3 [282] => 4 [283] => 5 [284] => 6 [285] => 7 [286] => 9 [287] => 8 [288] => 1 [289] => 2 [290] => 3 [291] => 4 [292] => 5 [293] => 6 [294] => 7 [295] => 9 [296] => 8 [297] => 1 [298] => 2 [299] => 3 [300] => 4 [301] => 5 [302] => 6 [303] => 7 [304] => 9 [305] => 8 [306] => 1 [307] => 2 [308] => 3 [309] => 4 [310] => 5 [311] => 6 [312] => 7 [313] => 9 [314] => 8 [315] => 1 [316] => 2 [317] => 3 [318] => 4 [319] => 5 [320] => 6 [321] => 7 [322] => 9 [323] => 8 [324] => 1 [325] => 2 [326] => 3 [327] => 4 [328] => 5 [329] => 6 [330] => 7 [331] => 9 [332] => 8 [333] => 1 [334] => 2 [335] => 3 [336] => 4 [337] => 5 [338] => 6 [339] => 7 [340] => 9 [341] => 8 [342] => 1 [343] => 2 [344] => 3 [345] => 4 [346] => 5 [347] => 6 [348] => 7 [349] => 9 [350] => 8 [351] => 1 [352] => 2 [353] => 3 [354] => 4 [355] => 5 [356] => 6 [357] => 7 [358] => 9 [359] => 8 [360] => 1 [361] => 2 [362] => 3 [363] => 4 [364] => 5 [365] => 6 [366] => 7 [367] => 9 [368] => 8 [369] => 1 [370] => 2 [371] => 3 [372] => 4 [373] => 5 [374] => 6 [375] => 7 [376] => 9 [377] => 8 [378] => 1 [379] => 2 [380] => 3 [381] => 4 [382] => 5 [383] => 6 [384] => 7 [385] => 9 [386] => 8 [387] => 1 [388] => 2 [389] => 3 [390] => 4 [391] => 5 [392] => 6 [393] => 7 [394] => 9 [395] => 8 [396] => 1 [397] => 2 [398] => 3 [399] => 4 [400] => 5 [401] => 6 [402] => 7 [403] => 9 [404] => 8 [405] => 1 [406] => 2 [407] => 3 [408] => 4 [409] => 5 [410] => 6 [411] => 7 [412] => 9 [413] => 8 [414] => 1 [415] => 2 [416] => 3 [417] => 4 [418] => 5 [419] => 6 [420] => 7 [421] => 9 [422] => 8 )
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function array_intersect_key() in /in/ujONQ on line 14
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: array_intersect_key() in /in/ujONQ on line 14
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: array_intersect_key() in /in/ujONQ on line 14
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: array_intersect_key() in /in/ujONQ on line 14