3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL); ini_set('display_errors', 'On'); Class login { //protected $mod_id; //protected $mod_name; //protected $mod_password; //protected $mod_type; private $logged_status = false; //private $con = $this->db_connect(); public $status_message = ""; function __construct() { $this->runApplication(); //$this->mod_id = null; //$this->mod_name = null; //$this->mod_password = null; //$this->mod_type = null; } private function validate_inputs() { if (!empty($_POST['user_name']) && !empty($_POST['user_password'])) { return true; } elseif (empty($_POST['user_name'])) { $this->status_message = "Username field was empty."; } elseif (empty($_POST['user_password'])) { $this->status_message = "Password field was empty."; } // default return return false; } private function page_login_form() { if ($this->status_message) { echo $this->status_message . "<br/><br/>"; } echo '<h2>Login</h2>'; echo '<form method="post" action="' . $_SERVER['SCRIPT_NAME'] . '" name="loginform">'; echo '<label for="login_input_username">Username</label> '; echo '<input id="login_input_username" type="text" name="user_name" required /> '; echo '<label for="login_input_password">Password</label> '; echo '<input id="login_input_password" type="password" name="user_password" required /> '; echo '<input type="submit" name="login" value="Log in" />'; echo '</form>'; } public function get_login_status() { return $this->logged_status; } private function verify_password_and_login() { } public funtion runApplication() { session_start(); this->page_login_form(); } private function logout() { $_SESSION = array(); session_destroy(); $this->logged_in = false; $this->status_message= "You were just logged out."; } } $application = new login(); ?>

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)
5.4.260.0130.05318.99
5.4.250.0100.07719.08
5.4.240.0030.06318.99
5.4.230.0230.04018.77
5.4.220.0070.05718.96
5.4.210.0100.04719.02
5.4.200.0070.05318.74
5.4.190.0100.05018.93
5.4.180.0100.06318.93
5.4.170.0100.05018.99
5.4.160.0030.06018.98
5.4.150.0100.06718.72
5.4.140.0070.06016.33
5.4.130.0100.04316.27
5.4.120.0230.06716.34
5.4.110.0070.07316.55
5.4.100.0230.04016.41
5.4.90.0100.06716.41
5.4.80.0070.06316.59
5.4.70.0170.07016.45
5.4.60.0270.05016.49
5.4.50.0070.05316.29
5.4.40.0130.04316.61
5.4.30.0100.05316.30
5.4.20.0070.05316.55
5.4.10.0170.07316.50
5.4.00.0200.05015.85
5.3.280.0070.05014.84
5.3.270.0100.05014.70
5.3.260.0070.07714.70
5.3.250.0200.05314.45
5.3.240.0030.05714.80
5.3.230.0030.07014.70
5.3.220.0030.06014.67
5.3.210.0100.05314.71
5.3.200.0030.05314.59
5.3.190.0070.05314.65
5.3.180.0100.06014.66
5.3.170.0130.05714.60
5.3.160.0170.06314.66
5.3.150.0130.04314.57
5.3.140.0070.07014.59
5.3.130.0100.05714.54
5.3.120.0100.07714.64
5.3.110.0170.06314.70
5.3.100.0200.05314.05
5.3.90.0070.05014.25
5.3.80.0070.07314.20
5.3.70.0100.04714.11
5.3.60.0170.06013.91
5.3.50.0130.06713.79
5.3.40.0130.06314.03
5.3.30.0100.04713.75
5.3.20.0030.06013.87
5.3.10.0170.05313.73
5.3.00.0130.06313.83