# Got error 'PHP message: PHP Warning - "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

**URL:** <https://forum.mautic.org/t/got-error-php-message-php-warning-continue-targeting-switch-is-equivalent-to-break-did-you-mean-to-use-continue-2/12805>\
**Category:** Product Support\
**Created:** [February 13, 2020, 7:43pm UTC](https://forum.mautic.org/t/got-error-php-message-php-warning-continue-targeting-switch-is-equivalent-to-break-did-you-mean-to-use-continue-2/12805 "2020-02-13T19:43:00Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [February 13, 2020, 7:43pm UTC](https://forum.mautic.org/t/got-error-php-message-php-warning-continue-targeting-switch-is-equivalent-to-break-did-you-mean-to-use-continue-2/12805/1 "2020-02-13T19:43:00Z")

</div>

**Your software**  
My Mautic version is: 2.16  
My PHP version is:7.3.14

**Your problem**  
My problem is:  
errors generating  
These errors are showing in the log:  
SERVER LOG:  
[Thu Feb 13 13:15:17.461213 2020] [proxy\_fcgi:error] [pid 33967:tid 139796110354176] [client 23.100.232.233:47882] AH01071: Got error ‘PHP message: PHP Warning - “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? - in file /var/www/vhosts/MYDOMAIN/MY SUBDOMAIN/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php - at line 2636PHP message: PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /var/www/vhosts/MYDOMAIN/MY SUBDOMAIN/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2636PHP message: PHP Warning - “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? - in file MYMautic/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php - at line 2665PHP message: PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in MYMautic/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2665’

Mautic Logs:

[2020-02-13 17:45:19] mautic.ERROR: CAMPAIGN: An exception occurred while executing ‘REPLACE INTO mauhu\_campaign\_lead\_event\_failed\_log( `log_id`, `date_added`, `reason`) SELECT id, :dateAdded as date\_added, :message as reason from mauhu\_campaign\_lead\_event\_log WHERE is\_scheduled = 1 AND lead\_id = :contactId AND campaign\_id = :campaignId AND rotation = :rotation’: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ':dateAdded as date\_added, :message as reason from mauhu\_campaign\_lead\_event\_log ’ at line 2

Steps I have tried to fix the problem: Cleared cache  
looked to open unitofwork.php line 2665 but it does not exist in the file structure in error

---

<div class="post-metadata">

**Author:** ![dennisameling](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dennisameling/32/958_2.png) [@dennisameling](https://forum.mautic.org/u/dennisameling)\
**Post date:** [February 13, 2020, 8:18pm UTC](https://forum.mautic.org/t/got-error-php-message-php-warning-continue-targeting-switch-is-equivalent-to-break-did-you-mean-to-use-continue-2/12805/2 "2020-02-13T20:18:46Z")

</div>

@EJL  
Thanks for posting this issue. **If you’re looking for a quick fix, try switching back from PHP 7.3 to PHP 7.2.**

I’ve seen the error you posted, `“continue” targeting switch is equivalent to “break”`, only happening on PHP 7.3, but I didn’t come across it anymore after the team added support for 7.3 in Mautic 2.16. Did you upgrade to PHP 7.3 before or after upgrading to Mautic 2.16?

Could you please give a bit more details about your environment, like the server software you’re using? From the folder structure, may I assume you’re using Plesk for Linux?

Thanks in advance!!

---

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [February 13, 2020, 8:28pm UTC](https://forum.mautic.org/t/got-error-php-message-php-warning-continue-targeting-switch-is-equivalent-to-break-did-you-mean-to-use-continue-2/12805/3 "2020-02-13T20:28:31Z")

</div>

7.3 was in place on this machine for several months.  
I upgraded to Mautic 2.16 this afternoon

CPU Intel® Xeon® CPU E5-2660 v4 @ 2.00GHz 6 core  
Plesk Obsidian v18.0.23\_build1800200206.14 os\_CentOS 7  
CentOS Linux 7.7.1908 (Core)

Memory Usage  
12 GB Total 53% Usage  
MariaDB 10.4.12

- Edit\* Changing to PHP 7.2 seemed to fix the error  
The database field error was unrelated and still present

---

<div class="post-metadata">

**Author:** ![dennisameling](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dennisameling/32/958_2.png) [@dennisameling](https://forum.mautic.org/u/dennisameling)\
**Post date:** [February 13, 2020, 9:29pm UTC](https://forum.mautic.org/t/got-error-php-message-php-warning-continue-targeting-switch-is-equivalent-to-break-did-you-mean-to-use-continue-2/12805/4 "2020-02-13T21:29:46Z")

</div>

7.3 support was only added in 2.16.0 which was released today, so the error might be related to that (from before the upgrade). If you switch back to 7.3 again now, does Mautic work without errors? Or are you still experiencing issues then?

Thanks!

---

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [February 17, 2020, 10:19pm UTC](https://forum.mautic.org/t/got-error-php-message-php-warning-continue-targeting-switch-is-equivalent-to-break-did-you-mean-to-use-continue-2/12805/5 "2020-02-17T22:19:53Z")

</div>

switching back to PHP 7.3 bring the error right back:

[Mon Feb 17 16:14:01.971372 2020] [proxy\_fcgi:error] [pid 29058:tid 140621524117248] [client 198.147.23.149:35746] AH01071: Got error ‘PHP message: PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /var/www/vhosts/mautic-install/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2636PHP message: PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /var/www/vhosts/mautic-install/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2665’,

---

<div class="post-metadata">

**Author:** ![dennisameling](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dennisameling/32/958_2.png) [@dennisameling](https://forum.mautic.org/u/dennisameling)\
**Post date:** [February 18, 2020, 10:51am UTC](https://forum.mautic.org/t/got-error-php-message-php-warning-continue-targeting-switch-is-equivalent-to-break-did-you-mean-to-use-continue-2/12805/6 "2020-02-18T10:51:04Z")

</div>

Found the issue. I wrote down more details about it, including current workarounds, here: [https://github.com/mautic/mautic/issues/7843#issuecomment-587360150](https://github.com/mautic/mautic/issues/7843#issuecomment-587360150)

We’re planning to fix this in 2.16.1, for workarounds until that time please check the GitHub issue. 🙂  
Thanks for reporting this!

---

<div class="post-metadata">

**Author:** ![stemautic88](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stemautic88/32/690_2.png) [@stemautic88](https://forum.mautic.org/u/stemautic88)\
**Post date:** [February 25, 2020, 12:37pm UTC](https://forum.mautic.org/t/got-error-php-message-php-warning-continue-targeting-switch-is-equivalent-to-break-did-you-mean-to-use-continue-2/12805/7 "2020-02-25T12:37:32Z")

</div>

**Your software**  
My Mautic version is: 2.16.0  
My PHP version is: 7.3.14

**Your problem**  
I repeatedly get the following PHP Error messages in my Error logs while I normally use Mautic.  
Just updated to 2.16.0 this morning. Mautic seems to run okay. Will see latest tomorrow when other campaign messages are sent.

Here are the error log entries that repeat:  
[25-Feb-2020 13:15:04 Europe/Berlin] PHP Notice: Undefined offset: 0 in /PathToMautic/app/bundles/LeadBundle/Views/Auditlog/details.html.php on line 62  
[25-Feb-2020 12:15:59 UTC] PHP Warning - “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? - in file /PathToMautic/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php - at line 2636  
[25-Feb-2020 12:15:59 UTC] PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /PathToMautic/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2636  
[25-Feb-2020 12:15:59 UTC] PHP Warning - “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? - in file /PathToMautic/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php - at line 2665  
[25-Feb-2020 12:15:59 UTC] PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /PathToMautic/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2665

These errors are showing in the log: Not in the Mautic log

Steps I have tried to fix the problem:  
None, as I have no clue what to do about it. As Mautic works, I just wanted to let everyone know. Maybe its something that could be resolved with the next update.

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [February 25, 2020, 12:46pm UTC](https://forum.mautic.org/t/got-error-php-message-php-warning-continue-targeting-switch-is-equivalent-to-break-did-you-mean-to-use-continue-2/12805/8 "2020-02-25T12:46:34Z")

</div>

Hi @stemautic88 and welcome to the Mautic Community Forum!

I have moved your message into the existing thread about this problem which I found by searching for your error message ’ Warning - “continue” targeting switch is equivalent to “break”’.

Please read up in the threads, where you’ll find a workaround to address this issue.

---

<div class="post-metadata">

**Author:** ![stemautic88](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stemautic88/32/690_2.png) [@stemautic88](https://forum.mautic.org/u/stemautic88)\
**Post date:** [February 25, 2020, 1:04pm UTC](https://forum.mautic.org/t/got-error-php-message-php-warning-continue-targeting-switch-is-equivalent-to-break-did-you-mean-to-use-continue-2/12805/9 "2020-02-25T13:04:15Z")

</div>

Thanks!  
My bad, haven’t searched the forum prior to posting.

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [February 25, 2020, 1:17pm UTC](https://forum.mautic.org/t/got-error-php-message-php-warning-continue-targeting-switch-is-equivalent-to-break-did-you-mean-to-use-continue-2/12805/10 "2020-02-25T13:17:19Z")

</div>

No worries, the GitHub link above gives instructions on how to workaround until we address the issue with the next release 🙂
