3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ar_val="134567,dogs,food,EEUU"; $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.0110.00316.63
8.3.50.0220.00516.53
8.3.40.0090.00618.72
8.3.30.0030.01018.83
8.3.20.0040.00418.87
8.3.10.0000.00818.95
8.3.00.0040.00419.26
8.2.180.0070.00716.38
8.2.170.0170.00022.96
8.2.160.0140.00720.57
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00220.96
8.2.110.0090.00020.97
8.2.100.0040.00817.91
8.2.90.0030.00619.47
8.2.80.0060.00319.39
8.2.70.0040.00417.50
8.2.60.0050.00318.05
8.2.50.0040.00418.07
8.2.40.0060.00318.34
8.2.30.0030.00617.96
8.2.20.0030.00617.66
8.2.10.0000.00717.79
8.2.00.0030.00617.79
8.1.280.0170.00025.92
8.1.270.0000.00724.66
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00322.46
8.1.230.0070.00420.94
8.1.220.0000.00817.74
8.1.210.0090.00018.96
8.1.200.0060.00317.47
8.1.190.0060.00317.40
8.1.180.0080.00018.10
8.1.170.0040.00418.97
8.1.160.0040.00418.86
8.1.150.0040.00418.65
8.1.140.0000.00717.45
8.1.130.0000.00717.83
8.1.120.0040.00717.50
8.1.110.0050.00317.45
8.1.100.0040.00417.32
8.1.90.0040.00417.46
8.1.80.0000.00717.33
8.1.70.0030.00717.47
8.1.60.0070.00417.61
8.1.50.0000.00817.40
8.1.40.0040.00417.49
8.1.30.0000.00817.59
8.1.20.0000.00717.64
8.1.10.0080.00017.55
8.1.00.0000.00817.57
8.0.300.0040.00419.89
8.0.290.0000.00816.75
8.0.280.0000.00818.44
8.0.270.0070.00017.17
8.0.260.0040.00416.71
8.0.250.0050.00316.86
8.0.240.0040.00416.88
8.0.230.0070.00016.96
8.0.220.0050.00216.80
8.0.210.0000.00716.91
8.0.200.0030.00316.92
8.0.190.0040.00416.94
8.0.180.0030.00616.79
8.0.170.0040.00416.77
8.0.160.0000.00716.91
8.0.150.0040.00416.88
8.0.140.0040.00416.78
8.0.130.0030.00313.41
8.0.120.0000.00816.80
8.0.110.0030.00516.78
8.0.100.0000.00816.93
8.0.90.0000.00716.86
8.0.80.0060.01016.86
8.0.70.0040.00417.00
8.0.60.0050.00216.77
8.0.50.0000.00716.91
8.0.30.0090.01716.83
8.0.20.0060.01216.89
8.0.10.0040.00417.05
8.0.00.0100.01116.99
7.4.330.0060.00013.00
7.4.320.0070.00016.61
7.4.300.0000.00716.61
7.4.290.0030.00316.51
7.4.280.0050.00216.60
7.4.270.0030.00316.49
7.4.260.0000.00613.32
7.4.250.0040.00416.59
7.4.240.0040.00416.52
7.4.230.0030.00316.50
7.4.220.0030.01516.64
7.4.210.0090.00616.58
7.4.200.0040.00416.50
7.4.190.0000.00716.38
7.4.160.0120.01216.63
7.4.150.0090.00916.42
7.4.140.0100.00716.39
7.4.130.0070.01116.55
7.4.120.0070.01016.42
7.4.110.0150.00316.54
7.4.100.0070.01016.55
7.4.90.0090.00916.51
7.4.80.0000.01719.39
7.4.70.0120.00916.68
7.4.60.0100.00616.40
7.4.50.0080.00016.75
7.4.40.0060.00916.25
7.4.30.0130.00316.52
7.4.00.0050.01314.95
7.3.330.0040.00313.03
7.3.320.0040.00413.18
7.3.310.0040.00416.33
7.3.300.0070.00016.37
7.3.290.0100.01016.22
7.3.280.0080.00916.25
7.3.270.0170.00016.38
7.3.260.0110.00616.33
7.3.250.0130.01016.51
7.3.240.0070.01016.51
7.3.230.0120.00316.39
7.3.210.0100.01016.54
7.3.200.0090.00816.18
7.3.190.0090.00916.51
7.3.180.0060.01116.35
7.3.170.0100.01016.60
7.3.160.0060.01016.58
7.3.120.0070.01214.89
7.3.110.0030.01514.87
7.3.100.0070.00714.72
7.3.90.0030.00614.97
7.3.80.0110.00314.76
7.3.70.0030.00714.70
7.3.60.0120.00614.79
7.3.50.0090.00614.71
7.3.40.0030.00714.54
7.3.30.0040.01214.87
7.3.20.0060.00616.77
7.3.10.0080.01116.64
7.3.00.0070.00916.51
7.2.330.0090.00916.47
7.2.320.0100.00716.83
7.2.310.0070.01016.71
7.2.300.0070.01516.40
7.2.290.0070.01416.56
7.2.250.0100.01015.09
7.2.240.0000.01815.04
7.2.230.0000.01314.86
7.2.220.0060.01214.92
7.2.210.0060.00915.01
7.2.200.0070.00715.24
7.2.190.0070.01115.16
7.2.180.0140.00315.02
7.2.170.0150.00014.91
7.2.130.0090.00616.62
7.2.120.0120.00516.84
7.2.110.0130.00916.79
7.2.100.0120.00516.62
7.2.90.0060.00716.74
7.2.80.0070.00916.85
7.2.70.0070.00616.92
7.2.60.0130.00316.74
7.2.50.0110.00816.94
7.2.40.0080.00817.08
7.2.30.0090.01016.94
7.2.20.0130.00416.48
7.2.10.0100.00517.01
7.2.00.0110.00516.84
7.1.330.0110.00315.80
7.1.320.0100.00315.71
7.1.310.0090.00615.80
7.1.300.0070.01015.73
7.1.290.0070.00315.79
7.1.280.0110.00315.80
7.1.270.0120.00015.86
7.1.260.0030.01315.82
7.1.250.0120.00615.56
7.1.70.0000.01016.92
7.1.60.0110.01419.40
7.1.50.0300.00734.77
7.1.00.0030.07722.30
7.0.200.0030.00716.30
7.0.140.0070.07021.96
7.0.120.0030.07322.01
7.0.60.0300.07019.95
7.0.50.0100.05717.66
7.0.40.0300.05720.42
7.0.30.0370.07020.30
7.0.20.0270.05020.26
7.0.10.0370.07320.11
7.0.00.0270.06020.23
5.6.280.0100.06720.82
5.6.210.0070.03720.75
5.6.200.0100.07018.22
5.6.190.0430.07020.65
5.6.180.0300.04320.78
5.6.170.0300.07720.43
5.6.160.0300.05720.60
5.6.150.0370.05720.33
5.6.140.0270.04720.40
5.6.130.0300.07020.11
5.6.120.0300.08020.11
5.6.110.0230.04320.39
5.6.100.0330.07720.27
5.6.90.0330.04720.41
5.6.80.0230.04319.50
5.6.70.0230.04719.48
5.6.60.0200.08319.65
5.6.50.0330.07019.80
5.6.40.0170.04719.64
5.6.30.0230.04019.76
5.6.20.0270.06319.75
5.6.10.0270.05319.75
5.6.00.0230.08019.80
5.5.350.0100.08020.42
5.5.340.0070.06017.99
5.5.330.0330.06320.28
5.5.320.0230.04720.40
5.5.310.0300.06020.43
5.5.300.0300.08020.24
5.5.290.0230.04320.18
5.5.280.0270.08320.18
5.5.270.0300.04320.20
5.5.260.0270.07020.13
5.5.250.0300.07019.75
5.5.240.0230.07319.56
5.5.230.0230.04019.35
5.5.220.0230.04719.58
5.5.210.0270.06319.57
5.5.200.0230.06019.61
5.5.190.0300.07719.44
5.5.180.0300.07319.61
5.5.160.0230.04319.51
5.5.150.0370.06719.42
5.5.140.0300.06319.61
5.5.130.0230.04019.46
5.5.120.0400.07719.52
5.5.110.0270.04319.60
5.5.100.0330.06319.37
5.5.90.0370.07319.18
5.5.80.0270.08019.50
5.5.70.0270.06319.45
5.5.60.0270.03719.37
5.5.50.0230.04019.41
5.5.40.0230.04019.37
5.5.30.0230.08019.39
5.5.20.0330.06319.34
5.5.10.0230.04019.31
5.5.00.0200.05719.35
5.4.450.0230.05019.52
5.4.440.0300.04319.41
5.4.430.0230.04019.42
5.4.420.0330.03719.40
5.4.410.0470.05719.29
5.4.400.0330.07019.09
5.4.390.0230.03719.09
5.4.380.0270.03319.14
5.4.370.0300.07319.14
5.4.360.0270.08718.91
5.4.350.0230.04318.81
5.4.340.0170.04318.80
5.4.320.0270.03718.81
5.4.310.0400.06018.79
5.4.300.0270.04719.18
5.4.290.0230.05719.18
5.4.280.0330.06718.79
5.4.270.0270.04719.18
5.4.260.0170.06019.18
5.4.250.0300.05719.00
5.4.240.0370.05719.14
5.4.230.0370.07018.79
5.4.220.0270.03719.08
5.4.210.0300.03318.88
5.4.200.0270.03319.07
5.4.190.0300.05019.17
5.4.180.0300.05319.11
5.4.170.0270.03719.07
5.4.160.0300.06319.05
5.4.150.0370.06719.16
5.4.140.0300.06716.34
5.4.130.0400.06316.24
5.4.120.0370.02316.44
5.4.110.0270.04716.41
5.4.100.0270.03316.31
5.4.90.0230.03716.20
5.4.80.0330.04016.34
5.4.70.0270.04716.39
5.4.60.0470.05316.36
5.4.50.0270.04316.30
5.4.40.0300.04316.38
5.4.30.0270.07016.38
5.4.20.0330.05716.22
5.4.10.0230.03716.34
5.4.00.0230.04715.64
5.3.290.0200.04014.60
5.3.280.0270.03714.57
5.3.270.0400.02714.56
5.3.260.0300.07314.54
5.3.250.0230.04014.40
5.3.240.0230.05314.51
5.3.230.0270.03714.54
5.3.220.0230.03714.37
5.3.210.0300.07014.50
5.3.200.0270.03314.52
5.3.190.0330.03014.53
5.3.180.0230.05314.50
5.3.170.0370.06714.45
5.3.160.0330.03014.47
5.3.150.0200.04014.59
5.3.140.0300.04714.38
5.3.130.0300.04314.44
5.3.120.0270.03314.35
5.3.110.0330.06714.49
5.3.100.0230.04013.98
5.3.90.0270.07013.98
5.3.80.0330.05313.86
5.3.70.0330.06713.86
5.3.60.0430.05313.80
5.3.50.0400.04713.78
5.3.40.0330.07013.91
5.3.30.0300.06013.75
5.3.20.0270.04713.52
5.3.10.0170.07313.61
5.3.00.0230.03013.58
5.2.170.0270.04712.86
5.2.160.0200.05712.86
5.2.150.0330.05012.86
5.2.140.0330.04012.86
5.2.130.0270.05312.86
5.2.120.0170.04712.86
5.2.110.0200.02712.86
5.2.100.0100.03712.86
5.2.90.0270.05312.86
5.2.80.0170.05712.86
5.2.70.0170.04312.86
5.2.60.0200.04312.86
5.2.50.0200.05712.86
5.2.40.0200.05712.86
5.2.30.0200.02712.86
5.2.20.0200.05712.86
5.2.10.0130.03012.86
5.2.00.0230.04712.86
5.1.60.0230.05012.86
5.1.50.0200.04012.86
5.1.40.0300.04312.86
5.1.30.0200.03712.86
5.1.20.0130.02712.86
5.1.10.0130.06012.86
5.1.00.0130.06012.86
5.0.50.0100.04312.86
5.0.40.0170.04012.86
5.0.30.0130.06012.86
5.0.20.0100.02312.86
5.0.10.0230.02712.86
5.0.00.0130.06012.86
4.4.90.0100.02712.86
4.4.80.0070.02012.86
4.4.70.0070.02012.86
4.4.60.0130.02312.86
4.4.50.0070.01712.86
4.4.40.0100.02312.86
4.4.30.0130.02712.86
4.4.20.0100.01312.86
4.4.10.0100.04012.86
4.4.00.0130.05012.86
4.3.110.0130.01312.86
4.3.100.0170.01012.86
4.3.90.0170.03012.86
4.3.80.0070.04012.86
4.3.70.0130.03012.86
4.3.60.0100.03312.86
4.3.50.0170.02312.86
4.3.40.0130.04312.86
4.3.30.0070.03312.86
4.3.20.0070.03012.86
4.3.10.0070.03712.86
4.3.00.0030.03712.86

preferences:
45.68 ms | 401 KiB | 5 Q