Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Bug 65548 #439
I think this can be solved a bit easier. You should be able to keep one compare handler for both and just remove this part from it:
The IS_OBJECT checks are unnecessary (compare_objects is only invoked on ... objects).
If you do it this way, then a DateTime and a DateTimeImmutable with the same values would be considered equal (I assume that is a behavior we want, right?)
PR updated as suggested. I thought of that, but I was thinking that IS_OBJECT might cause harm if removed. Another thing, question is if it's worth to consider, is the "Trying to compare an incomplete DateTime object" string, should we try to detect instance_of and use DateTime or DateTimeImmutable accordingly?