3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "ABCDE "; $array = array(); $array[] = trim($string); $array[] = preg_replace('/\s+/', '', $string); $array[] = preg_replace('/\s\s+/', '', $string); $array[] = trim(preg_replace('/[\s\t\n\r\s]+/', '', $string)); $array[] = preg_replace('/~\x{00a0}~siu/', '', $string); $array[] = str_replace(array("\t", "\n", "\r"), '', $string); var_dump($array);

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.0090.00616.88
8.3.50.0110.00723.00
8.3.40.0040.01218.71
8.3.30.0090.00618.92
8.3.20.0040.00420.34
8.3.10.0030.00623.71
8.3.00.0060.00319.50
8.2.180.0040.01118.54
8.2.170.0180.00322.96
8.2.160.0080.00820.38
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0090.00921.28
8.2.110.0040.00420.53
8.2.100.0060.00618.03
8.2.90.0030.00619.22
8.2.80.0030.00517.97
8.2.70.0030.00617.38
8.2.60.0030.00618.04
8.2.50.0040.00418.07
8.2.40.0040.00418.09
8.2.30.0000.00719.34
8.2.20.0000.00717.82
8.2.10.0000.00717.97
8.2.00.0050.00217.75
8.1.280.0150.00625.92
8.1.270.0040.00423.84
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00323.83
8.1.230.0100.00019.15
8.1.220.0040.00717.74
8.1.210.0040.00418.77
8.1.200.0000.00917.48
8.1.190.0040.00417.22
8.1.180.0030.00618.10
8.1.170.0080.00018.63
8.1.160.0070.00021.88
8.1.150.0000.00718.85
8.1.140.0040.00417.45
8.1.130.0030.00317.84
8.1.120.0070.00017.45
8.1.110.0040.00417.52
8.1.100.0000.00817.57
8.1.90.0050.00317.51
8.1.80.0060.00317.50
8.1.70.0030.00517.41
8.1.60.0060.00617.63
8.1.50.0000.00817.55
8.1.40.0040.00417.63
8.1.30.0030.00617.60
8.1.20.0050.00317.55
8.1.10.0040.00417.60
8.1.00.0050.00217.54
8.0.300.0090.00018.77
8.0.290.0030.00516.75
8.0.280.0030.00418.46
8.0.270.0050.00317.20
8.0.260.0030.00317.22
8.0.250.0070.00016.93
8.0.240.0040.00417.07
8.0.230.0040.00416.96
8.0.220.0070.00016.97
8.0.210.0040.00417.04
8.0.200.0030.00317.04
8.0.190.0000.00817.03
8.0.180.0040.00417.05
8.0.170.0000.00816.95
8.0.160.0030.00516.96
8.0.150.0070.00016.94
8.0.140.0030.00516.75
8.0.130.0000.00513.40
8.0.120.0000.00816.91
8.0.110.0040.00416.89
8.0.100.0000.00816.79
8.0.90.0000.00716.87
8.0.80.0060.00916.96
8.0.70.0070.00316.96
8.0.60.0030.00516.94
8.0.50.0050.00316.81
8.0.30.0060.01617.17
8.0.20.0120.01117.40
8.0.10.0000.00717.13
8.0.00.0070.01116.72
7.4.330.0000.00715.00
7.4.320.0030.00316.77
7.4.300.0030.00316.63
7.4.290.0030.00316.64
7.4.280.0020.00616.75
7.4.270.0020.00516.62
7.4.260.0070.00016.62
7.4.250.0030.00516.71
7.4.240.0020.00516.70
7.4.230.0000.00716.63
7.4.220.0050.01416.69
7.4.210.0000.01516.72
7.4.200.0000.00716.44
7.4.160.0130.00416.75
7.4.150.0120.00617.40
7.4.140.0090.01217.86
7.4.130.0100.01016.58
7.4.120.0110.00816.65
7.4.110.0120.00616.58
7.4.100.0110.00616.47
7.4.90.0100.00716.76
7.4.80.0140.01019.39
7.4.70.0160.00016.64
7.4.60.0080.00916.70
7.4.50.0000.00916.59
7.4.40.0030.01316.48
7.4.30.0060.01016.61
7.4.00.0120.00614.80
7.3.330.0030.00313.26
7.3.320.0030.00313.23
7.3.310.0000.00716.32
7.3.300.0030.00316.36
7.3.290.0090.00616.39
7.3.280.0070.00816.36
7.3.270.0110.00717.40
7.3.260.0110.01516.75
7.3.250.0140.00316.37
7.3.240.0070.01016.39
7.3.230.0030.01516.48
7.3.210.0080.00816.85
7.3.200.0100.01019.39
7.3.190.0070.01516.45
7.3.180.0110.00516.62
7.3.170.0110.00516.78
7.3.160.0140.00316.64
7.3.120.0000.01314.66
7.3.110.0060.01314.88
7.3.100.0080.00414.68
7.3.90.0000.01015.09
7.3.80.0070.00714.63
7.3.70.0040.01114.84
7.3.60.0030.01014.67
7.3.50.0090.00314.73
7.3.40.0130.00314.98
7.3.30.0100.00315.06
7.3.20.0080.00816.80
7.3.10.0130.00316.86
7.3.00.0090.00316.51
7.2.330.0120.00916.62
7.2.320.0120.00616.66
7.2.310.0060.01116.57
7.2.300.0070.02016.73
7.2.290.0090.00616.56
7.2.250.0060.01315.14
7.2.240.0100.01015.05
7.2.230.0060.00615.08
7.2.220.0030.00615.32
7.2.210.0040.01115.17
7.2.200.0030.01015.09
7.2.190.0140.00015.04
7.2.180.0070.00714.92
7.2.170.0030.01014.92
7.2.00.0000.01219.42
7.1.330.0030.01015.94
7.1.320.0040.00715.77
7.1.310.0130.00015.77
7.1.300.0030.01316.08
7.1.290.0040.01215.80
7.1.280.0120.00315.95
7.1.270.0110.00615.95
7.1.260.0140.00315.86
7.1.100.0060.00618.30
7.1.70.0040.00417.16
7.1.60.0070.01519.46
7.1.50.0030.01717.03
7.1.00.0030.07722.32
7.0.200.0000.00716.83
7.0.140.0000.07721.92
7.0.60.0200.04719.89
7.0.50.0070.07717.91
7.0.40.0100.07320.26
7.0.30.0400.07020.35
7.0.20.0200.03720.32
7.0.10.0030.08720.10
7.0.00.0170.07720.05
5.6.280.0100.06721.15
5.6.210.0100.08320.76
5.6.200.0030.08018.19
5.6.190.0030.08720.67
5.6.180.0530.07320.63
5.6.170.0230.04720.50
5.6.160.0030.04320.70
5.6.150.0070.04318.12
5.6.140.0030.05718.20
5.6.130.0070.08018.16
5.6.120.0030.08020.80
5.6.110.0100.08721.11
5.6.100.0070.04021.02
5.6.90.0030.06020.88
5.6.80.0130.07320.53
5.5.350.0200.08020.52
5.5.340.0100.08018.02
5.5.330.0130.08020.44
5.5.320.0070.07720.21
5.5.310.0270.07320.11
5.5.300.0170.07018.00
5.5.290.0170.07317.95
5.5.280.0030.07320.80
5.5.270.0000.04320.70
5.5.260.0200.07020.86
5.5.250.0070.03720.68
5.5.240.4030.03720.03
5.4.450.0300.04719.58
5.4.440.0200.04319.56
5.4.430.0200.05019.09
5.4.420.0130.05319.45
5.4.410.0370.04319.00
5.4.400.0100.04319.09
5.4.390.0200.04318.94
5.4.380.0370.05018.60
5.4.370.0300.05318.73
5.4.360.0530.04318.67
5.4.350.0370.05018.53
5.4.340.0430.05018.55
5.4.320.0100.03412.46
5.4.310.0060.04212.45
5.4.300.0030.04112.45
5.4.290.0080.04012.45
5.4.280.0050.03712.35
5.4.270.0070.03812.35
5.4.260.0050.04112.35
5.4.250.0070.04512.35
5.4.240.0080.03512.35
5.4.230.0070.03912.34
5.4.220.0120.04112.34
5.4.210.0060.03812.34
5.4.200.0080.03712.34
5.4.190.0040.04012.34
5.4.180.0050.04012.34
5.4.170.0110.03112.35
5.4.160.0080.03412.34
5.4.150.0070.04012.34
5.4.140.0080.04412.03
5.4.130.0080.03212.01
5.4.120.0080.03611.97
5.4.110.0140.03611.96
5.4.100.0080.03911.97
5.4.90.0080.04611.96
5.4.80.0080.03611.97
5.4.70.0070.04011.96
5.4.60.0110.03411.96
5.4.50.0060.04611.96
5.4.40.0070.04011.95
5.4.30.0050.04111.95
5.4.20.0060.04111.95
5.4.10.0060.04211.95
5.4.00.0050.03611.44
5.3.290.0090.04112.80
5.3.280.0100.03612.70
5.3.270.0050.04212.72
5.3.260.0100.04212.72
5.3.250.0050.04112.72
5.3.240.0050.04012.72
5.3.230.0090.03612.71
5.3.220.0080.03512.68
5.3.210.0070.03812.68
5.3.200.0070.03512.68
5.3.190.0060.03812.68
5.3.180.0080.03412.68
5.3.170.0070.03912.66
5.3.160.0060.03612.68
5.3.150.0080.03712.67
5.3.140.0050.03812.66
5.3.130.0070.03812.66
5.3.120.0060.03912.65
5.3.110.0030.04112.66
5.3.100.0050.03712.11
5.3.90.0060.04112.08
5.3.80.0110.03912.08
5.3.70.0110.03912.08
5.3.60.0060.04612.06
5.3.50.0050.03712.00
5.3.40.0050.03912.00
5.3.30.0060.03411.95
5.3.20.0070.03611.73
5.3.10.0090.04111.70
5.3.00.0050.04211.69
5.2.170.0040.0419.19
5.2.160.0060.0319.19
5.2.150.0070.0369.18
5.2.140.0060.0379.19
5.2.130.0070.0349.14
5.2.120.0050.0309.15
5.2.110.0060.0369.15
5.2.100.0090.0319.15
5.2.90.0060.0359.15
5.2.80.0050.0359.15
5.2.70.0060.0309.14
5.2.60.0040.0369.10
5.2.50.0050.0379.07
5.2.40.0090.0329.05
5.2.30.0060.0389.02
5.2.20.0070.0339.01
5.2.10.0080.0348.92
5.2.00.0060.0328.78
5.1.60.0050.0238.07
5.1.50.0060.0248.07
5.1.40.0040.0278.04
5.1.30.0030.0278.39
5.1.20.0020.0288.41
5.1.10.0040.0258.14
5.1.00.0060.0238.14
5.0.50.0040.0256.62
5.0.40.0050.0206.48
5.0.30.0050.0306.29
5.0.20.0040.0226.26
5.0.10.0070.0246.24
5.0.00.0060.0356.23
4.4.90.0060.0154.77
4.4.80.0050.0224.75
4.4.70.0030.0174.75
4.4.60.0050.0204.75
4.4.50.0070.0124.77
4.4.40.0040.0244.71
4.4.30.0030.0214.76
4.4.20.0020.0194.84
4.4.10.0040.0184.85
4.4.00.0040.0324.76
4.3.110.0030.0174.67
4.3.100.0020.0224.66
4.3.90.0030.0194.63
4.3.80.0040.0264.59
4.3.70.0020.0204.63
4.3.60.0040.0184.63
4.3.50.0050.0144.63
4.3.40.0060.0264.54
4.3.30.0020.0213.29
4.3.20.0030.0183.27
4.3.10.0050.0213.22
4.3.00.0030.01718.56

preferences:
44.31 ms | 401 KiB | 5 Q