# PHP Fatal Error - Can't use function return value in write context in

**URL:** <https://forum.mautic.org/t/php-fatal-error-cant-use-function-return-value-in-write-context-in/17137>\
**Category:** Product Support\
**Created:** [November 24, 2020, 9:55pm UTC](https://forum.mautic.org/t/php-fatal-error-cant-use-function-return-value-in-write-context-in/17137 "2020-11-24T21:55:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![arnold2606](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/arnold2606/32/1441_2.png) [@arnold2606](https://forum.mautic.org/u/arnold2606)\
**Post date:** [November 24, 2020, 9:55pm UTC](https://forum.mautic.org/t/php-fatal-error-cant-use-function-return-value-in-write-context-in/17137/1 "2020-11-24T21:55:47Z")

</div>

**Your software**  
My Mautic version is: 3.1.2  
My PHP version is: 7.3.11  
My Database type and version is: MySQL v 15.1

**Your problem**  
My problem is:

When I ran a cron job in Webmin to check if they work, I got the following error:

PHP Fatal error: Can’t use function return value in write context in /home/XXXXXXX/public\_html/bin/console on line 5

The line 5 is as follows:

```
#!/usr/bin/env php
<?php

// Fix for hosts that do not have date.timezone set
 **if (empty(ini_get('date.timezone'))) {**
    date_default_timezone_set('UTC');
 }

```

These errors are showing in the log:

There is no error in the logs

Steps I have tried to fix the problem:

I have re-installed 3.1.2

I then removed 3.1.2 and installed 3.1.0 with the same result

I tried to comment the lines out (5 - 7), but then got the following error message

PHP Parse error: syntax error, unexpected ‘class’ (T\_CLASS), expecting identifier (T\_STRING) or variable (T\_VARIABLE) or ‘{’ or ‘$’ in /home/XXXXXXXXXX/public\_html/vendor/hoa/protocol/Wrapper.php on line 582

---

<div class="post-metadata">

**Author:** ![petermwalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petermwalker/32/4758_2.png) [@petermwalker](https://forum.mautic.org/u/petermwalker)\
**Post date:** [March 24, 2021, 11:46am UTC](https://forum.mautic.org/t/php-fatal-error-cant-use-function-return-value-in-write-context-in/17137/2 "2021-03-24T11:46:39Z")

</div>

Hi

Did you ever get an update on this? I have the same issue trying to upgrade to 3.3.2. I have gone into my php settings and changed the blank timezone to one in Europe but still no joy and get the same PHP Fatal error: Can’t use function return value in write context in xxxx

---

<div class="post-metadata">

**Author:** ![arnold2606](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/arnold2606/32/1441_2.png) [@arnold2606](https://forum.mautic.org/u/arnold2606)\
**Post date:** [March 24, 2021, 1:15pm UTC](https://forum.mautic.org/t/php-fatal-error-cant-use-function-return-value-in-write-context-in/17137/3 "2021-03-24T13:15:13Z")

</div>

Hi Peter

I should have posted my response earlier. Thanks for the reminder.  
I was running Mautic on an unmanaged VPS.  
When I accessed Webmin, it indicated that I’m using PHP 7.3.11. In fact Mautic, it also showed PHP 7.3.11 in the config.  
However, when I SSH’ed into the VPS and checked the PHP, it showed 5.6.40. So I changed it to PHP 7.3.11 and then it worked.  
I hope it helps you too.
