yii2-dynamicform icon indicating copy to clipboard operation
yii2-dynamicform copied to clipboard

syntax error, unexpected ':', expecting ';' or '{'

Open Elmaddin opened this issue 6 years ago • 7 comments

I have that error in in /home/brandup4/public_html/stp/vendor/symfony/dom-crawler/Crawler.php at line 958

Elmaddin avatar Jun 08 '18 05:06 Elmaddin

Were you able to resolve it? I encounter the same Error.

sebastianreza avatar Jun 18 '18 18:06 sebastianreza

I couldnt

Elmaddin avatar Jun 20 '18 05:06 Elmaddin

It seems to be related with the PHP version. Trying to run with 5.6 server gets the same error in Crawler... when trying to install wbraganca with composer and php 5.6 i get this error:

`ERGMBP:gescaad ergon$ /Applications/AMPPS/php-5.6/bin/php ../composer.phar require --prefer-dist wbraganca/yii2-dynamicform "*" ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages.

Problem 1 - symfony/browser-kit v4.1.0 requires php ^7.1.3 -> your PHP version (5.6.31) does not satisfy that requirement. - symfony/browser-kit v4.1.0 requires php ^7.1.3 -> your PHP version (5.6.31) does not satisfy that requirement. - symfony/browser-kit v4.1.0 requires php ^7.1.3 -> your PHP version (5.6.31) does not satisfy that requirement. - Installation request for symfony/browser-kit (locked at v4.1.0) -> satisfiable by symfony/browser-kit[v4.1.0].

Installation failed, reverting ./composer.json to its original content.`

Anybody knows if there is a php 5.6 wbraganca compatible version?

jmvictoria avatar Jul 08 '18 08:07 jmvictoria

And here is the explanation...

https://www.tutorialspoint.com/php7/php7_returntype_declarations.htm

New funcionality of PHP 7.0 for casting the function return values...

jmvictoria avatar Jul 08 '18 08:07 jmvictoria

This must be updated Pls wbraganca sir, update your widget thank you.

resuta566 avatar Nov 04 '18 07:11 resuta566

im have same trouble in php 5.6, and im fix with downgrade this :

symfony/dom-crawler (v4.2.2) >> to >> "symfony/dom-crawler": "~2.7.5", symfony/css-selector (v4.2.2) >> to >> "symfony/css-selector": "~2.7.0"

how to ? just install again with another version .. composer require --prefer-dist symfony/dom-crawler "2.7.0" composer require --prefer-dist symfony/css-selector "2.7.0"

this error come because symfony/dom-crawler and symfony/css-selector newest version use syntax for php 7 not for php 5.6

aldiferdiyan avatar Jan 25 '19 21:01 aldiferdiyan

To everyone who just upgrade from php5.6 to php7. To save your life, make sure set short_open_tag to on in php.ini.

brain90 avatar Mar 24 '20 10:03 brain90