3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = ',,,,,apples,,,,,,oranges,pears,,kiwis,,'; $string = preg_replace("/,+/", ",", $str); echo trim($string,',');

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.120.0140.00620.25
8.4.110.0100.00218.95
8.4.100.0100.01117.90
8.4.90.0130.00717.96
8.4.80.0050.00322.43
8.4.70.0080.01218.13
8.4.60.0110.00918.86
8.4.50.0110.00818.10
8.4.40.0060.01319.55
8.4.30.0070.01317.66
8.4.20.0100.01017.78
8.4.10.0040.00417.87
8.3.250.0090.01018.66
8.3.240.0100.00916.67
8.3.230.0130.00616.54
8.3.220.0070.01116.84
8.3.210.0100.00816.78
8.3.200.0050.00416.63
8.3.190.0070.01118.81
8.3.180.0120.00618.42
8.3.170.0160.00316.69
8.3.160.0060.01216.47
8.3.150.0150.00418.76
8.3.140.0150.00317.01
8.3.130.0040.00418.61
8.3.120.0030.00520.53
8.3.110.0040.00416.63
8.3.100.0030.00624.06
8.3.90.0040.00426.77
8.3.80.0070.00318.30
8.3.70.0100.01018.16
8.3.60.0190.00318.63
8.3.50.0120.00621.95
8.3.40.0070.00719.02
8.3.30.0140.00018.86
8.3.20.0000.00820.34
8.3.10.0030.00620.61
8.3.00.0060.00320.57
8.2.290.0100.01020.62
8.2.280.0090.00620.31
8.2.270.0100.00616.52
8.2.260.0140.00320.50
8.2.250.0090.00918.52
8.2.240.0130.00718.96
8.2.230.0060.00320.94
8.2.220.0060.00337.54
8.2.210.0030.01426.77
8.2.200.0030.00718.63
8.2.190.0110.00716.75
8.2.180.0170.00017.00
8.2.170.0110.00322.96
8.2.160.0130.00321.94
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0000.00819.00
8.2.120.0000.00726.35
8.2.110.0100.00320.35
8.2.100.0080.00317.84
8.2.90.0040.00418.22
8.2.80.0040.00418.04
8.2.70.0000.00817.75
8.2.60.0060.00317.88
8.2.50.0000.00817.63
8.2.40.0050.00319.60
8.2.30.0040.00418.14
8.2.20.0030.00517.79
8.2.10.0070.00018.07
8.2.00.0000.00818.07
8.1.330.0120.00616.94
8.1.320.0110.00916.44
8.1.310.0090.00016.88
8.1.300.0090.00019.90
8.1.290.0060.00630.84
8.1.280.0150.00625.92
8.1.270.0040.00423.97
8.1.260.0070.00328.09
8.1.250.0050.00328.09
8.1.240.0000.00923.96
8.1.230.0090.00320.91
8.1.220.0000.00817.78
8.1.210.0060.00318.91
8.1.200.0040.00417.38
8.1.190.0040.00417.23
8.1.180.0030.00618.10
8.1.170.0000.00717.62
8.1.160.0040.00418.90
8.1.150.0040.00418.95
8.1.140.0040.00419.54
8.1.130.0000.00817.71
8.1.120.0000.00717.52
8.1.110.0070.00017.53
8.1.100.0040.00417.55
8.1.90.0080.00017.48
8.1.80.0000.00817.55
8.1.70.0040.00417.54
8.1.60.0040.00417.68
8.1.50.0090.00017.54
8.1.40.0000.00717.55
8.1.30.0030.00517.62
8.1.20.0000.00717.55
8.1.10.0050.00317.67
8.1.00.0040.00417.63
8.0.300.0000.00720.03
8.0.290.0000.00716.88
8.0.280.0040.00418.48
8.0.270.0070.00017.23
8.0.260.0030.00317.18
8.0.250.0030.00317.10
8.0.240.0000.00817.16
8.0.230.0000.00716.96
8.0.220.0020.00516.90
8.0.210.0000.00716.94
8.0.200.0000.00817.02
8.0.190.0000.00716.96
8.0.180.0070.00016.98
8.0.170.0040.00416.89
8.0.160.0000.00716.93
8.0.150.0070.00016.88
8.0.140.0070.00016.89
8.0.130.0000.00613.37
8.0.120.0000.00916.91
8.0.110.0040.00416.98
8.0.100.0040.00417.03
8.0.90.0000.00716.75
8.0.80.0060.00916.91
8.0.70.0070.00016.86
8.0.60.0080.00017.08
8.0.50.0040.00416.92
8.0.30.0110.00717.08
8.0.20.0110.01017.45
8.0.10.0000.00817.04
8.0.00.0110.00916.99
7.4.330.0050.00016.78
7.4.320.0000.00616.76
7.4.300.0060.00016.55
7.4.290.0030.00316.58
7.4.280.0050.00316.65
7.4.270.0040.00416.56
7.4.260.0050.00216.67
7.4.250.0050.00316.53
7.4.240.0030.00316.75
7.4.230.0040.00416.77
7.4.220.0120.01216.80
7.4.210.0030.01016.72
7.4.200.0000.00716.55
7.4.160.0180.00016.61
7.4.150.0070.01217.40
7.4.140.0120.00817.86
7.4.130.0020.01516.66
7.4.120.0080.01316.76
7.4.110.0110.00716.59
7.4.100.0060.01216.76
7.4.90.0130.00316.59
7.4.80.0180.00519.39
7.4.70.0060.01016.53
7.4.60.0030.01316.61
7.4.50.0030.01316.62
7.4.40.0110.00616.76
7.4.30.0060.00916.63
7.4.00.0030.01215.22
7.3.330.0000.00513.10
7.3.320.0070.00013.02
7.3.310.0030.00316.21
7.3.300.0050.00216.30
7.3.290.0000.00616.28
7.3.280.0090.00816.26
7.3.270.0160.00317.40
7.3.260.0040.01416.70
7.3.250.0130.00416.48
7.3.240.0070.01016.51
7.3.230.0100.00616.39
7.3.210.0100.01016.30
7.3.200.0140.00316.35
7.3.190.0100.01016.29
7.3.180.0120.00416.51
7.3.170.0100.01016.53
7.3.160.0090.01416.32
7.2.330.0040.01216.89
7.2.320.0070.01116.78
7.2.310.0170.00016.68
7.2.300.0090.00916.71
7.2.290.0060.00916.64
7.2.110.0220.00716.61
7.2.60.0060.00916.65
7.1.200.0090.00615.86
7.1.100.0070.00418.41
7.1.70.0070.00717.16
7.1.60.0070.01719.77
7.1.50.0030.00817.18
7.1.00.0030.07722.32
7.0.200.0000.00916.91
7.0.60.0230.08021.73
7.0.50.0100.07017.92
7.0.40.0200.07020.10
7.0.30.0230.04320.20
7.0.20.0200.07720.18
7.0.10.0070.04020.02
7.0.00.0070.04020.22
5.6.280.0070.07321.11
5.6.210.0070.08020.76
5.6.200.0000.07718.16
5.6.190.0100.07020.56
5.6.180.0330.06020.43
5.6.170.0270.07720.33
5.6.160.0100.07720.48
5.6.150.0100.06018.11
5.6.140.0100.07718.10
5.6.130.0030.05318.18
5.6.120.0070.05321.01
5.6.110.0070.08321.08
5.6.100.0070.08020.97
5.6.90.0100.06720.98
5.6.80.0070.08020.52
5.5.350.0370.05720.42
5.5.340.0100.08017.92
5.5.330.0070.04720.37
5.5.320.0300.07020.34
5.5.310.0230.05320.15
5.5.300.0030.08017.90
5.5.290.0070.07317.98
5.5.280.0030.07720.86
5.5.270.0000.04720.87
5.5.260.0070.08020.70
5.5.250.0030.08720.70
5.5.240.0170.04320.18

preferences:
28.29 ms | 403 KiB | 5 Q