S
S
Stanislav2016-02-02 00:10:15
symfony
Stanislav, 2016-02-02 00:10:15

Symfony2 Doctrine: How to resolve array parsing error?

Greetings! When transferring a site to a hosting and trying to clear the cache,
php app/console cache:clear -env=prod
an error pops up

PHP Parse error:  syntax error, unexpected '[' in /home/c/site.ru/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 90

Swears at the array declaration private $definitions = [];, if you change the declaration to private $definitions = array();that, no error occurs!
PHP 5.6 and declaring an array [] in other files (without using Symfony) works without error.
The check php app/check.phpshows [OK] Your system is ready to run Symfony2 projects.
I believe that the error is in the server settings, but I can’t figure out which ones exactly.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BoShurik, 2016-02-02
@Chebaa

php -v
what gives out? I suspect that there are different versions of php on the web and in the console

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question