3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class RolesController extends Controller { const RESOURCE_NAME = 'roles'; const MODEL = App\Models\Role::class; } class Controller { private $model; public function __construct() { $modelClass = static::MODEL; $this->model = new $modelClass; } } var_dump(new RolesController);
based on Je0sj
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Class 'App\Models\Role' not found in /in/SYYVp:19 Stack trace: #0 /in/SYYVp(23): Controller->__construct() #1 {main} thrown in /in/SYYVp on line 19
Process exited with code 255.
Output for 5.5.0 - 5.6.28
Fatal error: Class 'App\Models\Role' not found in /in/SYYVp on line 19
Process exited with code 255.
Output for 5.4.0 - 5.4.45
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) in /in/SYYVp on line 7
Process exited with code 255.