3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = '/(\b\w+\b).*\b\1\b.*/i'; //should match $string = "TheseCharacters, I really enjoy TheseCharacters"; $result = preg_match($pattern, $string, $matches); echo "String 1 matches {$result} times: ".print_r($matches,true)."\n"; //should match $string = "TheseCharacters, I really enjoy TheseCharacters"; $result = preg_match($pattern, $string, $matches); echo "String 1 matches {$result} times: ".print_r($matches,true)."\n"; //match only with case insensitive flag, not an exact match in case $string = "TheseCharacters, I really enjoy TheseCharacters and some others"; $result = preg_match($pattern, $string, $matches); echo "String 2 matches {$result} times: ".print_r($matches,true)."\n"; //no match, TheseCharacters has been changed to TheseLetters $string = "TheseCharacters, I really enjoy TheseLetters"; $result = preg_match($pattern, $string, $matches); echo "String 3 matches {$result} times: ".print_r($matches,true)."\n"; //no match, additional letters has been added to TheseCharacters $string = "TheseCharacters, I really enjoy TheseCharactersasdf"; $result = preg_match($pattern, $string, $matches); echo "String 4 matches {$result} times: ".print_r($matches,true)."\n";

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.0040.01116.88
8.3.50.0130.00821.21
8.3.40.0110.00418.86
8.3.30.0090.00618.60
8.3.20.0040.00421.52
8.3.10.0000.00821.95
8.3.00.0070.00023.48
8.2.180.0090.00916.75
8.2.170.0030.01318.94
8.2.160.0100.00322.96
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0070.00021.24
8.2.110.0000.00922.36
8.2.100.0060.00617.84
8.2.90.0080.00017.97
8.2.80.0040.00418.84
8.2.70.0000.00817.93
8.2.60.0060.00318.22
8.2.50.0000.01018.10
8.2.40.0000.00819.47
8.2.30.0000.00719.21
8.2.20.0040.00418.17
8.2.10.0050.00318.17
8.2.00.0040.00417.88
8.1.280.0070.00725.92
8.1.270.0050.00223.97
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0030.00622.03
8.1.230.0030.00920.98
8.1.220.0040.00417.74
8.1.210.0060.00318.91
8.1.200.0030.00617.47
8.1.190.0030.00517.23
8.1.180.0040.00418.10
8.1.170.0030.00518.69
8.1.160.0000.00722.18
8.1.150.0000.00818.92
8.1.140.0080.00019.66
8.1.130.0030.00317.62
8.1.120.0040.00417.64
8.1.110.0040.00417.52
8.1.100.0080.00017.62
8.1.90.0080.00017.61
8.1.80.0020.00517.53
8.1.70.0000.01017.66
8.1.60.0000.00817.82
8.1.50.0040.00417.76
8.1.40.0050.00317.55
8.1.30.0000.00817.80
8.1.20.0080.00017.71
8.1.10.0070.00317.58
8.1.00.0000.00817.58
8.0.300.0070.00020.16
8.0.290.0080.00016.88
8.0.280.0040.00418.39
8.0.270.0080.00017.22
8.0.260.0030.00318.49
8.0.250.0050.00217.06
8.0.240.0030.00317.18
8.0.230.0030.00317.14
8.0.220.0000.00717.05
8.0.210.0000.00717.05
8.0.200.0050.00217.04
8.0.190.0000.00817.10
8.0.180.0040.00317.11
8.0.170.0080.00017.16
8.0.160.0040.00417.05
8.0.150.0070.00017.10
8.0.140.0040.00417.08
8.0.130.0060.00013.53
8.0.120.0050.00317.02
8.0.110.0040.00417.01
8.0.100.0050.00316.91
8.0.90.0000.00716.86
8.0.80.0090.01217.08
8.0.70.0040.00417.06
8.0.60.0040.00416.93
8.0.50.0000.00716.96
8.0.30.0150.00417.31
8.0.20.0110.00817.43
8.0.10.0050.00317.15
8.0.00.0080.00817.14
7.4.330.0000.00715.55
7.4.320.0030.00316.84
7.4.300.0030.00316.66
7.4.290.0070.00016.84
7.4.280.0040.00416.69
7.4.270.0040.00416.85
7.4.260.0040.00416.64
7.4.250.0040.00416.73
7.4.240.0070.00016.86
7.4.230.0000.00716.57
7.4.220.0060.01016.84
7.4.210.0090.01216.93
7.4.200.0040.00416.66
7.4.160.0100.00716.55
7.4.150.0060.01517.40
7.4.140.0100.00817.86
7.4.130.0110.00716.58
7.4.120.0070.01116.68
7.4.110.0070.01016.54
7.4.100.0110.00716.66
7.4.90.0070.01316.88
7.4.80.0150.00319.39
7.4.70.0060.01216.62
7.4.60.0090.00616.78
7.4.50.0090.00616.54
7.4.40.0030.01316.68
7.4.30.0060.01016.59
7.3.330.0000.00613.17
7.3.320.0060.00013.30
7.3.310.0040.00416.27
7.3.300.0070.00016.49
7.3.290.0090.00716.43
7.3.280.0090.00916.40
7.3.270.0140.00317.40
7.3.260.0060.01116.75
7.3.250.0120.00516.70
7.3.240.0100.00916.46
7.3.230.0070.01216.41
7.3.210.0070.01016.46
7.3.200.0110.00516.70
7.3.190.0090.00616.34
7.3.180.0090.00916.75
7.3.170.0080.01216.71
7.3.160.0180.00416.55
7.2.330.0090.01216.79
7.2.320.0130.01016.99
7.2.310.0070.01016.82
7.2.300.0090.01216.76
7.2.290.0130.01316.81
7.1.00.0030.07722.59
7.0.110.0100.05720.31
7.0.100.0030.06020.48
7.0.90.0230.04720.41
7.0.80.0130.05020.27
7.0.70.0170.04720.20
7.0.60.0200.04320.23
7.0.50.0030.06020.30
7.0.40.0230.05720.39
7.0.30.0400.05720.29
7.0.20.0300.05320.25
7.0.10.0270.05320.38
7.0.00.0230.05720.29
5.6.260.0030.06020.80
5.6.250.0070.06021.05
5.6.240.0030.06321.02
5.6.230.0130.05321.10
5.6.220.0130.05021.09
5.6.210.0100.05320.98
5.6.200.0070.06021.00
5.6.190.0030.06721.02
5.6.180.0170.04721.02
5.6.170.0200.04721.09
5.6.160.0000.06321.07
5.6.150.0070.06021.02
5.6.140.0130.05320.87
5.6.130.0130.05020.84
5.6.120.0070.06021.04
5.6.110.0100.05720.92
5.6.100.0070.06020.83
5.6.90.0130.04720.91
5.6.80.0070.05320.40
5.6.70.0070.05320.38
5.6.60.0130.04720.40
5.6.50.0000.05720.45
5.6.40.0030.05720.43
5.6.30.0130.04720.37
5.6.20.0030.06320.30
5.6.10.0030.05720.30
5.6.00.0070.05720.40

preferences:
61.1 ms | 401 KiB | 5 Q