Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? [closed] Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? [closed] symfony symfony

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


I've got same problem and got this error too, but in my case this error shows when i'm trying to run composer install or composer update.

and i solve this issue by running composer self-update. it works on my project.


Maybe your composer is outdated. Below are the steps to get rid of the error.

Note: For Windows professionals, Only Step2 and Step3 is needed and done.


Step1

Remove the composer:

sudo apt-get remove composer

Step2

Download the composer:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

Step3

Run composer-setup.php file

php composer-setup.php

Step4

Finally move the composer:

sudo mv composer.phar /usr/local/bin/composer  


Your composer should be updated now. To check it run command:

composer

You can remove the downloaded composer by php command

php -r "unlink('composer-setup.php');"


The issue looks to me to be a backward incompatibility with PHP 7.3 for the continue keyword in Switch statements. Take a look at the "Continue Targeting Switch issues Warning" section in Backward Incompatible Changes.

I ran into the same issue with Symfony 3.3 using PHP 7.3 and downgrading to PHP 7.2 resolved the warning.