I have php7.3 and symfony2.8 When I try to create the classes with the console I get this error:
[Symfony\Component\Debug\Exception\ContextErrorException]Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
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.
I upgraded to PHP 7.3, and None of these worked for me before I used,
sudo wget https://getcomposer.org/download/1.8.0/composer.phar -O /usr/local/bin/composer && sudo chmod 755 /usr/local/bin/composer
It's just the version dependency. PHP 7.3
and composer update worked like a charm!
I changed continue to continue 2 on line 1579 in shortcodeComon.php and it fixed my problem
if(trim($custom_link[$i]) == ""){
continue;
}
Change to:
if(trim($custom_link[$i]) == ""){
continue 2;
}
composer self-update
composer install
Now, it should works
Did you try to do a composer self-update?
composer self-update
or
composer install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With