laravel-scout-array-driver icon indicating copy to clipboard operation
laravel-scout-array-driver copied to clipboard

[PHP 8.3.13] - Overloaded object of type Illuminate\Support\Carbon is not compatible with RecursiveArrayIterator

Open cbaconnier opened this issue 1 year ago • 0 comments
trafficstars

Since the bugfix introduced with PHP 8.3.13: https://github.com/php/php-src/issues/15918

When we retrieve Carbon objects we get the error:

Overloaded object of type Illuminate\Support\Carbon is not compatible with RecursiveArrayIterator

At this line: https://github.com/Sti3bas/laravel-scout-array-driver/blob/5adbe5d966b862bfb45e10264f73dcd5481c79cc/src/Engines/ArrayEngine.php#L114

I'm not sure what the ideal way to fix this. Currently I did this fix on my own branch. I haven't tried yet to understand why we need a RecursiveArrayIterator and my fix will cast anything it can to a string and drop what it can't. That the reason I haven't opened a PR.

My fix: https://github.com/Sti3bas/laravel-scout-array-driver/commit/3ef8971365bcfb7c8ae3e086c47f2ee3c44c316a

cbaconnier avatar Nov 19 '24 10:11 cbaconnier