Description
I have just upgraded from Symfony 4.4.26 to 4.4.27 and have hit my first upgrade issue in a long time.
I am running PHP 7.4.15 as i'm not ready for PHP 8 yet, however the Yaml Parser.php is looking for str_contains - which is only available in PHP 8.
PHP Fatal error: Uncaught Error: Call to undefined function
Symfony\Component\Yaml\str_contains() in
/private/var/www/crmpicco/vendor/symfony/symfony/src/Symfony/Component/Yaml/Parser.php:214
I was under the impression the polyfills existed for this reason, but they don't seem to be working this time.
How to reproduce composer update
Additional context
I was under the impression the polyfills existed for this reason, but they don't seem to be working this time.
Bizarrely the app still boots up, but a composer update falls over as per output below:
composer update
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 10 updates, 0 removals
- Upgrading aws/aws-sdk-php (3.185.3 => 3.185.21)
- Upgrading doctrine/cache (2.0.3 => 2.1.1)
- Upgrading doctrine/migrations (3.1.4 => 3.2.0)
- Upgrading laminas/laminas-code (4.4.0 => 4.4.2)
- Upgrading nikic/php-parser (v4.10.5 => v4.12.0)
- Upgrading phar-io/manifest (2.0.1 => 2.0.3)
- Upgrading phpunit/phpunit (9.5.6 => 9.5.7)
- Upgrading symfony/maker-bundle (v1.32.0 => v1.33.0)
- Upgrading symfony/symfony (v4.4.26 => v4.4.27)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 10 updates, 0 removals
- Downloading aws/aws-sdk-php (3.185.21)
- Downloading symfony/symfony (v4.4.27)
- Downloading laminas/laminas-code (4.4.2)
- Downloading doctrine/cache (2.1.1)
- Downloading doctrine/migrations (3.2.0)
- Downloading nikic/php-parser (v4.12.0)
- Downloading phar-io/manifest (2.0.3)
- Downloading phpunit/phpunit (9.5.7)
- Downloading symfony/maker-bundle (v1.33.0)
- Upgrading aws/aws-sdk-php (3.185.3 => 3.185.21): Extracting archive
- Upgrading symfony/symfony (v4.4.26 => v4.4.27): Extracting archive
- Upgrading laminas/laminas-code (4.4.0 => 4.4.2): Extracting archive
- Upgrading doctrine/cache (2.0.3 => 2.1.1): Extracting archive
- Upgrading doctrine/migrations (3.1.4 => 3.2.0): Extracting archive
- Upgrading nikic/php-parser (v4.10.5 => v4.12.0): Extracting archive
- Upgrading phar-io/manifest (2.0.1 => 2.0.3): Extracting archive
- Upgrading phpunit/phpunit (9.5.6 => 9.5.7): Extracting archive
- Upgrading symfony/maker-bundle (v1.32.0 => v1.33.0): Extracting archive
Package mandrill/mandrill is abandoned, you should avoid using it. Use mailchimp/transactional instead.
Package sebastian/resource-operations is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
60 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
PHP Fatal error: Uncaught Error: Call to undefined function Symfony\Component\Yaml\str_contains() in /private/var/www/crmpicco/vendor/symfony/symfony/src/Symfony/Component/Yaml/Parser.php:214
Stack trace:
#0 /private/var/www/crmpicco/vendor/symfony/symfony/src/Symfony/Component/Yaml/Parser.php(96): Symfony\Component\Yaml\Parser->doParse('parameters:\n ...', 0)
#1 /private/var/www/crmpicco/vendor/incenteev/composer-parameter-handler/Processor.php(34): Symfony\Component\Yaml\Parser->parse('# This file is ...')
#2 /private/var/www/crmpicco/vendor/incenteev/composer-parameter-handler/ScriptHandler.php(34): Incenteev\ParameterHandler\Processor->processFile(Array)
#3 phar:///usr/local/Cellar/composer/1.9.2/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(377): Incenteev\ParameterHandler\ScriptHandler::buildParameters(Object(Composer\Script\Event))
#4 phar:///usr/local/Cellar/composer/1.9.2/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(236): Composer\EventDispatcher\EventDispatcher->execute in /private/var/www/crmpicco/vendor/symfony/symfony/src/Symfony/Component/Yaml/Parser.php on line 214
Fatal error: Uncaught Error: Call to undefined function Symfony\Component\Yaml\str_contains() in /private/var/www/crmpicco/vendor/symfony/symfony/src/Symfony/Component/Yaml/Parser.php:214
Stack trace:
#0 /private/var/www/crmpicco/vendor/symfony/symfony/src/Symfony/Component/Yaml/Parser.php(96): Symfony\Component\Yaml\Parser->doParse('parameters:\n ...', 0)
#1 /private/var/www/crmpicco/vendor/incenteev/composer-parameter-handler/Processor.php(34): Symfony\Component\Yaml\Parser->parse('# This file is ...')
#2 /private/var/www/crmpicco/vendor/incenteev/composer-parameter-handler/ScriptHandler.php(34): Incenteev\ParameterHandler\Processor->processFile(Array)
#3 phar:///usr/local/Cellar/composer/1.9.2/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(377): Incenteev\ParameterHandler\ScriptHandler::buildParameters(Object(Composer\Script\Event))
#4 phar:///usr/local/Cellar/composer/1.9.2/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(236): Composer\EventDispatcher\EventDispatcher->execute in /private/var/www/crmpicco/vendor/symfony/symfony/src/Symfony/Component/Yaml/Parser.php on line 214
The polyfills are all installed:
composer show | grep polyfill
paragonie/random_compat v9.99.100 PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
ralouphie/getallheaders 3.0.3 A polyfill for getallheaders.
symfony/polyfill-ctype v1.23.0 Symfony polyfill for ctype functions
symfony/polyfill-iconv v1.23.0 Symfony polyfill for the Iconv extension
symfony/polyfill-intl-icu v1.23.0 Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-intl-idn v1.23.0 Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-intl-normalizer v1.23.0 Symfony polyfill for intl's Normalizer class and related functions
symfony/polyfill-mbstring v1.23.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php72 v1.23.0 Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/polyfill-php73 v1.23.0 Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions
symfony/polyfill-php80 v1.23.0 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/polyfill-php81 v1.23.0 Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions
Removing the following from my composer.json fixes it, but i'm not convinced I can safely remove that and leave it out:
Symfony version(s) affected: 4.4.27
Description
I have just upgraded from Symfony 4.4.26 to 4.4.27 and have hit my first upgrade issue in a long time.
I am running PHP 7.4.15 as i'm not ready for PHP 8 yet, however the Yaml
Parser.php
is looking for str_contains - which is only available in PHP 8.I was under the impression the polyfills existed for this reason, but they don't seem to be working this time.
How to reproduce
composer update
Additional context
I was under the impression the polyfills existed for this reason, but they don't seem to be working this time.
Bizarrely the app still boots up, but a composer update falls over as per output below:
The polyfills are all installed:
composer show | grep polyfill
Removing the following from my
composer.json
fixes it, but i'm not convinced I can safely remove that and leave it out:The text was updated successfully, but these errors were encountered: