3v4l.org

run code in 300+ PHP versions simultaneously
<?php function checkIBAN(string $iban): bool { // Normalize input (remove spaces and make uppercase) $iban = strtoupper(str_replace(' ', '', $iban)); if (!preg_match('/^([A-Z]{2})(\d{2})([A-Z\d]{1,30})$/', $iban, $segments)) { return false; } [, $country, $check, $account] = $segments; $digits = str_split(strtr($account . $country, array_combine(range('A', 'Z'), range(10, 35))) . '00'); $first = array_shift($digits); $checksum = array_reduce( $digits, function ($carry, $int) { $carry = ($carry * 10 + (int)$int) % 97; return $carry; }, (int)$first ); return (98 - $checksum) == $check; } var_export(checkIBAN('GB29NWBK60161331926819'));

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.40.0110.00418.84
8.3.30.0080.00818.97
8.3.20.0080.00024.18
8.3.10.0080.00024.66
8.3.00.0040.00426.16
8.2.170.0040.01119.10
8.2.160.0070.00722.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0080.00021.00
8.2.110.0090.00019.26
8.2.100.0110.00018.03
8.2.90.0060.00317.90
8.2.80.0060.00319.11
8.2.70.0000.00817.88
8.2.60.0050.00317.75
8.2.50.0030.00618.10
8.2.40.0060.00719.55
8.2.30.0120.00018.45
8.2.20.0070.00517.92
8.2.10.0020.01018.49
8.2.00.0070.00518.45
8.1.270.0060.00320.79
8.1.260.0080.00026.35
8.1.250.0060.00828.09
8.1.240.0120.00022.05
8.1.230.0120.00020.94
8.1.220.0000.01017.79
8.1.210.0030.00618.84
8.1.200.0000.00817.48
8.1.190.0050.00317.50
8.1.180.0060.00318.10
8.1.170.0070.00518.18
8.1.160.0070.00619.19
8.1.150.0070.00618.23
8.1.140.0070.00518.24
8.1.130.0100.00218.90
8.1.120.0070.00617.61
8.1.110.0090.00317.61
8.1.100.0100.00217.61
8.1.90.0030.00917.64
8.1.80.0090.00517.60
8.1.70.0110.00317.52
8.1.60.0110.00417.70
8.1.50.0060.00917.61
8.1.40.0120.00417.67
8.1.30.0100.00417.77
8.1.20.0040.00617.75
8.1.10.0090.00517.65
8.1.00.0130.00517.61
8.0.300.0000.00820.08
8.0.290.0030.00616.75
8.0.280.0100.00117.99
8.0.270.0100.00217.32
8.0.260.0080.00518.07
8.0.250.0070.00517.31
8.0.240.0070.00417.34
8.0.230.0080.00317.33
8.0.220.0050.00617.33
8.0.210.0060.00517.32
8.0.200.0120.00117.24
8.0.190.0080.00617.24
8.0.180.0090.00417.28
8.0.170.0090.00617.14
8.0.160.0100.00517.17
8.0.150.0100.00517.11
8.0.140.0100.00517.17
8.0.130.0090.00516.28
8.0.120.0110.00417.18
8.0.110.0080.00617.18
8.0.100.0120.00417.11
8.0.90.0070.00717.17
8.0.80.0090.00817.10
8.0.70.0110.00417.13
8.0.60.0110.00117.19
8.0.50.0060.00717.16
8.0.30.0100.00617.09
8.0.20.0140.00517.19
8.0.10.0120.00917.23
8.0.00.0140.00717.26
7.4.330.0060.00216.58
7.4.320.0050.00617.24
7.4.300.0070.00417.03
7.4.290.0060.00517.00
7.4.280.0120.00216.97
7.4.270.0110.00316.96
7.4.260.0100.00416.14
7.4.250.0090.00416.92
7.4.240.0070.00316.92
7.4.230.0080.00516.89
7.4.220.0070.00316.86
7.4.210.0090.00516.82
7.4.200.0090.00416.93
7.4.190.0120.00517.02
7.4.180.0120.00417.10
7.4.160.0140.00516.94
7.4.150.0130.00516.85
7.4.140.0100.00716.79
7.4.130.0110.00716.89
7.4.120.0120.00416.88
7.4.110.0090.00716.89
7.4.100.0130.00616.85
7.4.90.0120.00516.85
7.4.80.0100.00616.85
7.4.70.0150.00516.88
7.4.60.0100.00516.89
7.4.50.0080.00816.76
7.4.40.0110.00616.85
7.4.30.0080.00816.73
7.4.20.0090.00716.80
7.4.10.0130.00416.76
7.4.00.0110.00616.78
7.3.330.0130.00416.78
7.3.320.0080.00616.04
7.3.310.0120.00216.81
7.3.300.0060.00816.78
7.3.290.0120.00516.81
7.3.280.0150.00416.72
7.3.270.0120.00816.71
7.3.260.0130.00516.69
7.3.250.0120.00716.66
7.3.240.0120.00516.71
7.3.230.0100.00616.71
7.3.220.0110.00716.67
7.3.210.0150.00416.61
7.3.200.0150.00416.67
7.3.190.0120.00516.68
7.3.180.0130.00416.63
7.3.170.0100.00716.66
7.3.160.0110.00616.69
7.3.150.0110.00516.71
7.3.140.0110.00616.70
7.3.130.0120.00416.70
7.3.120.0140.00416.68
7.3.110.0120.00616.62
7.3.100.0100.00716.62
7.3.90.0110.00616.88
7.3.80.0120.00516.72
7.3.70.0110.00516.75
7.3.60.0090.00716.81
7.3.50.0120.00416.81
7.3.40.0130.00416.78
7.3.30.0110.00516.81
7.3.20.0200.00517.59
7.3.10.0170.00217.42
7.3.00.0090.00717.51

preferences:
52.03 ms | 400 KiB | 5 Q