# Invalid argument supplied for foreach()

**URL:** <https://forum.mautic.org/t/invalid-argument-supplied-for-foreach/28243>\
**Category:** Product Support\
**Created:** [June 6, 2023, 2:20am UTC](https://forum.mautic.org/t/invalid-argument-supplied-for-foreach/28243 "2023-06-06T02:20:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaronriber](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@aaronriber](https://forum.mautic.org/u/aaronriber)\
**Post date:** [June 6, 2023, 2:20am UTC](https://forum.mautic.org/t/invalid-argument-supplied-for-foreach/28243/1 "2023-06-06T02:20:57Z")

</div>

**Your software**  
My Mautic version is: v4.4.9  
My PHP version is: 7.4.33  
My Database type and version is: 10.5.19-MariaDB-0+deb11u2

**Your problem**  
My problem is: When i open the Log i see this errors. Does anyone know what it means and how i can fix it?

These errors are showing in the log:  
[2023-06-06 04:13:57] mautic.WARNING: PHP Warning - Invalid argument supplied for foreach() - in file /var/www/mautic/docroot/app/bundles/EmailBundle/Controller/AjaxController.php - at line 299 {“request”:“[object] (Symfony\Component\HttpFoundation\Request: POST /s/ajax?action=email:getEmailCountStats&mauticUserLastActive=54&mauticLastNotificationId= HTTP/1.1\r\nAccept: _/_\r\nAccept-Encoding: gzip, deflate, br\r\nAccept-Language: de,en-US;q=0.7,en;q=0.3\r\nConnection: keep-alive\r\nContent-Length: 12\r\nContent-Type: application/x-www-form-urlencoded; charset=UTF-8\r\nCookie: mautic\_device\_id=iju7npwpcstrv84gyyn1top; 9799004fb68c47a7007be0f0e5c4c802=bnhe9s4vpgj9o30cpb4iqbibut; 714f7dce5b1ac1f1dfeca56efb5d3abd=mfvr5cumse8hne1u9es97h4jro; REMEMBERME=TWF1dGljXFVzZXJCdW5kbGVcRW50aXR5XFVzZXI6UVdGeWIyND06MTcxNzU1MzMzNTo4Y2FhNzBjOGE0OGNlMTZkMjlkNzUzZDYxNmQwMGNkNjJhZWJmMjhlODkwZmNlNjUzYmFjOGVlNmVlY2Q1ZDFm\r\nHost: [mautic.xxx.de](http://mautic.xxx.de)\r\nOrigin: [https://mautic.xxx.de](https://mautic.xxx.de)\r\nReferer: [https://mautic.xxx.de/s/emails\r\nSec-Fetch-Dest:](https://mautic.xxx.de/s/emails%5Cr%5CnSec-Fetch-Dest:) empty\r\nSec-Fetch-Mode: cors\r\nSec-Fetch-Site: same-origin\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/113.0\r\nX-Csrf-Token: -Nb2wyJEAfxEuR1iNQo4VbANMnQ2kVDhpy0iYLIhX38\r\nX-Php-Ob-Level: 1\r\nX-Requested-With: XMLHttpRequest\r\nCookie: mautic\_device\_id=iju7npwpcstrv84gyyn1top; 9799004fb68c47a7007be0f0e5c4c802=bnhe9s4vpgj9o30cpb4iqbibut; 714f7dce5b1ac1f1dfeca56efb5d3abd=mfvr5cumse8hne1u9es97h4jro; REMEMBERME=TWF1dGljXFVzZXJCdW5kbGVcRW50aXR5XFVzZXI6UVdGeWIyND06MTcxNzU1MzMzNTo4Y2FhNzBjOGE0OGNlMTZkMjlkNzUzZDYxNmQwMGNkNjJhZWJmMjhlODkwZmNlNjUzYmFjOGVlNmVlY2Q1ZDFm\r\n\r\nids%5B%5D=50)”,“model”:“[object] (Mautic\EmailBundle\Model\EmailModel: {})”,“id”:null,“ids”:null,“data”:} {“hostname”:“marketing”,“pid”:27027}

Steps I have tried to fix the problem: I cleared the cache but did not help

---

<div class="post-metadata">

**Author:** ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)\
**Post date:** [June 6, 2023, 7:41am UTC](https://forum.mautic.org/t/invalid-argument-supplied-for-foreach/28243/2 "2023-06-06T07:41:31Z")

</div>

Could you maybe update your PHP? It may be related to the version.

However - its a warning, not an error. Is anything broken for you in Mautic?
