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); 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.70.0140.00716.75
8.3.60.0090.00616.75
8.3.50.0110.01122.90
8.3.40.0070.00719.00
8.3.30.0040.01119.10
8.3.20.0000.00820.16
8.3.10.0060.00323.61
8.3.00.0030.00619.38
8.2.180.0040.01118.30
8.2.170.0040.01122.96
8.2.160.0130.00320.36
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0050.00321.21
8.2.110.0030.00621.03
8.2.100.0000.01217.84
8.2.90.0050.00317.97
8.2.80.0080.00017.97
8.2.70.0050.00318.04
8.2.60.0030.00518.05
8.2.50.0060.00318.10
8.2.40.0000.00818.03
8.2.30.0000.00719.50
8.2.20.0040.00417.78
8.2.10.0040.00418.04
8.2.00.0040.00417.86
8.1.280.0110.00425.92
8.1.270.0090.00023.88
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00922.21
8.1.230.0070.00720.76
8.1.220.0080.00017.74
8.1.210.0090.00018.77
8.1.200.0070.00317.35
8.1.190.0050.00317.35
8.1.180.0000.00918.10
8.1.170.0040.00418.78
8.1.160.0000.00722.00
8.1.150.0040.00418.87
8.1.140.0050.00317.57
8.1.130.0040.00417.88
8.1.120.0000.00717.52
8.1.110.0040.00417.57
8.1.100.0070.00017.48
8.1.90.0000.00717.51
8.1.80.0030.00517.63
8.1.70.0000.00717.54
8.1.60.0040.00817.59
8.1.50.0000.00817.50
8.1.40.0030.00617.59
8.1.30.0090.00017.75
8.1.20.0030.00617.75
8.1.10.0040.00417.52
8.1.00.0000.00717.50
8.0.300.0040.00419.91
8.0.290.0000.00817.00
8.0.280.0030.00318.33
8.0.270.0000.00817.29
8.0.260.0030.00317.12
8.0.250.0030.00316.96
8.0.240.0000.00717.06
8.0.230.0070.00016.90
8.0.220.0070.00016.90
8.0.210.0070.00017.04
8.0.200.0030.00317.04
8.0.190.0030.00617.09
8.0.180.0040.00417.01
8.0.170.0000.00817.04
8.0.160.0000.00716.90
8.0.150.0070.00016.96
8.0.140.0000.00816.93
8.0.130.0060.00013.36
8.0.120.0080.00016.84
8.0.110.0000.00716.96
8.0.100.0000.00716.95
8.0.90.0070.00017.12
8.0.80.0090.00616.96
8.0.70.0070.00016.97
8.0.60.0040.00417.11
8.0.50.0040.00416.92
8.0.30.0130.00617.14
8.0.20.0060.01717.40
8.0.10.0070.00017.07
8.0.00.0100.00816.91
7.4.330.0070.00015.00
7.4.320.0030.00316.81
7.4.300.0000.00716.76
7.4.290.0030.00316.76
7.4.280.0040.00416.66
7.4.270.0080.00016.63
7.4.260.0030.00316.77
7.4.250.0030.00516.55
7.4.240.0040.00416.65
7.4.230.0000.00716.80
7.4.220.0120.00616.73
7.4.210.0100.00316.79
7.4.200.0000.00716.62
7.4.160.0120.00416.69
7.4.150.0180.00017.40
7.4.140.0110.00617.86
7.4.130.0080.01016.68
7.4.120.0130.00616.60
7.4.110.0120.00616.73
7.4.100.0130.00416.61
7.4.90.0060.01216.56
7.4.80.0130.00419.39
7.4.70.0130.00316.75
7.4.60.0160.00316.52
7.4.50.0040.00416.39
7.4.40.0100.00716.78
7.4.30.0120.00416.74
7.4.00.0040.01115.00
7.3.330.0000.00613.20
7.3.320.0030.00313.07
7.3.310.0040.00416.30
7.3.300.0040.00416.39
7.3.290.0110.00316.41
7.3.280.0080.00916.33
7.3.270.0100.00617.40
7.3.260.0140.00816.37
7.3.250.0120.00916.49
7.3.240.0130.00416.43
7.3.230.0090.00916.64
7.3.210.0100.00716.30
7.3.200.0040.01919.39
7.3.190.0100.00616.40
7.3.180.0160.00616.47
7.3.170.0130.01016.50
7.3.160.0110.00716.20
7.3.10.0060.00916.80
7.3.00.0040.01216.67
7.2.330.0220.01016.70
7.2.320.0030.01416.47
7.2.310.0090.00916.58
7.2.300.0190.01216.61
7.2.290.0100.00616.59
7.2.130.0060.00916.76
7.2.120.0100.00316.85
7.2.110.0000.01417.03
7.2.100.0030.00916.97
7.2.90.0070.00316.71
7.2.80.0090.00616.67
7.2.70.0090.00617.14
7.2.60.0030.01216.90
7.2.50.0100.00316.71
7.2.40.0080.00316.78
7.2.30.0080.00816.83
7.2.20.0060.00917.14
7.2.10.0000.01216.79
7.2.00.0050.00917.99
7.1.250.0070.00415.68
7.1.200.0000.01215.78
7.1.100.0000.01118.30
7.1.70.0030.00917.39
7.1.60.0090.01619.46
7.1.50.0130.00617.09
7.1.00.0000.08022.38
7.0.200.0070.00016.80
7.0.140.0000.07321.92
7.0.60.0070.08720.07
7.0.50.0130.07317.87
7.0.40.0100.06720.33
7.0.30.0330.07020.35
7.0.20.0270.07720.01
7.0.10.0330.05320.19
7.0.00.0000.04720.02
5.6.280.0030.07321.09
5.6.210.0070.08720.71
5.6.200.0100.07718.21
5.6.190.0030.07320.59
5.6.180.0370.05020.33
5.6.170.0200.05020.41
5.6.160.0070.08320.50
5.6.150.0100.07018.21
5.6.140.0170.07018.16
5.6.130.0100.04318.14
5.6.120.0070.08320.89
5.6.110.0070.04021.02
5.6.100.0030.04320.95
5.6.90.0030.04020.98
5.6.80.0100.08320.38
5.6.70.0330.07320.45
5.5.350.0070.08320.38
5.5.340.0070.08017.91
5.5.330.0030.05720.12
5.5.320.0330.07020.39
5.5.310.0030.05320.17
5.5.300.0070.07018.02
5.5.290.0070.08017.95
5.5.280.0030.08320.68
5.5.270.0000.08320.64
5.5.260.0070.06020.93
5.5.250.0100.07720.61
5.5.240.0130.07020.23
5.4.450.0430.05319.26
5.4.440.0370.04019.42
5.4.430.0470.04319.39
5.4.420.0370.03719.13
5.4.410.0230.04319.25
5.4.400.0400.03319.16
5.4.390.0070.05018.77
5.4.380.0230.07318.55
5.4.370.0330.05018.66
5.4.360.0330.06018.77
5.4.350.0500.05318.61
5.4.340.0330.06018.76
5.4.320.0070.04012.46
5.4.310.0130.04412.45
5.4.300.0100.04312.45
5.4.290.0080.04412.45
5.4.280.0060.04512.35
5.4.270.0050.04312.35
5.4.260.0090.03412.35
5.4.250.0090.03412.35
5.4.240.0090.03312.35
5.4.230.0070.03612.34
5.4.220.0100.04112.34
5.4.210.0110.04312.34
5.4.200.0050.04212.34
5.4.190.0070.04112.34
5.4.180.0070.03512.34
5.4.170.0080.03412.35
5.4.160.0050.03712.35
5.4.150.0060.04512.34
5.4.140.0060.04212.02
5.4.130.0070.04612.01
5.4.120.0050.04311.97
5.4.110.0030.03811.96
5.4.100.0060.03411.97
5.4.90.0060.03611.97
5.4.80.0050.03711.97
5.4.70.0070.03411.96
5.4.60.0070.03311.96
5.4.50.0050.03611.96
5.4.40.0060.03511.95
5.4.30.0040.03911.95
5.4.20.0100.03511.95
5.4.10.0070.03511.95
5.4.00.0070.03511.44
5.3.290.0090.03812.80
5.3.280.0090.04712.70
5.3.270.0120.03412.73
5.3.260.0060.04212.71
5.3.250.0060.05412.72
5.3.240.0090.03512.72
5.3.230.0090.05312.71
5.3.220.0070.03712.68
5.3.210.0060.04512.68
5.3.200.0090.04212.68
5.3.190.0050.03812.68
5.3.180.0050.03812.67
5.3.170.0070.03512.67
5.3.160.0050.03812.68
5.3.150.0050.03712.67
5.3.140.0090.04212.66
5.3.130.0070.04612.66
5.3.120.0070.05612.66
5.3.110.0110.04212.66
5.3.100.0080.03712.12
5.3.90.0080.04312.09
5.3.80.0120.05312.07
5.3.70.0080.04212.07
5.3.60.0040.03812.06
5.3.50.0070.04012.00
5.3.40.0060.03612.00
5.3.30.0050.03611.95
5.3.20.0100.03411.74
5.3.10.0050.03611.70
5.3.00.0070.03511.69
5.2.170.0080.0299.19
5.2.160.0060.0389.19
5.2.150.0080.0389.19
5.2.140.0050.0339.19
5.2.130.0070.0399.14
5.2.120.0050.0299.14
5.2.110.0030.0319.15
5.2.100.0060.0349.15
5.2.90.0090.0369.15
5.2.80.0070.0539.14
5.2.70.0050.0329.14
5.2.60.0080.0349.09
5.2.50.0120.0429.07
5.2.40.0090.0339.05
5.2.30.0070.0379.02
5.2.20.0090.0339.01
5.2.10.0060.0398.92
5.2.00.0040.0298.78
5.1.60.0100.0358.07
5.1.50.0050.0418.06
5.1.40.0050.0448.04
5.1.30.0060.0308.39
5.1.20.0090.0308.41
5.1.10.0050.0418.14
5.1.00.0060.0258.14
5.0.50.0040.0226.61
5.0.40.0060.0236.48
5.0.30.0040.0356.29
5.0.20.0040.0186.26
5.0.10.0020.0386.24
5.0.00.0030.0316.23
4.4.90.0090.0154.78
4.4.80.0050.0234.75
4.4.70.0050.0194.75
4.4.60.0050.0244.75
4.4.50.0060.0254.77
4.4.40.0040.0314.71
4.4.30.0050.0184.76
4.4.20.0040.0164.85
4.4.10.0030.0204.85
4.4.00.0030.0274.76
4.3.110.0040.0154.67
4.3.100.0030.0244.67
4.3.90.0040.0194.63
4.3.80.0030.0254.58
4.3.70.0050.0204.63
4.3.60.0040.0134.63
4.3.50.0030.0164.63
4.3.40.0060.0264.54
4.3.30.0030.0273.29
4.3.20.0020.0183.26
4.3.10.0030.0183.22
4.3.00.0030.01718.56

preferences:
49.29 ms | 401 KiB | 5 Q