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'); 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.0040.01218.68
8.3.50.0060.01220.00
8.3.40.0120.00318.79
8.3.30.0110.00318.80
8.3.20.0020.00520.34
8.3.10.0080.00018.77
8.3.00.0040.00423.70
8.2.180.0070.01418.50
8.2.170.0000.01422.96
8.2.160.0030.01020.57
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00420.57
8.2.120.0110.00426.35
8.2.110.0070.00322.25
8.2.100.0060.00617.84
8.2.90.0050.00319.12
8.2.80.0030.00517.97
8.2.70.0060.00317.75
8.2.60.0000.00818.04
8.2.50.0030.00618.07
8.2.40.0090.00018.22
8.2.30.0000.00718.18
8.2.20.0040.00418.00
8.2.10.0050.00318.01
8.2.00.0000.00817.99
8.1.270.0050.00222.32
8.1.260.0040.00426.35
8.1.250.0000.00928.09
8.1.240.0030.00620.69
8.1.230.0110.00417.83
8.1.220.0000.00917.74
8.1.210.0060.00318.77
8.1.200.0000.00817.36
8.1.190.0000.00817.35
8.1.180.0000.00818.10
8.1.170.0070.00318.70
8.1.160.0040.00418.86
8.1.150.0030.00618.80
8.1.140.0000.00719.17
8.1.130.0070.00019.39
8.1.120.0090.00317.69
8.1.110.0040.00417.52
8.1.100.0040.00417.67
8.1.90.0050.00217.66
8.1.80.0030.00517.54
8.1.70.0030.00317.63
8.1.60.0080.00017.79
8.1.50.0100.00317.75
8.1.40.0040.00417.58
8.1.30.0000.00817.90
8.1.20.0000.00817.83
8.1.10.0000.00817.59
8.1.00.0060.00317.57
8.0.300.0050.00218.77
8.0.290.0070.00317.00
8.0.280.0050.00318.48
8.0.270.0000.00817.19
8.0.260.0000.00716.97
8.0.250.0000.00717.16
8.0.240.0040.00417.08
8.0.230.0000.00717.25
8.0.220.0000.00817.03
8.0.210.0070.00017.16
8.0.200.0040.00417.02
8.0.190.0070.00317.19
8.0.180.0040.00417.12
8.0.170.0040.00417.12
8.0.160.0000.01117.00
8.0.150.0070.00016.98
8.0.140.0000.00717.02
8.0.130.0030.00313.56
8.0.120.0050.00317.05
8.0.110.0030.00517.12
8.0.100.0030.00517.02
8.0.90.0000.00816.93
8.0.80.0090.00617.13
8.0.70.0040.00416.93
8.0.60.0020.00517.06
8.0.50.0060.00317.19
8.0.30.0150.00617.34
8.0.20.0140.00517.43
8.0.10.0000.00817.22
8.0.00.0110.00816.91
7.4.330.0000.00515.55
7.4.320.0030.00316.64
7.4.300.0060.00016.84
7.4.290.0000.00716.81
7.4.280.0050.00516.75
7.4.270.0000.00716.73
7.4.260.0040.00416.82
7.4.250.0070.00016.80
7.4.240.0030.00616.82
7.4.230.0040.00416.87
7.4.220.0030.01616.68
7.4.210.0090.01016.88
7.4.200.0070.00016.79
7.4.160.0080.00916.74
7.4.150.0060.01217.40
7.4.140.0140.00617.86
7.4.130.0160.00716.97
7.4.120.0150.00716.82
7.4.110.0090.00616.80
7.4.100.0110.01116.83
7.4.90.0140.00416.88
7.4.80.0140.00319.39
7.4.70.0060.01616.89
7.4.60.0120.00616.64
7.4.50.0110.00316.79
7.4.40.0100.01016.65
7.4.30.0060.01116.76
7.4.10.0070.01415.24
7.4.00.0070.00915.26
7.3.330.0030.00313.60
7.3.320.0030.00313.48
7.3.310.0000.00716.49
7.3.300.0050.00216.54
7.3.290.0030.00316.53
7.3.280.0050.01016.54
7.3.270.0090.00917.40
7.3.260.0110.01116.81
7.3.250.0090.00816.65
7.3.240.0070.01416.79
7.3.230.0120.00616.79
7.3.210.0120.00616.53
7.3.200.0090.00816.79
7.3.190.0120.00316.63
7.3.180.0110.00516.58
7.3.170.0090.00916.49
7.3.160.0060.00916.73
7.3.130.0150.00415.02
7.3.120.0080.00815.11
7.3.110.0080.00614.97
7.3.100.0030.01014.68
7.3.90.0030.01214.72
7.3.80.0100.00714.66
7.3.70.0040.01115.04
7.3.60.0090.00915.02
7.3.50.0080.00815.15
7.3.40.0070.01015.05
7.3.30.0110.00714.95
7.3.20.0070.00716.86
7.3.10.0070.00916.69
7.3.00.0160.01116.58
7.2.330.0090.00916.91
7.2.320.0090.00916.65
7.2.310.0030.01516.94
7.2.300.0120.00916.92
7.2.290.0090.00616.84
7.2.260.0060.01015.30
7.2.250.0080.00715.33
7.2.240.0100.00715.27
7.2.230.0030.01315.29
7.2.220.0060.00615.14
7.2.210.0070.01014.92
7.2.200.0070.01115.25
7.2.190.0070.01115.18
7.2.180.0060.00915.19
7.2.170.0000.01615.24
7.2.160.0080.00615.36
7.2.150.0090.00617.17
7.2.140.0110.00417.07
7.2.130.0140.00916.80
7.2.120.0120.00917.03
7.2.110.0100.00716.93
7.2.100.0110.00516.96
7.2.90.0120.00817.14
7.2.80.0100.00817.12
7.2.70.0090.00417.10
7.2.60.0090.00716.77
7.2.50.0110.00817.11
7.2.40.0180.00917.01
7.2.30.0120.00617.07
7.2.20.0120.00716.93
7.2.10.0200.00517.02
7.2.00.0080.00818.11
7.1.330.0030.01415.94
7.1.320.0080.00415.95
7.1.310.0040.01116.03
7.1.300.0040.01115.70
7.1.290.0030.01315.86
7.1.280.0060.00615.86
7.1.270.0110.00016.04
7.1.260.0040.01115.86
7.1.250.0120.00715.87
7.1.240.0100.00316.11
7.1.230.0070.00416.07
7.1.220.0070.00315.64
7.1.210.0100.00715.89
7.1.200.0060.00615.93
7.1.190.0120.00015.97
7.1.180.0070.00715.99
7.1.170.0090.00616.13
7.1.160.0030.00715.90
7.1.150.0030.00616.01
7.1.140.0100.00315.80
7.1.130.0070.00715.84
7.1.120.0040.00917.50
7.1.110.0070.00617.05
7.1.100.0070.00717.19
7.1.90.0070.00816.21
7.1.80.0020.01116.90
7.1.70.0080.00516.46
7.1.60.0070.01125.61
7.1.50.0090.00725.34
7.1.40.0090.00825.09
7.1.30.0090.00925.19
7.1.20.0110.00625.29
7.1.10.0030.00816.32
7.1.00.0030.00916.43
7.0.330.0000.01315.46
7.0.320.0070.00315.53
7.0.310.0060.00915.63
7.0.300.0070.00415.34
7.0.290.0100.00315.29
7.0.280.0000.01515.64
7.0.270.0070.00715.36
7.0.260.0090.00615.38
7.0.250.0060.00915.55
7.0.240.0000.01415.30
7.0.230.0040.00715.44
7.0.220.0000.01315.42
7.0.210.0030.00615.48
7.0.200.0040.00815.64
7.0.190.0040.00415.79
7.0.180.0040.01115.71
7.0.170.0000.01215.67
7.0.160.0040.00415.48
7.0.150.0000.01115.66
7.0.140.0110.00415.39
7.0.130.0050.00515.69
7.0.120.0070.00715.66
7.0.110.0070.00715.56
7.0.100.0060.00915.71
7.0.90.0030.00615.50
7.0.80.0070.01015.31
7.0.70.0070.00715.59
7.0.60.0030.01315.70
7.0.50.0100.00615.59
7.0.40.0030.00713.64
7.0.30.0100.00313.27
7.0.20.0030.00613.82
7.0.10.0070.00313.69
7.0.00.0030.01013.38
5.6.400.0000.01214.34
5.6.390.0040.01114.15
5.6.380.0040.01114.41
5.6.370.0000.01014.34
5.6.360.0080.00814.67
5.6.350.0060.00914.62
5.6.340.0060.00614.30
5.6.330.0080.00014.02
5.6.320.0080.00314.32
5.6.310.0070.00314.27
5.6.300.0000.01014.00
5.6.290.0040.00414.34
5.6.280.0070.00714.27
5.6.270.0040.00714.30
5.6.260.0070.00714.53
5.6.250.0040.00414.10
5.6.240.0110.00314.18
5.6.230.0030.00914.39
5.6.220.0070.00314.70
5.6.210.0030.00914.06
5.6.200.0090.00014.25
5.6.190.0070.00714.45
5.6.180.0030.01314.55
5.6.170.0000.01414.70
5.6.160.0000.01014.29
5.6.150.0080.00414.14
5.6.140.0070.00714.26
5.6.130.0120.00014.38
5.6.120.0000.00914.22
5.6.110.0060.00614.59
5.6.100.0040.00814.27
5.6.90.0000.01314.16
5.6.80.0060.00614.28
5.6.70.0060.00314.39
5.6.60.0040.00814.36
5.6.50.0090.00614.29
5.6.40.0030.01014.20
5.6.30.0040.00714.21
5.6.20.0000.01714.24
5.6.10.0070.00414.23
5.6.00.0060.00814.30

preferences:
67.99 ms | 400 KiB | 5 Q