3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "5,1"; $base = array('1'=>'Bread','5'=>'Butter'); $flipped = array_flip( explode(',', $str)); print_r( $flipped); $intersection = array_intersect_key( $flipped, $base); print_r( $intersection); $replacements = array_values( $intersection); print_r( $replacements);

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.0060.00918.45
8.3.30.0130.00318.59
8.3.20.0000.00818.53
8.3.10.0080.00020.92
8.3.00.0020.00521.73
8.2.170.0040.01122.96
8.2.160.0030.01320.44
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00421.13
8.2.110.0030.00720.14
8.2.100.0110.00017.91
8.2.90.0000.00819.23
8.2.80.0050.00317.97
8.2.70.0000.00817.63
8.2.60.0030.00517.68
8.2.50.0060.00318.07
8.2.40.0000.00818.09
8.2.30.0040.00421.21
8.2.20.0070.00017.57
8.2.10.0000.00717.73
8.2.00.0030.00617.54
8.1.270.0040.00423.99
8.1.260.0090.00926.35
8.1.250.0040.00428.09
8.1.240.0040.00422.53
8.1.230.0080.00320.84
8.1.220.0030.00618.77
8.1.210.0000.00818.85
8.1.200.0030.00617.13
8.1.190.0060.00317.39
8.1.180.0080.00018.10
8.1.170.0040.00418.55
8.1.160.0050.00318.73
8.1.150.0000.00818.60
8.1.140.0070.00017.41
8.1.130.0070.00017.77
8.1.120.0030.00517.30
8.1.110.0040.00417.41
8.1.100.0040.00417.39
8.1.90.0040.00417.28
8.1.80.0050.00317.40
8.1.70.0070.00017.35
8.1.60.0030.00617.45
8.1.50.0050.00317.43
8.1.40.0000.00717.46
8.1.30.0040.00417.55
8.1.20.0000.00917.40
8.1.10.0080.00017.45
8.1.00.0040.00717.35
8.0.300.0110.00019.66
8.0.290.0000.00717.15
8.0.280.0070.00018.44
8.0.270.0030.00317.04
8.0.260.0000.00618.38
8.0.250.0040.00416.80
8.0.240.0040.00416.76
8.0.230.0000.00716.89
8.0.220.0000.00716.74
8.0.210.0070.00016.75
8.0.200.0040.00416.84
8.0.190.0050.00216.93
8.0.180.0040.00416.76
8.0.170.0000.00716.76
8.0.160.0000.00716.71
8.0.150.0070.00016.79
8.0.140.0060.00316.83
8.0.130.0000.00713.20
8.0.120.0000.00816.79
8.0.110.0030.00616.87
8.0.100.0030.00316.77
8.0.90.0040.00416.59
8.0.80.0000.01516.82
8.0.70.0040.00416.82
8.0.60.0000.00716.70
8.0.50.0050.00316.76
8.0.30.0050.01416.97
8.0.20.0110.00817.40
8.0.10.0030.00516.93
8.0.00.0130.00516.66
7.4.330.0030.00316.67
7.4.320.0060.00016.44
7.4.300.0030.00316.49
7.4.290.0050.00216.52
7.4.280.0060.00316.50
7.4.270.0030.00316.48
7.4.260.0000.00613.13
7.4.250.0050.00316.46
7.4.240.0000.00716.45
7.4.230.0070.00016.58
7.4.220.0060.01616.58
7.4.210.0060.00916.48
7.4.200.0000.00916.42
7.4.190.0030.00316.61
7.4.160.0080.00816.57
7.4.150.0060.01317.40
7.4.140.0110.00517.86
7.4.130.0170.00516.53
7.4.120.0130.00316.37
7.4.110.0070.01016.45
7.4.100.0060.01216.57
7.4.90.0110.00716.28
7.4.80.0070.01019.39
7.4.70.0070.00716.36
7.4.60.0130.00316.38
7.4.50.0060.00316.40
7.4.40.0080.01222.77
7.4.30.0130.00316.43
7.4.00.0030.01315.10
7.3.330.0030.00312.96
7.3.320.0030.00212.84
7.3.310.0040.00416.27
7.3.300.0080.00016.14
7.3.290.0140.00316.16
7.3.280.0080.00816.12
7.3.270.0110.00517.40
7.3.260.0120.01118.24
7.3.250.0100.00916.32
7.3.240.0140.00716.10
7.3.230.0030.01316.39
7.3.210.0150.00316.19
7.3.200.0120.00619.39
7.3.190.0070.01016.11
7.3.180.0130.00316.18
7.3.170.0160.00016.59
7.3.160.0060.01016.18
7.3.120.0030.01014.54
7.3.10.0080.00416.56
7.3.00.0070.00316.35
7.2.330.0070.01316.60
7.2.320.0070.01016.57
7.2.310.0100.01316.47
7.2.300.0060.01016.50
7.2.290.0060.00916.54
7.2.130.0070.00716.77
7.2.120.0000.01016.83
7.2.110.0080.00816.77
7.2.100.0030.01016.83
7.2.90.0070.00316.70
7.2.80.0110.00417.02
7.2.70.0040.00716.90
7.2.60.0060.00716.66
7.2.50.0070.00716.65
7.2.40.0040.01216.70
7.2.30.0070.01016.92
7.2.20.0040.00816.73
7.2.10.0090.00616.88
7.2.00.0120.00817.72
7.1.250.0110.00415.44
7.1.200.0080.00415.66
7.1.100.0000.01118.08
7.1.70.0000.00917.02
7.1.60.0100.01019.40
7.1.50.0060.01316.86
7.1.00.0100.07022.29
7.0.200.0200.00916.24
7.0.140.0000.07322.00
7.0.70.0030.04721.61
7.0.60.0070.08021.72
7.0.50.0070.07722.09
7.0.40.0030.08020.13
7.0.30.0100.07720.15
7.0.20.0030.07320.18
7.0.10.0070.06319.99
7.0.00.0000.04720.02
5.6.280.0000.07720.98
5.6.220.0070.07320.52
5.6.210.0100.07020.61
5.6.200.0070.07021.04
5.6.190.0030.08021.01
5.6.180.0000.08720.92
5.6.170.0000.07321.02
5.6.160.0070.07720.98
5.6.150.0070.06320.95
5.6.140.0070.08321.16
5.6.130.0030.08320.98
5.6.120.0030.06721.00
5.6.110.0030.06321.00
5.6.100.0070.07321.00
5.6.90.0030.08021.05
5.6.80.0030.06320.42
5.6.70.0130.07320.30
5.6.60.0030.06720.41
5.6.50.0130.07020.29
5.6.40.0000.07720.48
5.6.30.0230.06020.46
5.6.20.0170.06020.48
5.6.10.0030.08020.39
5.6.00.0030.08020.39
5.5.360.0070.07320.29
5.5.350.0070.07720.39
5.5.340.0000.08020.79
5.5.330.0070.08320.87
5.5.320.0100.07720.92
5.5.310.0070.07720.83
5.5.300.0030.08020.86
5.5.290.0000.09020.79
5.5.280.0030.05020.63
5.5.270.0100.07720.85
5.5.260.0030.07720.61
5.5.250.0000.08020.45
5.5.240.0000.07720.02
5.5.230.0070.07320.15
5.5.220.0130.07020.22
5.5.210.0000.07320.13
5.5.200.0030.08320.23
5.5.190.0070.07319.96
5.5.180.0070.07720.24
5.5.160.0030.08020.14
5.5.150.0070.07720.10
5.5.140.0070.07320.11
5.5.130.0000.08019.98
5.5.120.0130.07020.23
5.5.110.0100.06320.16
5.5.100.0070.07720.15
5.5.90.0130.07020.10
5.5.80.0000.07720.05
5.5.70.0030.07020.03
5.5.60.0030.07720.14
5.5.50.0100.07020.05
5.5.40.0030.07720.14
5.5.30.0030.07720.08
5.5.20.0030.07719.92
5.5.10.0100.07320.11
5.5.00.0030.07720.09
5.4.450.0100.07719.43
5.4.440.0000.09019.37
5.4.430.0070.07019.43
5.4.420.0100.07319.27
5.4.410.0030.06719.10
5.4.400.0000.07319.23
5.4.390.0030.08019.04
5.4.380.0030.07019.04
5.4.370.0030.06319.14
5.4.360.0070.07019.21
5.4.350.0070.07319.09
5.4.340.0000.07318.98
5.4.320.0070.08018.85
5.4.310.0070.07319.02
5.4.300.0100.07019.03
5.4.290.0100.07019.04
5.4.280.0000.08019.11
5.4.270.0070.06319.02
5.4.260.0070.07319.04
5.4.250.0070.07018.83
5.4.240.0030.07319.15
5.4.230.0130.05719.11
5.4.220.0030.06719.02
5.4.210.0100.07318.94
5.4.200.0030.06719.11
5.4.190.0070.06719.01
5.4.180.0100.05719.02
5.4.170.0030.07319.03
5.4.160.0070.06319.10
5.4.150.0030.06718.85
5.4.140.0030.07716.38
5.4.130.0000.06016.14
5.4.120.0030.05316.38
5.4.110.0030.03716.51
5.4.100.0030.06716.43
5.4.90.0030.06316.27
5.4.80.0070.06716.38
5.4.70.0070.06316.41
5.4.60.0030.07016.34
5.4.50.0000.04016.36
5.4.40.0070.07016.30
5.4.30.0030.08016.40
5.4.20.0000.03716.29
5.4.10.0000.03716.36
5.4.00.0000.06715.84
5.3.290.0070.06314.88
5.3.280.0070.07314.88
5.3.270.0000.08014.88
5.3.260.0070.06714.88
5.3.250.0070.06714.88
5.3.240.0100.07014.88
5.3.230.0000.08314.88
5.3.220.0030.06314.88
5.3.210.0030.04314.88
5.3.200.0030.07714.88
5.3.190.0030.07014.88
5.3.180.0030.05714.88
5.3.170.0070.06314.88
5.3.160.0100.06314.88
5.3.150.0070.04014.88
5.3.140.0000.07314.88
5.3.130.0030.06714.88
5.3.120.0030.06014.88
5.3.110.0030.08014.88
5.3.100.0100.04314.88
5.3.90.0030.07714.88
5.3.80.0030.04714.88
5.3.70.0000.03714.88
5.3.60.0100.05014.88
5.3.50.0000.03714.88
5.3.40.0000.04014.88
5.3.30.0000.06714.88
5.3.20.0030.05714.88
5.3.10.0000.03714.88
5.3.00.0000.05314.88
5.2.170.0000.03014.88
5.2.160.0000.03714.88
5.2.150.0030.03014.88
5.2.140.0030.05314.88
5.2.130.0030.05714.88
5.2.120.0000.06714.88
5.2.110.0030.04714.88
5.2.100.0000.03714.88
5.2.90.0000.06014.88
5.2.80.0000.06714.88
5.2.70.0030.03014.88
5.2.60.0000.04014.88
5.2.50.0000.06314.88
5.2.40.0000.04714.88
5.2.30.0000.03014.88
5.2.20.0070.03014.88
5.2.10.0070.02314.88
5.2.00.0000.04014.88
5.1.60.0000.05314.88
5.1.50.0030.05014.88
5.1.40.0000.02714.88
5.1.30.0000.06014.88
5.1.20.0030.05014.88
5.1.10.0100.04014.88
5.1.00.0000.06014.88
5.0.50.0000.04314.88
5.0.40.0000.04714.88
5.0.30.0070.06314.88
5.0.20.0000.04714.88
5.0.10.0070.03014.88
5.0.00.0000.06014.88
4.4.90.0000.02014.88
4.4.80.0070.01714.88
4.4.70.0030.04014.88
4.4.60.0030.02714.88
4.4.50.0000.01714.88
4.4.40.0000.05014.88
4.4.30.0030.01314.88
4.4.20.0000.02314.88
4.4.10.0070.03014.88
4.4.00.0030.04714.88
4.3.110.0030.03314.88
4.3.100.0000.03314.88
4.3.90.0000.03314.88
4.3.80.0000.05714.88
4.3.70.0000.03314.88
4.3.60.0030.03014.88
4.3.50.0030.03314.88
4.3.40.0030.04314.88
4.3.30.0000.03014.88
4.3.20.0070.03014.88
4.3.10.0000.03314.88
4.3.00.0030.03014.88

preferences:
38.39 ms | 400 KiB | 5 Q