3v4l.org

run code in 300+ PHP versions simultaneously
<?php $hostname = "lekkere.koekjes.men"; $certificates = json_decode('[{"commonName":"*.men"},{"commonName":"*.hans.nl"},{"commonName":"*.koekjes.men"}]'); $hostnameParts = explode(".", $hostname); foreach ($certificates as $certificate) { // commonName = *.lekkere.koekjes.men // hostname = www.lekkere.koekjes.men $commonName = $certificate->commonName; $commonNameParts = explode(".", $commonName); for ($i = 0; $i < max(count($commonNameParts), count($hostnameParts)); $i++) { $commonNamePart = count($commonNameParts) > ($i + 1) ? $commonNameParts[count($commonNameParts) - $i - 1] : null; $hostnamePart = count($hostnameParts) > ($i + 1) ? $hostnameParts[count($hostnameParts) - $i - 1] : null; if (! ( $commonNamePart === '*' || ($commonNamePart === null && $hostnamePart === 'www' && !in_array("*", $commonNameParts)) || ($commonNamePart === $hostnamePart) ) ) { continue 2; } } var_dump($certificate); }

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.0110.00716.36
8.3.50.0110.00821.19
8.3.40.0100.00618.48
8.3.30.0090.00618.84
8.3.20.0040.00420.29
8.3.10.0030.00623.65
8.3.00.0020.00523.73
8.2.180.0080.00818.17
8.2.170.0070.01122.96
8.2.160.0030.01020.44
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00419.77
8.2.120.0040.00426.35
8.2.110.0060.00321.08
8.2.100.0090.00318.05
8.2.90.0060.00318.93
8.2.80.0070.00318.03
8.2.70.0030.00617.63
8.2.60.0040.00417.93
8.2.50.0050.00318.07
8.2.40.0040.00422.14
8.2.30.0030.00619.44
8.2.20.0040.00417.66
8.2.10.0000.00818.25
8.2.00.0000.00818.16
8.1.280.0030.01425.92
8.1.270.0080.00021.88
8.1.260.0070.00028.09
8.1.250.0050.00328.09
8.1.240.0040.00423.97
8.1.230.0120.00019.15
8.1.220.0000.00817.88
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0040.00417.13
8.1.180.0090.00018.10
8.1.170.0000.00818.37
8.1.160.0000.00720.69
8.1.150.0040.00419.01
8.1.140.0040.00419.51
8.1.130.0000.00717.76
8.1.120.0020.00517.34
8.1.110.0050.00317.48
8.1.100.0040.00417.38
8.1.90.0000.00717.52
8.1.80.0080.00017.35
8.1.70.0040.00417.36
8.1.60.0000.00717.57
8.1.50.0000.00917.59
8.1.40.0030.00517.53
8.1.30.0000.00917.63
8.1.20.0050.00217.64
8.1.10.0060.00317.62
8.1.00.0080.00017.41
8.0.300.0060.00318.77
8.0.290.0060.00316.75
8.0.280.0000.00718.37
8.0.270.0000.00717.27
8.0.260.0000.00617.30
8.0.250.0030.00316.93
8.0.240.0090.00016.84
8.0.230.0080.00016.92
8.0.220.0040.00416.82
8.0.210.0000.00716.91
8.0.200.0000.00716.84
8.0.190.0000.00716.99
8.0.180.0000.00816.87
8.0.170.0080.00016.95
8.0.160.0070.00016.77
8.0.150.0070.00016.92
8.0.140.0000.00716.73
8.0.130.0000.00513.38
8.0.120.0030.00716.88
8.0.110.0040.00416.92
8.0.100.0000.00816.96
8.0.90.0070.00016.73
8.0.80.0090.00616.93
8.0.70.0000.00716.97
8.0.60.0030.00516.94
8.0.50.0040.00416.86
8.0.30.0090.01116.97
8.0.20.0130.00617.40
8.0.10.0000.00716.96
8.0.00.0120.01016.78
7.4.330.0030.00615.08
7.4.320.0030.00316.51
7.4.300.0030.00316.62
7.4.290.0040.00416.50
7.4.280.0000.00916.60
7.4.270.0030.00616.50
7.4.260.0000.00716.50
7.4.250.0050.00316.62
7.4.240.0030.00316.50
7.4.230.0040.00416.59
7.4.220.0090.00916.62
7.4.210.0100.00916.55
7.4.200.0000.00716.64
7.4.160.0060.00916.38
7.4.150.0060.01217.40
7.4.140.0120.00717.86
7.4.130.0120.00616.43
7.4.120.0050.01316.60
7.4.110.0090.00916.44
7.4.100.0150.00716.43
7.4.90.0070.01016.40
7.4.80.0120.01219.39
7.4.70.0140.00316.57
7.4.60.0030.01216.49
7.4.50.0100.00316.41
7.4.40.0130.00316.45
7.4.30.0140.00616.66
7.4.10.0040.01514.93
7.4.00.0050.01215.00
7.3.330.0000.00613.10
7.3.320.0000.00613.29
7.3.310.0030.00316.19
7.3.300.0030.00316.36
7.3.290.0000.00716.35
7.3.280.0100.00516.36
7.3.270.0090.01317.40
7.3.260.0080.01216.38
7.3.250.0150.00516.29
7.3.240.0080.01216.47
7.3.230.0100.00716.64
7.3.210.0100.00716.50
7.3.200.0220.00019.39
7.3.190.0070.01416.39
7.3.180.0120.00316.20
7.3.170.0090.00616.49
7.3.160.0100.01016.64
7.3.130.0060.00914.81
7.3.120.0100.01014.86
7.3.110.0100.00614.58
7.3.100.0060.00915.01
7.3.90.0140.00315.05
7.3.80.0050.00514.80
7.3.70.0040.01114.82
7.3.60.0030.01014.59
7.3.50.0030.00814.72
7.3.40.0000.00814.96
7.3.30.0030.01414.79
7.3.20.0060.00616.69
7.3.10.0100.00316.55
7.3.00.0070.00816.73
7.2.330.0070.01116.50
7.2.320.0100.00716.46
7.2.310.0030.01416.77
7.2.300.0060.01116.78
7.2.290.0110.01116.50
7.2.260.0100.01015.24
7.2.250.0100.01015.02
7.2.240.0030.01015.20
7.2.230.0030.01314.68
7.2.220.0060.00914.95
7.2.210.0070.00414.76
7.2.200.0060.00614.96
7.2.190.0150.00015.13
7.2.180.0060.00614.96
7.2.170.0070.00714.63
7.2.160.0040.01214.97
7.2.150.0130.00316.84
7.2.140.0050.00516.67
7.2.130.0050.01016.61
7.2.120.0100.00516.71
7.2.110.0030.01016.81
7.2.100.0090.00616.83
7.2.90.0080.00816.97
7.2.80.0070.00516.67
7.2.70.0030.00817.02
7.2.60.0030.01016.70
7.2.50.0050.00716.98
7.2.40.0090.00516.73
7.2.30.0050.00516.75
7.2.20.0080.00916.97
7.2.10.0050.01216.84
7.2.00.0070.00617.83
7.1.330.0110.00315.81
7.1.320.0060.00915.52
7.1.310.0030.01315.61
7.1.300.0100.00615.83
7.1.290.0060.00615.68
7.1.280.0070.00715.45
7.1.270.0120.00315.93
7.1.260.0030.01015.80
7.1.250.0120.00315.64
7.1.240.0040.01115.97
7.1.230.0100.00015.69
7.1.220.0060.00615.89
7.1.210.0060.00915.89
7.1.200.0070.01015.53
7.1.190.0050.00815.83
7.1.180.0090.00315.73
7.1.170.0030.01015.52
7.1.160.0040.00815.51
7.1.150.0030.01015.85
7.1.140.0130.00315.63
7.1.130.0030.00715.75
7.1.120.0030.01415.96
7.1.110.0080.00415.98
7.1.100.0070.00516.66
7.1.90.0000.00815.60
7.1.80.0000.01415.72
7.1.70.0030.00916.50
7.1.60.0090.00817.44
7.1.50.0070.00816.41
7.1.40.0030.01115.83
7.1.30.0070.00715.84
7.1.20.0070.00715.93
7.1.10.0100.00315.76
7.1.00.0030.04418.99
7.0.330.0000.00915.48
7.0.320.0040.00415.39
7.0.310.0000.01315.33
7.0.300.0030.00515.43
7.0.290.0070.00415.26
7.0.280.0040.00415.41
7.0.270.0030.00715.45
7.0.260.0030.01215.40
7.0.250.0030.01015.45
7.0.240.0070.00315.44
7.0.230.0030.00515.21
7.0.220.0040.00415.41
7.0.210.0060.00615.48
7.0.200.0080.00316.11
7.0.190.0030.00615.59
7.0.180.0070.00715.18
7.0.170.0040.00715.59
7.0.160.0070.00715.30
7.0.150.0080.00015.30
7.0.140.0090.00615.17
7.0.130.0060.00615.27
7.0.120.0090.00615.50
7.0.110.0040.01215.18
7.0.100.0000.01115.33
7.0.90.0060.00615.27
7.0.80.0000.00815.48
7.0.70.0070.01015.15
7.0.60.0130.04418.58
7.0.50.0080.02716.69
7.0.40.0030.03216.82
7.0.30.0180.04016.88
7.0.20.0130.04616.85
7.0.10.0030.03316.91
7.0.00.0060.02616.79
5.6.400.0060.00314.26
5.6.390.0030.01314.37
5.6.380.0030.01314.59
5.6.370.0000.01114.46
5.6.360.0070.00714.14
5.6.350.0100.00314.46
5.6.340.0000.01214.47
5.6.330.0030.00714.41
5.6.320.0000.01014.45
5.6.310.0040.01114.39
5.6.300.0070.00414.37
5.6.290.0080.00814.13
5.6.280.0090.00914.44
5.6.270.0000.01514.25
5.6.260.0030.01014.22
5.6.250.0100.00714.33
5.6.240.0120.00314.42
5.6.230.0030.01014.21
5.6.220.0100.00714.28
5.6.210.0110.03817.29
5.6.200.0080.04516.37
5.6.190.0030.02817.35
5.6.180.0160.02217.50
5.6.170.0120.03517.60
5.6.160.0080.04417.37
5.6.150.0100.03016.25
5.6.140.0110.03616.23
5.6.130.0100.03316.26
5.6.120.0080.04417.61
5.6.110.0050.02317.68
5.6.100.0120.04017.67
5.6.90.0050.04717.55
5.6.80.0040.03617.45
5.6.70.0080.00414.45
5.6.60.0030.01314.24
5.6.50.0090.00014.31
5.6.40.0030.01214.27
5.6.30.0030.00614.11
5.6.20.0080.00814.50
5.6.10.0000.00814.25
5.6.00.0080.00414.28
5.5.380.0050.00314.49
5.5.370.0040.00814.43
5.5.360.0100.00714.13
5.5.350.0170.03817.26
5.5.340.0030.02316.23
5.5.330.0020.02717.35
5.5.320.0310.03817.35
5.5.310.0140.03717.53
5.5.300.0050.02816.21
5.5.290.0130.03316.24
5.5.280.0060.04617.57
5.5.270.0080.02817.62
5.5.260.0030.04517.46
5.5.250.0110.04117.49
5.5.240.0090.03217.15
5.5.230.0090.00613.95
5.5.220.0030.01014.27
5.5.210.0030.00614.11
5.5.200.0040.01214.27
5.5.190.0060.00913.89
5.5.180.0070.00713.91
5.5.170.0100.00314.30
5.5.160.0110.00014.34
5.5.150.0030.01014.20
5.5.140.0030.01014.12
5.5.130.0100.00314.27
5.5.120.0040.01114.25
5.5.110.0070.00714.39
5.5.100.0070.00714.22
5.5.90.0050.00513.88
5.5.80.0000.00914.09
5.5.70.0060.00914.06
5.5.60.0070.00714.42
5.5.50.0060.00914.26
5.5.40.0050.00314.08
5.5.30.0000.00814.39
5.5.20.0030.01014.20
5.5.10.0060.00613.87
5.5.00.0040.01114.32

preferences:
60.42 ms | 401 KiB | 5 Q