3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Model { protected $DB; function __construct($rowFields) { global $DB; $this->DB = $DB; foreach ($rowFields as $field => $value) { $this->$field = $value; } } } class NewsModel extends Model { private $NewsID = 0; private $NewsPostedBy = 0; private $NewsCreateDate = 0; private $NewsPublishDate = 0; private $NewsEditDate = 0; private $NewsStatus = 0; private $NewsOrder = 0; private $NewsDataLangID = array(0 => 0); private $NewsDataTitle = array(0 => ''); private $NewsDataSubTitle = array(0 => ''); private $NewsDataSummary = array(0 => ''); private $NewsDataContent = array(0 => ''); private $NewsDataStatus = array(0 => 0); private $NewsDataOrder = array(0 => 0); function __construct($newsRowFields) { parent::__construct($newsRowFields); // // Initialize the model // $this->NewsID = $newsID; // $this->NewsLangID = $newsLangID; // $this->NewsTitle = $newsTitle; // $this->NewsSubTitle = $newsSubTitle; // $this->NewsSummary = $newsSummary; // $this->NewsContent = $newsContent; // $this->NewsPostedBy = $newsPostedBy; // $this->NewsCreateDate = $newsCreateDate; // $this->NewsPublishDate = $newsPublishDate; // $this->NewsEditDate = $newsEditDate; // $this->NewsStatus = $newsStatus; // $this->NewsOrder = $newsOrder; } } /** * View class */ class View { function __construct() { # code... } public function Render(Model $viewName) { $result = include(P_VIEW_DIR_SYS . $viewName . '.php'); } } class NewsListView extends View { function __construct() { $DB -> Select('*') -> From('News JOIN NewsData ON newsID = newsDataRecID') -> Where("newsStatus = 'a' AND newsStatus = 'a'") -> OrderBy('a.newsOrder DESC') -> BeginTransaction(); $errors = false; if ($errors === false) { $DB->Commit(); } else { $DB->RollBack(); } } public function Render(NewsModel $news) { parent::Render($news); } }

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.60.0060.00918.15
8.3.50.0090.00821.96
8.3.40.0100.00318.70
8.3.30.0140.00718.96
8.3.20.0040.00420.38
8.3.10.0040.00423.66
8.3.00.0040.00422.43
8.2.180.0040.01116.50
8.2.170.0100.00322.96
8.2.160.0070.00722.25
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0060.00319.36
8.2.110.0080.00022.25
8.2.100.0090.00917.66
8.2.90.0030.00519.14
8.2.80.0050.00317.97
8.2.70.0050.00317.00
8.2.60.0040.00417.80
8.2.50.0030.00518.07
8.2.40.0050.00317.91
8.2.30.0000.00817.95
8.2.20.0050.00217.48
8.2.10.0070.00017.57
8.2.00.0040.00417.58
8.1.280.0180.00425.92
8.1.270.0040.00423.96
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0050.00523.91
8.1.230.0030.00719.18
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0030.00616.88
8.1.190.0080.00017.41
8.1.180.0030.00518.10
8.1.170.0030.00518.39
8.1.160.0040.00421.99
8.1.150.0050.00518.57
8.1.140.0070.00017.30
8.1.130.0070.00017.79
8.1.120.0000.00717.21
8.1.110.0030.00517.37
8.1.100.0000.00717.25
8.1.90.0030.00317.27
8.1.80.0070.00017.25
8.1.70.0000.00717.30
8.1.60.0030.00617.38
8.1.50.0030.00617.43
8.1.40.0060.00317.30
8.1.30.0000.00817.41
8.1.20.0000.00817.52
8.1.10.0000.00817.39
8.1.00.0060.00317.17
8.0.300.0000.00718.77
8.0.290.0040.00417.05
8.0.280.0030.00318.21
8.0.270.0070.00017.13
8.0.260.0030.00316.82
8.0.250.0000.00716.89
8.0.240.0030.00316.80
8.0.230.0030.00316.89
8.0.220.0000.00716.85
8.0.210.0000.00816.71
8.0.200.0030.00316.88
8.0.190.0030.00316.98
8.0.180.0080.00016.75
8.0.170.0000.00716.82
8.0.160.0070.00016.87
8.0.150.0000.00716.85
8.0.140.0050.00216.70
8.0.130.0040.00413.26
8.0.120.0000.00716.79
8.0.110.0040.00416.85
8.0.100.0020.00516.71
8.0.90.0030.00516.83
8.0.80.0030.01216.80
8.0.70.0000.00716.64
8.0.60.0040.00416.73
8.0.50.0050.00216.82
8.0.30.0130.00516.92
8.0.20.0120.00717.40
8.0.10.0000.00716.98
8.0.00.0100.01416.57
7.4.330.0050.00015.00
7.4.320.0070.00016.54
7.4.300.0040.00416.49
7.4.290.0000.00716.38
7.4.280.0000.00716.43
7.4.270.0060.00316.30
7.4.260.0070.00016.41
7.4.250.0040.00416.46
7.4.240.0010.00616.39
7.4.230.0000.00716.50
7.4.220.0070.01016.43
7.4.210.0080.00716.42
7.4.200.0030.00316.23
7.4.190.0030.00316.45
7.4.160.0080.00816.33
7.4.150.0100.00717.40
7.4.140.0100.01017.86
7.4.130.0120.00716.37
7.4.120.0090.01016.40
7.4.110.0110.00816.56
7.4.100.0100.00716.55
7.4.90.0090.00916.36
7.4.80.0160.00316.49
7.4.70.0100.00716.26
7.4.60.0070.01016.44
7.4.50.0080.00016.25
7.4.40.0060.01222.77
7.4.30.0060.01116.54
7.4.00.0040.01114.95
7.3.330.0030.00313.12
7.3.320.0060.00013.27
7.3.310.0030.00316.24
7.3.300.0030.00316.11
7.3.290.0070.00716.16
7.3.280.0090.00916.26
7.3.270.0070.01017.40
7.3.260.0120.00616.24
7.3.250.0100.00816.14
7.3.240.0060.00916.23
7.3.230.0100.01016.39
7.3.210.0120.01116.29
7.3.200.0120.00619.39
7.3.190.0110.01116.39
7.3.180.0100.01016.22
7.3.170.0070.01416.46
7.3.160.0080.00816.32
7.3.120.0070.00714.57
7.3.110.0080.00814.86
7.3.100.0000.01014.46
7.3.90.0100.00714.43
7.3.80.0000.01514.74
7.3.70.0140.00014.75
7.3.60.0120.00014.88
7.3.50.0040.00714.74
7.3.40.0070.00714.75
7.3.30.0150.00014.66
7.3.20.0070.00416.41
7.3.10.0090.00816.19
7.3.00.0090.01016.56
7.2.330.0070.01616.33
7.2.320.0070.01616.59
7.2.310.0100.00716.50
7.2.300.0080.01216.36
7.2.290.0110.00616.46
7.2.240.0040.01515.09
7.2.230.0130.00314.71
7.2.220.0040.00814.84
7.2.210.0120.00314.89
7.2.200.0060.00914.83
7.2.190.0120.00315.01
7.2.180.0070.01114.92
7.2.170.0060.00914.86
7.2.160.0100.00714.58
7.2.150.0070.00716.62
7.2.140.0050.00516.61
7.2.130.0060.01316.35
7.2.120.0060.01316.74
7.2.110.0070.01016.43
7.2.100.0130.00616.50
7.2.90.0130.00716.74
7.2.80.0080.00616.46
7.2.70.0070.00716.50
7.2.60.0090.00816.59
7.2.50.0050.01016.54
7.2.40.0110.00516.53
7.2.30.0120.00516.49
7.2.20.0050.01016.38
7.2.10.0050.01216.48
7.2.00.0100.00617.39
7.1.330.0030.00915.57
7.1.320.0080.00815.53
7.1.310.0130.00315.67
7.1.300.0080.00515.60
7.1.290.0140.00015.39
7.1.280.0030.00815.71
7.1.270.0000.01515.41
7.1.260.0070.00715.73
7.1.250.0080.00715.47
7.1.200.0100.00315.74
7.1.100.0060.00617.86
7.1.70.0060.00616.95
7.1.60.0070.01419.24
7.1.50.0070.01316.64
7.1.00.0030.07722.35
7.0.200.0110.00016.54
7.0.140.0000.07022.21
7.0.60.0030.06319.95
7.0.50.0030.05717.92
7.0.40.0070.06320.09
7.0.30.0270.08020.24
7.0.20.0170.06020.15
7.0.10.0270.08320.24
7.0.00.0170.07020.22
5.6.280.0000.07720.85
5.6.210.0100.07720.79
5.6.200.0030.04718.25
5.6.190.0130.08320.52
5.6.180.3230.04720.36
5.6.170.0300.03720.51
5.6.160.0100.05320.43
5.6.150.0070.03718.28
5.6.140.0100.07318.31
5.6.130.0200.06318.19
5.6.120.0070.04721.01
5.6.110.0170.07321.13
5.6.100.0100.06021.00
5.6.90.0070.08321.13
5.6.80.0070.08020.53
5.6.70.3530.03720.46
5.5.350.0070.03720.41
5.5.340.0130.04018.09
5.5.330.0070.05020.35
5.5.320.0300.07720.48
5.5.310.0300.07320.24
5.5.300.0070.06017.96
5.5.290.0030.08017.98
5.5.280.0100.08320.68
5.5.270.0030.04320.92
5.5.260.0170.05720.83
5.5.250.0200.07020.64
5.5.240.0030.06720.18
5.4.450.0900.06019.46
5.4.440.0800.06019.63
5.4.430.0470.07319.22
5.4.420.0630.06319.22
5.4.410.0100.06319.02
5.4.400.1300.04718.87
5.4.390.1100.05318.68
5.4.380.0400.06718.53
5.4.370.0130.03718.70
5.4.360.0130.03018.53
5.4.350.0040.04312.04
5.4.340.0060.04112.04
5.4.320.0080.03412.54
5.4.310.0090.04912.53
5.4.300.0030.04312.53
5.4.290.0070.03812.53
5.4.280.0060.04312.42
5.4.270.0090.04612.43
5.4.260.0060.03612.42
5.4.250.0050.05212.42
5.4.240.0080.03512.42
5.4.230.0030.04112.41
5.4.220.0060.03912.41
5.4.210.0070.03412.42
5.4.200.0070.04312.41
5.4.190.0170.04412.40
5.4.180.0160.04312.41
5.4.170.0180.04112.42
5.4.160.0150.04512.41
5.4.150.0140.04612.41
5.4.140.0160.04212.09
5.4.130.0200.03812.09
5.4.120.0170.04312.04
5.4.110.0090.04912.03
5.4.100.0130.04812.03
5.4.90.0140.04512.04
5.4.80.0150.04412.04
5.4.70.0090.05012.03
5.4.60.0100.04712.03
5.4.50.0120.04812.02
5.4.40.0210.03712.01
5.4.30.0180.04212.01
5.4.20.0160.04412.00
5.4.10.0200.03912.01
5.4.00.0130.04411.50
5.3.290.0070.04212.80
5.3.280.0050.03912.71
5.3.270.0150.05112.72
5.3.260.0210.04912.72
5.3.250.0220.04212.72
5.3.240.0170.04512.72
5.3.230.0150.05012.71
5.3.220.0180.04512.68
5.3.210.0170.04512.68
5.3.200.0130.05412.68
5.3.190.0230.04012.68
5.3.180.0140.04812.68
5.3.170.0160.04512.67
5.3.160.0140.04712.67
5.3.150.0170.04312.68
5.3.140.0180.04512.67
5.3.130.0190.04312.65
5.3.120.0150.04812.66
5.3.110.0250.03712.66
5.3.100.0150.04612.14
5.3.90.0160.04312.13
5.3.80.0200.04512.11
5.3.70.0140.04912.11
5.3.60.0210.04212.09
5.3.50.0160.04612.05
5.3.40.0150.04512.05
5.3.30.0190.03912.02
5.3.20.0170.04511.79
5.3.10.0170.04111.75
5.3.00.0120.04711.73
5.2.170.0100.0389.24
5.2.160.0130.0349.24
5.2.150.0140.0349.23
5.2.140.0130.0379.23
5.2.130.0160.0349.20
5.2.120.0100.0409.19
5.2.110.0110.0409.20
5.2.100.0110.0419.21
5.2.90.0120.0379.21
5.2.80.0150.0369.20
5.2.70.0160.0339.19
5.2.60.0100.0389.14
5.2.50.0140.0359.11
5.2.40.0150.0379.09
5.2.30.0160.0329.07
5.2.20.0160.0359.07
5.2.10.0140.0368.96
5.2.00.0150.0358.82
5.1.60.0140.0278.11
5.1.50.0160.0278.11
5.1.40.0150.0268.10
5.1.30.0170.0328.44
5.1.20.0130.0318.47
5.1.10.0130.0338.18
5.1.00.0150.0288.18
5.0.50.0110.0256.67
5.0.40.0120.0226.52
5.0.30.0090.0366.34
5.0.20.0070.0266.31
5.0.10.0140.0206.28
5.0.00.0120.0336.27
4.4.90.0070.0214.78
4.4.80.0070.0184.75
4.4.70.0070.0214.76
4.4.60.0080.0194.76
4.4.50.0090.0174.77
4.4.40.0060.0314.71
4.4.30.0090.0184.76
4.4.20.0070.0214.84
4.4.10.0040.0224.85
4.4.00.0100.0274.75
4.3.110.0080.0194.67
4.3.100.0090.0174.67
4.3.90.0070.0184.63
4.3.80.0080.0274.59
4.3.70.0100.0154.63
4.3.60.0080.0174.63
4.3.50.0080.0184.63
4.3.40.0070.0284.54
4.3.30.0070.0173.29
4.3.20.0040.0213.29
4.3.10.0040.0213.24
4.3.00.0170.0177.27

preferences:
36.68 ms | 401 KiB | 5 Q