PHP 7.1 Error

Permalink 3 users found helpful
Here is the error message when I attempt to upload an image using a custom external form.
Declaration of Carbon\Carbon::setTime($hour, $minute, $second = 0) should be compatible with DateTime::setTime($hour, $minute, $second = NULL, $microseconds = NULL).

PHP 7.0.10 does not throw an error, so I am assuming my custom form is not the problem also I see that this is a problem for other cms users when using PHP 7.1
I managed to get this working again by changing line 671 of concrete/vendor/nesbot/carbon/src/Carbon/Carbon.php from this
public function setTime($hour, $minute, $second = 0)

To this
public function setTime($hour, $minute, $second = NULL, $microseconds = NULL)

I am using Concrete5.7.5.13
I see on the Supermint addon help pages that this error has been reported when using Supermint with PHP 7.1

View Replies: View Best Answer
ConcreteOwl replied on at Permalink Best Answer Reply
Looks like this is a recently discovered bug in Carbon.php.
It is mentioned on GitHub at..

From what I can see, PHP 7.1 requires a fourth parameter for Microseconds to be set.
SmoothPixel replied on at Permalink Reply
Thanks @Weyboat for documenting this - it has saved me a lot of hassle.

I upgraded my local setup to PHP7.1 so that I could work on a new C5.8 site and just discovered that an older (C5.7.5.13) site throws this error.

I have simply rolled back this one site to PHP5.5 for the time being (easy to do on my Windows IIS setup).
nigelcooper66 replied on at Permalink Reply
I have this same problem on MAMP on OSX PHP 7.1.0