3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php defined('CMS_TA') or die; namespace App\Controllers; use App\Core\Flash; // use App\core\Messages; // use flight\Flight; class Controller { protected $tmpl; protected $inst; protected $title; protected $data; protected $errors = []; protected $msg; protected $multi = []; public function __construct($instanca= null){ $this->msg = $instanca->flash_data(); $this->flash = $instanca->flash_msg(); $this->inst= $instanca; } protected function view() { // header tmpl $this->inst->render('tmpl/header', [ 'title' => $this->title, 'base' => $this->inst->request()->base, 'flash' => $this->flash::display(), ]); // content tmpl $this->inst->render($this->tmpl, [ 'data'=>$this->data, 'errors'=>$this->errors, ]); // footer tmpl $this->inst->render('tmpl/footer'); } }
based on 9a8iR
Output for 7.0.1 - 7.1.7
Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in /in/vpmF2 on line 5
Process exited with code 255.
Output for 5.6.0 - 5.6.30, 7.0.0
Fatal error: Namespace declaration statement has to be the very first statement in the script in /in/vpmF2 on line 5
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Namespace declaration statement has to be the very first statement in the script: (Line: 5, Char: 26) in /in/vpmF2:5 Stack trace: #0 {main}
Process exited with code 255.