Bug report
array_diff() attempts to (string) $value in order to compare them. This is a problem when the values aren't stringable, like objects without __toString(), or arrays.
Code snippet that reproduces the problem
https://phpstan.org/r/59da99db-33f2-4546-892f-51240144c160
https://3v4l.org/VhL6n
Expected output
An error should be reported on line 6, because stdClass is not castable to string.