3v4l.org

run code in 300+ PHP versions simultaneously
<?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'); } }
Output for 7.0.1 - 7.0.20, 7.1.0 - 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 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.

preferences:
171.45 ms | 1395 KiB | 36 Q