Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

alirezah's avatar

Inflector error with php v5.6

Laravel Version: 5.4.36

PHP Version: 5.6.32

update my project and: syntax error, unexpected ':', expecting ';' or '{' in Inflector.php (line 265) laravel

delete the composer.lock file and vendor, then run composer install. but yet still have error!!!

0 likes
2 replies
click's avatar

It looks like you have installed a PHP 7.x library of Inflector.

See https://github.com/doctrine/inflector/blob/master/lib/Doctrine/Common/Inflector/Inflector.php#L265

Do you have doctrine/inflector in your own composer.json file?

You could try setting the config.platform.php variable in your composer file to `<=5.6.32' and than run composer install again. This should prevent composer installing incompatible dependencies.

see: https://stackoverflow.com/a/37438345

{
    "name": ".../...",
    "config": {
        "platform": {
            "php": "<=5.6.32"
        }
    },
    "require": {
        ...
    }
} 
1 like
alirezah's avatar

no but i check composer.lock and see doctrine/inflector version is 1.3.0

so add "doctrine/inflector": "1.2.x" in composer.json then run composer install and fix the error

tnx

Please or to participate in this conversation.