3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Class User * Application/controller/user.php */ class User extends Controller { function my__construct($user_model) { include 'application/model/usermodel.php'; } spl_autoload_register('my__construct'); public function index() { // load views/partials. require 'application/views/partials/header.php'; require 'application/views/partials/footer.php'; // run the login() method in the login-model, put the result in $login_successful (true or false) // perform the login method, put result (true or false) into $login_successful $login_successful = $user_model->login(); // check login status if ($login_successful) { // if YES, then move user to dashboard/index (btw this is a browser-redirection, not a rendered view!) header('location: ' . URL . 'user/profile'); } else { // if NO, then move user to login/index (login form) again header('location: ' . URL . 'user/access'); } } public function access() { // @TODO fix $this->view->render require 'application/views/partials/header.php'; require 'application/views/user/access.php'; require 'application/views/partials/footer.php'; }

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)
5.4.280.0150.05112.38
5.4.270.0040.04712.38
5.4.260.0080.03812.38
5.4.250.0050.04212.38
5.4.240.0090.04212.38
5.4.230.0080.05512.38
5.4.220.0070.05312.38
5.4.210.0070.05212.38
5.4.200.0090.05612.37
5.4.190.0090.04612.37
5.4.180.0100.03912.37
5.4.170.0110.05312.38
5.4.160.0050.05712.37
5.4.150.0090.06512.37
5.4.140.0110.05412.06
5.4.130.0090.05212.04
5.4.120.0080.04912.01
5.4.110.0090.04412.00
5.4.100.0090.05312.00
5.4.90.0210.09612.00
5.4.80.0070.04412.00
5.4.70.0100.06112.00
5.4.60.0130.06612.00
5.4.50.0170.05212.00
5.4.40.0080.07011.99
5.4.30.0070.06411.98
5.4.20.0080.06511.98
5.4.10.0110.06911.99
5.4.00.0100.05311.48
5.3.280.0090.05512.71
5.3.270.0090.07012.72
5.3.260.0230.06012.72
5.3.250.0140.06112.72
5.3.240.0110.07212.72
5.3.230.0120.05212.71
5.3.220.0070.06812.68
5.3.210.0120.07612.68
5.3.200.0080.05512.68
5.3.190.0100.06512.68
5.3.180.0080.04512.68
5.3.170.0060.04012.67
5.3.160.0080.03912.67
5.3.150.0100.04912.67
5.3.140.0090.03612.66
5.3.130.0070.04512.66
5.3.120.0100.06312.65
5.3.110.0100.06712.66
5.3.100.0160.07012.12
5.3.90.0120.05712.08
5.3.80.0150.06412.07
5.3.70.0140.04312.07
5.3.60.0100.04212.06
5.3.50.0090.04612.00
5.3.40.0100.03912.00
5.3.30.0090.04811.95
5.3.20.0110.04411.73
5.3.10.0050.06111.70
5.3.00.0090.04911.69

preferences:
138.72 ms | 1394 KiB | 7 Q