3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a1 = range(2, 4048, 2); $a2 = range(4, 8096, 4); $count1 = count($a1); $count2 = count($a2); for($i = 0; $i < $count1; $i++){ for($j = 0; $j < $count2; $j++){ if($a1[$i] === $a2[$j]){ $a3[] = $a1[$i]; } } } print_r($a3);
based on LfvDG
Output for 5.0.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => 4 [1] => 8 [2] => 12 [3] => 16 [4] => 20 [5] => 24 [6] => 28 [7] => 32 [8] => 36 [9] => 40 [10] => 44 [11] => 48 [12] => 52 [13] => 56 [14] => 60 [15] => 64 [16] => 68 [17] => 72 [18] => 76 [19] => 80 [20] => 84 [21] => 88 [22] => 92 [23] => 96 [24] => 100 [25] => 104 [26] => 108 [27] => 112 [28] => 116 [29] => 120 [30] => 124 [31] => 128 [32] => 132 [33] => 136 [34] => 140 [35] => 144 [36] => 148 [37] => 152 [38] => 156 [39] => 160 [40] => 164 [41] => 168 [42] => 172 [43] => 176 [44] => 180 [45] => 184 [46] => 188 [47] => 192 [48] => 196 [49] => 200 [50] => 204 [51] => 208 [52] => 212 [53] => 216 [54] => 220 [55] => 224 [56] => 228 [57] => 232 [58] => 236 [59] => 240 [60] => 244 [61] => 248 [62] => 252 [63] => 256 [64] => 260 [65] => 264 [66] => 268 [67] => 272 [68] => 276 [69] => 280 [70] => 284 [71] => 288 [72] => 292 [73] => 296 [74] => 300 [75] => 304 [76] => 308 [77] => 312 [78] => 316 [79] => 320 [80] => 324 [81] => 328 [82] => 332 [83] => 336 [84] => 340 [85] => 344 [86] => 348 [87] => 352 [88] => 356 [89] => 360 [90] => 364 [91] => 368 [92] => 372 [93] => 376 [94] => 380 [95] => 384 [96] => 388 [97] => 392 [98] => 396 [99] => 400 [100] => 404 [101] => 408 [102] => 412 [103] => 416 [104] => 420 [105] => 424 [106] => 428 [107] => 432 [108] => 436 [109] => 440 [110] => 444 [111] => 448 [112] => 452 [113] => 456 [114] => 460 [115] => 464 [116] => 468 [117] => 472 [118] => 476 [119] => 480 [120] => 484 [121] => 488 [122] => 492 [123] => 496 [124] => 500 [125] => 504 [126] => 508 [127] => 512 [128] => 516 [129] => 520 [130] => 524 [131] => 528 [132] => 532 [133] => 536 [134] => 540 [135] => 544 [136] => 548 [137] => 552 [138] => 556 [139] => 560 [140] => 564 [141] => 568 [142] => 572 [143] => 576 [144] => 580 [145] => 584 [146] => 588 [147] => 592 [148] => 596 [149] => 600 [150] => 604 [151] => 608 [152] => 612 [153] => 616 [154] => 620 [155] => 624 [156] => 628 [157] => 632 [158] => 636 [159] => 640 [160] => 644 [161] => 648 [162] => 652 [163] => 656 [164] => 660 [165] => 664 [166] => 668 [167] => 672 [168] => 676 [169] => 680 [170] => 684 [171] => 688 [172] => 692 [173] => 696 [174] => 700 [175] => 704 [176] => 708 [177] => 712 [178] => 716 [179] => 720 [180] => 724 [181] => 728 [182] => 732 [183] => 736 [184] => 740 [185] => 744 [186] => 748 [187] => 752 [188] => 756 [189] => 760 [190] => 764 [191] => 768 [192] => 772 [193] => 776 [194] => 780 [195] => 784 [196] => 788 [197] => 792 [198] => 796 [199] => 800 [200] => 804 [201] => 808 [202] => 812 [203] => 816 [204] => 820 [205] => 824 [206] => 828 [207] => 832 [208] => 836 [209] => 840 [210] => 844 [211] => 848 [212] => 852 [213] => 856 [214] => 860 [215] => 864 [216] => 868 [217] => 872 [218] => 876 [219] => 880 [220] => 884 [221] => 888 [222] => 892 [223] => 896 [224] => 900 [225] => 904 [226] => 908 [227] => 912 [228] => 916 [229] => 920 [230] => 924 [231] => 928 [232] => 932 [233] => 936 [234] => 940 [235] => 944 [236] => 948 [237] => 952 [238] => 956 [239] => 960 [240] => 964 [241] => 968 [242] => 972 [243] => 976 [244] => 980 [245] => 984 [246] => 988 [247] => 992 [248] => 996 [249] => 1000 [250] => 1004 [251] => 1008 [252] => 1012 [253] => 1016 [254] => 1020 [255] => 1024 [256] => 1028 [257] => 1032 [258] => 1036 [259] => 1040 [260] => 1044 [261] => 1048 [262] => 1052 [263] => 1056 [264] => 1060 [265] => 1064 [266] => 1068 [267] => 1072 [268] => 1076 [269] => 1080 [270] => 1084 [271] => 1088 [272] => 1092 [273] => 1096 [274] => 1100 [275] => 1104 [276] => 1108 [277] => 1112 [278] => 1116 [279] => 1120 [280] => 1124 [281] => 1128 [282] => 1132 [283] => 1136 [284] => 1140 [285] => 1144 [286] => 1148 [287] => 1152 [288] => 1156 [289] => 1160 [290] => 1164 [291] => 1168 [292] => 1172 [293] => 1176 [294] => 1180 [295] => 1184 [296] => 1188 [297] => 1192 [298] => 1196 [299] => 1200 [300] => 1204 [301] => 1208 [302] => 1212 [303] => 1216 [304] => 1220 [305] => 1224 [306] => 1228 [307] => 1232 [308] => 1236 [309] => 1240 [310] => 1244 [311] => 1248 [312] => 1252 [313] => 1256 [314] => 1260 [315] => 1264 [316] => 1268 [317] => 1272 [318] => 1276 [319] => 1280 [320] => 1284 [321] => 1288 [322] => 1292 [323] => 1296 [324] => 1300 [325] => 1304 [326] => 1308 [327] => 1312 [328] => 1316 [329] => 1320 [330] => 1324 [331] => 1328 [332] => 1332 [333] => 1336 [334] => 1340 [335] => 1344 [336] => 1348 [337] => 1352 [338] => 1356 [339] => 1360 [340] => 1364 [341] => 1368 [342] => 1372 [343] => 1376 [344] => 1380 [345] => 1384 [346] => 1388 [347] => 1392 [348] => 1396 [349] => 1400 [350] => 1404 [351] => 1408 [352] => 1412 [353] => 1416 [354] => 1420 [355] => 1424 [356] => 1428 [357] => 1432 [358] => 1436 [359] => 1440 [360] => 1444 [361] => 1448 [362] => 1452 [363] => 1456 [364] => 1460 [365] => 1464 [366] => 1468 [367] => 1472 [368] => 1476 [369] => 1480 [370] => 1484 [371] => 1488 [372] => 1492 [373] => 1496 [374] => 1500 [375] => 1504 [376] => 1508 [377] => 1512 [378] => 1516 [379] => 1520 [380] => 1524 [381] => 1528 [382] => 1532 [383] => 1536 [384] => 1540 [385] => 1544 [386] => 1548 [387] => 1552 [388] => 1556 [389] => 1560 [390] => 1564 [391] => 1568 [392] => 1572 [393] => 1576 [394] => 1580 [395] => 1584 [396] => 1588 [397] => 1592 [398] => 1596 [399] => 1600 [400] => 1604 [401] => 1608 [402] => 1612 [403] => 1616 [404] => 1620 [405] => 1624 [406] => 1628 [407] => 1632 [408] => 1636 [409] => 1640 [410] => 1644 [411] => 1648 [412] => 1652 [413] => 1656 [414] => 1660 [415] => 1664 [416] => 1668 [417] => 1672 [418] => 1676 [419] => 1680 [420] => 1684 [421] => 1688 [422] => 1692 [423] => 1696 [424] => 1700 [425] => 1704 [426] => 1708 [427] => 1712 [428] => 1716 [429] => 1720 [430] => 1724 [431] => 1728 [432] => 1732 [433] => 1736 [434] => 1740 [435] => 1744 [436] => 1748 [437] => 1752 [438] => 1756 [439] => 1760 [440] => 1764 [441] => 1768 [442] => 1772 [443] => 1776 [444] => 1780 [445] => 1784 [446] => 1788 [447] => 1792 [448] => 1796 [449] => 1800 [450] => 1804 [451] => 1808 [452] => 1812 [453] => 1816 [454] => 1820 [455] => 1824 [456] => 1828 [457] => 1832 [458] => 1836 [459] => 1840 [460] => 1844 [461] => 1848 [462] => 1852 [463] => 1856 [464] => 1860 [465] => 1864 [466] => 1868 [467] => 1872 [468] => 1876 [469] => 1880 [470] => 1884 [471] => 1888 [472] => 1892 [473] => 1896 [474] => 1900 [475] => 1904 [476] => 1908 [477] => 1912 [478] => 1916 [479] => 1920 [480] => 1924 [481] => 1928 [482] => 1932 [483] => 1936 [484] => 1940 [485] => 1944 [486] => 1948 [487] => 1952 [488] => 1956 [489] => 1960 [490] => 1964 [491] => 1968 [492] => 1972 [493] => 1976 [494] => 1980 [495] => 1984 [496] => 1988 [497] => 1992 [498] => 1996 [499] => 2000 [500] => 2004 [501] => 2008 [502] => 2012 [503] => 2016 [504] => 2020 [505] => 2024 [506] => 2028 [507] => 2032 [508] => 2036 [509] => 2040 [510] => 2044 [511] => 2048 [512] => 2052 [513] => 2056 [514] => 2060 [515] => 2064 [516] => 2068 [517] => 2072 [518] => 2076 [519] => 2080 [520] => 2084 [521] => 2088 [522] => 2092 [523] => 2096 [524] => 2100 [525] => 2104 [526] => 2108 [527] => 2112 [528] => 2116 [529] => 2120 [530] => 2124 [531] => 2128 [532] => 2132 [533] => 2136 [534] => 2140 [535] => 2144 [536] => 2148 [537] => 2152 [538] => 2156 [539] => 2160 [540] => 2164 [541] => 2168 [542] => 2172 [543] => 2176 [544] => 2180 [545] => 2184 [546] => 2188 [547] => 2192 [548] => 2196 [549] => 2200 [550] => 2204 [551] => 2208 [552] => 2212 [553] => 2216 [554] => 2220 [555] => 2224 [556] => 2228 [557] => 2232 [558] => 2236 [559] => 2240 [560] => 2244 [561] => 2248 [562] => 2252 [563] => 2256 [564] => 2260 [565] => 2264 [566] => 2268 [567] => 2272 [568] => 2276 [569] => 2280 [570] => 2284 [571] => 2288 [572] => 2292 [573] => 2296 [574] => 2300 [575] => 2304 [576] => 2308 [577] => 2312 [578] => 2316 [579] => 2320 [580] => 2324 [581] => 2328 [582] => 2332 [583] => 2336 [584] => 2340 [585] => 2344 [586] => 2348 [587] => 2352 [588] => 2356 [589] => 2360 [590] => 2364 [591] => 2368 [592] => 2372 [593] => 2376 [594] => 2380 [595] => 2384 [596] => 2388 [597] => 2392 [598] => 2396 [599] => 2400 [600] => 2404 [601] => 2408 [602] => 2412 [603] => 2416 [604] => 2420 [605] => 2424 [606] => 2428 [607] => 2432 [608] => 2436 [609] => 2440 [610] => 2444 [611] => 2448 [612] => 2452 [613] => 2456 [614] => 2460 [615] => 2464 [616] => 2468 [617] => 2472 [618] => 2476 [619] => 2480 [620] => 2484 [621] => 2488 [622] => 2492 [623] => 2496 [624] => 2500 [625] => 2504 [626] => 2508 [627] => 2512 [628] => 2516 [629] => 2520 [630] => 2524 [631] => 2528 [632] => 2532 [633] => 2536 [634] => 2540 [635] => 2544 [636] => 2548 [637] => 2552 [638] => 2556 [639] => 2560 [640] => 2564 [641] => 2568 [642] => 2572 [643] => 2576 [644] => 2580 [645] => 2584 [646] => 2588 [647] => 2592 [648] => 2596 [649] => 2600 [650] => 2604 [651] => 2608 [652] => 2612 [653] => 2616 [654] => 2620 [655] => 2624 [656] => 2628 [657] => 2632 [658] => 2636 [659] => 2640 [660] => 2644 [661] => 2648 [662] => 2652 [663] => 2656 [664] => 2660 [665] => 2664 [666] => 2668 [667] => 2672 [668] => 2676 [669] => 2680 [670] => 2684 [671] => 2688 [672] => 2692 [673] => 2696 [674] => 2700 [675] => 2704 [676] => 2708 [677] => 2712 [678] => 2716 [679] => 2720 [680] => 2724 [681] => 2728 [682] => 2732 [683] => 2736 [684] => 2740 [685] => 2744 [686] => 2748 [687] => 2752 [688] => 2756 [689] => 2760 [690] => 2764 [691] => 2768 [692] => 2772 [693] => 2776 [694] => 2780 [695] => 2784 [696] => 2788 [697] => 2792 [698] => 2796 [699] => 2800 [700] => 2804 [701] => 2808 [702] => 2812 [703] => 2816 [704] => 2820 [705] => 2824 [706] => 2828 [707] => 2832 [708] => 2836 [709] => 2840 [710] => 2844 [711] => 2848 [712] => 2852 [713] => 2856 [714] => 2860 [715] => 2864 [716] => 2868 [717] => 2872 [718] => 2876 [719] => 2880 [720] => 2884 [721] => 2888 [722] => 2892 [723] => 2896 [724] => 2900 [725] => 2904 [726] => 2908 [727] => 2912 [728] => 2916 [729] => 2920 [730] => 2924 [731] => 2928 [732] => 2932 [733] => 2936 [734] => 2940 [735] => 2944 [736] => 2948 [737] => 2952 [738] => 2956 [739] => 2960 [740] => 2964 [741] => 2968 [742] => 2972 [743] => 2976 [744] => 2980 [745] => 2984 [746] => 2988 [747] => 2992 [748] => 2996 [749] => 3000 [750] => 3004 [751] => 3008 [752] => 3012 [753] => 3016 [754] => 3020 [755] => 3024 [756] => 3028 [757] => 3032 [758] => 3036 [759] => 3040 [760] => 3044 [761] => 3048 [762] => 3052 [763] => 3056 [764] => 3060 [765] => 3064 [766] => 3068 [767] => 3072 [768] => 3076 [769] => 3080 [770] => 3084 [771] => 3088 [772] => 3092 [773] => 3096 [774] => 3100 [775] => 3104 [776] => 3108 [777] => 3112 [778] => 3116 [779] => 3120 [780] => 3124 [781] => 3128 [782] => 3132 [783] => 3136 [784] => 3140 [785] => 3144 [786] => 3148 [787] => 3152 [788] => 3156 [789] => 3160 [790] => 3164 [791] => 3168 [792] => 3172 [793] => 3176 [794] => 3180 [795] => 3184 [796] => 3188 [797] => 3192 [798] => 3196 [799] => 3200 [800] => 3204 [801] => 3208 [802] => 3212 [803] => 3216 [804] => 3220 [805] => 3224 [806] => 3228 [807] => 3232 [808] => 3236 [809] => 3240 [810] => 3244 [811] => 3248 [812] => 3252 [813] => 3256 [814] => 3260 [815] => 3264 [816] => 3268 [817] => 3272 [818] => 3276 [819] => 3280 [820] => 3284 [821] => 3288 [822] => 3292 [823] => 3296 [824] => 3300 [825] => 3304 [826] => 3308 [827] => 3312 [828] => 3316 [829] => 3320 [830] => 3324 [831] => 3328 [832] => 3332 [833] => 3336 [834] => 3340 [835] => 3344 [836] => 3348 [837] => 3352 [838] => 3356 [839] => 3360 [840] => 3364 [841] => 3368 [842] => 3372 [843] => 3376 [844] => 3380 [845] => 3384 [846] => 3388 [847] => 3392 [848] => 3396 [849] => 3400 [850] => 3404 [851] => 3408 [852] => 3412 [853] => 3416 [854] => 3420 [855] => 3424 [856] => 3428 [857] => 3432 [858] => 3436 [859] => 3440 [860] => 3444 [861] => 3448 [862] => 3452 [863] => 3456 [864] => 3460 [865] => 3464 [866] => 3468 [867] => 3472 [868] => 3476 [869] => 3480 [870] => 3484 [871] => 3488 [872] => 3492 [873] => 3496 [874] => 3500 [875] => 3504 [876] => 3508 [877] => 3512 [878] => 3516 [879] => 3520 [880] => 3524 [881] => 3528 [882] => 3532 [883] => 3536 [884] => 3540 [885] => 3544 [886] => 3548 [887] => 3552 [888] => 3556 [889] => 3560 [890] => 3564 [891] => 3568 [892] => 3572 [893] => 3576 [894] => 3580 [895] => 3584 [896] => 3588 [897] => 3592 [898] => 3596 [899] => 3600 [900] => 3604 [901] => 3608 [902] => 3612 [903] => 3616 [904] => 3620 [905] => 3624 [906] => 3628 [907] => 3632 [908] => 3636 [909] => 3640 [910] => 3644 [911] => 3648 [912] => 3652 [913] => 3656 [914] => 3660 [915] => 3664 [916] => 3668 [917] => 3672 [918] => 3676 [919] => 3680 [920] => 3684 [921] => 3688 [922] => 3692 [923] => 3696 [924] => 3700 [925] => 3704 [926] => 3708 [927] => 3712 [928] => 3716 [929] => 3720 [930] => 3724 [931] => 3728 [932] => 3732 [933] => 3736 [934] => 3740 [935] => 3744 [936] => 3748 [937] => 3752 [938] => 3756 [939] => 3760 [940] => 3764 [941] => 3768 [942] => 3772 [943] => 3776 [944] => 3780 [945] => 3784 [946] => 3788 [947] => 3792 [948] => 3796 [949] => 3800 [950] => 3804 [951] => 3808 [952] => 3812 [953] => 3816 [954] => 3820 [955] => 3824 [956] => 3828 [957] => 3832 [958] => 3836 [959] => 3840 [960] => 3844 [961] => 3848 [962] => 3852 [963] => 3856 [964] => 3860 [965] => 3864 [966] => 3868 [967] => 3872 [968] => 3876 [969] => 3880 [970] => 3884 [971] => 3888 [972] => 3892 [973] => 3896 [974] => 3900 [975] => 3904 [976] => 3908 [977] => 3912 [978] => 3916 [979] => 3920 [980] => 3924 [981] => 3928 [982] => 3932 [983] => 3936 [984] => 3940 [985] => 3944 [986] => 3948 [987] => 3952 [988] => 3956 [989] => 3960 [990] => 3964 [991] => 3968 [992] => 3972 [993] => 3976 [994] => 3980 [995] => 3984 [996] => 3988 [997] => 3992 [998] => 3996 [999] => 4000 [1000] => 4004 [1001] => 4008 [1002] => 4012 [1003] => 4016 [1004] => 4020 [1005] => 4024 [1006] => 4028 [1007] => 4032 [1008] => 4036 [1009] => 4040 [1010] => 4044 [1011] => 4048 )
Output for 4.3.0 - 4.4.9
Warning: Wrong parameter count for range() in /in/kU1be on line 3 Warning: Wrong parameter count for range() in /in/kU1be on line 4 Notice: Undefined variable: a3 in /in/kU1be on line 15