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.70.0110.00716.63
8.3.60.0040.01816.75
8.3.50.0140.00721.16
8.3.40.0100.00718.78
8.3.30.0040.01118.88
8.3.20.0000.00921.53
8.3.10.0030.00521.91
8.3.00.0060.00323.60
8.2.180.0110.00425.92
8.2.170.0100.01022.96
8.2.160.0160.00320.53
8.2.150.0080.00024.18
8.2.140.0000.00724.66
8.2.130.0040.00419.83
8.2.120.0080.00026.35
8.2.110.0070.00420.45
8.2.100.0110.00018.03
8.2.90.0030.00617.74
8.2.80.0050.00318.86
8.2.70.0080.00017.75
8.2.60.0050.00317.75
8.2.50.0040.00418.10
8.2.40.0050.00319.14
8.2.30.0000.00719.17
8.2.20.0000.00817.98
8.2.10.0000.00818.14
8.2.00.0040.00418.02
8.1.280.0160.00325.92
8.1.270.0050.00323.92
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0090.00023.82
8.1.230.0110.00019.14
8.1.220.0030.00517.74
8.1.210.0000.00918.77
8.1.200.0080.00017.38
8.1.190.0050.00517.37
8.1.180.0030.00618.10
8.1.170.0060.00318.63
8.1.160.0070.00022.22
8.1.150.0000.00718.91
8.1.140.0070.00019.63
8.1.130.0000.00717.62
8.1.120.0030.00317.61
8.1.110.0040.00417.60
8.1.100.0050.00317.63
8.1.90.0030.00517.62
8.1.80.0000.00717.51
8.1.70.0030.00817.61
8.1.60.0050.00517.72
8.1.50.0030.00517.73
8.1.40.0040.00417.69
8.1.30.0000.00817.71
8.1.20.0050.00317.76
8.1.10.0000.01217.69
8.1.00.0030.00517.54
8.0.300.0080.00319.73
8.0.290.0040.00417.00
8.0.280.0000.00818.47
8.0.270.0000.00717.04
8.0.260.0040.00420.16
8.0.250.0050.00317.02
8.0.240.0050.00317.08
8.0.230.0000.00717.09
8.0.220.0000.00717.00
8.0.210.0060.00317.06
8.0.200.0060.00317.01
8.0.190.0030.00517.07
8.0.180.0040.00417.13
8.0.170.0070.00017.14
8.0.160.0050.00317.09
8.0.150.0000.00817.09
8.0.140.0040.00416.92
8.0.130.0000.00513.55
8.0.120.0000.00817.02
8.0.110.0040.00417.07
8.0.100.0000.00716.96
8.0.90.0000.00717.01
8.0.80.0160.00617.09
8.0.70.0040.00317.13
8.0.60.0000.00717.05
8.0.50.0040.00417.17
8.0.30.0090.00917.39
8.0.20.0090.01217.43
8.0.10.0040.00416.93
8.0.00.0070.01016.76
7.4.330.0040.00415.55
7.4.320.0000.00616.76
7.4.300.0060.00016.65
7.4.290.0030.00316.80
7.4.280.0000.00716.80
7.4.270.0030.00316.72
7.4.260.0040.00416.86
7.4.250.0030.00316.81
7.4.240.0000.00716.72
7.4.230.0030.00316.88
7.4.220.0160.00616.93
7.4.210.0090.01216.73
7.4.200.0000.00816.54
7.4.160.0100.00716.54
7.4.150.0070.01117.40
7.4.140.0090.00817.86
7.4.130.0090.01216.56
7.4.120.0060.01316.78
7.4.110.0100.00716.75
7.4.100.0030.02116.61
7.4.90.0090.01516.85
7.4.80.0140.00819.39
7.4.70.0160.00916.64
7.4.60.0030.01316.70
7.4.50.0000.01616.48
7.4.40.0030.01216.59
7.4.30.0150.00316.50
7.4.00.0020.01415.06
7.3.330.0000.00513.37
7.3.320.0000.00613.42
7.3.310.0070.00016.40
7.3.300.0000.00616.43
7.3.290.0000.00716.46
7.3.280.0090.00816.49
7.3.270.0060.01217.40
7.3.260.0080.00816.55
7.3.250.0090.00816.47
7.3.240.0100.01016.66
7.3.230.0110.01116.86
7.3.210.0070.01016.70
7.3.200.0100.00716.80
7.3.190.0140.00316.77
7.3.180.0030.02016.77
7.3.170.0060.01116.49
7.3.160.0110.00716.62
7.3.120.0030.01414.97
7.3.110.0070.01014.73
7.3.100.0120.00314.74
7.3.90.0100.00715.18
7.3.80.0030.01015.29
7.3.70.0000.00914.64
7.3.60.0120.00315.10
7.3.50.0030.01215.13
7.3.40.0060.00815.11
7.3.30.0040.01114.90
7.3.20.0100.00316.91
7.3.10.0090.00116.67
7.3.00.0040.00616.75
7.2.330.0090.01516.98
7.2.320.0130.00816.55
7.2.310.0090.00916.86
7.2.300.0090.01216.76
7.2.290.0150.00716.75
7.2.250.0030.01615.23
7.2.240.0060.00915.23
7.2.230.0100.00715.12
7.2.220.0030.01415.27
7.2.210.0060.00915.16
7.2.200.0120.00315.30
7.2.190.0040.00815.25
7.2.180.0070.00715.30
7.2.170.0070.00315.47
7.2.130.0080.00516.88
7.2.120.0070.00717.05
7.2.110.0090.00517.07
7.2.100.0030.00817.07
7.2.90.0040.00817.11
7.2.80.0070.00616.98
7.2.70.0060.00717.02
7.2.60.0050.00716.99
7.2.50.0050.01017.02
7.2.40.0060.00717.11
7.2.30.0060.00616.98
7.2.20.0080.00517.06
7.2.10.0080.00317.00
7.2.00.0040.00617.81
7.1.330.0030.01016.09
7.1.320.0060.00915.74
7.1.310.0030.01015.79
7.1.300.0030.00715.93
7.1.290.0040.00716.09
7.1.280.0090.00315.98
7.1.270.0110.00015.88
7.1.260.0060.00915.70
7.1.250.0060.00515.99
7.1.200.0040.01115.99
7.1.70.0030.00617.36
7.1.60.0000.01017.16
7.1.00.0000.08022.26
7.0.200.0620.00614.77
7.0.110.0330.06320.36
7.0.100.0400.05020.32
7.0.90.0370.05720.34
7.0.80.0300.06020.29
7.0.70.0400.05320.28
7.0.60.0370.05720.25
7.0.50.0400.06020.35
7.0.40.0400.06320.30
7.0.30.0330.05720.22
7.0.20.0430.06320.26
7.0.10.0400.05320.34
7.0.00.0470.05020.36
5.6.260.0030.06320.95
5.6.250.0170.05320.91
5.6.240.0070.06321.04
5.6.230.0100.05720.88
5.6.220.0070.06021.09
5.6.210.0130.05321.07
5.6.200.0030.07020.84
5.6.190.0170.05720.88
5.6.180.0130.05721.03
5.6.170.0130.05321.02
5.6.160.0170.05021.07
5.6.150.0100.06021.02
5.6.140.0070.06321.04
5.6.130.0100.05720.80
5.6.120.0100.06021.03
5.6.110.0100.06020.83
5.6.100.0030.06721.00
5.6.90.0070.06020.98
5.6.80.0070.05720.43
5.6.70.0170.04720.40
5.6.60.0100.05720.41
5.6.50.0030.05720.21
5.6.40.0030.05720.19
5.6.30.0130.05720.11
5.6.20.0130.06320.38
5.6.10.0030.06020.21
5.6.00.0170.04720.37

preferences:
49.26 ms | 401 KiB | 5 Q