daveh / php-mvc

A simple PHP model-view-controller framework, built step-by-step as part of the "Write PHP like a pro: build an MVC framework from scratch" course on Udemy.
https://davehollingworth.com/go/phpmvc/
MIT License
777 stars 310 forks source link

syntax error unexpected array in Router.php #86

Open pagodzik opened 3 years ago

pagodzik commented 3 years ago

I have this error with PHP Version 7.3.2. Works good with 7.4.4.

`Fatal error Uncaught exception: 'ParseError'

Message: 'syntax error, unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST)'

Stack trace:

0 C:\wamp\www\flexim-hotesse-virtuelle\vendor\composer\ClassLoader.php(322): Composer\Autoload\includeFile('C:\wamp\www\fle...')

1 [internal function]: Composer\Autoload\ClassLoader->loadClass('Core\Router')

2 C:\wamp\www\flexim-hotesse-virtuelle\public\index.php(33): spl_autoload_call('Core\Router')

3 {main}

Thrown in 'C:\wamp\www\flexim-hotesse-virtuelle\Core\Router.php' on line 20`

What is missing here?

daveh commented 3 years ago

It looks like an error with Composer - Composer requires PHP 7.4, so it won't work with 7.3.2.