3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * a range(), or regex [a-zA-Z] could also be used * @param string $input * @return bool whether it is a letter or not */ function isLetter($letter) { if (!is_string($letter)) throw new InvalidArgumentException('the argument must be a letter, `'.$letter.'` was passed in'); $letters = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM"; return strpos($letters, $letter) !== false; } /** * @param string $input * if it is true, echo true * elseif false, echo false * else echo other */ function isLetterLineOut($input) { var_dump($input); $output (true === $input) ? "true" : (false === $input) ? "false" : "other"; echo $output . PHP_EOL; } isLetterLineOut(isLetter("N")); isLetterLineOut(isLetter("1")); isLetterLineOut(isLetter("j")); isLetterLineOut(isLetter("-"));

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.00718.68
8.3.50.0090.00616.26
8.3.40.0060.01218.43
8.3.30.0070.00718.71
8.3.20.0140.00020.39
8.3.10.0040.00421.80
8.3.00.0000.00819.67
8.2.180.0040.01516.32
8.2.170.0090.00922.96
8.2.160.0030.01020.38
8.2.150.0060.00324.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0160.00317.38
8.2.110.0040.00820.52
8.2.100.0090.00317.63
8.2.90.0040.00419.09
8.2.80.0030.00517.97
8.2.70.0000.00817.50
8.2.60.0050.00317.55
8.2.50.0040.00418.07
8.2.40.0030.00520.94
8.2.30.0030.00717.95
8.2.20.0000.00817.52
8.2.10.0000.00917.88
8.2.00.0070.00018.00
8.1.280.0070.01025.92
8.1.270.0000.00724.66
8.1.260.0060.00326.35
8.1.250.0070.00028.09
8.1.240.0050.00523.88
8.1.230.0000.01117.42
8.1.220.0070.00017.74
8.1.210.0080.00018.77
8.1.200.0100.00017.22
8.1.190.0050.00417.00
8.1.180.0040.00418.10
8.1.170.0040.00418.36
8.1.160.0040.00421.96
8.1.150.0050.00218.70
8.1.140.0000.00717.36
8.1.130.0040.00417.45
8.1.120.0040.00417.36
8.1.110.0030.00517.21
8.1.100.0000.00817.27
8.1.90.0000.00717.29
8.1.80.0040.00317.38
8.1.70.0030.00317.39
8.1.60.0000.00717.36
8.1.50.0080.00017.40
8.1.40.0060.00317.30
8.1.30.0050.00317.57
8.1.20.0080.00017.45
8.1.10.0030.00517.37
8.1.00.0040.00417.35
8.0.300.0000.00818.77
8.0.290.0050.00216.63
8.0.280.0000.00718.34
8.0.270.0040.00316.61
8.0.260.0070.00017.13
8.0.250.0030.00316.97
8.0.240.0030.00316.91
8.0.230.0000.00716.77
8.0.220.0000.00716.73
8.0.210.0000.00716.90
8.0.200.0060.00016.88
8.0.190.0040.00416.90
8.0.180.0070.00016.89
8.0.170.0040.00416.82
8.0.160.0050.00316.82
8.0.150.0050.00216.69
8.0.140.0040.00416.68
8.0.130.0030.00313.22
8.0.120.0040.00416.68
8.0.110.0000.00716.87
8.0.100.0040.00416.70
8.0.90.0070.00016.64
8.0.80.0140.00716.81
8.0.70.0040.00416.71
8.0.60.0070.00016.76
8.0.50.0070.00016.75
8.0.30.0110.00916.95
8.0.20.0100.00917.40
8.0.10.0070.00016.96
8.0.00.0080.00916.64
7.4.330.0020.00215.10
7.4.320.0030.00316.60
7.4.300.0060.00016.47
7.4.290.0000.00716.54
7.4.280.0030.00516.45
7.4.270.0030.00316.61
7.4.260.0070.00016.45
7.4.250.0030.00516.49
7.4.240.0020.00516.58
7.4.230.0030.00316.42
7.4.220.0070.01716.54
7.4.210.0090.00616.63
7.4.200.0070.00016.36
7.4.160.0040.01216.82
7.4.150.0120.00617.40
7.4.140.0100.01117.86
7.4.130.0110.00816.72
7.4.120.0080.00916.43
7.4.110.0070.01016.61
7.4.100.0150.01216.64
7.4.90.0100.00716.44
7.4.80.0140.00319.39
7.4.70.0070.01516.69
7.4.60.0030.01316.43
7.4.50.0050.00016.55
7.4.40.0100.01016.61
7.4.30.0130.00316.48
7.4.00.0050.01214.94
7.3.330.0000.00713.29
7.3.320.0000.00513.18
7.3.310.0000.00716.41
7.3.300.0030.00316.23
7.3.290.0120.00516.28
7.3.280.0120.00616.30
7.3.270.0000.01917.40
7.3.260.0000.01616.43
7.3.250.0130.00416.29
7.3.240.0070.01016.48
7.3.230.0100.00716.39
7.3.210.0070.01116.48
7.3.200.0130.00319.39
7.3.190.0100.00616.48
7.3.180.0090.00616.28
7.3.170.0090.00916.30
7.3.160.0120.00616.39
7.3.120.0090.00914.70
7.3.110.0060.01214.91
7.3.100.0030.01014.87
7.3.90.0040.00414.68
7.3.80.0060.00814.77
7.3.70.0040.00414.91
7.3.60.0030.00714.73
7.3.50.0110.00414.87
7.3.40.0060.00614.80
7.3.30.0090.00614.87
7.3.20.0130.00016.64
7.3.10.0100.00716.67
7.3.00.0070.00416.48
7.2.330.0040.01516.39
7.2.320.0120.00616.37
7.2.310.0030.01616.81
7.2.300.0120.00616.84
7.2.290.0090.01416.47
7.2.250.0100.00614.82
7.2.240.0100.00715.09
7.2.230.0090.00615.15
7.2.220.0030.00615.19
7.2.210.0030.01014.54
7.2.200.0080.00614.61
7.2.190.0060.00615.10
7.2.180.0040.01115.00
7.2.170.0030.01015.11
7.2.60.0030.00916.64
7.2.00.0040.01119.11
7.1.330.0040.01215.64
7.1.320.0100.00315.83
7.1.310.0040.01115.62
7.1.300.0070.00315.73
7.1.290.0090.00615.79
7.1.280.0090.00615.89
7.1.270.0060.01015.78
7.1.260.0040.00715.72
7.1.200.0070.00315.77
7.1.100.0070.00718.14
7.1.70.0130.00317.23
7.1.60.0120.00620.03
7.1.50.0070.00716.62
7.1.00.0070.07022.28
7.0.200.0080.00416.89
7.0.60.0100.08319.95
7.0.50.0100.03317.89
7.0.40.0070.04020.23
7.0.30.0330.07320.26
7.0.20.0200.05320.12
7.0.10.0100.06720.20
7.0.00.0100.04320.18
5.6.280.0070.07021.16
5.6.210.0170.07020.48
5.6.200.0130.04018.23
5.6.190.0030.05320.57
5.6.180.2430.03720.61
5.6.170.0330.05320.54
5.6.160.0130.07020.47
5.6.150.0100.07718.17
5.6.140.0100.07718.11
5.6.130.0030.04318.18
5.6.120.0070.05020.99
5.6.110.0030.07720.97
5.6.100.0170.07721.00
5.6.90.0070.09021.11
5.6.80.0100.07320.52
5.5.350.0170.06720.41
5.5.340.0100.03017.95
5.5.330.0070.08320.37
5.5.320.0330.04720.27
5.5.310.0300.07020.32
5.5.300.0070.06717.96
5.5.290.0030.05017.97
5.5.280.0200.03020.81
5.5.270.0100.08020.78
5.5.260.0200.07020.97
5.5.250.0030.06320.55
5.5.240.0300.06320.20
5.4.450.0130.06019.18
5.4.440.0270.05019.34
5.4.430.0200.05719.49
5.4.420.0170.05719.56
5.4.410.0200.05719.46
5.4.400.0230.05718.88
5.4.390.0270.05319.16
5.4.380.0270.06319.26
5.4.370.0300.04319.28
5.4.360.0200.06019.00
5.4.350.0300.06719.01
5.4.340.0200.07019.16
5.4.320.0230.06318.85
5.4.310.0170.06319.01
5.4.300.0170.05319.28
5.4.290.0300.04719.12
5.4.280.0270.04719.27
5.4.270.0270.04719.10
5.4.260.0300.04018.87
5.4.250.0330.04019.00
5.4.240.0230.05319.28
5.4.230.0200.05019.25
5.4.220.0200.06019.14
5.4.210.0100.06019.18
5.4.200.0330.04316.69
5.4.190.0270.05019.30
5.4.180.0330.05719.02
5.4.170.0430.05019.00
5.4.160.0300.05019.34
5.4.150.0230.05718.96
5.4.140.0170.05316.45
5.4.130.0230.05016.57
5.4.120.0330.03716.50
5.4.110.0170.04716.56
5.4.100.0200.05016.56
5.4.90.0230.04716.41
5.4.80.0370.05016.40
5.4.70.0170.05316.58
5.4.60.0270.05716.53
5.4.50.0330.05016.41
5.4.40.0270.05016.38
5.4.30.0330.04316.47
5.4.20.0300.05316.30
5.4.10.0170.05316.50
5.4.00.0270.05316.08

preferences:
58.94 ms | 400 KiB | 5 Q