3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "ABCDE "; echo trim($string)."\n"; echo preg_replace('/\s+/', '', $string)."\n"; echo preg_replace('/\s\s+/', '', $string)."\n"; echo trim(preg_replace('/[\s\t\n\r\s]+/', '', $string))."\n"; 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.0060.00916.63
8.3.50.0150.00323.07
8.3.40.0040.01118.80
8.3.30.0100.00318.91
8.3.20.0040.00420.39
8.3.10.0000.00823.52
8.3.00.0080.00019.51
8.2.180.0140.00018.41
8.2.170.0110.00422.96
8.2.160.0090.00620.51
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0070.00021.04
8.2.110.0090.00020.12
8.2.100.0080.00418.22
8.2.90.0030.00619.26
8.2.80.0060.00317.97
8.2.70.0000.00817.63
8.2.60.0040.00417.80
8.2.50.0030.00518.07
8.2.40.0080.00018.34
8.2.30.0040.00419.52
8.2.20.0000.00817.75
8.2.10.0030.00617.94
8.2.00.0060.00317.62
8.1.280.0080.00825.92
8.1.270.0080.00023.80
8.1.260.0070.00026.35
8.1.250.0000.00828.09
8.1.240.0050.00523.67
8.1.230.0040.00719.07
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0000.00917.48
8.1.190.0060.00317.25
8.1.180.0040.00418.10
8.1.170.0050.00318.65
8.1.160.0040.00421.91
8.1.150.0000.00718.79
8.1.140.0060.00317.47
8.1.130.0070.00017.84
8.1.120.0050.00217.50
8.1.110.0000.00817.70
8.1.100.0030.00417.59
8.1.90.0000.00717.54
8.1.80.0000.00717.59
8.1.70.0000.00717.57
8.1.60.0000.01017.73
8.1.50.0080.00017.66
8.1.40.0000.00717.55
8.1.30.0030.00517.80
8.1.20.0040.00417.85
8.1.10.0000.00817.73
8.1.00.0000.00717.52
8.0.300.0030.00518.77
8.0.290.0040.00416.88
8.0.280.0070.00018.41
8.0.270.0000.00717.26
8.0.260.0000.00617.34
8.0.250.0000.00816.98
8.0.240.0040.00417.06
8.0.230.0030.00317.09
8.0.220.0030.00317.00
8.0.210.0050.00317.00
8.0.200.0030.00316.96
8.0.190.0000.00817.14
8.0.180.0000.00817.10
8.0.170.0040.00417.11
8.0.160.0080.00017.08
8.0.150.0070.00016.87
8.0.140.0040.00416.82
8.0.130.0050.00313.46
8.0.120.0040.00417.02
8.0.110.0040.00417.08
8.0.100.0040.00417.01
8.0.90.0000.00717.00
8.0.80.0000.02017.07
8.0.70.0000.00716.93
8.0.60.0040.00417.03
8.0.50.0030.00517.04
8.0.30.0090.01017.32
8.0.20.0090.01717.40
8.0.10.0040.00417.06
8.0.00.0110.00916.85
7.4.330.0000.00615.00
7.4.320.0000.00716.75
7.4.300.0030.00316.73
7.4.290.0070.00016.55
7.4.280.0000.00716.52
7.4.270.0070.00016.70
7.4.260.0040.00416.72
7.4.250.0000.00716.53
7.4.240.0020.00516.72
7.4.230.0030.00316.55
7.4.220.0030.01616.70
7.4.210.0100.01016.69
7.4.200.0040.00416.54
7.4.160.0040.01516.54
7.4.150.0140.00417.40
7.4.140.0110.00617.86
7.4.130.0050.01216.65
7.4.120.0070.00916.62
7.4.110.0110.00616.67
7.4.100.0110.00616.75
7.4.90.0080.00916.56
7.4.80.0110.00719.39
7.4.70.0080.00916.78
7.4.60.0100.00716.70
7.4.50.0030.00516.44
7.4.40.0100.00716.71
7.4.30.0060.00916.57
7.4.00.0070.00614.78
7.3.330.0000.00513.26
7.3.320.0060.00013.25
7.3.310.0070.00016.20
7.3.300.0030.00316.34
7.3.290.0070.00716.39
7.3.280.0130.00416.36
7.3.270.0130.00617.40
7.3.260.0110.00616.38
7.3.250.0150.00216.46
7.3.240.0080.00816.47
7.3.230.0110.00616.39
7.3.210.0070.01016.72
7.3.200.0080.00819.39
7.3.190.0060.01016.48
7.3.180.0030.01916.35
7.3.170.0060.00916.49
7.3.160.0080.00816.65
7.3.10.0130.00716.84
7.3.00.0030.00916.45
7.2.330.0120.00616.70
7.2.320.0160.00016.70
7.2.310.0030.01316.57
7.2.300.0090.01516.73
7.2.290.0040.01316.82
7.2.130.0040.01116.68
7.2.120.0030.01216.76
7.2.110.0140.00316.72
7.2.100.0070.01116.52
7.2.90.0040.01117.08
7.2.80.0160.00516.71
7.2.70.0080.01716.75
7.2.60.0100.00716.85
7.2.50.0060.01216.63
7.2.40.0210.00016.92
7.2.30.0180.00316.76
7.2.20.0110.01516.81
7.2.10.0130.00716.75
7.2.00.0080.01018.27
7.1.250.0130.00815.73
7.1.200.0090.00315.88
7.1.100.0060.00318.19
7.1.70.0000.01317.35
7.1.60.0100.01319.46
7.1.50.0070.01716.76
7.1.00.0030.07722.32
7.0.200.0070.00316.88
7.0.140.0070.07022.04
7.0.60.0070.03720.02
7.0.50.0000.04317.87
7.0.40.0100.04020.23
7.0.30.0230.08320.04
7.0.20.0300.07320.24
7.0.10.0030.05320.03
7.0.00.0200.06720.05
5.6.280.0170.06021.10
5.6.210.0070.08720.50
5.6.200.0030.09018.22
5.6.190.0200.07020.43
5.6.180.0200.06020.67
5.6.170.0330.07020.49
5.6.160.0130.07020.41
5.6.150.0030.05018.22
5.6.140.0030.07318.22
5.6.130.0030.08718.21
5.6.120.0030.05021.00
5.6.110.0130.03720.98
5.6.100.0030.08720.98
5.6.90.0100.08320.96
5.6.80.0030.08720.28
5.5.350.0270.07020.30
5.5.340.0100.07717.92
5.5.330.0070.08020.07
5.5.320.0230.07020.27
5.5.310.0270.08020.31
5.5.300.0100.05017.98
5.5.290.0030.04017.87
5.5.280.0030.06320.87
5.5.270.0130.08320.86
5.5.260.0070.06320.72
5.5.250.0070.08020.79
5.5.240.0030.07320.35
5.4.450.0230.05019.25
5.4.440.0230.05019.46
5.4.430.0500.04319.40
5.4.420.0300.04019.56
5.4.410.0230.04319.33
5.4.400.0400.03719.05
5.4.390.0100.04319.09
5.4.380.0270.08318.49
5.4.370.0770.05318.64
5.4.360.0300.06318.60
5.4.350.0370.06018.77
5.4.340.0400.06718.51
5.4.320.0070.04012.45
5.4.310.0050.04412.45
5.4.300.0090.04312.46
5.4.290.0070.03712.45
5.4.280.0080.04112.35
5.4.270.0080.04012.35
5.4.260.0120.04112.35
5.4.250.0080.04412.35
5.4.240.0120.04712.35
5.4.230.0060.04612.34
5.4.220.0050.04212.34
5.4.210.0110.04512.34
5.4.200.0120.04512.34
5.4.190.0080.04712.34
5.4.180.0060.04212.34
5.4.170.0060.03512.35
5.4.160.0110.03212.34
5.4.150.0090.03412.34
5.4.140.0130.03912.02
5.4.130.0070.03812.01
5.4.120.0060.04311.97
5.4.110.0060.04211.96
5.4.100.0060.03911.96
5.4.90.0050.05511.97
5.4.80.0040.03911.97
5.4.70.0120.04511.96
5.4.60.0080.03411.96
5.4.50.0070.03511.96
5.4.40.0070.03411.95
5.4.30.0070.03511.95
5.4.20.0060.05111.95
5.4.10.0130.04111.95
5.4.00.0050.03711.44
5.3.290.0060.04312.80
5.3.280.0040.04012.71
5.3.270.0090.03612.73
5.3.260.0100.03512.71
5.3.250.0070.04812.71
5.3.240.0090.03412.71
5.3.230.0050.03812.70
5.3.220.0060.03712.68
5.3.210.0060.04012.68
5.3.200.0090.03712.68
5.3.190.0070.04112.68
5.3.180.0100.03812.68
5.3.170.0090.04312.67
5.3.160.0060.04112.67
5.3.150.0100.03512.67
5.3.140.0040.04812.66
5.3.130.0040.04512.66
5.3.120.0070.03812.65
5.3.110.0090.03612.65
5.3.100.0080.03412.12
5.3.90.0060.04812.08
5.3.80.0060.03712.07
5.3.70.0080.03812.07
5.3.60.0070.04212.06
5.3.50.0030.04912.00
5.3.40.0070.04812.00
5.3.30.0060.04111.96
5.3.20.0070.03811.74
5.3.10.0080.03911.70
5.3.00.0080.04511.69
5.2.170.0070.0399.19
5.2.160.0060.0319.19
5.2.150.0090.0439.19
5.2.140.0120.0289.19
5.2.130.0070.0329.15
5.2.120.0070.0319.14
5.2.110.0050.0359.15
5.2.100.0080.0369.15
5.2.90.0050.0319.15
5.2.80.0090.0369.15
5.2.70.0080.0289.14
5.2.60.0070.0309.10
5.2.50.0040.0309.07
5.2.40.0060.0309.05
5.2.30.0080.0319.02
5.2.20.0090.0269.02
5.2.10.0060.0288.92
5.2.00.0040.0338.78
5.1.60.0020.0298.07
5.1.50.0080.0258.06
5.1.40.0050.0258.04
5.1.30.0050.0298.39
5.1.20.0050.0298.41
5.1.10.0030.0278.14
5.1.00.0080.0268.14
5.0.50.0040.0286.62
5.0.40.0020.0296.47
5.0.30.0020.0336.29
5.0.20.0050.0186.26
5.0.10.0040.0206.24
5.0.00.0020.0326.23
4.4.90.0030.0194.78
4.4.80.0030.0154.75
4.4.70.0040.0144.75
4.4.60.0020.0164.75
4.4.50.0050.0134.77
4.4.40.0030.0254.71
4.4.30.0050.0194.76
4.4.20.0030.0164.84
4.4.10.0030.0154.85
4.4.00.0040.0304.76
4.3.110.0020.0194.67
4.3.100.0030.0234.66
4.3.90.0030.0144.64
4.3.80.0030.0244.59
4.3.70.0040.0194.63
4.3.60.0040.0164.63
4.3.50.0030.0234.63
4.3.40.0030.0294.53
4.3.30.0040.0213.28
4.3.20.0010.0173.26
4.3.10.0030.0163.22
4.3.00.0070.01018.56

preferences:
26.51 ms | 401 KiB | 5 Q