3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array ( 1 => 'one', 2 => 'two', 3 => 'three', 4 => 'four' ); $comma_separated = implode(", ", $arr); echo preg_replace('/\,([^,]+)$/', ' and $1', $comma_separated);

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.4.140.0150.00717.58
8.4.130.0120.00918.02
8.4.120.0110.00820.94
8.4.110.0130.00822.25
8.4.100.0090.01117.96
8.4.90.0100.01120.55
8.4.80.0040.00718.85
8.4.70.0030.00518.89
8.4.60.0160.00618.65
8.4.50.0130.00817.91
8.4.40.0160.00320.71
8.4.30.0070.01417.67
8.4.20.0100.01017.63
8.4.10.0030.00617.84
8.3.270.0130.00916.57
8.3.260.0100.00916.50
8.3.250.0090.00718.66
8.3.240.0080.01016.62
8.3.230.0130.00616.45
8.3.220.0100.00718.89
8.3.210.0100.01316.62
8.3.200.0060.00316.61
8.3.190.0080.00716.95
8.3.180.0060.00416.53
8.3.170.0110.00717.26
8.3.160.0090.00916.62
8.3.150.0030.01618.81
8.3.140.0050.00318.41
8.3.130.0050.00316.66
8.3.120.0000.00820.57
8.3.110.0130.00320.94
8.3.100.0060.00316.79
8.3.90.0030.00526.77
8.3.80.0090.00017.97
8.3.70.0120.00616.59
8.3.60.0150.00416.88
8.3.50.0150.00921.02
8.3.40.0040.01118.89
8.3.30.0040.01118.78
8.3.20.0080.00018.76
8.3.10.0040.00421.79
8.3.00.0080.00020.90
8.2.290.0110.00817.13
8.2.280.0120.00622.38
8.2.270.0140.00716.82
8.2.260.0030.01618.79
8.2.250.0070.00418.50
8.2.240.0030.00617.29
8.2.230.0160.00022.58
8.2.220.0040.00424.06
8.2.210.0040.00426.77
8.2.200.0090.00018.29
8.2.190.0070.00716.58
8.2.180.0120.00618.63
8.2.170.0070.01422.96
8.2.160.0070.00719.04
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0030.00526.16
8.2.120.0080.00019.38
8.2.110.0070.00421.19
8.2.100.0040.00717.91
8.2.90.0000.00818.99
8.2.80.0040.00417.97
8.2.70.0000.01117.63
8.2.60.0040.00417.92
8.2.50.0050.00318.10
8.2.40.0080.00020.43
8.2.30.0070.00020.66
8.2.20.0040.00417.69
8.2.10.0040.00418.00
8.2.00.0000.00718.08
8.1.330.0100.00816.12
8.1.320.0110.00716.38
8.1.310.0060.00316.73
8.1.300.0080.00020.21
8.1.290.0030.00730.84
8.1.280.0070.01125.92
8.1.270.0060.00323.76
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00623.98
8.1.230.0070.00417.77
8.1.220.0080.00017.79
8.1.210.0040.00418.77
8.1.200.0090.00017.35
8.1.190.0050.00319.29
8.1.180.0030.00618.10
8.1.170.0030.00518.49
8.1.160.0000.00722.11
8.1.150.0000.00818.75
8.1.140.0080.00019.57
8.1.130.0070.00017.53
8.1.120.0040.00417.51
8.1.110.0000.00717.52
8.1.100.0040.00417.53
8.1.90.0000.00717.45
8.1.80.0050.00317.43
8.1.70.0000.00717.50
8.1.60.0060.00317.62
8.1.50.0030.00717.45
8.1.40.0080.00017.49
8.1.30.0050.00317.75
8.1.20.0080.00017.75
8.1.10.0080.00017.48
8.1.00.0000.00717.54
8.0.300.0040.00418.77
8.0.290.0080.00016.88
8.0.280.0000.00718.48
8.0.270.0000.00717.27
8.0.260.0030.00517.27
8.0.250.0000.00717.09
8.0.240.0040.00416.96
8.0.230.0040.00417.06
8.0.220.0040.00416.86
8.0.210.0070.00016.84
8.0.200.0030.00316.95
8.0.190.0030.00617.01
8.0.180.0040.00416.83
8.0.170.0000.00716.92
8.0.160.0040.00417.00
8.0.150.0070.00016.80
8.0.140.0000.00716.80
8.0.130.0000.00713.47
8.0.120.0080.00016.93
8.0.110.0040.00316.88
8.0.100.0070.00016.78
8.0.90.0030.00316.97
8.0.80.0070.00716.99
8.0.70.0070.00016.93
8.0.60.0040.00416.89
8.0.50.0040.00416.81
8.0.30.0090.00917.07
8.0.20.0100.00817.44
8.0.10.0040.00416.88
8.0.00.0110.00916.93
7.4.330.0000.00515.08
7.4.320.0030.00316.61
7.4.300.0000.00616.77
7.4.290.0000.00716.64
7.4.280.0050.00216.75
7.4.270.0030.00316.63
7.4.260.0030.00316.71
7.4.250.0050.00216.73
7.4.240.0040.00416.64
7.4.230.0030.00316.74
7.4.220.0030.01416.68
7.4.210.0090.00616.80
7.4.200.0040.00416.69
7.4.160.0040.01516.75
7.4.150.0000.01717.40
7.4.140.0110.00717.86
7.4.130.0080.01116.70
7.4.120.0020.01816.74
7.4.110.0080.00816.48
7.4.100.0060.01316.60
7.4.90.0140.00616.61
7.4.80.0130.00619.39
7.4.70.0140.00416.57
7.4.60.0100.01016.65
7.4.50.0070.00716.76
7.4.40.0090.01216.68
7.4.30.0130.00316.54
7.4.00.0050.00515.00
7.3.330.0030.00313.00
7.3.320.0000.00513.16
7.3.310.0000.00716.23
7.3.300.0030.00316.26
7.3.290.0070.01216.29
7.3.280.0100.00816.22
7.3.270.0150.00317.40
7.3.260.0030.01616.67
7.3.250.0140.00316.54
7.3.240.0100.00916.50
7.3.230.0060.01016.41
7.3.210.0100.00716.65
7.3.200.0120.00416.31
7.3.190.0080.00916.35
7.3.180.0100.00616.67
7.3.170.0100.00716.64
7.3.160.0100.01016.63
7.2.330.0090.00916.64
7.2.320.0090.00916.66
7.2.310.0120.00416.88
7.2.300.0080.00816.70
7.2.290.0070.01116.89
7.2.60.0040.00416.99
7.2.00.0000.01619.73
7.1.200.0000.01216.01
7.1.100.0070.00718.28
7.1.70.0090.00317.08
7.1.60.0120.00620.41
7.1.00.0000.08022.46
7.0.200.0460.00414.33
7.0.60.0200.05719.92
7.0.50.0100.04017.87
7.0.40.0800.06020.14
7.0.30.0600.06320.16
7.0.20.0570.06320.00
7.0.10.0670.05720.27
7.0.00.0870.05020.26
5.6.280.0100.06721.10
5.6.210.0100.09020.73
5.6.200.0100.05318.22
5.6.190.0630.06720.37
5.6.180.0500.05720.61
5.6.170.0530.05720.36
5.6.160.0430.06320.53
5.6.150.0530.05320.33
5.6.140.0530.06020.42
5.6.130.0600.06320.24
5.6.120.0500.06020.29
5.6.110.0230.07720.31
5.6.100.0470.06020.28
5.6.90.0630.04720.26
5.6.80.0600.05719.71
5.6.70.0570.05719.62
5.6.60.0430.06019.73
5.6.50.0500.05319.67
5.6.40.0600.05319.77
5.6.30.0430.06019.59
5.6.20.0500.05319.77
5.6.10.0630.04719.65
5.6.00.0530.05719.64
5.5.350.0130.04020.38
5.5.340.0000.07317.99
5.5.330.0370.06020.23
5.5.320.0670.04720.36
5.5.310.0570.05320.43
5.5.300.0530.06320.12
5.5.290.0600.05320.11
5.5.280.0500.05720.31
5.5.270.0570.06320.22
5.5.260.0530.05720.08
5.5.250.0470.05319.75
5.5.240.0470.06319.38
5.5.230.0600.04719.50
5.5.220.0570.04719.47
5.5.210.0530.05719.38
5.5.200.0600.05319.45
5.5.190.0430.06019.45
5.5.180.0400.05719.55
5.5.160.0530.05719.66
5.5.150.0470.06019.45
5.5.140.0130.05319.58
5.5.130.0070.06019.47
5.5.120.0470.05319.48
5.5.110.0530.04719.48
5.5.100.0670.05319.39
5.5.90.0470.05319.46
5.5.80.0200.05719.38
5.5.70.0630.05319.37
5.5.60.0600.07019.38
5.5.50.0570.04719.43
5.5.40.0530.05319.25
5.5.30.0600.05719.51
5.5.20.0630.05019.46
5.5.10.0570.06719.28
5.5.00.0630.06019.38

preferences:
149.84 ms | 403 KiB | 5 Q