3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ar_val="134567,dogs,food,EUU"; $ar_url="134567,dogs,toys,EEUU"; $arrayVal = explode(',', $ar_val); $arrayUrl = explode(',', $ar_url); $maxLength = max(sizeof($arrayVal), sizeof($arrayUrl)); $arrayIdsEqual = array(); $arrayIdsDifferent = array(); for ($i = 0; $i < $maxLength; $i++) { if (isset($arrayVal[$i]) && isset($arrayUrl[$i])) { if ($arrayVal[$i] == $arrayUrl[$i]) { $arrayIdsEqual[] = $i; } else { $arrayIdsDifferent[] = $i; } } else { //you arrive here if you have 2 arrays that don't have the same size / sme number of variables } } //assuming your 2 arrays ALWAYS have the same size, you can use the following logic if (empty($arrayIdsDifferent)) { echo '2 arrays are the same'; } else { echo "Differences: \n"; foreach ($arrayIdsDifferent as $indexDifferent => $currentIdDifferent) { $output = 'difference ' . ($indexDifferent + 1) . ': '; $output .= 'val = ' . $arrayVal[$currentIdDifferent]; $output .= 'url = ' . $arrayUrl[$currentIdDifferent]; echo $output; echo "\n"; } }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0120.00316.75
8.3.50.0180.00516.47
8.3.40.0110.00418.81
8.3.30.0110.00318.79
8.3.20.0040.00418.71
8.3.10.0000.00818.52
8.3.00.0040.00419.38
8.2.180.0150.00316.35
8.2.170.0110.00422.96
8.2.160.0070.01020.38
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0070.00020.95
8.2.110.0040.00420.35
8.2.100.0120.00017.91
8.2.90.0030.00517.62
8.2.80.0090.00017.97
8.2.70.0090.00017.79
8.2.60.0000.00918.16
8.2.50.0060.00318.10
8.2.40.0000.00819.33
8.2.30.0040.00419.17
8.2.20.0090.00017.72
8.2.10.0000.00817.66
8.2.00.0000.00917.75
8.1.280.0170.00325.92
8.1.270.0080.00024.66
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0000.01123.77
8.1.230.0060.00622.75
8.1.220.0030.00617.77
8.1.210.0080.00018.77
8.1.200.0060.00317.35
8.1.190.0000.00817.36
8.1.180.0050.00318.10
8.1.170.0030.00718.67
8.1.160.0050.00218.88
8.1.150.0000.00918.88
8.1.140.0000.00817.51
8.1.130.0030.00317.67
8.1.120.0030.00617.43
8.1.110.0020.00517.36
8.1.100.0040.00417.33
8.1.90.0050.00317.36
8.1.80.0000.00717.47
8.1.70.0090.00017.39
8.1.60.0030.00717.57
8.1.50.0030.00617.44
8.1.40.0030.00517.42
8.1.30.0000.00817.54
8.1.20.0030.00517.53
8.1.10.0040.00417.50
8.1.00.0040.00417.45
8.0.300.0000.00818.77
8.0.290.0040.00416.75
8.0.280.0030.00318.45
8.0.270.0070.00017.11
8.0.260.0000.00816.69
8.0.250.0040.00416.87
8.0.240.0000.00816.86
8.0.230.0000.00717.00
8.0.220.0000.00716.93
8.0.210.0050.00216.76
8.0.200.0060.00016.82
8.0.190.0030.00616.86
8.0.180.0060.00316.92
8.0.170.0080.00016.71
8.0.160.0000.00816.74
8.0.150.0030.00616.73
8.0.140.0050.00316.89
8.0.130.0030.00313.35
8.0.120.0040.00416.85
8.0.110.0080.00016.86
8.0.100.0030.00516.88
8.0.90.0000.00716.76
8.0.80.0150.00016.82
8.0.70.0000.00716.95
8.0.60.0070.00016.99
8.0.50.0040.00416.83
8.0.30.0150.00317.11
8.0.20.0070.01117.06
8.0.10.0030.00516.97
8.0.00.0150.01016.84
7.4.330.0060.00012.98
7.4.320.0030.00316.57
7.4.300.0000.00616.65
7.4.290.0000.00716.52
7.4.280.0070.00016.64
7.4.270.0030.00316.52
7.4.260.0030.00313.36
7.4.250.0080.00016.57
7.4.240.0050.00216.52
7.4.230.0030.00316.70
7.4.220.0060.01316.55
7.4.210.0100.00716.57
7.4.200.0070.00016.70
7.4.190.0030.00316.47
7.4.160.0070.01716.39
7.4.150.0110.00716.63
7.4.140.0110.00616.55
7.4.130.0080.00916.55
7.4.120.0100.00616.52
7.4.110.0100.00716.61
7.4.100.0070.01016.54
7.4.90.0120.00616.44
7.4.80.0170.00619.39
7.4.70.0070.01016.50
7.4.60.0030.01216.41
7.4.50.0000.01316.54
7.4.40.0060.00616.66
7.4.30.0080.00816.52
7.4.10.0090.00915.02
7.4.00.0040.01214.93
7.3.330.0040.00413.16
7.3.320.0000.00813.20
7.3.310.0000.00716.26
7.3.300.0030.00316.24
7.3.290.0070.01016.38
7.3.280.0090.01016.29
7.3.270.0040.01416.43
7.3.260.0060.01016.53
7.3.250.0170.00816.46
7.3.240.0110.00616.43
7.3.230.0060.01016.33
7.3.210.0120.00616.36
7.3.200.0070.01016.25
7.3.190.0070.01416.35
7.3.180.0180.00016.72
7.3.170.0080.00816.26
7.3.160.0100.00616.37
7.3.130.0040.01515.17
7.3.120.0070.01014.83
7.3.110.0070.01014.66
7.3.100.0080.00414.66
7.3.90.0000.00914.84
7.3.80.0060.00614.93
7.3.70.0030.01014.54
7.3.60.0000.00914.89
7.3.50.0060.00314.71
7.3.40.0040.00714.86
7.3.30.0070.01014.54
7.3.20.0060.01016.67
7.3.10.0050.00916.56
7.3.00.0020.00616.78
7.2.330.0090.00916.66
7.2.320.0120.01216.59
7.2.310.0100.01316.75
7.2.300.0080.00816.65
7.2.290.0120.00616.74
7.2.260.0070.01414.83
7.2.250.0060.00615.10
7.2.240.0100.00415.03
7.2.230.0060.01015.10
7.2.220.0060.00915.12
7.2.210.0060.00615.17
7.2.200.0100.00615.00
7.2.190.0000.01215.03
7.2.180.0070.00715.20
7.2.170.0080.00615.04
7.2.160.0070.00715.08
7.2.150.0130.00317.04
7.2.140.0040.01117.13
7.2.130.0050.00816.75
7.2.120.0110.00317.02
7.2.110.0060.01017.05
7.2.100.0020.00916.87
7.2.90.0050.00917.02
7.2.80.0030.00816.93
7.2.70.0100.00617.06
7.2.60.0080.00716.88
7.2.50.0050.00816.96
7.2.40.0030.00917.07
7.2.30.0050.00916.96
7.2.20.0060.00416.94
7.2.10.0020.00917.06
7.2.00.0040.01017.76
7.1.330.0070.00715.88
7.1.320.0050.00415.89
7.1.310.0060.00615.97
7.1.300.0000.01215.86
7.1.290.0000.00915.89
7.1.280.0000.01115.76
7.1.270.0070.01015.85
7.1.260.0060.00615.77
7.1.250.0050.00915.71
7.1.240.0000.01215.55
7.1.230.0030.00715.83
7.1.220.0080.00315.59
7.1.210.0000.01115.71
7.1.200.0130.00315.99
7.1.190.0030.00615.57
7.1.180.0030.01315.73
7.1.170.0030.01215.58
7.1.160.0040.00816.02
7.1.150.0000.01115.81
7.1.140.0000.01215.71
7.1.130.0060.00315.89
7.1.120.0060.00615.79
7.1.110.0030.00715.49
7.1.100.0080.00616.92
7.1.90.0060.00915.79
7.1.80.0070.00715.96
7.1.70.0040.00616.59
7.1.60.0120.00717.70
7.1.50.0110.01125.20
7.1.40.0040.01116.03
7.1.30.0030.00915.68
7.1.20.0080.00315.75
7.1.10.0070.00415.84
7.1.00.0050.04019.15
7.0.330.0060.00915.46
7.0.320.0040.00415.32
7.0.310.0040.01115.49
7.0.300.0030.00615.17
7.0.290.0040.01115.48
7.0.280.0060.00315.52
7.0.270.0030.00715.42
7.0.260.0030.00615.44
7.0.250.0060.00615.11
7.0.240.0080.00815.29
7.0.230.0000.01315.48
7.0.220.0000.00815.39
7.0.210.0000.01415.55
7.0.200.0050.00516.04
7.0.190.0060.00615.44
7.0.180.0070.00715.49
7.0.170.0000.01115.57
7.0.160.0070.00715.61
7.0.150.0030.01215.44
7.0.140.0080.03818.57
7.0.130.0040.00715.59
7.0.120.0050.03918.77
7.0.110.0070.01015.45
7.0.100.0110.00415.46
7.0.90.0060.00915.53
7.0.80.0000.01515.17
7.0.70.0060.00615.20
7.0.60.0070.03017.49
7.0.50.0050.02516.76
7.0.40.0030.02415.67
7.0.30.0070.02015.64
7.0.20.0090.02015.51
7.0.10.0070.02515.60
7.0.00.0050.02815.58
5.6.400.0000.01014.65
5.6.390.0120.00314.39
5.6.380.0070.00614.53
5.6.370.0060.01014.59
5.6.360.0080.00414.39
5.6.350.0000.00814.38
5.6.340.0100.00714.54
5.6.330.0100.00314.75
5.6.320.0030.01414.31
5.6.310.0170.00014.76
5.6.300.0000.01314.48
5.6.290.0090.00614.47
5.6.280.0020.04218.00
5.6.270.0040.01114.45
5.6.260.0000.01714.16
5.6.250.0140.00014.53
5.6.240.0070.00714.52
5.6.230.0070.00314.35
5.6.220.0100.00714.52
5.6.210.0090.03017.60
5.6.200.0000.02816.37
5.6.190.0040.02316.41
5.6.180.0000.03116.30
5.6.170.0030.02516.32
5.6.160.0050.02516.22
5.6.150.0040.02416.30
5.6.140.0070.02216.26
5.6.130.0100.02316.42
5.6.120.0020.02716.33
5.6.110.0080.02316.15
5.6.100.0050.02216.24
5.6.90.0050.02316.25
5.6.80.0030.03515.89
5.6.70.0090.01816.01
5.6.60.0100.01815.96
5.6.50.0050.03116.06
5.6.40.0050.04315.94
5.6.30.0050.04515.96
5.6.20.0080.03715.87
5.6.10.0030.04515.96
5.6.00.0070.03915.85
5.5.380.0000.01514.25
5.5.370.0060.00914.36
5.5.360.0110.00314.52
5.5.350.0150.03017.61
5.5.340.0080.02216.31
5.5.330.0030.02316.24
5.5.320.0050.02616.26
5.5.310.0050.02816.32
5.5.300.0060.02116.35
5.5.290.0050.02016.31
5.5.280.0080.02216.19
5.5.270.0050.02316.31
5.5.260.0020.02616.21
5.5.250.0060.02016.06
5.5.240.0100.01815.77
5.5.230.0100.03215.93
5.5.220.0110.02015.89
5.5.210.0050.02515.85
5.5.200.0050.02315.77
5.5.190.0040.04815.88
5.5.180.0050.03016.04
5.5.170.0040.01114.05
5.5.160.0080.02715.79
5.5.150.0030.03415.92
5.5.140.0050.02715.66
5.5.130.0120.03715.83
5.5.120.0030.04515.85
5.5.110.0020.03115.92
5.5.100.0120.03415.90
5.5.90.0050.02615.71
5.5.80.0020.03715.86
5.5.70.0090.03715.87
5.5.60.0070.04015.91
5.5.50.0020.03415.68
5.5.40.0050.04015.71
5.5.30.0020.02815.64
5.5.20.0090.03515.69
5.5.10.0070.04215.71
5.5.00.0050.03815.70
5.4.450.0020.02515.54
5.4.440.0030.02015.51
5.4.430.0040.02515.49
5.4.420.0050.02215.57
5.4.410.0020.02215.47
5.4.400.0070.01815.36
5.4.390.0050.01915.27
5.4.380.0050.04215.30
5.4.370.0070.04015.35
5.4.360.0100.01815.27
5.4.350.0090.02015.35
5.4.340.0000.04815.37
5.4.330.0110.00011.71
5.4.320.0030.04015.40
5.4.310.0070.03815.36
5.4.300.0030.02315.35
5.4.290.0080.02015.37
5.4.280.0050.03415.33
5.4.270.0050.04015.40
5.4.260.0120.03515.48
5.4.250.0080.02015.37
5.4.240.0050.04515.36
5.4.230.0060.02615.41
5.4.220.0060.03615.41
5.4.210.0050.03215.36
5.4.200.0030.04215.38
5.4.190.0050.04015.34
5.4.180.0080.03515.34
5.4.170.0070.02315.32
5.4.160.0020.04315.38
5.4.150.0020.04715.36
5.4.140.0050.02414.02
5.4.130.0030.02813.99
5.4.120.0060.02313.99
5.4.110.0080.03514.04
5.4.100.0060.02114.03
5.4.90.0080.04014.00
5.4.80.0040.02913.99
5.4.70.0060.02113.97
5.4.60.0030.02314.10
5.4.50.0040.04213.98
5.4.40.0050.03813.99
5.4.30.0050.04313.98
5.4.20.0120.02013.97
5.4.10.0110.03313.98
5.4.00.0050.03513.75
5.3.290.0050.02413.17
5.3.280.0060.03313.14
5.3.270.0060.03913.13
5.3.260.0100.03213.08
5.3.250.0120.03513.15
5.3.240.0030.02813.21
5.3.230.0020.04413.08
5.3.220.0080.02913.03
5.3.210.0060.02313.03
5.3.200.0080.04013.13
5.3.190.0070.04113.18
5.3.180.0050.04013.13
5.3.170.0070.02013.13
5.3.160.0060.03713.12
5.3.150.0090.03713.05
5.3.140.0100.03513.11
5.3.130.0050.03013.12
5.3.120.0040.03113.09
5.3.110.0060.04013.11
5.3.100.0020.04512.91
5.3.90.0030.03012.79
5.3.80.0070.03812.82
5.3.70.0050.04012.82
5.3.60.0050.03912.84
5.3.50.0100.01812.71
5.3.40.0080.03812.82
5.3.30.0040.02912.78
5.3.20.0070.03512.58
5.3.10.0020.02312.68
5.3.00.0030.02512.55
5.2.170.0070.06310.93
5.2.160.0100.04710.99
5.2.150.0000.06011.13
5.2.140.0030.06011.06
5.2.130.0030.05311.14
5.2.120.0070.03711.09
5.2.110.0000.03011.12
5.2.100.0100.05711.26
5.2.90.0070.05011.07
5.2.80.0130.03711.06
5.2.70.0030.06711.07
5.2.60.0130.05711.21
5.2.50.0100.04711.00
5.2.40.0070.04010.83
5.2.30.0070.05310.94
5.2.20.0070.06310.89
5.2.10.0000.04310.91
5.2.00.0030.06010.77
5.1.60.0000.03010.01
5.1.50.0030.0339.99
5.1.40.0030.0239.92
5.1.30.0000.04010.37
5.1.20.0100.04710.35
5.1.10.0070.02710.12
5.1.00.0070.05710.12
5.0.50.0070.0338.62
5.0.40.0030.0208.46
5.0.30.0030.0308.23
5.0.20.0030.0238.30
5.0.10.0030.0478.15
5.0.00.0000.0608.13
4.4.90.0000.0407.91
4.4.80.0000.0307.91
4.4.70.0030.0377.91
4.4.60.0000.0377.91
4.4.50.0000.0407.91
4.4.40.0030.0507.91
4.4.30.0030.0237.91
4.4.20.0070.0237.91
4.4.10.0000.0177.91
4.4.00.0030.0277.91
4.3.110.0030.0377.91
4.3.100.0030.0377.91
4.3.90.0070.0237.91
4.3.80.0030.0477.91
4.3.70.0000.0377.91
4.3.60.0030.0377.91
4.3.50.0100.0137.91
4.3.40.0000.0537.91
4.3.30.0000.0377.91
4.3.20.0000.0337.91
4.3.10.0000.0377.91
4.3.00.0000.0337.91

preferences:
35.41 ms | 401 KiB | 5 Q