3v4l.org

run code in 300+ PHP versions simultaneously
<?php $newString = "One of the best card on the world I love it and use it everyday for everything, I feel I have $1 000 000 in my pocket All the best Amex of the world, and many thanks Sami Suhail NYC Rock Inc."; $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'; } } echo $replacement; $match = preg_quote($match); echo $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.0140.00717.00
8.3.50.0100.00716.57
8.3.40.0060.00919.04
8.3.30.0000.01519.05
8.3.20.0040.00419.07
8.3.10.0040.00421.07
8.3.00.0030.00518.14
8.2.180.0130.00616.88
8.2.170.0110.00422.96
8.2.160.0060.01219.24
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00021.16
8.2.110.0030.00722.10
8.2.100.0070.00418.22
8.2.90.0030.00518.00
8.2.80.0080.00019.20
8.2.70.0050.00519.78
8.2.60.0040.00417.93
8.2.50.0000.00818.10
8.2.40.0040.00419.32
8.2.30.0000.00819.59
8.2.20.0020.00518.22
8.2.10.0050.00218.27
8.2.00.0080.00019.66
8.1.280.0110.00425.92
8.1.270.0080.00024.04
8.1.260.0090.00626.35
8.1.250.0040.00428.09
8.1.240.0060.00322.20
8.1.230.0040.00818.08
8.1.220.0060.00318.04
8.1.210.0030.00518.77
8.1.200.0030.00717.60
8.1.190.0000.00817.60
8.1.180.0080.00018.10
8.1.170.0030.00518.80
8.1.160.0040.00419.08
8.1.150.0000.00819.03
8.1.140.0040.00417.78
8.1.130.0030.00319.25
8.1.120.0030.00617.71
8.1.110.0040.00417.68
8.1.100.0070.00417.71
8.1.90.0040.00417.58
8.1.80.0000.00817.62
8.1.70.0050.00317.71
8.1.60.0040.00417.71
8.1.50.0000.00917.63
8.1.40.0050.00317.79
8.1.30.0000.00917.69
8.1.20.0030.00617.92
8.1.10.0040.00417.81
8.1.00.0030.00517.65
8.0.300.0040.00418.77
8.0.290.0080.00016.88
8.0.280.0030.00318.43
8.0.270.0070.00017.30
8.0.260.0050.00517.24
8.0.250.0000.00717.25
8.0.240.0030.00317.03
8.0.230.0000.00717.14
8.0.220.0080.00017.15
8.0.210.0070.00017.09
8.0.200.0060.00017.12
8.0.190.0000.00817.18
8.0.180.0030.00517.11
8.0.170.0040.00417.14
8.0.160.0000.00717.09
8.0.150.0000.00716.92
8.0.140.0000.00817.10
8.0.130.0060.00013.50
8.0.120.0000.00817.10
8.0.110.0000.00717.19
8.0.100.0000.00816.93
8.0.90.0080.00017.05
8.0.80.0090.00917.14
8.0.70.0000.00717.28
8.0.60.0000.00817.05
8.0.50.0080.00017.11
8.0.30.0070.01017.42
8.0.20.0110.00817.40
8.0.10.0040.00417.35
8.0.00.0110.01216.95
7.4.330.0050.00015.55
7.4.320.0000.00616.88
7.4.300.0060.00016.93
7.4.290.0000.00716.72
7.4.280.0030.00516.89
7.4.270.0000.00816.81
7.4.260.0050.00316.95
7.4.250.0000.00716.92
7.4.240.0070.00017.00
7.4.230.0030.00316.96
7.4.220.0050.00216.92
7.4.210.0060.00916.89
7.4.200.0000.00716.81
7.4.160.0110.00716.89
7.4.140.0110.00917.86
7.4.130.0150.00316.76
7.4.120.0110.01016.84
7.4.110.0080.00816.81
7.4.100.0060.01016.86
7.4.90.0120.00616.71
7.4.80.0080.01619.39
7.4.70.0070.01616.80
7.4.60.0130.00316.66
7.4.50.0070.00716.58
7.4.40.0040.01516.62
7.4.10.0070.01115.21
7.4.00.0070.00915.28
7.3.330.0030.00313.26
7.3.320.0000.00613.30
7.3.310.0070.00016.62
7.3.300.0040.00416.42
7.3.290.0070.00016.53
7.3.280.0140.00816.58
7.3.260.0100.00716.67
7.3.240.0090.00916.67
7.3.230.0120.00616.57
7.3.210.0070.01516.93
7.3.200.0030.01316.70
7.3.190.0160.00016.89
7.3.180.0100.00716.71
7.3.170.0110.00716.66
7.3.160.0070.01016.63
7.3.130.0110.00715.32
7.3.120.0050.01314.94
7.3.110.0040.01515.07
7.3.100.0040.00914.99
7.3.90.0050.00515.04
7.3.80.0030.01015.09
7.3.70.0070.00715.17
7.3.60.0020.01415.14
7.3.50.0050.01214.93
7.3.40.0100.00215.00
7.3.30.0040.01115.02
7.3.20.0060.00816.86
7.3.10.0060.00916.81
7.3.00.0050.01216.97
7.2.330.0100.01317.06
7.2.320.0100.01316.93
7.2.310.0070.01317.01
7.2.300.0060.01216.93
7.2.290.0060.01116.86
7.2.260.0120.00915.40
7.2.250.0110.00915.33
7.2.240.0050.01215.28
7.2.230.0070.01015.26
7.2.220.0030.00815.45
7.2.210.0050.01215.30
7.2.200.0020.01315.26
7.2.190.0060.01015.26
7.2.180.0060.00615.17
7.2.170.0000.01215.42
7.2.160.0000.01415.12
7.2.150.0000.01617.14
7.2.140.0040.01117.21
7.2.130.0030.00917.35
7.2.120.0110.00717.30
7.2.110.0060.00917.02
7.2.100.0070.01116.90
7.2.90.0090.00617.04
7.2.80.0030.01316.95
7.2.70.0060.00616.84
7.2.60.0860.00716.29
7.2.50.0920.00516.27
7.2.40.0960.00716.35
7.2.30.0670.00916.45
7.2.20.0780.00816.27
7.2.10.1050.00716.46
7.2.00.0860.00816.37
7.1.330.0030.01015.99
7.1.320.0050.00716.13
7.1.310.0030.01015.98
7.1.300.0040.01015.88
7.1.290.0040.00615.90
7.1.280.0030.01016.00
7.1.270.0080.00715.89
7.1.260.0080.00715.90
7.1.250.0060.00915.81
7.1.240.0120.00316.07
7.1.230.0000.01215.95
7.1.220.0040.01415.86
7.1.210.0030.00716.14
7.1.200.0020.01215.82
7.1.190.0040.00816.02
7.1.180.0100.00315.91
7.1.170.0650.00914.93
7.1.160.0990.00616.73
7.1.150.0750.01116.61
7.1.140.0930.01016.73
7.1.130.0620.00916.48
7.1.120.0800.00816.57
7.1.110.0810.00616.27
7.1.100.0920.01216.35
7.1.90.0830.01016.26
7.1.80.0700.00816.14
7.1.70.1060.01015.71
7.1.60.1170.01024.74
7.1.50.1240.01324.57
7.1.40.1180.01424.46
7.1.30.0330.01324.34
7.1.20.1100.01124.52
7.1.10.0810.00815.42
7.1.00.0960.00915.56
7.0.330.0080.00315.73
7.0.320.0040.01115.57
7.0.310.0030.01015.54
7.0.300.0120.00315.39
7.0.290.0100.00315.68
7.0.280.0070.00715.80
7.0.270.0030.01315.55
7.0.260.0030.00715.51
7.0.250.0070.00315.61
7.0.240.0090.00615.32
7.0.230.0060.00615.68
7.0.220.0160.00015.80
7.0.210.0070.00315.58
7.0.200.0070.00715.56
7.0.190.0070.00415.68
7.0.180.0070.00315.71
7.0.170.0040.00415.65
7.0.160.0060.00615.80
7.0.150.0030.01315.63
7.0.140.0100.00315.61
7.0.130.0070.00415.47
7.0.120.0000.01315.79
7.0.110.0030.01315.80
7.0.100.0000.01015.64
7.0.90.0060.00615.41
7.0.80.0000.00815.58
7.0.70.0030.00715.61
7.0.60.0030.00915.81
7.0.50.0110.00715.70
7.0.40.0050.00513.77
7.0.30.0070.00313.78
7.0.20.0120.00013.80
7.0.10.0060.01013.68
7.0.00.0040.01213.68
5.6.400.0100.01014.67
5.6.390.0120.00014.52
5.6.380.0090.00014.85
5.6.370.0090.00314.67
5.6.360.0000.01514.66
5.6.350.0060.00314.54
5.6.340.0040.01114.30
5.6.330.0140.00014.44
5.6.320.0060.00614.36
5.6.310.0060.00314.70
5.6.300.0050.00514.55
5.6.290.0030.00614.26
5.6.280.0090.00614.64
5.6.270.0060.00314.55
5.6.260.0030.01414.21
5.6.250.0050.00314.35
5.6.240.0040.01114.51
5.6.230.0050.00314.57
5.6.220.0060.00614.38
5.6.210.0100.00314.34
5.6.200.0040.00714.77
5.6.190.0030.00614.55
5.6.180.0070.00714.64
5.6.170.0040.01214.50
5.6.160.0070.01014.31
5.6.150.0090.00314.21
5.6.140.0000.01214.54
5.6.130.0000.01314.58
5.6.120.0120.00314.44
5.6.110.0060.00614.53
5.6.100.0030.01214.68
5.6.90.0030.01314.11
5.6.80.0090.00614.39
5.6.70.0070.01014.30
5.6.60.0040.01214.16
5.6.50.0080.00414.56
5.6.40.0030.01014.46
5.6.30.0030.01014.57
5.6.20.0030.01214.40
5.6.10.0120.00314.67
5.6.00.0040.00414.23

preferences:
60.76 ms | 400 KiB | 5 Q