3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // index.php require(baseController.php); require(basemodel.php); require(header.php); // baseController.php class baseController { function __construct() { baseModel } function echoView($view) { $this->view->render('views/header');// go to view controller and use the render method to echo view.php view. } } // basemodel.php class baseModel { function __construct() { // acces db with new db(); } public function userList() { $query = $this->db->prepare('SELECET....'); $query->execute(); return $query->fetchAll(); } } //view.php <p>This is a view!</p> //header.php <header></header> // controller methods operate models // userController.php class userController { function __construct() { parent::baseController; } function edit($i) { $tis->view->user = $this->model->userList(); $this->view->render(user/edit); } } // model methods operate on the database // usermodel.php class userModel extends baseModel{ function __construct() { parent::__construct(); } public function userList() { $query = $this->db->prepare('SELECET users FROM...'); $query->execute(); return $query->fetchAll(); } }

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.280.0130.05912.38
5.4.270.0110.05012.38
5.4.260.0060.04512.38
5.4.250.0050.04012.38
5.4.240.0060.05212.38
5.4.230.0060.05212.38
5.4.220.0070.04612.38
5.4.210.0080.03512.37
5.4.200.0080.05412.37
5.4.190.0070.03712.37
5.4.180.0140.04712.37
5.4.170.0080.05412.38
5.4.160.0050.05212.38
5.4.150.0050.03812.37
5.4.140.0090.04312.06
5.4.130.0090.03812.04
5.4.120.0090.03512.00
5.4.110.0080.03612.00
5.4.100.0090.03312.00
5.4.90.0080.03812.00
5.4.80.0090.04012.00
5.4.70.0070.03612.00
5.4.60.0120.03912.00
5.4.50.0080.04812.00
5.4.40.0110.03111.99
5.4.30.0030.04011.98
5.4.20.0060.05211.98
5.4.10.0060.03611.98
5.4.00.0070.03511.47
5.3.280.0070.03812.71
5.3.270.0050.04312.72
5.3.260.0080.04412.71
5.3.250.0130.05412.72
5.3.240.0080.04112.72
5.3.230.0090.03812.71
5.3.220.0060.04712.68
5.3.210.0060.03912.68
5.3.200.0060.05312.68
5.3.190.0080.03812.68
5.3.180.0100.04712.67
5.3.170.0050.03812.67
5.3.160.0070.03712.67
5.3.150.0090.04212.67
5.3.140.0090.03612.66
5.3.130.0080.03812.66
5.3.120.0080.03812.66
5.3.110.0080.05512.66
5.3.100.0110.04112.12
5.3.90.0050.04212.08
5.3.80.0070.03812.07
5.3.70.0060.04012.08
5.3.60.0070.04912.06
5.3.50.0070.04212.00
5.3.40.0080.03612.00
5.3.30.0090.03511.95
5.3.20.0080.03411.73
5.3.10.0060.03611.70
5.3.00.0090.03511.70
5.2.170.0050.0329.19
5.2.160.0090.0279.19
5.2.150.0070.0349.19
5.2.140.0090.0449.19
5.2.130.0050.0529.15
5.2.120.0020.0359.15
5.2.110.0070.0289.14
5.2.100.0050.0299.14
5.2.90.0040.0319.14
5.2.80.0050.0309.14
5.2.70.0070.0349.14
5.2.60.0080.0379.10
5.2.50.0110.0399.07
5.2.40.0090.0329.04
5.2.30.0110.0369.01
5.2.20.0100.0329.01
5.2.10.0050.0328.92
5.2.00.0060.0298.78
5.1.60.0020.0278.07
5.1.50.0040.0268.07
5.1.40.0080.0228.04
5.1.30.0060.0248.39
5.1.20.0050.0278.41
5.1.10.0100.0308.15
5.1.00.0050.0278.15
5.0.50.0090.0256.62
5.0.40.0040.0206.49
5.0.30.0040.0326.29
5.0.20.0080.0246.26
5.0.10.0080.0276.24
5.0.00.0060.0476.23
4.4.90.0030.0254.78
4.4.80.0060.0214.76
4.4.70.0030.0164.75
4.4.60.0000.0194.76
4.4.50.0030.0164.77
4.4.40.0050.0234.71
4.4.30.0050.0134.76
4.4.20.0020.0174.84
4.4.10.0040.0154.85
4.4.00.0050.0234.76
4.3.110.0030.0164.67
4.3.100.0030.0154.66
4.3.90.0030.0154.64
4.3.80.0020.0264.58
4.3.70.0040.0144.63
4.3.60.0040.0134.63
4.3.50.0030.0164.63
4.3.40.0040.0294.54
4.3.30.0020.0213.29
4.3.20.0030.0203.26
4.3.10.0030.0153.23
4.3.00.0200.0206.90