3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a1 = range(2, 4048, 2); $a2 = range(4, 8096, 4); $a3 = array_intersect($a1, $a2); print_r($a3);
based on EAmkY
Output for 5.0.0 - 7.1.0
Array ( [1] => 4 [3] => 8 [5] => 12 [7] => 16 [9] => 20 [11] => 24 [13] => 28 [15] => 32 [17] => 36 [19] => 40 [21] => 44 [23] => 48 [25] => 52 [27] => 56 [29] => 60 [31] => 64 [33] => 68 [35] => 72 [37] => 76 [39] => 80 [41] => 84 [43] => 88 [45] => 92 [47] => 96 [49] => 100 [51] => 104 [53] => 108 [55] => 112 [57] => 116 [59] => 120 [61] => 124 [63] => 128 [65] => 132 [67] => 136 [69] => 140 [71] => 144 [73] => 148 [75] => 152 [77] => 156 [79] => 160 [81] => 164 [83] => 168 [85] => 172 [87] => 176 [89] => 180 [91] => 184 [93] => 188 [95] => 192 [97] => 196 [99] => 200 [101] => 204 [103] => 208 [105] => 212 [107] => 216 [109] => 220 [111] => 224 [113] => 228 [115] => 232 [117] => 236 [119] => 240 [121] => 244 [123] => 248 [125] => 252 [127] => 256 [129] => 260 [131] => 264 [133] => 268 [135] => 272 [137] => 276 [139] => 280 [141] => 284 [143] => 288 [145] => 292 [147] => 296 [149] => 300 [151] => 304 [153] => 308 [155] => 312 [157] => 316 [159] => 320 [161] => 324 [163] => 328 [165] => 332 [167] => 336 [169] => 340 [171] => 344 [173] => 348 [175] => 352 [177] => 356 [179] => 360 [181] => 364 [183] => 368 [185] => 372 [187] => 376 [189] => 380 [191] => 384 [193] => 388 [195] => 392 [197] => 396 [199] => 400 [201] => 404 [203] => 408 [205] => 412 [207] => 416 [209] => 420 [211] => 424 [213] => 428 [215] => 432 [217] => 436 [219] => 440 [221] => 444 [223] => 448 [225] => 452 [227] => 456 [229] => 460 [231] => 464 [233] => 468 [235] => 472 [237] => 476 [239] => 480 [241] => 484 [243] => 488 [245] => 492 [247] => 496 [249] => 500 [251] => 504 [253] => 508 [255] => 512 [257] => 516 [259] => 520 [261] => 524 [263] => 528 [265] => 532 [267] => 536 [269] => 540 [271] => 544 [273] => 548 [275] => 552 [277] => 556 [279] => 560 [281] => 564 [283] => 568 [285] => 572 [287] => 576 [289] => 580 [291] => 584 [293] => 588 [295] => 592 [297] => 596 [299] => 600 [301] => 604 [303] => 608 [305] => 612 [307] => 616 [309] => 620 [311] => 624 [313] => 628 [315] => 632 [317] => 636 [319] => 640 [321] => 644 [323] => 648 [325] => 652 [327] => 656 [329] => 660 [331] => 664 [333] => 668 [335] => 672 [337] => 676 [339] => 680 [341] => 684 [343] => 688 [345] => 692 [347] => 696 [349] => 700 [351] => 704 [353] => 708 [355] => 712 [357] => 716 [359] => 720 [361] => 724 [363] => 728 [365] => 732 [367] => 736 [369] => 740 [371] => 744 [373] => 748 [375] => 752 [377] => 756 [379] => 760 [381] => 764 [383] => 768 [385] => 772 [387] => 776 [389] => 780 [391] => 784 [393] => 788 [395] => 792 [397] => 796 [399] => 800 [401] => 804 [403] => 808 [405] => 812 [407] => 816 [409] => 820 [411] => 824 [413] => 828 [415] => 832 [417] => 836 [419] => 840 [421] => 844 [423] => 848 [425] => 852 [427] => 856 [429] => 860 [431] => 864 [433] => 868 [435] => 872 [437] => 876 [439] => 880 [441] => 884 [443] => 888 [445] => 892 [447] => 896 [449] => 900 [451] => 904 [453] => 908 [455] => 912 [457] => 916 [459] => 920 [461] => 924 [463] => 928 [465] => 932 [467] => 936 [469] => 940 [471] => 944 [473] => 948 [475] => 952 [477] => 956 [479] => 960 [481] => 964 [483] => 968 [485] => 972 [487] => 976 [489] => 980 [491] => 984 [493] => 988 [495] => 992 [497] => 996 [499] => 1000 [501] => 1004 [503] => 1008 [505] => 1012 [507] => 1016 [509] => 1020 [511] => 1024 [513] => 1028 [515] => 1032 [517] => 1036 [519] => 1040 [521] => 1044 [523] => 1048 [525] => 1052 [527] => 1056 [529] => 1060 [531] => 1064 [533] => 1068 [535] => 1072 [537] => 1076 [539] => 1080 [541] => 1084 [543] => 1088 [545] => 1092 [547] => 1096 [549] => 1100 [551] => 1104 [553] => 1108 [555] => 1112 [557] => 1116 [559] => 1120 [561] => 1124 [563] => 1128 [565] => 1132 [567] => 1136 [569] => 1140 [571] => 1144 [573] => 1148 [575] => 1152 [577] => 1156 [579] => 1160 [581] => 1164 [583] => 1168 [585] => 1172 [587] => 1176 [589] => 1180 [591] => 1184 [593] => 1188 [595] => 1192 [597] => 1196 [599] => 1200 [601] => 1204 [603] => 1208 [605] => 1212 [607] => 1216 [609] => 1220 [611] => 1224 [613] => 1228 [615] => 1232 [617] => 1236 [619] => 1240 [621] => 1244 [623] => 1248 [625] => 1252 [627] => 1256 [629] => 1260 [631] => 1264 [633] => 1268 [635] => 1272 [637] => 1276 [639] => 1280 [641] => 1284 [643] => 1288 [645] => 1292 [647] => 1296 [649] => 1300 [651] => 1304 [653] => 1308 [655] => 1312 [657] => 1316 [659] => 1320 [661] => 1324 [663] => 1328 [665] => 1332 [667] => 1336 [669] => 1340 [671] => 1344 [673] => 1348 [675] => 1352 [677] => 1356 [679] => 1360 [681] => 1364 [683] => 1368 [685] => 1372 [687] => 1376 [689] => 1380 [691] => 1384 [693] => 1388 [695] => 1392 [697] => 1396 [699] => 1400 [701] => 1404 [703] => 1408 [705] => 1412 [707] => 1416 [709] => 1420 [711] => 1424 [713] => 1428 [715] => 1432 [717] => 1436 [719] => 1440 [721] => 1444 [723] => 1448 [725] => 1452 [727] => 1456 [729] => 1460 [731] => 1464 [733] => 1468 [735] => 1472 [737] => 1476 [739] => 1480 [741] => 1484 [743] => 1488 [745] => 1492 [747] => 1496 [749] => 1500 [751] => 1504 [753] => 1508 [755] => 1512 [757] => 1516 [759] => 1520 [761] => 1524 [763] => 1528 [765] => 1532 [767] => 1536 [769] => 1540 [771] => 1544 [773] => 1548 [775] => 1552 [777] => 1556 [779] => 1560 [781] => 1564 [783] => 1568 [785] => 1572 [787] => 1576 [789] => 1580 [791] => 1584 [793] => 1588 [795] => 1592 [797] => 1596 [799] => 1600 [801] => 1604 [803] => 1608 [805] => 1612 [807] => 1616 [809] => 1620 [811] => 1624 [813] => 1628 [815] => 1632 [817] => 1636 [819] => 1640 [821] => 1644 [823] => 1648 [825] => 1652 [827] => 1656 [829] => 1660 [831] => 1664 [833] => 1668 [835] => 1672 [837] => 1676 [839] => 1680 [841] => 1684 [843] => 1688 [845] => 1692 [847] => 1696 [849] => 1700 [851] => 1704 [853] => 1708 [855] => 1712 [857] => 1716 [859] => 1720 [861] => 1724 [863] => 1728 [865] => 1732 [867] => 1736 [869] => 1740 [871] => 1744 [873] => 1748 [875] => 1752 [877] => 1756 [879] => 1760 [881] => 1764 [883] => 1768 [885] => 1772 [887] => 1776 [889] => 1780 [891] => 1784 [893] => 1788 [895] => 1792 [897] => 1796 [899] => 1800 [901] => 1804 [903] => 1808 [905] => 1812 [907] => 1816 [909] => 1820 [911] => 1824 [913] => 1828 [915] => 1832 [917] => 1836 [919] => 1840 [921] => 1844 [923] => 1848 [925] => 1852 [927] => 1856 [929] => 1860 [931] => 1864 [933] => 1868 [935] => 1872 [937] => 1876 [939] => 1880 [941] => 1884 [943] => 1888 [945] => 1892 [947] => 1896 [949] => 1900 [951] => 1904 [953] => 1908 [955] => 1912 [957] => 1916 [959] => 1920 [961] => 1924 [963] => 1928 [965] => 1932 [967] => 1936 [969] => 1940 [971] => 1944 [973] => 1948 [975] => 1952 [977] => 1956 [979] => 1960 [981] => 1964 [983] => 1968 [985] => 1972 [987] => 1976 [989] => 1980 [991] => 1984 [993] => 1988 [995] => 1992 [997] => 1996 [999] => 2000 [1001] => 2004 [1003] => 2008 [1005] => 2012 [1007] => 2016 [1009] => 2020 [1011] => 2024 [1013] => 2028 [1015] => 2032 [1017] => 2036 [1019] => 2040 [1021] => 2044 [1023] => 2048 [1025] => 2052 [1027] => 2056 [1029] => 2060 [1031] => 2064 [1033] => 2068 [1035] => 2072 [1037] => 2076 [1039] => 2080 [1041] => 2084 [1043] => 2088 [1045] => 2092 [1047] => 2096 [1049] => 2100 [1051] => 2104 [1053] => 2108 [1055] => 2112 [1057] => 2116 [1059] => 2120 [1061] => 2124 [1063] => 2128 [1065] => 2132 [1067] => 2136 [1069] => 2140 [1071] => 2144 [1073] => 2148 [1075] => 2152 [1077] => 2156 [1079] => 2160 [1081] => 2164 [1083] => 2168 [1085] => 2172 [1087] => 2176 [1089] => 2180 [1091] => 2184 [1093] => 2188 [1095] => 2192 [1097] => 2196 [1099] => 2200 [1101] => 2204 [1103] => 2208 [1105] => 2212 [1107] => 2216 [1109] => 2220 [1111] => 2224 [1113] => 2228 [1115] => 2232 [1117] => 2236 [1119] => 2240 [1121] => 2244 [1123] => 2248 [1125] => 2252 [1127] => 2256 [1129] => 2260 [1131] => 2264 [1133] => 2268 [1135] => 2272 [1137] => 2276 [1139] => 2280 [1141] => 2284 [1143] => 2288 [1145] => 2292 [1147] => 2296 [1149] => 2300 [1151] => 2304 [1153] => 2308 [1155] => 2312 [1157] => 2316 [1159] => 2320 [1161] => 2324 [1163] => 2328 [1165] => 2332 [1167] => 2336 [1169] => 2340 [1171] => 2344 [1173] => 2348 [1175] => 2352 [1177] => 2356 [1179] => 2360 [1181] => 2364 [1183] => 2368 [1185] => 2372 [1187] => 2376 [1189] => 2380 [1191] => 2384 [1193] => 2388 [1195] => 2392 [1197] => 2396 [1199] => 2400 [1201] => 2404 [1203] => 2408 [1205] => 2412 [1207] => 2416 [1209] => 2420 [1211] => 2424 [1213] => 2428 [1215] => 2432 [1217] => 2436 [1219] => 2440 [1221] => 2444 [1223] => 2448 [1225] => 2452 [1227] => 2456 [1229] => 2460 [1231] => 2464 [1233] => 2468 [1235] => 2472 [1237] => 2476 [1239] => 2480 [1241] => 2484 [1243] => 2488 [1245] => 2492 [1247] => 2496 [1249] => 2500 [1251] => 2504 [1253] => 2508 [1255] => 2512 [1257] => 2516 [1259] => 2520 [1261] => 2524 [1263] => 2528 [1265] => 2532 [1267] => 2536 [1269] => 2540 [1271] => 2544 [1273] => 2548 [1275] => 2552 [1277] => 2556 [1279] => 2560 [1281] => 2564 [1283] => 2568 [1285] => 2572 [1287] => 2576 [1289] => 2580 [1291] => 2584 [1293] => 2588 [1295] => 2592 [1297] => 2596 [1299] => 2600 [1301] => 2604 [1303] => 2608 [1305] => 2612 [1307] => 2616 [1309] => 2620 [1311] => 2624 [1313] => 2628 [1315] => 2632 [1317] => 2636 [1319] => 2640 [1321] => 2644 [1323] => 2648 [1325] => 2652 [1327] => 2656 [1329] => 2660 [1331] => 2664 [1333] => 2668 [1335] => 2672 [1337] => 2676 [1339] => 2680 [1341] => 2684 [1343] => 2688 [1345] => 2692 [1347] => 2696 [1349] => 2700 [1351] => 2704 [1353] => 2708 [1355] => 2712 [1357] => 2716 [1359] => 2720 [1361] => 2724 [1363] => 2728 [1365] => 2732 [1367] => 2736 [1369] => 2740 [1371] => 2744 [1373] => 2748 [1375] => 2752 [1377] => 2756 [1379] => 2760 [1381] => 2764 [1383] => 2768 [1385] => 2772 [1387] => 2776 [1389] => 2780 [1391] => 2784 [1393] => 2788 [1395] => 2792 [1397] => 2796 [1399] => 2800 [1401] => 2804 [1403] => 2808 [1405] => 2812 [1407] => 2816 [1409] => 2820 [1411] => 2824 [1413] => 2828 [1415] => 2832 [1417] => 2836 [1419] => 2840 [1421] => 2844 [1423] => 2848 [1425] => 2852 [1427] => 2856 [1429] => 2860 [1431] => 2864 [1433] => 2868 [1435] => 2872 [1437] => 2876 [1439] => 2880 [1441] => 2884 [1443] => 2888 [1445] => 2892 [1447] => 2896 [1449] => 2900 [1451] => 2904 [1453] => 2908 [1455] => 2912 [1457] => 2916 [1459] => 2920 [1461] => 2924 [1463] => 2928 [1465] => 2932 [1467] => 2936 [1469] => 2940 [1471] => 2944 [1473] => 2948 [1475] => 2952 [1477] => 2956 [1479] => 2960 [1481] => 2964 [1483] => 2968 [1485] => 2972 [1487] => 2976 [1489] => 2980 [1491] => 2984 [1493] => 2988 [1495] => 2992 [1497] => 2996 [1499] => 3000 [1501] => 3004 [1503] => 3008 [1505] => 3012 [1507] => 3016 [1509] => 3020 [1511] => 3024 [1513] => 3028 [1515] => 3032 [1517] => 3036 [1519] => 3040 [1521] => 3044 [1523] => 3048 [1525] => 3052 [1527] => 3056 [1529] => 3060 [1531] => 3064 [1533] => 3068 [1535] => 3072 [1537] => 3076 [1539] => 3080 [1541] => 3084 [1543] => 3088 [1545] => 3092 [1547] => 3096 [1549] => 3100 [1551] => 3104 [1553] => 3108 [1555] => 3112 [1557] => 3116 [1559] => 3120 [1561] => 3124 [1563] => 3128 [1565] => 3132 [1567] => 3136 [1569] => 3140 [1571] => 3144 [1573] => 3148 [1575] => 3152 [1577] => 3156 [1579] => 3160 [1581] => 3164 [1583] => 3168 [1585] => 3172 [1587] => 3176 [1589] => 3180 [1591] => 3184 [1593] => 3188 [1595] => 3192 [1597] => 3196 [1599] => 3200 [1601] => 3204 [1603] => 3208 [1605] => 3212 [1607] => 3216 [1609] => 3220 [1611] => 3224 [1613] => 3228 [1615] => 3232 [1617] => 3236 [1619] => 3240 [1621] => 3244 [1623] => 3248 [1625] => 3252 [1627] => 3256 [1629] => 3260 [1631] => 3264 [1633] => 3268 [1635] => 3272 [1637] => 3276 [1639] => 3280 [1641] => 3284 [1643] => 3288 [1645] => 3292 [1647] => 3296 [1649] => 3300 [1651] => 3304 [1653] => 3308 [1655] => 3312 [1657] => 3316 [1659] => 3320 [1661] => 3324 [1663] => 3328 [1665] => 3332 [1667] => 3336 [1669] => 3340 [1671] => 3344 [1673] => 3348 [1675] => 3352 [1677] => 3356 [1679] => 3360 [1681] => 3364 [1683] => 3368 [1685] => 3372 [1687] => 3376 [1689] => 3380 [1691] => 3384 [1693] => 3388 [1695] => 3392 [1697] => 3396 [1699] => 3400 [1701] => 3404 [1703] => 3408 [1705] => 3412 [1707] => 3416 [1709] => 3420 [1711] => 3424 [1713] => 3428 [1715] => 3432 [1717] => 3436 [1719] => 3440 [1721] => 3444 [1723] => 3448 [1725] => 3452 [1727] => 3456 [1729] => 3460 [1731] => 3464 [1733] => 3468 [1735] => 3472 [1737] => 3476 [1739] => 3480 [1741] => 3484 [1743] => 3488 [1745] => 3492 [1747] => 3496 [1749] => 3500 [1751] => 3504 [1753] => 3508 [1755] => 3512 [1757] => 3516 [1759] => 3520 [1761] => 3524 [1763] => 3528 [1765] => 3532 [1767] => 3536 [1769] => 3540 [1771] => 3544 [1773] => 3548 [1775] => 3552 [1777] => 3556 [1779] => 3560 [1781] => 3564 [1783] => 3568 [1785] => 3572 [1787] => 3576 [1789] => 3580 [1791] => 3584 [1793] => 3588 [1795] => 3592 [1797] => 3596 [1799] => 3600 [1801] => 3604 [1803] => 3608 [1805] => 3612 [1807] => 3616 [1809] => 3620 [1811] => 3624 [1813] => 3628 [1815] => 3632 [1817] => 3636 [1819] => 3640 [1821] => 3644 [1823] => 3648 [1825] => 3652 [1827] => 3656 [1829] => 3660 [1831] => 3664 [1833] => 3668 [1835] => 3672 [1837] => 3676 [1839] => 3680 [1841] => 3684 [1843] => 3688 [1845] => 3692 [1847] => 3696 [1849] => 3700 [1851] => 3704 [1853] => 3708 [1855] => 3712 [1857] => 3716 [1859] => 3720 [1861] => 3724 [1863] => 3728 [1865] => 3732 [1867] => 3736 [1869] => 3740 [1871] => 3744 [1873] => 3748 [1875] => 3752 [1877] => 3756 [1879] => 3760 [1881] => 3764 [1883] => 3768 [1885] => 3772 [1887] => 3776 [1889] => 3780 [1891] => 3784 [1893] => 3788 [1895] => 3792 [1897] => 3796 [1899] => 3800 [1901] => 3804 [1903] => 3808 [1905] => 3812 [1907] => 3816 [1909] => 3820 [1911] => 3824 [1913] => 3828 [1915] => 3832 [1917] => 3836 [1919] => 3840 [1921] => 3844 [1923] => 3848 [1925] => 3852 [1927] => 3856 [1929] => 3860 [1931] => 3864 [1933] => 3868 [1935] => 3872 [1937] => 3876 [1939] => 3880 [1941] => 3884 [1943] => 3888 [1945] => 3892 [1947] => 3896 [1949] => 3900 [1951] => 3904 [1953] => 3908 [1955] => 3912 [1957] => 3916 [1959] => 3920 [1961] => 3924 [1963] => 3928 [1965] => 3932 [1967] => 3936 [1969] => 3940 [1971] => 3944 [1973] => 3948 [1975] => 3952 [1977] => 3956 [1979] => 3960 [1981] => 3964 [1983] => 3968 [1985] => 3972 [1987] => 3976 [1989] => 3980 [1991] => 3984 [1993] => 3988 [1995] => 3992 [1997] => 3996 [1999] => 4000 [2001] => 4004 [2003] => 4008 [2005] => 4012 [2007] => 4016 [2009] => 4020 [2011] => 4024 [2013] => 4028 [2015] => 4032 [2017] => 4036 [2019] => 4040 [2021] => 4044 [2023] => 4048 )
Output for 4.3.2 - 4.4.9
Warning: Wrong parameter count for range() in /in/QfMbo on line 3 Warning: Wrong parameter count for range() in /in/QfMbo on line 4 Warning: array_intersect(): Argument #1 is not an array in /in/QfMbo on line 5
Output for 4.3.0 - 4.3.1
Warning: Wrong parameter count for range() in /in/QfMbo on line 3 Warning: Wrong parameter count for range() in /in/QfMbo on line 4 Warning: array_intersect() [http://www.php.net/function.array-intersect]: Argument #1 is not an array in /in/QfMbo on line 5