Skip to content

PHP 7.3 breaks composer with continue/targeting error (solution: downgrade to 7.2) #7783

@kakohari

Description

@kakohari

PHP version not working:

/usr/bin/php7.3 -v
PHP 7.3.0RC4 (cli) (built: Nov  7 2018 10:06:25) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.0RC4, Copyright (c) 1999-2018, by Zend Technologies

PHP version working:

PHP 7.2.12-1+0~20181112102304.11+stretch~1.gbp55f215 (cli) (built: Nov 12 2018 10:23:04) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.12-1+0~20181112102304.11+stretch~1.gbp55f215, Copyright (c) 1999-2018, by Zend Technologies

My composer.json:

empty / not existing

Output of composer diagnose:

[some bullshit complaining about a wrong SPDX-license code which is clearly existing on https://spdx.org/licenses/]
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK

When I run this command:

kako@devserver:~/skripte$ composer require mpdf/mpdf -vvv

I get the following output:

Reading ./composer.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/home/kako/skripte): git branch --no-color --no-abbrev -v
Executing command (/home/kako/skripte): git describe --exact-match --tags
Executing command (/home/kako/skripte): git log --pretty="%H" -n1 HEAD
Reading /home/kako/.composer/composer.json
Loading config file /home/kako/.composer/composer.json
Running 1.2.2 (2016-11-03 17:43:15) with PHP 7.3.0RC4 on Linux / 4.9.0-8-amd64
Downloading https://packagist.org/packages.json
Writing /home/kako/.cache/composer/repo/https---packagist.org/packages.json into cache
Reading /home/kako/.cache/composer/repo/https---packagist.org/p-provider-2013.json from cache
Reading /home/kako/.cache/composer/repo/https---packagist.org/p-provider-2014.json from cache
Reading /home/kako/.cache/composer/repo/https---packagist.org/p-provider-2015.json from cache
Reading /home/kako/.cache/composer/repo/https---packagist.org/p-provider-2016.json from cache
Reading /home/kako/.cache/composer/repo/https---packagist.org/p-provider-2017.json from cache
Reading /home/kako/.cache/composer/repo/https---packagist.org/p-provider-2018-01.json from cache
Reading /home/kako/.cache/composer/repo/https---packagist.org/p-provider-2018-04.json from cache
Reading /home/kako/.cache/composer/repo/https---packagist.org/p-provider-2018-07.json from cache
Downloading http://packagist.org/p/provider-2018-10%24aa9e2fdf4422be2ee3f3633edaf047f05e92c0ec96f760c5fa2f2257f89fa98e.json
Writing /home/kako/.cache/composer/repo/https---packagist.org/p-provider-2018-10.json into cache
Reading /home/kako/.cache/composer/repo/https---packagist.org/p-provider-archived.json from cache
Downloading http://packagist.org/p/provider-latest%2430d19a056d26ac01f571e70ec61607d697a76339914cc646bdfa8416f79f7f07.json
Writing /home/kako/.cache/composer/repo/https---packagist.org/p-provider-latest.json into cache
Reading /home/kako/.cache/composer/repo/https---packagist.org/provider-mpdf$mpdf.json from cache
Using version ^6.1 for mpdf/mpdf
./composer.json has been updated
Reading ./composer.json
Loading config file ./composer.json
Executing command (/home/kako/skripte): git branch --no-color --no-abbrev -v
Executing command (/home/kako/skripte): git describe --exact-match --tags
Executing command (/home/kako/skripte): git log --pretty="%H" -n1 HEAD
Reading /home/kako/.composer/composer.json
Loading config file /home/kako/.composer/composer.json
Loading composer repositories with package information
Downloading https://packagist.org/packages.json
Writing /home/kako/.cache/composer/repo/https---packagist.org/packages.json into cache
Updating dependencies (including require-dev)

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

                                                                                           
  [ErrorException]                                                                         
  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?  
                                                                                           

Exception trace:
 () at /usr/share/php/Composer/DependencyResolver/RuleSetGenerator.php:286
 Composer\Util\ErrorHandler::handle() at /usr/share/php/Composer/autoload.php:258
 require() at /usr/share/php/Composer/autoload.php:258
 {closure}() at n/a:n/a
 spl_autoload_call() at /usr/share/php/Composer/DependencyResolver/Solver.php:75
 Composer\DependencyResolver\Solver->__construct() at /usr/share/php/Composer/Installer.php:459
 Composer\Installer->doInstall() at /usr/share/php/Composer/Installer.php:216
 Composer\Installer->run() at /usr/share/php/Composer/Command/RequireCommand.php:175
 Composer\Command\RequireCommand->execute() at /usr/share/php/Symfony/Component/Console/Command/Command.php:259
 Symfony\Component\Console\Command\Command->run() at /usr/share/php/Symfony/Component/Console/Application.php:844
 Symfony\Component\Console\Application->doRunCommand() at /usr/share/php/Symfony/Component/Console/Application.php:192
 Symfony\Component\Console\Application->doRun() at /usr/share/php/Composer/Console/Application.php:231
 Composer\Console\Application->doRun() at /usr/share/php/Symfony/Component/Console/Application.php:123
 Symfony\Component\Console\Application->run() at /usr/share/php/Composer/Console/Application.php:104
 Composer\Console\Application->run() at /usr/bin/composer:44

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader]` [-a|--classmap-authoritative] [--] [<packages>]...

And I expected this to happen:
composer installing mpdf ;-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions