3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array('field1' => 'toast', 'field2' => 'butter'); $array2 = array('field1' => 'toast', 'field2' => 'margerine', 'field3' => 'tea'); $keys = array(); print_r(array_diff_key($array1, $array2)); foreach($array2 as $key=>$value) { $t = 0; foreach($array1 as $key2=>$value2) { if($value == $value2) { $t++; } } if($t==0) array_push($keys, $key); } print_r($keys);

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.40.0090.00618.54
8.3.30.0110.00420.22
8.3.20.0040.00420.16
8.3.10.0000.00821.96
8.3.00.0100.00722.34
8.2.170.0110.00422.96
8.2.160.0030.01020.38
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0110.00726.16
8.2.120.0040.00419.66
8.2.110.0060.00322.25
8.2.100.0070.00419.28
8.2.90.0090.00019.30
8.2.80.0050.00319.34
8.2.70.0000.00917.63
8.2.60.0030.00517.80
8.2.50.0000.00818.07
8.2.40.0000.00718.34
8.2.30.0040.00418.11
8.2.20.0040.00417.50
8.2.10.0040.00417.73
8.2.00.0040.00417.66
8.1.270.0090.00920.28
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0070.00323.98
8.1.230.0080.00319.16
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0060.00317.36
8.1.190.0050.00317.53
8.1.180.0050.00218.86
8.1.170.0000.00918.59
8.1.160.0000.00722.09
8.1.150.0080.00018.61
8.1.140.0040.00417.50
8.1.130.0030.00317.77
8.1.120.0000.00717.43
8.1.110.0070.00017.45
8.1.100.0050.00217.45
8.1.90.0040.00417.43
8.1.80.0000.00717.34
8.1.70.0030.00317.36
8.1.60.0050.00717.58
8.1.50.0030.00517.52
8.1.40.0040.00417.50
8.1.30.0040.00417.64
8.1.20.0040.00417.70
8.1.10.0000.00717.44
8.1.00.0060.00317.31
8.0.300.0070.00018.77
8.0.290.0050.00317.04
8.0.280.0000.00818.44
8.0.270.0000.00717.21
8.0.260.0000.00616.86
8.0.250.0000.00716.96
8.0.240.0030.00616.84
8.0.230.0020.00516.87
8.0.220.0000.00716.92
8.0.210.0070.00016.77
8.0.200.0000.00816.93
8.0.190.0030.00616.89
8.0.180.0000.00716.73
8.0.170.0070.00016.80
8.0.160.0000.00716.87
8.0.150.0040.00416.91
8.0.140.0000.00716.86
8.0.130.0030.00313.27
8.0.120.0020.00516.85
8.0.110.0000.00816.79
8.0.100.0070.00016.77
8.0.90.0040.00416.78
8.0.80.0110.00716.80
8.0.70.0070.00016.76
8.0.60.0000.00716.93
8.0.50.0000.00716.93
8.0.30.0100.00717.01
8.0.20.0230.00517.40
8.0.10.0040.00416.87
8.0.00.0110.00716.78
7.4.330.0000.00515.00
7.4.320.0000.00616.43
7.4.300.0000.00616.54
7.4.290.0000.00616.59
7.4.280.0000.00616.49
7.4.270.0050.00516.60
7.4.260.0040.00416.43
7.4.250.0040.00416.44
7.4.240.0030.00416.50
7.4.230.0000.00616.23
7.4.220.0080.00816.45
7.4.210.0120.00216.60
7.4.200.0000.00716.41
7.4.190.0000.00716.63
7.4.160.0110.00416.38
7.4.150.0170.00317.40
7.4.140.0120.00717.86
7.4.130.0060.01316.48
7.4.120.0070.00916.47
7.4.110.0030.01416.59
7.4.100.0100.00916.43
7.4.90.0160.00416.53
7.4.80.0070.01019.39
7.4.70.0040.01816.36
7.4.60.0060.01016.43
7.4.50.0030.00516.41
7.4.40.0070.00722.77
7.4.30.0060.00916.49
7.4.00.0070.00715.10
7.3.330.0000.00613.09
7.3.320.0050.00013.16
7.3.310.0000.00716.09
7.3.300.0060.00016.25
7.3.290.0050.01016.25
7.3.280.0090.00616.31
7.3.270.0200.00517.40
7.3.260.0040.01216.50
7.3.250.0110.00716.38
7.3.240.0030.01616.28
7.3.230.0060.01016.39
7.3.210.0090.00616.27
7.3.200.0140.00319.39
7.3.190.0090.01216.39
7.3.180.0090.00616.55
7.3.170.0060.01316.36
7.3.160.0090.00616.47
7.3.120.0080.00314.81
7.2.330.0130.00316.30
7.2.320.0060.01216.42
7.2.310.0130.01016.39
7.2.300.0030.01316.36
7.2.290.0110.00716.57
7.2.00.0100.00319.48
7.1.100.0030.00617.70
7.1.70.0040.00716.95
7.1.60.0110.01519.29
7.1.50.0030.02116.64
7.1.00.0000.04322.43
7.0.200.0430.00414.41
7.0.140.0100.08321.99
7.0.60.0370.07319.96
7.0.50.0070.05017.72
7.0.40.0130.07720.29
7.0.30.0330.08020.13
7.0.20.0330.06320.30
7.0.10.0070.09020.10
7.0.00.0000.06320.26
5.6.280.0030.07320.77
5.6.210.0000.04720.47
5.6.200.0070.08018.18
5.6.190.0030.04720.50
5.6.180.0530.04320.64
5.6.170.0200.03720.55
5.6.160.0100.05020.49
5.6.150.0100.08318.21
5.6.140.0100.04718.23
5.6.130.0030.04718.15
5.6.120.0070.06020.96
5.6.110.0100.04021.01
5.6.100.0070.08320.88
5.6.90.0100.06320.96
5.6.80.0070.08020.53
5.5.350.0170.06320.43
5.5.340.0070.08017.95
5.5.330.0130.07020.19
5.5.320.0330.05720.28
5.5.310.0170.07720.50
5.5.300.0130.07318.08
5.5.290.0030.04017.93
5.5.280.0070.06720.68
5.5.270.0070.05320.79
5.5.260.0130.03320.72
5.5.250.0100.05020.68
5.5.240.0230.07020.15
5.4.450.0100.07319.43
5.4.440.3670.04019.45
5.4.430.4400.04019.56
5.4.420.0100.04019.46
5.4.410.0100.04719.42
5.4.400.3900.03719.20
5.4.390.3470.03319.23
5.4.380.3700.04019.22
5.4.370.3930.04319.13
5.4.360.3830.04319.13
5.4.350.3570.04719.19
5.4.340.4070.03319.26
5.4.320.3930.04319.22
5.4.310.4730.03019.22
5.4.300.4670.03019.17
5.4.290.4530.04319.22
5.4.280.3930.04319.24
5.4.270.3800.03319.25
5.4.260.4500.04719.10
5.4.250.3770.03319.21
5.4.240.4170.03319.00
5.4.230.4000.04319.21
5.4.220.0870.04019.14
5.4.210.1500.03718.98
5.4.200.3030.03319.21
5.4.190.3730.03319.09
5.4.180.3570.04319.03
5.4.170.3600.04319.05
5.4.160.3230.03319.11
5.4.150.3630.04019.17
5.4.140.3670.04316.54
5.4.130.2630.03016.39
5.4.120.3200.03716.46
5.4.110.3830.03016.37
5.4.100.2070.04316.45
5.4.90.3970.03016.45
5.4.80.3870.03316.46
5.4.70.3730.03016.51
5.4.60.3570.04016.23
5.4.50.4070.04316.45
5.4.40.4100.03316.45
5.4.30.3870.03016.22
5.4.20.4730.04716.52
5.4.10.3800.04016.45
5.4.00.3630.04015.93
5.3.290.4300.03714.80
5.3.280.4030.04014.58
5.3.270.3230.04014.61
5.3.260.3230.03714.61
5.3.250.2770.03714.60
5.3.240.3100.03714.61
5.3.230.3400.03714.66
5.3.220.3730.03314.60
5.3.210.3870.03714.48
5.3.200.3830.03314.61
5.3.190.3970.03314.55
5.3.180.4600.03714.57
5.3.170.4200.03314.63
5.3.160.3700.04014.61
5.3.150.3800.03014.55
5.3.140.3870.03714.57
5.3.130.4170.04314.48
5.3.120.3930.04014.59
5.3.110.4230.04014.70
5.3.100.3830.03714.04
5.3.90.4530.03314.02
5.3.80.4670.02713.96
5.3.70.4370.03014.07
5.3.60.4470.03713.99
5.3.50.3800.04013.93
5.3.40.3570.04013.82
5.3.30.4030.03313.95
5.3.20.4630.04013.75
5.3.10.3900.03313.82
5.3.00.3830.04713.73
5.2.170.3330.03011.02
5.2.160.3230.03011.29
5.2.150.3300.03311.06
5.2.140.3270.02311.09
5.2.130.3500.03711.02
5.2.120.2930.03711.17
5.2.110.3400.03011.01
5.2.100.3230.02711.13
5.2.90.3000.03011.25
5.2.80.3600.02311.05
5.2.70.3500.03011.08
5.2.60.3330.03011.01
5.2.50.3400.03010.93
5.2.40.1400.03310.88
5.2.30.0070.04710.94
5.2.20.0070.05710.98
5.2.10.0100.04010.77
5.2.00.2900.02710.68
5.1.60.3200.0239.94
5.1.50.2870.0179.99
5.1.40.2900.0209.98
5.1.30.3130.02310.34
5.1.20.2930.02010.35
5.1.10.3200.02710.02
5.1.00.2930.0239.91
5.0.50.1700.0238.63
5.0.40.1700.0208.42
5.0.30.1770.0338.29
5.0.20.1370.0278.27
5.0.10.1400.0208.33
5.0.00.1270.0278.30
4.4.90.1270.0177.58
4.4.80.1630.0207.58
4.4.70.0130.0277.58
4.4.60.0030.0337.58
4.4.50.0000.0307.58
4.4.40.1970.0237.58
4.4.30.1730.0137.58
4.4.20.1530.0207.58
4.4.10.1800.0137.58
4.4.00.1870.0207.58
4.3.110.1830.0137.58
4.3.100.1700.0177.58
4.3.90.1200.0177.58
4.3.80.1370.0307.58
4.3.70.1430.0137.58
4.3.60.1570.0177.58
4.3.50.1600.0177.58
4.3.40.1570.0237.58
4.3.30.0830.0177.58
4.3.20.0770.0237.58
4.3.10.0630.0177.58
4.3.00.0800.0177.58

preferences:
39.13 ms | 400 KiB | 5 Q