3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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); } }
Output for 7.0.0 - 7.1.0
Warning: Declaration of NewsListView::Render(NewsModel $news) should be compatible with View::Render(Model $viewName) in /in/mH4MW on line 96
Output for 5.4.20 - 5.6.28
Strict Standards: Declaration of NewsListView::Render() should be compatible with View::Render(Model $viewName) in /in/mH4MW on line 96
Output for 5.4.0 - 5.4.19
Strict Standards: Declaration of NewsListView::Render() should be compatible with View::Render(Model $viewName) in /in/J6Uta on line 96
Output for 5.3.28 - 5.3.29
Strict Standards: Declaration of NewsListView::Render() should be compatible with that of View::Render() in /in/mH4MW on line 96
Output for 5.0.0 - 5.3.27
Strict Standards: Declaration of NewsListView::Render() should be compatible with that of View::Render() in /in/J6Uta on line 96
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/J6Uta on line 5
Process exited with code 255.
Output for 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/J6Uta on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/J6Uta on line 5
Process exited with code 255.
Output for 4.3.0
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/mH4MW on line 5
Process exited with code 255.