3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/^(?=.{8,12}$)(?=[^A-Z]*[A-Z])(?=\D*\d)(?=(?:[^a-z]*[a-z]){3})(?=[^\s#*.!?$]*[#*.!?$])(?!.*(.)\1)(?:[a-z]|[A-Z])[a-zA-Z0-9#*.!?$,]+$/m'; $str = 'Abcd123!, Abcd123!, abcD123!,dfe abcD123,dfe abcD122!,dfe'; preg_match_all($re, $str, $matches); print_r($matches[0]); $strings = [ "Abcd123!,", "Abcd123!,", "abcD123!,dfe", "abcD123,dfe", "abcD122!,dfe" ]; $re2 = '/^(?=.{8,12}$)(?=[^A-Z]*[A-Z])(?=\D*\d)(?=(?:[^a-z]*[a-z]){3})(?=[^\s#*.!?$]*[#*.!?$])(?!.*(.)\1)(?:[a-z]|[A-Z])[a-zA-Z0-9#*.!?$,]+$/'; foreach ($strings as $string) { if (preg_match($re2, $string)) { echo "Match for $string" . PHP_EOL; } else { echo "No match for $string" . PHP_EOL; } }

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.140.0170.01117.60
8.4.130.0100.01017.97
8.4.120.0120.00920.72
8.4.110.0120.00820.94
8.4.100.0140.00517.92
8.4.90.0090.01418.53
8.4.80.0060.00318.04
8.4.70.0120.00818.00
8.4.60.0150.00818.93
8.4.50.0120.00818.09
8.4.40.0120.00819.79
8.4.30.0000.00819.71
8.4.20.0170.00319.00
8.4.10.0120.00619.50
8.3.270.0130.00716.65
8.3.260.0110.00916.82
8.3.250.0120.00718.77
8.3.240.0130.00716.70
8.3.230.0040.00716.88
8.3.220.0140.00417.23
8.3.210.0100.00716.73
8.3.200.0050.00416.62
8.3.190.0080.01116.53
8.3.180.0090.00916.57
8.3.170.0070.01119.00
8.3.160.0040.01416.78
8.3.150.0140.00417.25
8.3.140.0100.01018.30
8.3.130.0060.00918.40
8.3.120.0120.00818.86
8.3.110.0090.01220.94
8.3.100.0030.00624.06
8.3.90.0080.00026.77
8.3.80.0030.00718.66
8.3.70.0070.00718.68
8.3.60.0040.01218.56
8.3.50.0100.00516.61
8.3.40.0110.00718.93
8.3.30.0120.00318.96
8.3.20.0090.00020.50
8.3.10.0050.00323.66
8.3.00.0070.00022.39
8.2.290.0080.01320.43
8.2.280.0060.01118.53
8.2.270.0000.00717.20
8.2.260.0050.00319.27
8.2.250.0050.00316.82
8.2.240.0060.00318.96
8.2.230.0070.00322.58
8.2.220.0070.00337.54
8.2.210.0040.00426.77
8.2.200.0030.00618.41
8.2.190.0000.01518.66
8.2.180.0190.00316.75
8.2.170.0090.00622.96
8.2.160.0110.00321.23
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0050.00318.03
8.2.120.0030.00526.35
8.2.110.0090.00922.14
8.2.100.0060.00618.03
8.2.90.0090.00022.28
8.2.80.0030.00517.97
8.2.70.0030.00518.02
8.2.60.0000.00818.16
8.2.50.0000.01118.10
8.2.40.0030.00519.42
8.2.30.0000.00819.35
8.2.20.0040.00418.28
8.2.10.0080.00019.38
8.2.00.0000.00819.89
8.1.330.0080.01022.22
8.1.320.0130.00616.34
8.1.310.0090.00316.55
8.1.300.0130.00618.17
8.1.290.0050.00530.84
8.1.280.0120.00325.92
8.1.270.0030.00523.98
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00722.59
8.1.230.0040.00720.93
8.1.220.0030.00517.74
8.1.210.0050.00318.90
8.1.200.0000.00817.36
8.1.190.0000.00817.35
8.1.180.0050.00318.10
8.1.170.0040.00418.66
8.1.160.0040.00418.93
8.1.150.0040.00418.94
8.1.140.0000.00722.15
8.1.130.0040.00417.61
8.1.120.0000.00717.63
8.1.110.0000.00717.66
8.1.100.0100.00017.63
8.1.90.0000.00817.52
8.1.80.0080.00017.66
8.1.70.0030.00317.68
8.1.60.0000.00817.74
8.1.50.0030.00517.74
8.1.40.0040.00417.71
8.1.30.0000.00817.83
8.1.20.0070.00317.79
8.1.10.0040.00417.63
8.1.00.0040.00417.73
8.0.300.0000.00919.98
8.0.290.0000.00817.00
8.0.280.0030.00318.50
8.0.270.0000.00817.38
8.0.260.0000.00716.93
8.0.250.0040.00417.02
8.0.240.0000.00717.10
8.0.230.0020.00517.12
8.0.220.0000.00717.06
8.0.210.0000.00716.91
8.0.200.0000.00817.13
8.0.190.0030.00716.99
8.0.180.0000.00717.09
8.0.170.0060.00317.09
8.0.160.0000.00817.04
8.0.150.0000.00717.00
8.0.140.0000.00717.00
8.0.130.0030.00313.43
8.0.120.0050.00316.94
8.0.110.0040.00416.91
8.0.100.0050.00216.87
8.0.90.0030.00317.07
8.0.80.0080.00717.05
8.0.70.0040.00416.93
8.0.60.0000.00717.07
8.0.50.0080.00017.03
8.0.30.0100.00617.06
8.0.20.0090.01217.15
8.0.10.0000.00917.14
8.0.00.0120.00817.07
7.4.330.0030.00316.73
7.4.320.0000.00816.73
7.4.300.0000.00616.89
7.4.290.0050.00316.75
7.4.280.0000.00816.71
7.4.270.0050.00316.88
7.4.260.0040.00416.82
7.4.250.0030.00316.80
7.4.240.0050.00216.82
7.4.230.0050.00216.82
7.4.220.0030.00616.87
7.4.210.0070.01016.76
7.4.200.0000.00716.82
7.4.160.0070.01016.74
7.4.140.0100.01017.86
7.4.130.0150.00316.67
7.4.120.0090.00916.57
7.4.110.0150.00316.73
7.4.100.0160.00716.98
7.4.90.0030.01416.60
7.4.80.0090.00919.39
7.4.70.0120.00916.66
7.4.60.0080.00816.91
7.4.50.0100.00216.56
7.4.40.0070.01116.78
7.4.10.0090.01216.71
7.4.00.0060.00615.93
7.3.330.0020.00213.23
7.3.320.0000.00613.34
7.3.310.0080.00016.42
7.3.300.0070.00016.30
7.3.290.0090.00616.44
7.3.280.0100.01016.52
7.3.260.0100.00816.52
7.3.240.0080.01116.54
7.3.230.0170.00416.72
7.3.210.0150.00716.94
7.3.200.0120.00416.54
7.3.190.0000.01716.79
7.3.180.0150.00316.69
7.3.170.0100.01316.54
7.3.160.0090.01216.70
7.3.130.0140.00716.52
7.3.120.0090.00416.38
7.3.110.0080.00816.74
7.3.100.0040.01216.50
7.3.90.0000.01216.65
7.3.80.0040.01116.47
7.3.70.0130.00316.62
7.3.60.0000.01016.60
7.3.50.0090.00616.49
7.3.40.0000.01516.53
7.3.30.0070.01315.78
7.3.20.0340.00616.74
7.3.10.0370.00716.68
7.3.00.0330.00916.71
7.2.330.0110.00716.73
7.2.320.0060.01216.81
7.2.310.0080.01316.86
7.2.300.0110.00516.79
7.2.290.0160.00616.66
7.2.260.0040.01216.74
7.2.250.0130.00816.73
7.2.240.0030.01416.65
7.2.230.0000.01116.93
7.2.220.0040.01116.69
7.2.210.0100.00716.77
7.2.200.0000.01216.68
7.2.190.0000.01016.61
7.2.180.0090.00716.72
7.2.170.0140.00316.68
7.2.160.0130.00016.00
7.2.150.0350.00716.92
7.2.140.0310.00616.96
7.2.130.0380.00716.89
7.2.120.0320.00516.79
7.2.110.0300.00716.87
7.2.100.0330.00416.95
7.2.90.0290.00316.87
7.2.80.0320.00516.98
7.2.70.0240.00816.91
7.2.60.0300.00816.92
7.2.50.0270.00616.92
7.2.40.0290.01116.88
7.2.30.0360.01116.86
7.2.20.0840.00316.93
7.2.10.0340.00716.86
7.2.00.0290.00816.95
7.1.330.0110.00817.47
7.1.320.0070.00717.57
7.1.310.0070.01017.77
7.1.300.0030.01017.62
7.1.290.0110.00417.55
7.1.280.0090.00317.33
7.1.270.0360.00515.82
7.1.260.0420.00415.82
7.1.250.0380.00515.74
7.1.240.0030.01017.47
7.1.230.0090.00617.56
7.1.220.0160.00017.48
7.1.210.0110.00417.54
7.1.200.0030.01017.47
7.1.190.0030.01317.45
7.1.180.0090.00917.43
7.1.170.0000.01517.57
7.1.160.0080.00417.54
7.1.150.0030.01217.62
7.1.140.0030.01417.63
7.1.130.0040.01117.34
7.1.120.0030.01317.43
7.1.110.0060.00917.59
7.1.100.0150.00317.52
7.1.90.0040.01217.44
7.1.80.0070.00717.46
7.1.70.0040.00917.47
7.1.60.0100.00717.67
7.1.50.0040.01417.55
7.1.40.0120.00317.63
7.1.30.0120.00317.59
7.1.20.0100.00717.58
7.1.10.0090.00917.52
7.1.00.0060.01017.55

preferences:
31.17 ms | 403 KiB | 5 Q