diff --git a/src/Carbon/Carbon.php b/src/Carbon/Carbon.php index 7b8a5d9108..b7dcf2009c 100644 --- a/src/Carbon/Carbon.php +++ b/src/Carbon/Carbon.php @@ -556,7 +556,7 @@ public function __construct($time = null, $tz = null) if (isset($locale)) { setlocale(LC_NUMERIC, $locale); } - static::setLastErrors(parent::getLastErrors()); + static::setLastErrors((array)parent::getLastErrors()); } /** @@ -884,7 +884,7 @@ public static function createFromFormat($format, $time, $tz = null) { // First attempt to create an instance, so that error messages are based on the unmodified format. $date = self::createFromFormatAndTimezone($format, $time, $tz); - $lastErrors = parent::getLastErrors(); + $lastErrors = (array)parent::getLastErrors(); if (($mock = static::getTestNow()) && ($date instanceof DateTime || $date instanceof DateTimeInterface)) { // Set timezone from mock if custom timezone was neither given directly nor as a part of format.