3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "ABCDE "; echo trim($string); echo preg_replace('/\s+/', '', $string); echo preg_replace('/\s\s+/', '', $string); echo trim(preg_replace('/[\s\t\n\r\s]+/', '', $string)); echo preg_replace('/~\x{00a0}~siu/', '', $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.3.60.0090.00616.50
8.3.50.0100.00822.79
8.3.40.0040.01118.82
8.3.30.0070.00718.79
8.3.20.0050.00220.39
8.3.10.0080.00023.66
8.3.00.0030.00619.50
8.2.180.0100.01016.50
8.2.170.0120.00918.89
8.2.160.0110.00422.96
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0030.00521.17
8.2.110.0060.00320.35
8.2.100.0120.00018.09
8.2.90.0020.00519.17
8.2.80.0070.00317.97
8.2.70.0030.00617.50
8.2.60.0080.00018.04
8.2.50.0030.00518.07
8.2.40.0060.00318.16
8.2.30.0050.00219.56
8.2.20.0040.00417.71
8.2.10.0050.00217.91
8.2.00.0000.00817.77
8.1.280.0060.01025.92
8.1.270.0060.00323.80
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.75
8.1.230.0060.00619.09
8.1.220.0060.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00717.35
8.1.190.0060.00317.35
8.1.180.0000.00918.10
8.1.170.0000.00818.77
8.1.160.0000.00722.03
8.1.150.0060.00318.69
8.1.140.0040.00417.57
8.1.130.0040.00417.89
8.1.120.0000.00717.50
8.1.110.0050.00317.49
8.1.100.0000.00717.55
8.1.90.0000.00717.42
8.1.80.0040.00417.42
8.1.70.0030.00317.45
8.1.60.0070.00317.59
8.1.50.0000.00817.66
8.1.40.0080.00017.51
8.1.30.0050.00317.80
8.1.20.0040.00417.61
8.1.10.0040.00417.65
8.1.00.0060.00317.61
8.0.300.0000.00818.77
8.0.290.0000.00816.88
8.0.280.0000.00718.47
8.0.270.0030.00517.27
8.0.260.0060.00017.25
8.0.250.0030.00317.11
8.0.240.0040.00417.09
8.0.230.0070.00016.98
8.0.220.0000.00716.93
8.0.210.0030.00316.94
8.0.200.0000.00617.03
8.0.190.0030.00517.05
8.0.180.0040.00416.90
8.0.170.0040.00416.98
8.0.160.0000.00716.93
8.0.150.0040.00416.93
8.0.140.0000.00716.94
8.0.130.0000.00613.40
8.0.120.0040.00416.96
8.0.110.0000.00717.02
8.0.100.0050.00216.96
8.0.90.0000.00716.80
8.0.80.0040.01416.91
8.0.70.0070.00016.78
8.0.60.0050.00216.86
8.0.50.0040.00417.08
8.0.30.0120.00717.27
8.0.20.0080.01717.40
8.0.10.0050.00217.14
8.0.00.0090.01116.91
7.4.330.0000.00615.00
7.4.320.0030.00516.66
7.4.300.0060.00016.79
7.4.290.0030.00316.59
7.4.280.0000.00716.62
7.4.270.0000.00716.67
7.4.260.0030.00716.70
7.4.250.0000.00816.71
7.4.240.0020.00516.71
7.4.230.0030.00316.84
7.4.220.0110.00616.76
7.4.210.0130.00316.69
7.4.200.0030.00316.72
7.4.160.0090.00916.68
7.4.150.0150.00317.40
7.4.140.0140.00517.86
7.4.130.0110.00616.58
7.4.120.0070.00916.66
7.4.110.0090.00916.68
7.4.100.0100.00616.62
7.4.90.0090.00916.71
7.4.80.0110.00719.39
7.4.70.0040.01716.68
7.4.60.0060.01116.61
7.4.50.0060.00316.53
7.4.40.0120.00316.60
7.4.30.0060.01016.39
7.4.00.0100.00714.98
7.3.330.0000.00513.12
7.3.320.0030.00313.12
7.3.310.0070.00016.22
7.3.300.0030.00316.27
7.3.290.0110.00316.24
7.3.280.0080.01016.24
7.3.270.0150.00317.40
7.3.260.0110.00616.62
7.3.250.0090.00816.45
7.3.240.0070.01316.50
7.3.230.0040.01416.63
7.3.210.0100.00716.51
7.3.200.0200.00319.39
7.3.190.0130.00316.56
7.3.180.0060.00916.32
7.3.170.0150.00016.41
7.3.160.0090.00616.57
7.3.120.0110.00714.73
7.3.110.0030.01414.68
7.3.100.0060.00914.72
7.3.90.0070.00714.88
7.3.80.0060.00915.02
7.3.70.0100.00714.70
7.3.60.0100.00715.00
7.3.50.0120.00014.88
7.3.40.0060.00814.98
7.3.30.0000.01314.87
7.3.20.0090.00916.77
7.3.10.0080.00516.71
7.3.00.0040.01116.67
7.2.330.0140.00716.61
7.2.320.0160.00016.57
7.2.310.0140.01016.65
7.2.300.0100.01316.58
7.2.290.0110.00816.64
7.2.250.0110.00414.89
7.2.240.0070.01114.81
7.2.230.0070.00715.16
7.2.220.0050.00514.98
7.2.210.0090.00415.11
7.2.200.0070.00714.87
7.2.190.0120.00315.12
7.2.180.0040.01414.94
7.2.170.0100.00715.11
7.2.130.0060.00817.08
7.2.120.0040.00716.83
7.2.110.0070.00716.99
7.2.100.0120.00316.99
7.2.90.0070.00717.06
7.2.80.0040.00716.69
7.2.70.0050.00816.81
7.2.60.0120.00316.97
7.2.50.0070.00717.00
7.2.40.0050.01016.83
7.2.30.0030.01017.05
7.2.20.0060.00716.87
7.2.10.0060.00716.98
7.2.00.0040.00917.75
7.1.330.0070.01015.80
7.1.320.0040.01215.92
7.1.310.0030.01015.64
7.1.300.0070.01015.66
7.1.290.0100.00315.84
7.1.280.0030.00715.66
7.1.270.0100.00716.00
7.1.260.0100.00715.87
7.1.250.0040.00715.82
7.1.200.0190.00315.79
7.1.100.0030.01018.17
7.1.70.0030.00317.26
7.1.60.0060.01819.46
7.1.50.0120.01217.06
7.1.00.0030.07722.49
7.0.200.0030.00716.63
7.0.140.0000.07722.21
7.0.60.0070.08319.87
7.0.50.0030.05017.91
7.0.40.0070.06720.11
7.0.30.0130.05720.02
7.0.20.0100.04720.05
7.0.10.0070.06320.01
7.0.00.0030.09020.34
5.6.280.0070.07020.82
5.6.210.0200.04720.71
5.6.200.0100.08318.08
5.6.190.0070.07320.57
5.6.180.0530.07320.35
5.6.170.0300.05320.48
5.6.160.0100.03720.48
5.6.150.0100.08018.15
5.6.140.0030.08018.21
5.6.130.0000.04718.17
5.6.120.0100.04720.73
5.6.110.0170.07021.04
5.6.100.0030.04321.04
5.6.90.0070.08721.09
5.6.80.0130.07320.27
5.5.350.0200.04320.34
5.5.340.0030.08317.95
5.5.330.0030.08320.59
5.5.320.0030.07720.13
5.5.310.0200.08320.13
5.5.300.0030.05317.92
5.5.290.0100.07718.01
5.5.280.0070.08320.95
5.5.270.0100.04020.80
5.5.260.0100.08020.70
5.5.250.0100.07020.67
5.5.240.0230.07720.03
5.4.450.0470.02719.49
5.4.440.0100.05019.39
5.4.430.0230.04719.13
5.4.420.0430.03319.40
5.4.410.0430.04019.44
5.4.400.0470.04018.81
5.4.390.0370.03718.77
5.4.380.0930.06718.49
5.4.370.0470.04018.63
5.4.360.0330.05318.73
5.4.350.0270.06018.62
5.4.340.0430.07318.72
5.4.320.0090.03512.45
5.4.310.0070.04112.45
5.4.300.0050.04012.45
5.4.290.0060.03912.45
5.4.280.0060.04312.34
5.4.270.0070.04012.35
5.4.260.0090.04512.34
5.4.250.0100.04412.34
5.4.240.0020.04012.34
5.4.230.0070.03612.34
5.4.220.0040.04712.34
5.4.210.0090.03212.34
5.4.200.0060.03612.34
5.4.190.0090.03512.34
5.4.180.0060.03512.33
5.4.170.0080.04412.34
5.4.160.0040.04512.34
5.4.150.0040.03812.34
5.4.140.0050.04112.02
5.4.130.0060.03412.01
5.4.120.0060.03511.96
5.4.110.0030.03911.96
5.4.100.0040.04211.96
5.4.90.0040.03711.96
5.4.80.0050.04311.96
5.4.70.0080.03711.96
5.4.60.0070.03611.96
5.4.50.0100.03411.96
5.4.40.0090.03511.95
5.4.30.0070.04111.95
5.4.20.0080.04011.95
5.4.10.0060.03411.95
5.4.00.0020.04011.43
5.3.290.0060.04112.80
5.3.280.0070.04412.71
5.3.270.0090.04312.72
5.3.260.0100.03912.72
5.3.250.0060.04212.72
5.3.240.0070.03912.72
5.3.230.0070.04212.71
5.3.220.0060.03612.68
5.3.210.0090.04612.68
5.3.200.0130.04212.68
5.3.190.0070.03612.68
5.3.180.0070.03812.68
5.3.170.0080.03512.67
5.3.160.0050.04312.67
5.3.150.0080.03812.68
5.3.140.0050.04512.66
5.3.130.0070.03912.66
5.3.120.0060.04212.66
5.3.110.0060.03712.66
5.3.100.0060.04012.12
5.3.90.0040.04312.08
5.3.80.0080.04112.08
5.3.70.0080.03812.07
5.3.60.0070.03412.07
5.3.50.0090.04012.00
5.3.40.0060.04212.01
5.3.30.0060.04311.96
5.3.20.0050.04011.73
5.3.10.0070.03311.70
5.3.00.0070.03511.69
5.2.170.0060.0289.19
5.2.160.0040.0299.19
5.2.150.0060.0359.19
5.2.140.0040.0359.18
5.2.130.0030.0389.14
5.2.120.0030.0339.14
5.2.110.0070.0359.15
5.2.100.0040.0399.15
5.2.90.0030.0349.15
5.2.80.0060.0379.15
5.2.70.0040.0329.14
5.2.60.0090.0329.10
5.2.50.0040.0339.06
5.2.40.0050.0359.05
5.2.30.0070.0329.03
5.2.20.0070.0389.01
5.2.10.0040.0338.92
5.2.00.0070.0298.78
5.1.60.0060.0238.06
5.1.50.0090.0238.06
5.1.40.0050.0258.04
5.1.30.0050.0378.39
5.1.20.0070.0308.41
5.1.10.0060.0238.14
5.1.00.0050.0308.14
5.0.50.0040.0256.61
5.0.40.0040.0266.48
5.0.30.0040.0336.29
5.0.20.0040.0276.26
5.0.10.0060.0236.24
5.0.00.0020.0406.23
4.4.90.0000.0204.78
4.4.80.0040.0164.76
4.4.70.0050.0174.75
4.4.60.0030.0244.76
4.4.50.0030.0204.77
4.4.40.0010.0274.71
4.4.30.0050.0194.76
4.4.20.0030.0204.84
4.4.10.0020.0204.85
4.4.00.0030.0254.76
4.3.110.0040.0164.67
4.3.100.0030.0214.67
4.3.90.0030.0184.64
4.3.80.0050.0244.58
4.3.70.0020.0164.63
4.3.60.0040.0214.63
4.3.50.0050.0184.63
4.3.40.0040.0334.54
4.3.30.0030.0233.28
4.3.20.0030.0263.26
4.3.10.0010.0233.22
4.3.00.0000.01318.56

preferences:
54.97 ms | 401 KiB | 5 Q