3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $_POST['email'] = 'test@mail.com'; $_POST['emailrepeat'] = 'test@gmail.com'; function cleanInput($input){ if(isset($_POST[$input])){ $input = $_POST[$input]; }else{ return false; } $input = htmlspecialchars($input); $input = trim($input); $input = stripslashes($input); return $input; } function isCorrectLength($input,$min,$max){ $x = mb_strlen($input); return ($x >= $min && $x <= $max); } if($email = cleanInput('email')){ if(filter_var($email, FILTER_VALIDATE_EMAIL)){ if(isCorrectLength($email,1,60)){ if(!$auth->isEmailTaken($email)){ $email_clean = $email; }else{ array_push($errorMessages,'Your email is already registered'); } }else{ array_push($errorMessage,'Your email is too long'); } }else{ array_push($errorMessages,'You entered an incorrect email'); } }else{ array_push($errorMessages,'You did not input an email'); } if($emailrepeat = cleanInput('emailrepeat')){ if(strcasecmp($email_clean, emailrepeat) != 0){ echo "$emailrepeat<br>$email_clean<br>"; array_push($errorMessages,'Your emails did not match'); } }else{ array_push($errorMessages,'You did not repeat your email'); }
based on QQCiC

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.2.60.0030.01017.09
7.2.00.0050.01419.67
7.1.200.0080.00316.23
7.1.100.0060.00618.61
7.1.70.0000.00917.43
7.1.60.0070.00719.27
7.1.50.0070.01317.55
7.1.00.0030.07722.58
7.0.200.0070.00417.15
7.0.60.0200.07722.05
7.0.50.0030.08718.08
7.0.40.0030.08320.13
7.0.30.0200.04320.27
7.0.20.0330.07320.22
7.0.10.0070.04020.45
7.0.00.0030.07320.37
5.6.280.0000.03320.95
5.6.210.0100.07020.77
5.6.200.0000.04718.32
5.6.190.0030.06720.53
5.6.180.0330.08020.53
5.6.170.0300.08020.54
5.6.160.0100.08720.52
5.6.150.0000.05318.24
5.6.140.0000.05018.17
5.6.130.0100.03718.20
5.6.120.0070.04021.15
5.6.110.0100.07021.04
5.6.100.0070.04021.01
5.6.90.0030.07321.16
5.6.80.0170.07320.39
5.5.350.0030.09020.55
5.5.340.0070.05317.96
5.5.330.0030.05020.36
5.5.320.0270.06020.38
5.5.310.0300.06320.40
5.5.300.0000.04018.02
5.5.290.0130.07018.13
5.5.280.0130.08020.72
5.5.270.0130.07720.68
5.5.260.0100.08020.91
5.5.250.0070.07020.62
5.5.240.0170.08320.16
5.4.450.0600.05019.26
5.4.440.0470.06719.59
5.4.430.0730.06319.55
5.4.420.0630.04719.55
5.4.410.0600.05019.12
5.4.400.0730.04719.23
5.4.390.0130.05319.34
5.4.380.0230.04719.24
5.4.370.0230.07319.16
5.4.360.0300.05719.25
5.4.350.0270.06019.15
5.4.340.0170.05319.25
5.4.320.0400.03719.33
5.4.310.0230.04719.28
5.4.300.0230.06019.14
5.4.290.0200.05019.31
5.4.280.0230.06719.32
5.4.270.0170.07019.24
5.4.260.0270.04719.25
5.4.250.0200.05319.17
5.4.240.0170.05719.13
5.4.230.0200.05019.33
5.4.220.0200.05319.28
5.4.210.0200.05019.22
5.4.200.0170.05019.22
5.4.190.0230.04719.16
5.4.180.0270.04319.21
5.4.170.0130.05719.09
5.4.160.0230.04319.20
5.4.150.0170.05319.30
5.4.140.0170.05316.42
5.4.130.0230.04316.41
5.4.120.0270.04716.25
5.4.110.0170.05016.23
5.3.290.0170.05314.76
5.3.280.0130.05714.73
5.3.270.0230.05014.74
5.3.260.0130.07314.75
5.3.250.0170.05014.77
5.3.240.0230.05714.79
5.3.230.0230.04314.89
5.3.220.0030.06314.52
5.3.210.0170.05314.73