3v4l.org

run code in 300+ PHP versions simultaneously
<?php $newString = "he 800s."; $originalString = $newString; $regex = "/[$#]*(\d+(\.|\,|\s)?\d*(\.|\,|\s)?\d*){3,}[%.\)]*/"; preg_match_all($regex, $originalString, $matches); foreach($matches[0] as $match) { if ($match[0] == "$" || $match[0] == "#") { continue; } $stringLength = strlen($match); if ($match[$stringLength - 1] == "%" || $match[$stringLength - 1] == "." || $match[$stringLength - 1] == ")") { continue; } $replacement = ''; for ($i = 0; $i < strlen($match); $i++) { if ($match[$i] == '-' || $match[$i] == '+' || $match[$i] == ' ' || $match[$i] == '.' || $match[$i] == ',' || $match[$i] == '(' || $match[$i] == ')') { $replacement .= $match[$i]; } else { $replacement .= 'X'; } } $match = preg_quote($match); $newString = preg_replace("/" . $match . "/U", $replacement, $newString); } print_r("ORIGINAL STRING: " . $originalString . "\n"); print_r("FILTERED STRING: " . $newString . "\n"); print_r("MATCHES: \n"); print_r($matches);

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.0160.00316.84
8.3.50.0140.00016.62
8.3.40.0120.00319.09
8.3.30.0060.00918.95
8.3.20.0000.00819.13
8.3.10.0030.00620.87
8.3.00.0040.00418.05
8.2.180.0140.00716.88
8.2.170.0140.00719.20
8.2.160.0070.00722.96
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00419.88
8.2.120.0050.00226.35
8.2.110.0070.00321.03
8.2.100.0120.00018.09
8.2.90.0030.00518.03
8.2.80.0040.00417.97
8.2.70.0090.00018.15
8.2.60.0060.00317.93
8.2.50.0080.00018.10
8.2.40.0030.00619.42
8.2.30.0040.00419.66
8.2.20.0000.00718.16
8.2.10.0040.00418.13
8.2.00.0040.00419.57
8.1.280.0130.00325.92
8.1.270.0050.00324.09
8.1.260.0050.00226.35
8.1.250.0080.00028.09
8.1.240.0030.00723.91
8.1.230.0040.00821.00
8.1.220.0000.00817.79
8.1.210.0000.00819.16
8.1.200.0030.00617.60
8.1.190.0000.00817.60
8.1.180.0040.00418.10
8.1.170.0000.00818.76
8.1.160.0000.00718.92
8.1.150.0060.00318.89
8.1.140.0040.00417.83
8.1.130.0030.00319.07
8.1.120.0000.00717.73
8.1.110.0040.00417.59
8.1.100.0030.00717.54
8.1.90.0040.00417.61
8.1.80.0030.00617.71
8.1.70.0030.00517.63
8.1.60.0040.00417.79
8.1.50.0040.00417.71
8.1.40.0000.00817.75
8.1.30.0040.00417.85
8.1.20.0000.00817.82
8.1.10.0030.00617.67
8.1.00.0000.00817.72
8.0.300.0040.00419.98
8.0.290.0030.00617.00
8.0.280.0030.00318.57
8.0.270.0040.00417.32
8.0.260.0070.00317.26
8.0.250.0030.00417.21
8.0.240.0040.00417.17
8.0.230.0000.00717.10
8.0.220.0090.00317.15
8.0.210.0030.00317.13
8.0.200.0000.00817.13
8.0.190.0050.00317.16
8.0.180.0040.00417.01
8.0.170.0000.00817.13
8.0.160.0040.00417.02
8.0.150.0050.00516.89
8.0.140.0000.00716.96
8.0.130.0000.00513.55
8.0.120.0040.00416.99
8.0.110.0040.00417.01
8.0.100.0040.00417.02
8.0.90.0040.00417.01
8.0.80.0030.01817.14
8.0.70.0000.00717.21
8.0.60.0040.00417.02
8.0.50.0030.00517.16
8.0.30.0080.00917.32
8.0.20.0170.00317.40
8.0.10.0000.00817.07
8.0.00.0100.01217.08
7.4.330.0050.00015.55
7.4.320.0030.00316.83
7.4.300.0000.00616.86
7.4.290.0030.00516.80
7.4.280.0080.00016.86
7.4.270.0040.00416.82
7.4.260.0070.00016.88
7.4.250.0030.00316.87
7.4.240.0000.00716.96
7.4.230.0050.00216.90
7.4.220.0000.00816.92
7.4.210.0080.00916.89
7.4.200.0000.00716.70
7.4.160.0110.00416.71
7.4.140.0130.00917.86
7.4.130.0040.01516.76
7.4.120.0100.01016.84
7.4.110.0160.00316.82
7.4.100.0130.00316.82
7.4.90.0070.01016.70
7.4.80.0120.00619.39
7.4.70.0070.01016.77
7.4.60.0100.01316.79
7.4.50.0000.01316.73
7.4.40.0060.01116.78
7.4.00.0090.00615.36
7.3.330.0000.00613.43
7.3.320.0000.00613.48
7.3.310.0000.00816.52
7.3.300.0040.00416.55
7.3.290.0070.00016.54
7.3.280.0160.00516.57
7.3.260.0070.01016.50
7.3.240.0100.00716.65
7.3.230.0120.00616.54
7.3.210.0030.01516.42
7.3.200.0100.01116.85
7.3.190.0030.01516.83
7.3.180.0090.00916.49
7.3.170.0100.00616.48
7.3.160.0140.00316.64
7.3.10.0040.01117.01
7.3.00.0040.01116.71
7.2.330.0140.00416.84
7.2.320.0070.01616.94
7.2.310.0120.00617.10
7.2.300.0160.00216.90
7.2.290.0060.01116.94
7.2.130.0030.01017.12
7.2.120.0060.00617.25
7.2.110.0110.00417.17
7.2.100.0060.00916.84
7.2.90.0030.01317.10
7.2.80.0050.00517.36
7.2.70.0060.00817.21
7.2.60.1310.00816.11
7.2.50.1120.00916.19
7.2.40.0780.00716.54
7.2.30.1010.01016.47
7.2.20.0960.00816.49
7.2.10.1340.01116.39
7.2.00.1130.01016.44
7.1.250.0030.00715.83
7.1.200.0000.01215.90
7.1.170.1900.00713.87
7.1.160.1360.01017.25
7.1.150.3010.01017.40
7.1.140.2390.01017.30
7.1.130.2070.01116.98
7.1.120.2020.00917.36
7.1.110.2160.00516.48
7.1.100.2170.01316.25
7.1.90.2320.01216.38
7.1.80.2420.01616.59
7.1.70.2120.01015.62
7.1.60.2360.01333.47
7.1.50.2250.01232.97
7.1.40.2370.01433.08
7.1.30.2110.01332.82
7.1.20.2100.01632.95
7.1.10.1990.00914.91
7.1.00.2000.01315.07

preferences:
55.9 ms | 401 KiB | 5 Q