3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(1 => 'a', 2 => 'b', 3 => 'c'); $b = array_flip(array(1, 2)); print_r(array_replace(array(1, 2), array(2,3, 4)));

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.00416.38
8.3.50.0120.00622.11
8.3.40.0110.00418.44
8.3.30.0170.00318.88
8.3.20.0000.00720.07
8.3.10.0080.00023.66
8.3.00.0080.00019.31
8.2.180.0140.00716.50
8.2.170.0100.01022.96
8.2.160.0070.00720.36
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0080.00019.27
8.2.110.0030.00622.25
8.2.100.0040.00720.40
8.2.90.0040.00419.27
8.2.80.0040.00417.97
8.2.70.0040.00417.50
8.2.60.0040.00417.68
8.2.50.0060.00618.07
8.2.40.0060.00317.78
8.2.30.0040.00418.23
8.2.20.0030.00617.47
8.2.10.0000.00717.92
8.2.00.0000.00717.60
8.1.280.0070.01125.92
8.1.270.0060.00323.97
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0050.00322.18
8.1.230.0000.01118.97
8.1.220.0060.00317.79
8.1.210.0040.00418.77
8.1.200.0100.00017.35
8.1.190.0050.00317.00
8.1.180.0040.00418.10
8.1.170.0000.00818.44
8.1.160.0000.00721.84
8.1.150.0020.00518.46
8.1.140.0040.00417.38
8.1.130.0070.00017.68
8.1.120.0040.00417.35
8.1.110.0080.00217.42
8.1.100.0050.00217.33
8.1.90.0030.00317.28
8.1.80.0040.00417.27
8.1.70.0000.00717.26
8.1.60.0040.00417.44
8.1.50.0030.00517.36
8.1.40.0000.00717.45
8.1.30.0000.00817.46
8.1.20.0040.00417.61
8.1.10.0000.00717.47
8.1.00.0040.00417.38
8.0.300.0070.00018.77
8.0.290.0000.00816.63
8.0.280.0040.00418.24
8.0.270.0040.00417.12
8.0.260.0030.00317.13
8.0.250.0030.00316.78
8.0.240.0060.00316.88
8.0.230.0000.00716.83
8.0.220.0050.00216.81
8.0.210.0000.00716.79
8.0.200.0000.00616.88
8.0.190.0000.00816.78
8.0.180.0040.00316.86
8.0.170.0040.00416.88
8.0.160.0000.00716.84
8.0.150.0030.00316.65
8.0.140.0040.00416.80
8.0.130.0030.00313.20
8.0.120.0040.00416.77
8.0.110.0040.00416.79
8.0.100.0040.00416.70
8.0.90.0000.00816.77
8.0.80.0060.00916.75
8.0.70.0000.00816.85
8.0.60.0070.00016.86
8.0.50.0040.00416.78
8.0.30.0080.01116.95
8.0.20.0140.00617.40
8.0.10.0070.00016.92
8.0.00.0100.00716.71
7.4.330.0050.00015.09
7.4.320.0000.00616.48
7.4.300.0000.00716.36
7.4.290.0070.00016.49
7.4.280.0030.00316.44
7.4.270.0030.00316.41
7.4.260.0000.00716.36
7.4.250.0030.00316.46
7.4.240.0030.00316.41
7.4.230.0040.00416.63
7.4.220.0090.00916.48
7.4.210.0070.00716.56
7.4.200.0000.00716.55
7.4.160.0120.00316.58
7.4.150.0120.00617.40
7.4.140.0130.00417.86
7.4.130.0100.00616.38
7.4.120.0060.01216.56
7.4.110.0070.01016.20
7.4.100.0200.00316.37
7.4.90.0090.00916.36
7.4.80.0060.01119.39
7.4.70.0100.00516.45
7.4.60.0130.00316.49
7.4.50.0050.00016.35
7.4.40.0090.00916.42
7.4.30.0080.00816.41
7.4.00.0070.00814.75
7.3.330.0000.00513.04
7.3.320.0030.00312.85
7.3.310.0000.00716.09
7.3.300.0040.00416.17
7.3.290.0070.01416.15
7.3.280.0120.00616.10
7.3.270.0170.00017.40
7.3.260.0100.00716.13
7.3.250.0120.00716.26
7.3.240.0110.00616.39
7.3.230.0140.00316.39
7.3.210.0100.01016.09
7.3.200.0130.00319.39
7.3.190.0100.00716.27
7.3.180.0140.00316.08
7.3.170.0070.00716.27
7.3.160.0060.01216.24
7.3.120.0050.01214.62
7.3.110.0070.01114.89
7.3.100.0030.01114.54
7.3.90.0090.00314.53
7.3.80.0140.00014.52
7.3.70.0040.00714.39
7.3.60.0100.00714.44
7.3.50.0040.01114.39
7.3.40.0110.00314.63
7.3.30.0090.00614.44
7.3.20.0060.00616.45
7.3.10.0100.00316.49
7.3.00.0060.00616.50
7.2.330.0140.00316.55
7.2.320.0150.01016.52
7.2.310.0130.01016.25
7.2.300.0060.01016.36
7.2.290.0040.01216.41
7.2.250.0130.00314.82
7.2.240.0100.01014.69
7.2.230.0100.00714.63
7.2.220.0070.00714.87
7.2.210.0060.00615.14
7.2.200.0030.01314.69
7.2.190.0110.00414.71
7.2.180.0030.00914.93
7.2.170.0000.00914.91
7.2.00.0000.01119.26
7.1.330.0060.00615.53
7.1.320.0070.00715.67
7.1.310.0060.00615.52
7.1.300.0000.01215.80
7.1.290.0120.00315.67
7.1.280.0000.00915.61
7.1.270.0070.00415.64
7.1.260.0050.00315.29
7.1.100.0040.00718.03
7.1.70.0040.00416.99
7.1.60.0120.00619.70
7.1.50.0030.02116.81
7.1.00.0130.06322.31
7.0.200.0200.00016.50
7.0.140.0000.07721.92
7.0.60.0030.08019.93
7.0.50.0070.05317.85
7.0.40.0100.08320.02
7.0.30.0430.04320.17
7.0.20.0200.04020.33
7.0.10.0200.07320.33
7.0.00.0030.05020.20
5.6.280.0070.07021.04
5.6.210.0100.08020.66
5.6.200.0070.05318.16
5.6.190.0100.08320.50
5.6.180.0300.07320.47
5.6.170.0370.08020.52
5.6.160.0030.09020.57
5.6.150.0100.07718.11
5.6.140.0170.06718.16
5.6.130.0030.06318.13
5.6.120.0030.09021.02
5.6.110.0070.08721.00
5.6.100.0200.06320.98
5.6.90.0070.06021.01
5.6.80.0200.07320.40
5.5.350.0000.09020.42
5.5.340.0100.08318.03
5.5.330.0000.06020.19
5.5.320.3170.04720.27
5.5.310.0270.06320.29
5.5.300.0100.04718.08
5.5.290.0130.07317.93
5.5.280.0030.05720.77
5.5.270.0030.09020.66
5.5.260.0130.03720.75
5.5.250.0070.05020.54
5.5.240.0000.08320.27
5.4.450.0430.07719.55
5.4.440.0130.05019.39
5.4.430.0230.03319.16
5.4.420.0470.05719.48
5.4.410.0500.06319.39
5.4.400.0500.06719.20
5.4.390.0230.07319.16
5.4.380.0270.04019.16
5.4.370.0230.04318.98
5.4.360.0330.06719.00
5.4.350.0200.05018.96
5.4.340.0230.05719.21
5.4.320.0200.03718.84
5.4.310.0130.04319.08
5.4.300.0170.03718.95
5.4.290.0330.06719.21
5.4.280.0200.06719.16
5.4.270.0300.06319.24
5.4.260.0200.08018.87
5.4.250.0570.04719.07
5.4.240.0270.02718.97
5.4.230.0200.05019.05
5.4.220.0230.07018.86
5.4.210.0100.05319.12
5.4.200.0230.03718.94
5.4.190.0200.04319.30
5.4.180.0270.06719.08
5.4.170.0200.06719.20
5.4.160.0170.04019.07
5.4.150.0230.03319.06
5.4.140.0170.03716.30
5.4.130.0230.03016.28
5.4.120.0200.06016.65
5.4.110.0170.04016.43
5.4.100.0100.04316.40
5.4.90.0170.04316.58
5.4.80.0270.03716.23
5.4.70.0230.06716.38
5.4.60.0230.07316.56
5.4.50.0200.03316.16
5.4.40.0230.04016.43
5.4.30.0170.03716.43
5.4.20.0230.03316.22
5.4.10.0170.03316.25
5.4.00.0230.02716.12
5.3.290.0170.03714.74
5.3.280.0230.04014.50
5.3.270.0100.03714.51
5.3.260.0130.03714.64
5.3.250.0330.02314.61
5.3.240.0270.02714.76
5.3.230.0130.05714.57
5.3.220.0300.06314.56
5.3.210.0100.04314.48
5.3.200.0200.04314.69
5.3.190.0200.06314.48
5.3.180.0200.06014.48
5.3.170.0270.03714.64
5.3.160.0230.03014.56
5.3.150.0200.03714.57
5.3.140.0230.03314.54
5.3.130.0170.04314.53
5.3.120.0170.04014.59
5.3.110.0200.04314.51
5.3.100.0170.04314.04
5.3.90.0170.03714.00
5.3.80.0170.04714.15
5.3.70.0270.02714.02
5.3.60.0200.03714.00
5.3.50.0170.03314.09
5.3.40.0200.03313.84
5.3.30.0200.04313.81
5.3.20.0100.04013.80
5.3.10.0270.04013.66
5.3.00.0200.03013.85
5.2.170.0200.05711.00
5.2.160.0130.03011.05
5.2.150.0170.02711.20
5.2.140.0130.03711.00
5.2.130.0200.05711.15
5.2.120.0200.03710.95
5.2.110.0000.03010.98
5.2.100.0030.03311.15
5.2.90.0770.03011.15
5.2.80.2330.03010.95
5.2.70.2230.03711.11
5.2.60.2300.03710.88
5.2.50.2270.03010.89
5.2.40.1870.02710.86
5.2.30.1970.04011.13
5.2.20.1630.02710.96
5.2.10.1770.02311.01
5.2.00.1700.02710.61
5.1.60.1630.0209.88
5.1.50.1230.0279.97
5.1.40.0030.03310.05
5.1.30.0030.02310.23
5.1.20.0030.02710.31
5.1.10.0600.0279.96
5.1.00.1600.0239.96
5.0.50.0800.0208.41
5.0.40.0770.0208.38
5.0.30.0830.0278.23
5.0.20.0870.0208.13
5.0.10.0800.0178.14
5.0.00.0930.0338.38
4.4.90.0930.0207.77
4.4.80.1070.0177.77
4.4.70.0930.0177.77
4.4.60.0970.0237.77
4.4.50.1170.0177.77
4.4.40.1100.0337.77
4.4.30.0830.0137.77
4.4.20.1170.0177.77
4.4.10.1000.0237.77
4.4.00.0900.0277.77
4.3.110.0930.0237.77
4.3.100.0800.0137.77
4.3.90.0930.0237.77
4.3.80.0870.0237.77
4.3.70.1030.0137.77
4.3.60.1000.0207.77
4.3.50.0930.0107.77
4.3.40.0770.0237.77
4.3.30.0570.0277.77
4.3.20.0500.0207.77
4.3.10.0600.0277.77
4.3.00.0700.0237.77

preferences:
45.88 ms | 401 KiB | 5 Q