3v4l.org

run code in 300+ PHP versions simultaneously
<?php // define variables and set to empty values $nameErr = $emailErr = $genderErr = $websiteErr = ""; $name = $email = $gender = $comment = $website = ""; if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["name"])) {$nameErr = "Name is required";} else { $name = test_input($_POST["name"]); // check if name only contains letters and whitespace if (!preg_match("/^[a-zA-Z ]*$/",$name)) { $nameErr = "Only letters and white space allowed"; } } if (empty($_POST["email"])) {$emailErr = "Email is required";} else { $email = test_input($_POST["email"]); // check if e-mail address syntax is valid if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/",$email)) { $emailErr = "Invalid email format"; } } if (empty($_POST["website"])) {$website = "";} else { $website = test_input($_POST["website"]); // check if URL address syntax is valid (this regular expression also allows dashes in the URL) if (!preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i",$website)) { $websiteErr = "Invalid URL"; } } if (empty($_POST["comment"])) {$comment = "";} else {$comment = test_input($_POST["comment"]);} if (empty($_POST["gender"])) {$genderErr = "Gender is required";} else {$gender = test_input($_POST["gender"]);} } ?>

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.0090.00618.60
8.3.30.0100.00320.25
8.3.20.0040.00420.16
8.3.10.0040.00422.10
8.3.00.0040.00422.52
8.2.170.0090.00622.96
8.2.160.0130.00020.35
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0060.00926.16
8.2.120.0030.00521.07
8.2.110.0090.00319.28
8.2.100.0120.00419.57
8.2.90.0070.00019.17
8.2.80.0000.00819.18
8.2.70.0030.00517.75
8.2.60.0000.00818.05
8.2.50.0040.00718.07
8.2.40.0040.00418.34
8.2.30.0030.00518.05
8.2.20.0000.00817.84
8.2.10.0030.00617.89
8.2.00.0060.00317.82
8.1.270.0040.00424.66
8.1.260.0000.00826.35
8.1.250.0030.00628.09
8.1.240.0040.00419.65
8.1.230.0080.00419.16
8.1.220.0040.00417.76
8.1.210.0060.00318.77
8.1.200.0060.00317.35
8.1.190.0000.00817.43
8.1.180.0060.00319.01
8.1.170.0000.00818.63
8.1.160.0000.00722.23
8.1.150.0080.00318.63
8.1.140.0000.00717.49
8.1.130.0000.00717.88
8.1.120.0040.00417.39
8.1.110.0000.00717.55
8.1.100.0000.00817.48
8.1.90.0030.00317.56
8.1.80.0070.00017.52
8.1.70.0000.00717.39
8.1.60.0040.00417.51
8.1.50.0040.00417.60
8.1.40.0020.00517.55
8.1.30.0050.00217.72
8.1.20.0060.00317.63
8.1.10.0000.00717.46
8.1.00.0060.00317.50
8.0.300.0040.00418.77
8.0.290.0040.00417.05
8.0.280.0040.00418.47
8.0.270.0030.00317.20
8.0.260.0030.00316.97
8.0.250.0030.00316.97
8.0.240.0030.00617.05
8.0.230.0050.00317.04
8.0.220.0000.00817.01
8.0.210.0070.00017.03
8.0.200.0000.00617.07
8.0.190.0030.00517.01
8.0.180.0000.00816.98
8.0.170.0040.00417.00
8.0.160.0050.00316.86
8.0.150.0030.00616.90
8.0.140.0070.00017.01
8.0.130.0000.00513.41
8.0.120.0050.00216.91
8.0.110.0040.00416.98
8.0.100.0000.00717.02
8.0.90.0030.00516.89
8.0.80.0060.00916.97
8.0.70.0000.00817.01
8.0.60.0080.00016.86
8.0.50.0050.00217.02
8.0.30.0120.00917.18
8.0.20.0090.01017.40
8.0.10.0000.00717.06
8.0.00.0070.01016.70
7.4.330.0040.00015.00
7.4.320.0000.00616.58
7.4.300.0030.00316.68
7.4.290.0070.00016.56
7.4.280.0000.00716.56
7.4.270.0070.00016.53
7.4.260.0000.00716.50
7.4.250.0080.00016.52
7.4.240.0020.00516.54
7.4.230.0030.00316.38
7.4.220.0070.01116.63
7.4.210.0070.00716.58
7.4.200.0080.00016.50
7.4.190.0000.00816.66
7.4.160.0050.01016.66
7.4.150.0120.00617.40
7.4.140.0100.01017.86
7.4.130.0130.00716.49
7.4.120.0130.00416.61
7.4.110.0130.00316.51
7.4.100.0130.01016.34
7.4.90.0100.00716.81
7.4.80.0110.00619.39
7.4.70.0120.00916.44
7.4.60.0030.01316.51
7.4.50.0000.00916.55
7.4.40.0110.00422.77
7.4.30.0040.01216.57
7.4.10.0060.00614.82
7.4.00.0070.01015.03
7.3.330.0000.00513.23
7.3.320.0020.00213.07
7.3.310.0040.00416.18
7.3.300.0030.00316.35
7.3.290.0040.01116.41
7.3.280.0100.00516.40
7.3.270.0090.00917.40
7.3.260.0140.00516.51
7.3.250.0080.01116.44
7.3.240.0190.00016.32
7.3.230.0090.00616.39
7.3.210.0030.01316.32
7.3.200.0140.00719.39
7.3.190.0130.01216.45
7.3.180.0090.00916.36
7.3.170.0030.01416.43
7.3.160.0080.00816.36
7.3.130.0030.01014.82
7.3.120.0090.00914.81
7.3.110.0070.01114.79
7.3.100.0090.00614.96
7.3.90.0060.00815.00
7.3.80.0080.00814.88
7.3.70.0080.00614.87
7.3.60.0080.00514.76
7.3.50.0080.00414.77
7.3.40.0030.00814.78
7.3.30.0070.00414.90
7.3.20.0060.00816.55
7.3.10.0030.01116.59
7.3.00.0090.00416.56
7.2.330.0110.00716.64
7.2.320.0140.00416.71
7.2.310.0150.00616.71
7.2.300.0060.01316.30
7.2.290.0070.01016.73
7.2.260.0040.01414.85
7.2.250.0090.00814.92
7.2.240.0030.01514.96
7.2.230.0040.01314.98
7.2.220.0040.00814.97
7.2.210.0070.00915.11
7.2.200.0110.00014.90
7.2.190.0070.00614.86
7.2.180.0060.00815.04
7.2.170.0060.00615.10
7.2.160.0040.01014.92
7.2.150.0030.00716.65
7.2.140.0030.00916.69
7.2.130.0080.00616.82
7.2.120.0050.00616.78
7.2.110.0050.00916.68
7.2.100.0060.00916.58
7.2.90.0030.01116.87
7.2.80.0080.00816.78
7.2.70.0030.01016.60
7.2.60.0050.00916.75
7.2.50.0080.00516.80
7.2.40.0070.00916.53
7.2.30.0030.00916.71
7.2.20.0080.00416.69
7.2.10.0070.00816.84
7.2.00.0070.01017.73
7.1.330.0070.00915.60
7.1.320.0060.00715.70
7.1.310.0020.01315.80
7.1.300.0060.00715.72
7.1.290.0010.00915.65
7.1.280.0040.00815.69
7.1.270.0070.00815.62
7.1.260.0040.01115.81
7.1.250.0020.01015.58
7.1.240.0060.00215.89
7.1.230.0070.00515.65
7.1.220.0070.00715.84
7.1.210.0020.01215.64
7.1.200.0040.00815.76
7.1.190.0060.00815.71
7.1.180.0110.00315.91
7.1.170.0020.00915.78
7.1.160.0060.00515.70
7.1.150.0040.00915.83
7.1.140.0080.00615.80
7.1.130.0050.00715.85
7.1.120.0090.00515.82
7.1.110.0060.00515.83
7.1.100.0060.00716.43
7.1.90.0060.00715.59
7.1.80.0020.01115.85
7.1.70.0050.00516.17
7.1.60.0090.00816.86
7.1.50.0080.00416.02
7.1.40.0060.00515.92
7.1.30.0040.00915.43
7.1.20.0100.01015.80
7.1.10.0020.00815.53
7.1.00.0090.01517.94
7.0.330.0030.00915.26
7.0.320.0060.00715.33
7.0.310.0020.00715.29
7.0.300.0030.01215.20
7.0.290.0080.00815.31
7.0.280.0080.00515.31
7.0.270.0070.00915.31
7.0.260.0020.01115.16
7.0.250.0050.00815.12
7.0.240.0100.00615.32
7.0.230.0070.00415.43
7.0.220.0060.00715.24
7.0.210.0080.00615.27
7.0.200.0100.00615.06
7.0.190.0040.01115.37
7.0.180.0050.00815.24
7.0.170.0090.00315.40
7.0.160.0060.00615.26
7.0.150.0050.00815.02
7.0.140.0050.02917.53
7.0.130.0020.01415.41
7.0.120.0040.00715.36
7.0.110.0090.00515.42
7.0.100.0070.00715.13
7.0.90.0080.00715.07
7.0.80.0060.01015.15
7.0.70.0020.01115.19
7.0.60.0030.03616.85
7.0.50.0090.01216.17
7.0.40.0100.01815.61
7.0.30.0120.02915.52
7.0.20.0100.03115.71
7.0.10.0130.03215.59
7.0.00.0100.03115.62
5.6.400.0060.00614.43
5.6.390.0050.00514.61
5.6.380.0050.00914.58
5.6.370.0020.01114.38
5.6.360.0070.00414.41
5.6.350.0070.00514.35
5.6.340.0070.00114.46
5.6.330.0070.00914.10
5.6.320.0050.00714.32
5.6.310.0060.00614.37
5.6.300.0080.00714.32
5.6.290.0030.01414.59
5.6.280.0110.01114.33
5.6.270.0060.01014.44
5.6.260.0100.00914.59
5.6.250.0100.00614.25
5.6.240.0060.01014.40
5.6.230.0060.01014.30
5.6.220.0070.01214.36
5.6.210.0070.01916.41
5.6.200.0030.03515.57
5.6.190.0100.01916.44
5.6.180.0110.02316.49
5.6.170.0070.02316.35
5.6.160.0120.02916.41
5.6.150.0050.02915.56
5.6.140.0080.03515.71
5.6.130.0150.02715.67
5.6.120.0110.03516.55
5.6.110.0100.02616.50
5.6.100.0070.03216.52
5.6.90.0070.02016.54
5.6.80.0090.01816.48
5.6.70.0160.02616.21
5.6.60.0100.00314.16
5.6.50.0080.00714.34
5.6.40.0120.00814.28
5.6.30.0040.00913.99
5.6.20.0120.00514.20
5.6.10.0060.00914.10
5.6.00.0080.00714.11
5.5.380.0070.00712.54
5.5.370.0050.00812.56
5.5.360.0070.00712.84
5.5.350.0040.03115.23
5.5.340.0040.01814.36
5.5.330.0110.01815.18
5.5.320.0180.02915.10
5.5.310.0130.02815.20
5.5.300.0070.02014.34
5.5.290.0110.02614.31
5.5.280.0050.02515.24
5.5.270.0040.03615.32
5.5.260.0060.02615.34
5.5.250.0060.03215.23
5.5.240.0060.02615.17
5.5.230.0080.00612.50
5.5.220.0040.01112.56
5.5.210.0120.00412.60
5.5.200.0050.00812.50
5.5.190.0100.00812.52
5.5.180.0090.00312.47
5.5.170.0070.00512.46
5.5.160.0040.00712.54
5.5.150.0020.00812.49
5.5.140.0030.00612.60
5.5.130.0050.00712.30
5.5.120.0060.00612.26
5.5.110.0050.00712.42
5.5.100.0060.00612.42
5.5.90.0070.00312.44
5.5.80.0040.00612.46
5.5.70.0100.00012.55
5.5.60.0030.00612.51
5.5.50.0050.00812.53
5.5.40.0090.00312.40
5.5.30.0040.00812.40
5.5.20.0050.00512.39
5.5.10.0050.00612.27
5.5.00.0040.00712.41
5.4.450.0080.02114.33
5.4.440.0430.02314.26
5.4.430.0380.02414.37
5.4.420.0310.02914.31
5.4.410.0310.02014.13
5.4.400.0100.02113.99
5.4.390.0430.02014.05
5.4.380.0170.01913.98
5.4.370.0060.02214.00
5.4.360.0080.02213.97
5.4.350.0070.01911.86
5.4.340.0090.01411.82
5.4.330.0050.00511.70
5.4.320.0030.01811.97
5.4.310.0090.01511.84
5.4.300.0070.01511.87
5.4.290.0040.01612.02
5.4.280.0040.01611.79
5.4.270.0010.01911.77
5.4.260.0030.02311.94
5.4.250.0050.01911.96
5.4.240.0060.02014.03
5.4.230.0080.01713.99
5.4.220.0050.02314.04
5.4.210.0050.02114.11
5.4.200.0050.02114.01
5.4.190.0030.02313.97
5.4.180.0020.02513.98
5.4.170.0040.02514.16
5.4.160.0060.02013.97
5.4.150.0090.01914.04
5.4.140.0090.01913.25
5.4.130.0030.02313.20
5.4.120.0090.01913.10
5.4.110.0050.01913.17
5.4.100.0060.02213.17
5.4.90.0110.01513.20
5.4.80.0050.02313.19
5.4.70.0090.01613.14
5.4.60.0060.01813.17
5.4.50.0060.02313.19
5.4.40.0030.02713.21
5.4.30.0070.02313.20
5.4.20.0080.02013.11
5.4.10.0080.02813.07
5.4.00.0090.01912.93
5.3.290.0050.01911.87
5.3.280.0080.01712.45
5.3.270.0040.02212.57
5.3.260.0050.02612.53
5.3.250.0040.02612.57
5.3.240.0080.02612.43
5.3.230.0060.02512.38
5.3.220.0050.02012.57
5.3.210.0050.03112.40
5.3.200.0030.02112.52
5.3.190.0060.02112.49
5.3.180.0060.02112.52
5.3.170.0100.01512.53
5.3.160.0100.02012.57
5.3.150.0020.02312.60
5.3.140.0100.01812.60
5.3.130.0010.02712.48
5.3.120.0060.01812.48
5.3.110.0020.02412.53
5.3.100.0040.02412.31
5.3.90.0070.02012.36
5.3.80.0050.02012.13
5.3.70.0060.02512.25
5.3.60.0050.02212.29
5.3.50.0090.01812.29
5.3.40.0040.02312.21
5.3.30.0030.02112.26
5.3.20.0100.01512.08
5.3.10.0050.02012.11
5.3.00.0030.02212.10
5.2.170.0110.02410.27
5.2.160.0100.02710.40
5.2.150.0070.02210.22
5.2.140.0050.02110.40
5.2.130.0030.02010.17
5.2.120.0050.02010.30
5.2.110.0100.02510.31
5.2.100.0050.02110.25
5.2.90.0080.02210.26
5.2.80.0080.02110.23
5.2.70.0040.02910.29
5.2.60.0100.01710.19
5.2.50.0030.02610.20
5.2.40.0050.02010.29
5.2.30.0070.01910.35
5.2.20.0060.02110.01
5.2.10.0020.02710.02
5.2.00.0050.02310.05
5.1.60.0030.0189.31
5.1.50.0050.0189.19
5.1.40.0050.0189.22
5.1.30.0030.0269.50
5.1.20.0010.0219.47
5.1.10.0010.0219.31
5.1.00.0020.0239.34
5.0.50.0030.0168.14
5.0.40.0030.0168.02
5.0.30.0050.0227.99
5.0.20.0050.0158.07
5.0.10.0070.0187.92
5.0.00.0050.0217.92
4.4.90.0000.0157.29
4.4.80.0050.0107.29
4.4.70.0020.0157.29
4.4.60.0030.0137.29
4.4.50.0050.0127.29
4.4.40.0040.0187.29
4.4.30.0050.0137.29
4.4.20.0020.0137.29
4.4.10.0020.0127.29
4.4.00.0020.0187.29
4.3.110.0020.0197.29
4.3.100.0070.0087.29
4.3.90.0020.0147.29
4.3.80.0000.0207.29
4.3.70.0040.0087.29
4.3.60.0030.0157.29
4.3.50.0030.0127.29
4.3.40.0020.0187.29
4.3.30.0020.0137.29
4.3.20.0000.0167.29
4.3.10.0020.0137.29
4.3.00.0020.0137.20

preferences:
43.28 ms | 400 KiB | 5 Q