3v4l.org

run code in 300+ PHP versions simultaneously
<?php function str_is($pattern, $value) { $patterns = is_array($pattern) ? $pattern : (array) $pattern; if (empty($patterns)) { return false; } foreach ($patterns as $pattern) { // If the given value is an exact match we can of course return true right // from the beginning. Otherwise, we will translate asterisks and do an // actual pattern match against the two strings to see if they match. if ($pattern == $value) { return true; } $pattern = preg_quote($pattern, '#'); var_dump($pattern); // Asterisks are translated into zero-or-more regular expression wildcards // to make it convenient to check if the strings starts with the given // pattern such as "library/*", making any string check convenient. $pattern = str_replace('\*', '.*', $pattern); if (preg_match('#^'.$pattern.'\z#u', $value) === 1) { return true; } } return false; } $result = preg_match('/[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}/i', '5d8977f1-8809-47b0-a01d-492373fd81c6'); $resultLaravel = str_is('[a-z]', '5d8977f1-8809-47b0-a01d-492373fd81c6'); var_dump($result, $resultLaravel);

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.0150.00018.68
8.3.50.0040.01119.89
8.3.40.0120.00918.88
8.3.30.0110.00418.96
8.3.20.0080.00020.29
8.3.10.0000.00818.85
8.3.00.0080.00023.65
8.2.180.0130.00918.29
8.2.170.0120.00322.96
8.2.160.0030.01420.39
8.2.150.0000.00724.18
8.2.140.0070.00024.66
8.2.130.0020.00520.53
8.2.120.0080.00026.35
8.2.110.0000.01022.43
8.2.100.0070.00418.03
8.2.90.0030.00620.14
8.2.80.0060.00318.03
8.2.70.0030.00617.93
8.2.60.0030.00718.09
8.2.50.0080.00018.16
8.2.40.0040.00420.53
8.2.30.0000.00819.31
8.2.20.0000.00717.99
8.2.10.0000.00718.10
8.2.00.0040.00418.10
8.1.280.0110.00725.92
8.1.270.0080.00023.90
8.1.260.0110.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00622.07
8.1.230.0070.00419.15
8.1.220.0050.00317.74
8.1.210.0030.00618.77
8.1.200.0000.00917.35
8.1.190.0000.00817.35
8.1.180.0060.00318.10
8.1.170.0000.00818.78
8.1.160.0040.00418.94
8.1.150.0050.00318.94
8.1.140.0040.00419.17
8.1.130.0000.00718.92
8.1.120.0090.00017.66
8.1.110.0080.00017.61
8.1.100.0080.00017.52
8.1.90.0050.00317.57
8.1.80.0090.00017.61
8.1.70.0070.00017.54
8.1.60.0040.00417.73
8.1.50.0030.00717.67
8.1.40.0030.00617.59
8.1.30.0000.00817.82
8.1.20.0000.00817.73
8.1.10.0000.00817.67
8.1.00.0000.00717.52
8.0.300.0040.00419.85
8.0.290.0040.00417.13
8.0.280.0070.00018.37
8.0.270.0000.00717.32
8.0.260.0030.00317.10
8.0.250.0030.00317.15
8.0.240.0000.00817.09
8.0.230.0070.00017.15
8.0.220.0040.00417.07
8.0.210.0030.00317.02
8.0.200.0090.00017.10
8.0.190.0090.00317.23
8.0.180.0000.00817.14
8.0.170.0000.00817.08
8.0.160.0030.00617.02
8.0.150.0050.00217.01
8.0.140.0050.00317.09
8.0.130.0000.00613.51
8.0.120.0050.00317.08
8.0.110.0040.00417.09
8.0.100.0040.00417.11
8.0.90.0080.00017.12
8.0.80.0040.01117.09
8.0.70.0000.00717.14
8.0.60.0000.00717.24
8.0.50.0030.00517.13
8.0.30.0110.00817.38
8.0.20.0100.01017.40
8.0.10.0000.00717.04
8.0.00.0100.01116.83
7.4.330.0030.00315.55
7.4.320.0060.00016.73
7.4.300.0030.00316.79
7.4.290.0000.00716.88
7.4.280.0030.00616.88
7.4.270.0030.00316.66
7.4.260.0000.00716.71
7.4.250.0070.00016.69
7.4.240.0050.00316.84
7.4.230.0000.00716.73
7.4.220.0070.01116.74
7.4.210.0070.01016.85
7.4.200.0000.00716.62
7.4.160.0090.00816.71
7.4.150.0040.01317.40
7.4.140.0090.00917.86
7.4.130.0150.00316.70
7.4.120.0170.00716.89
7.4.110.0070.01016.71
7.4.100.0130.00316.80
7.4.90.0150.00316.79
7.4.80.0100.00719.39
7.4.70.0150.00716.71
7.4.60.0060.01616.60
7.4.50.0130.00316.66
7.4.40.0140.00716.74
7.4.30.0170.00016.85
7.4.00.0000.01415.03
7.3.330.0020.00313.36
7.3.320.0060.00013.51
7.3.310.0040.00416.56
7.3.300.0000.00716.34
7.3.290.0000.00716.54
7.3.280.0100.00616.51
7.3.270.0070.01917.40
7.3.260.0120.00716.74
7.3.250.0050.01316.65
7.3.240.0090.00916.83
7.3.230.0070.01416.81
7.3.210.0070.02016.53
7.3.200.0060.01016.52
7.3.190.0080.00816.71
7.3.180.0040.01216.55
7.3.170.0060.01216.77
7.3.160.0090.00616.68
7.2.330.0100.00716.73
7.2.320.0110.00916.91
7.2.310.0120.01216.94
7.2.300.0090.00916.88
7.2.290.0030.01416.90
7.2.60.0080.00817.16
7.2.00.0060.00620.09
7.1.200.0110.00415.85
7.1.120.0030.00918.85
7.1.110.0080.00418.41
7.1.100.0000.01018.19
7.1.90.0070.00418.27
7.1.80.0000.01118.16
7.1.70.0070.00317.36
7.1.60.0160.00635.26
7.1.50.0150.00934.68
7.1.40.0130.01034.69
7.1.30.0080.01634.71
7.1.20.0150.01134.84
7.1.10.0000.01016.79
7.1.00.0000.01016.86

preferences:
71.81 ms | 401 KiB | 5 Q