3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = " 12| 150 | test one| 33235 13| 151| test two |33236 "; $pattern = '/(?:\s\|\s)|(?:\s\|)|(?:\|\s)/'; echo preg_replace($pattern, '|', $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.00916.75
8.3.50.0140.00720.26
8.3.40.0110.00420.48
8.3.30.0000.01518.79
8.3.20.0080.00024.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.180.0150.00625.92
8.2.170.0090.00918.91
8.2.160.0060.00922.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0050.00321.13
8.2.110.0100.00021.25
8.2.100.0110.00017.91
8.2.90.0080.00020.64
8.2.80.0030.00620.50
8.2.70.0040.00417.88
8.2.60.0000.00817.80
8.2.50.0040.00417.98
8.2.40.0000.00818.22
8.2.30.0000.00718.15
8.2.20.0040.00420.47
8.2.10.0000.00717.84
8.2.00.0000.00719.09
8.1.280.0150.00025.92
8.1.270.0080.00023.99
8.1.260.0000.00826.35
8.1.250.0000.00728.09
8.1.240.0060.00322.14
8.1.230.0040.00820.96
8.1.220.0000.00717.76
8.1.210.0000.00818.77
8.1.200.0030.00617.36
8.1.190.0050.00317.23
8.1.180.0090.00018.84
8.1.170.0060.00317.62
8.1.160.0030.00618.91
8.1.150.0020.00518.73
8.1.140.0030.00617.54
8.1.130.0030.00318.90
8.1.120.0070.00017.57
8.1.110.0020.00517.50
8.1.100.0040.00417.51
8.1.90.0000.00817.51
8.1.80.0030.00617.53
8.1.70.0080.00817.43
8.1.60.0150.00517.62
8.1.50.0000.01717.48
8.1.40.0070.01117.49
8.1.30.0150.00417.73
8.1.20.0140.00017.61
8.1.10.0150.00417.61
8.1.00.0130.00417.62
8.0.300.0000.00720.08
8.0.290.0040.00416.88
8.0.280.0000.00718.47
8.0.270.0030.00316.96
8.0.260.0000.00718.39
8.0.250.0070.00017.02
8.0.240.0000.00816.97
8.0.230.0030.00616.98
8.0.220.0000.00716.85
8.0.210.0030.00316.91
8.0.200.0080.00016.90
8.0.190.0070.00717.04
8.0.180.0000.01617.00
8.0.170.0110.00216.89
8.0.160.0070.00716.80
8.0.150.0080.00516.82
8.0.140.0030.00516.82
8.0.130.0050.00616.97
8.0.120.0070.00016.93
8.0.110.0150.00016.86
8.0.100.0180.00016.86
8.0.90.0120.00616.79
8.0.80.0110.00416.90
8.0.70.0150.00016.72
8.0.60.0100.00516.75
8.0.50.0090.00616.89
8.0.30.0080.00616.84
8.0.20.0080.00516.83
8.0.10.0040.00916.96
7.4.330.0030.00315.55
7.4.320.0030.00316.68
7.4.300.0030.00716.73
7.4.290.0100.00016.57
7.4.280.0110.00016.72
7.4.270.0080.00316.68
7.4.260.0040.00916.78
7.4.250.0080.00316.60
7.4.240.0040.00816.50
7.4.230.0170.00016.74
7.4.220.0070.00716.61
7.4.210.0150.00016.77
7.4.200.0070.00216.49
7.4.190.0070.00216.64
7.4.180.0060.00616.21
7.4.160.0130.00016.38
7.4.150.0080.00416.19
7.4.140.0070.00416.64
7.4.130.0060.00616.59
7.4.120.0070.00416.51
7.4.110.0040.00716.64
7.4.100.0100.00516.28
7.4.90.0100.00316.38
7.4.80.0040.00716.51
7.4.70.0090.00216.59
7.4.60.0000.01016.50
7.4.50.0070.00316.64
7.4.40.0030.00716.41
7.4.30.0040.00816.54
7.4.20.0070.00716.55
7.4.10.0050.00816.63
7.4.00.0130.00016.68

preferences:
60.26 ms | 401 KiB | 5 Q