3v4l.org

run code in 300+ PHP versions simultaneously
<?php $before = html_entity_decode("&nbsp;") . "&nbsp;abc&nbsp;xyz&nbsp;"; $pattern = '~^(\xC2\xA0|&nbsp;)*(.*?)(?1)*$~'; $after = preg_replace($pattern, '$2', $before); var_dump($before, $after);

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.4.130.0120.00419.58
8.4.120.0130.00724.24
8.4.110.0110.01022.34
8.4.100.0130.00618.83
8.4.90.0160.00418.88
8.4.80.0110.00920.50
8.4.70.0120.00717.98
8.4.60.0130.00918.79
8.4.50.0100.00620.33
8.4.40.0040.00817.80
8.4.30.0030.01518.78
8.4.20.0100.01021.77
8.4.10.0130.00619.43
8.3.250.0120.00818.89
8.3.240.0140.00717.32
8.3.230.0100.01016.60
8.3.220.0100.00718.88
8.3.210.0070.00716.98
8.3.200.0050.00416.57
8.3.190.0110.00817.17
8.3.180.0090.01018.32
8.3.170.0080.01120.64
8.3.160.0070.00717.05
8.3.150.0080.00817.23
8.3.140.0090.00616.59
8.3.130.0030.00618.41
8.3.120.0140.00720.59
8.3.110.0110.00020.94
8.3.100.0060.00316.75
8.3.90.0080.00026.77
8.3.80.0090.00017.97
8.3.70.0070.00718.55
8.3.60.0240.00717.81
8.3.50.0000.01117.81
8.3.40.0140.01017.81
8.3.30.0240.00017.81
8.3.20.0190.00317.81
8.3.10.0170.00317.81
8.3.00.0160.00817.81
8.2.290.0060.00220.59
8.2.280.0110.00818.55
8.2.270.0100.01017.25
8.2.260.0140.00416.86
8.2.250.0040.00416.82
8.2.240.0060.01019.11
8.2.230.0090.00022.58
8.2.220.0060.00324.06
8.2.210.0080.00026.77
8.2.200.0060.00318.41
8.2.190.0220.00417.81
8.2.180.0170.00917.81
8.2.170.0280.00017.81
8.2.160.0210.01017.81
8.2.150.0210.00617.81
8.2.140.0270.00017.81
8.2.130.0210.00617.81
8.2.120.0260.00317.81
8.2.110.0210.01017.81
8.2.100.0280.00717.81
8.2.90.0200.00717.81
8.2.80.0170.01017.81
8.2.70.0200.00817.81
8.2.60.0200.01417.81
8.2.50.0290.01217.81
8.2.40.0270.00717.81
8.2.30.0210.00417.81
8.2.20.0210.00317.81
8.2.10.0210.00017.81
8.2.00.0140.00917.81
8.1.330.0100.00821.84
8.1.320.0150.00516.32
8.1.310.0090.00016.60
8.1.300.0090.00616.47
8.1.290.0090.00030.84
8.1.280.0160.00817.81
8.1.270.0210.00717.81
8.1.260.0160.00817.81
8.1.250.0170.00817.81
8.1.240.0080.01217.81
8.1.230.0150.00417.81
8.1.220.0200.00017.81
8.1.210.0250.00017.81
8.1.200.0230.00717.81
8.1.190.0280.00317.81
8.1.180.0160.00617.81
8.1.170.0270.00317.81
8.1.160.0300.00417.81
8.1.150.0230.01317.81
8.1.140.0250.00417.81
8.1.130.0180.00617.81
8.1.120.0140.00717.81
8.1.110.0200.00017.81
8.1.100.0180.00317.81
8.1.90.0160.00417.81
8.1.80.0160.00717.81
8.1.70.0280.00317.81
8.1.60.0310.00617.81
8.1.50.0200.01017.81
8.1.40.0320.00017.81
8.1.30.0120.01517.81
8.1.20.0220.00417.81
8.1.10.0250.00017.81
8.1.00.0180.00417.81

preferences:
27.13 ms | 403 KiB | 5 Q