3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "1,5"; $base = array('1'=>'Bread','5'=>'Butter'); $flipped = array_flip( explode(',', $str)); print_r( $flipped); print_r( array_merge( $flipped, $base)); $intersection = array_intersect_key( array_merge( $flipped, $base), $flipped); 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.60.0140.00316.38
8.3.50.0150.00517.21
8.3.40.0120.00418.65
8.3.30.0140.00018.57
8.3.20.0080.00018.65
8.3.10.0000.00818.65
8.3.00.0080.00019.26
8.2.180.0090.00616.38
8.2.170.0090.00622.96
8.2.160.0100.00718.66
8.2.150.0060.00324.18
8.2.140.0050.00324.66
8.2.130.0080.00326.16
8.2.120.0030.00519.66
8.2.110.0030.00619.08
8.2.100.0110.00017.70
8.2.90.0090.00019.18
8.2.80.0060.00317.97
8.2.70.0040.00417.50
8.2.60.0040.00417.88
8.2.50.0040.00417.80
8.2.40.0000.00919.23
8.2.30.0030.00617.63
8.2.20.0080.00317.67
8.2.10.0030.00617.57
8.2.00.0080.00317.59
8.1.280.0150.00025.92
8.1.270.0000.00723.99
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0080.00422.23
8.1.230.0080.00417.79
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0000.01017.23
8.1.190.0050.00317.23
8.1.180.0040.00418.10
8.1.170.0080.00017.62
8.1.160.0070.00018.89
8.1.150.0080.00318.58
8.1.140.0040.00417.30
8.1.130.0030.00317.39
8.1.120.0040.00717.41
8.1.110.0040.00417.42
8.1.100.0070.00017.38
8.1.90.0000.00817.46
8.1.80.0040.00417.30
8.1.70.0030.00317.40
8.1.60.0060.00317.48
8.1.50.0050.00217.48
8.1.40.0000.00817.35
8.1.30.0060.00317.52
8.1.20.0100.00417.57
8.1.10.0100.00517.34
8.1.00.0040.00517.25
8.0.300.0000.00818.77
8.0.290.0040.00416.58
8.0.280.0050.00318.43
8.0.270.0000.00717.21
8.0.260.0070.00016.68
8.0.250.0070.00016.78
8.0.240.0060.00316.86
8.0.230.0060.00316.94
8.0.220.0030.00616.77
8.0.210.0080.00016.81
8.0.200.0060.00016.79
8.0.190.0040.00416.77
8.0.180.0040.00416.92
8.0.170.0070.00016.81
8.0.160.0000.00816.80
8.0.150.0080.00216.65
8.0.140.0030.00616.74
8.0.130.0040.00415.59
8.0.120.0040.00516.68
8.0.110.0090.00316.74
8.0.100.0100.00316.75
8.0.90.0090.00516.66
8.0.80.0070.00916.77
8.0.70.0060.00716.71
8.0.60.0040.00716.71
8.0.50.0080.00316.77
8.0.30.0070.00716.87
8.0.20.0090.00816.93
8.0.10.0110.00316.97
8.0.00.0100.00616.78
7.4.330.0000.00512.84
7.4.320.0030.00316.54
7.4.300.0030.00316.52
7.4.290.0070.00016.46
7.4.280.0050.00216.46
7.4.270.0040.00716.39
7.4.260.0050.00415.28
7.4.250.0090.00316.36
7.4.240.0060.00516.40
7.4.230.0040.00816.23
7.4.220.0090.00916.42
7.4.210.0110.00316.45
7.4.200.0060.00516.39
7.4.190.0090.00316.53
7.4.180.0110.00516.44
7.4.160.0100.00516.40
7.4.150.0100.00416.36
7.4.140.0080.00616.79
7.4.130.0060.00616.26
7.4.120.0090.00416.25
7.4.110.0040.01016.39
7.4.100.0090.00516.42
7.4.90.0080.00616.40
7.4.80.0090.00517.29
7.4.70.0050.00816.38
7.4.60.0080.00516.24
7.4.50.0060.00516.37
7.4.40.0090.00516.27
7.4.30.0100.00616.30
7.4.20.0060.00816.26
7.4.10.0080.00516.27
7.4.00.0100.00515.78
7.3.330.0150.00214.97
7.3.320.0140.00514.96
7.3.310.0120.00416.00
7.3.300.0080.00816.06
7.3.290.0110.00716.16
7.3.280.0100.00916.08
7.3.270.0160.00216.19
7.3.260.0130.00516.10
7.3.250.0170.00216.04
7.3.240.0100.00916.13
7.3.230.0160.00416.03
7.3.220.0130.00815.99
7.3.210.0130.00616.13
7.3.200.0110.00816.20
7.3.190.0100.00916.22
7.3.180.0160.00316.06
7.3.170.0080.00916.02
7.3.160.0110.00816.18
7.3.150.0200.00116.07
7.3.140.0150.00515.94
7.3.130.0170.00315.90
7.3.120.0150.00415.52
7.3.110.0160.00415.92
7.3.100.0160.00316.02
7.3.90.0120.00716.46
7.3.80.0150.00415.96
7.3.70.0140.00516.05
7.3.60.0140.00616.26
7.3.50.0150.00616.26
7.3.40.0160.00416.13
7.3.30.0200.00216.25
7.3.20.0160.00418.13
7.3.10.0140.00717.76
7.3.00.0190.00317.75
7.2.340.0160.00616.19
7.2.330.0110.00916.24
7.2.320.0140.00716.14
7.2.310.0130.00816.18
7.2.300.0090.01116.22
7.2.290.0130.00716.20
7.2.280.0170.00416.03
7.2.270.0110.01016.18
7.2.260.0180.00316.03
7.2.250.0130.00716.14
7.2.240.0160.00516.17
7.2.230.0170.00316.11
7.2.220.0130.00716.19
7.2.210.0120.00816.25
7.2.200.0170.00616.31
7.2.190.0210.00216.22
7.2.180.0170.00416.26
7.2.170.0160.00516.28
7.2.160.0130.00716.37
7.2.150.0160.00418.08
7.2.140.0160.00418.18
7.2.130.0160.00318.32
7.2.120.0160.00418.23
7.2.110.0160.00318.24
7.2.100.0150.00718.29
7.2.90.0160.00518.19
7.2.80.0140.00618.17
7.2.70.0130.00718.22
7.2.60.0090.00817.71
7.2.50.0150.00418.19
7.2.40.0170.00318.30
7.2.30.0150.00618.27
7.2.20.0120.00718.11
7.2.10.0130.00618.15
7.2.00.0120.00518.55
7.1.330.0150.00417.15
7.1.320.0110.00617.25
7.1.310.0150.00317.28
7.1.300.0160.00317.14
7.1.290.0110.00617.18
7.1.280.0130.00417.36
7.1.270.0120.00517.35
7.1.260.0140.00617.24
7.1.250.0120.00517.10
7.1.240.0110.00617.07
7.1.230.0170.00117.12
7.1.220.0120.00617.22
7.1.210.0130.00617.08
7.1.200.0120.00416.72
7.1.190.0110.00617.12
7.1.180.0140.00417.22
7.1.170.0160.00317.15
7.1.160.0130.00517.23
7.1.150.0140.00417.11
7.1.140.0150.00217.02
7.1.130.0160.00417.21
7.1.120.0150.00417.09
7.1.110.0160.00317.23
7.1.100.0100.00717.39
7.1.90.0140.00517.00
7.1.80.0080.01017.13
7.1.70.0120.00317.02
7.1.60.0130.00317.16
7.1.50.0110.00917.06
7.1.40.0150.00417.21
7.1.30.0120.00617.19
7.1.20.0130.00517.17
7.1.10.0110.00717.27
7.1.00.0070.01718.79
7.0.330.0140.00316.92
7.0.320.0160.00216.90
7.0.310.0160.00116.71
7.0.300.0180.00016.76
7.0.290.0170.00016.66
7.0.280.0100.00816.89
7.0.270.0130.00316.82
7.0.260.0170.00016.87
7.0.250.0100.00716.92
7.0.240.0100.00616.90
7.0.230.0140.00317.01
7.0.220.0140.00416.83
7.0.210.0150.00416.79
7.0.200.0150.00116.75
7.0.190.0100.00716.90
7.0.180.0130.00516.84
7.0.170.0160.00116.83
7.0.160.0140.00416.86
7.0.150.0120.00616.81
7.0.140.0130.02218.62
7.0.130.0100.00717.04
7.0.120.0090.02818.68
7.0.110.0140.00316.80
7.0.100.0130.00416.76
7.0.90.0110.00516.86
7.0.80.0110.00516.68
7.0.70.0100.00716.79
7.0.60.0070.03118.47
7.0.50.0130.01417.15
7.0.40.0070.02417.91
7.0.30.0160.02317.93
7.0.20.0190.02817.89
7.0.10.0120.02117.99
7.0.00.0100.02117.95
5.6.400.0110.00615.59
5.6.390.0120.00615.47
5.6.380.0140.00315.46
5.6.370.0180.00215.54
5.6.360.0100.00715.52
5.6.350.0110.00615.46
5.6.340.0100.00715.52
5.6.330.0120.00415.61
5.6.320.0160.00115.55
5.6.310.0110.00615.55
5.6.300.0160.00215.55
5.6.290.0140.00315.56
5.6.280.0120.03017.34
5.6.270.0150.00215.69
5.6.260.0100.00615.59
5.6.250.0130.00415.69
5.6.240.0150.00215.73
5.6.230.0130.00515.76
5.6.220.0090.00915.75
5.6.210.0110.03017.32
5.6.200.0100.02216.58
5.6.190.0110.03217.28
5.6.180.0160.01617.34
5.6.170.0180.02717.50
5.6.160.0090.02617.37
5.6.150.0110.02316.64
5.6.140.0100.01716.54
5.6.130.0130.02916.58
5.6.120.0110.01717.57
5.6.110.0150.02817.53
5.6.100.0110.03017.58
5.6.90.0140.02517.46
5.6.80.0130.01917.21
5.6.70.0170.00115.70
5.6.60.0140.00415.81
5.6.50.0160.00415.61
5.6.40.0170.00315.78
5.6.30.0110.00715.68
5.6.20.0130.00515.65
5.6.10.0150.00415.68
5.6.00.0140.00615.63
5.5.380.0190.00015.71
5.5.370.0140.00515.85
5.5.360.0140.00315.51
5.5.350.0100.02517.17
5.5.340.0090.03116.39
5.5.330.0130.02217.19
5.5.320.0220.01717.07
5.5.310.0180.02917.20
5.5.300.0130.02816.38
5.5.290.0090.02216.47
5.5.280.0160.02717.27
5.5.270.0190.02517.40
5.5.260.0100.03217.21
5.5.250.0130.03017.45
5.5.240.0130.01317.22
5.5.230.0150.00215.63
5.5.220.0120.00515.63
5.5.210.0130.00315.78
5.5.200.0140.00215.58
5.5.190.0120.00415.50
5.5.180.0140.00215.42
5.5.170.0140.00215.43
5.5.160.0120.00315.44
5.5.150.0140.00215.35
5.5.140.0120.00415.48
5.5.130.0130.00315.44
5.5.120.0130.00215.46
5.5.110.0120.00515.32
5.5.100.0150.00215.66
5.5.90.0150.00115.57
5.5.80.0120.00415.49
5.5.70.0140.00215.73
5.5.60.0140.00215.53
5.5.50.0130.00315.56
5.5.40.0140.00115.52
5.5.30.0140.00115.68
5.5.20.0150.00115.67
5.5.10.0120.00315.53
5.5.00.0090.00715.42
5.4.450.0060.02514.99
5.4.440.0100.02814.74
5.4.430.0080.01514.89
5.4.420.0110.02915.02
5.4.410.0110.01814.66
5.4.400.0110.02914.73
5.4.390.0100.02414.74
5.4.380.0090.01714.74
5.4.370.0110.01114.67
5.4.360.0080.01714.82
5.4.350.0070.02114.73
5.4.340.0090.02914.76
5.4.330.0140.00012.63
5.4.320.0090.02114.73
5.4.310.0120.02214.78
5.4.300.0110.02114.75
5.4.290.0110.02314.78
5.4.280.0110.02814.87
5.4.270.0120.02314.79
5.4.260.0100.02714.66
5.4.250.0120.02614.54
5.4.240.0100.02214.63
5.4.230.0060.03114.43
5.4.220.0120.02014.57
5.4.210.0080.02514.57
5.4.200.0150.02314.63
5.4.190.0120.02014.62
5.4.180.0080.02714.61
5.4.170.0110.02514.76
5.4.160.0070.02014.41
5.4.150.0090.02014.70
5.4.140.0100.01313.71
5.4.130.0080.01413.87
5.4.120.0090.01713.88
5.4.110.0100.02814.06
5.4.100.0100.01713.89
5.4.90.0080.03013.82
5.4.80.0080.02513.82
5.4.70.0120.01313.95
5.4.60.0080.01413.89
5.4.50.0110.02713.70
5.4.40.0110.01913.76
5.4.30.0100.02514.01
5.4.20.0130.02014.00
5.4.10.0110.02713.95
5.4.00.0090.02113.58
5.3.290.0120.03013.65
5.3.280.0070.02713.60
5.3.270.0130.02613.45
5.3.260.0090.01713.55
5.3.250.0110.01413.53
5.3.240.0080.01813.34
5.3.230.0100.02613.46
5.3.220.0100.02713.40
5.3.210.0080.01813.43
5.3.200.0150.02313.62
5.3.190.0050.02113.52
5.3.180.0100.02713.54
5.3.170.0130.01813.61
5.3.160.0110.01413.56
5.3.150.0080.02513.47
5.3.140.0110.02413.57
5.3.130.0100.02613.44
5.3.120.0100.02413.40
5.3.110.0110.03113.36
5.3.100.0080.02813.45
5.3.90.0080.02613.32
5.3.80.0100.02313.25
5.3.70.0080.01813.13
5.3.60.0130.02413.26
5.3.50.0080.02413.21
5.3.40.0080.02513.30
5.3.30.0060.03013.23
5.3.20.0090.02313.24
5.3.10.0060.02713.06
5.3.00.0080.02213.07

preferences:
46.26 ms | 401 KiB | 5 Q