Fix GH-11310: __debugInfo() does nothing on classes extending DateTime#12534
Fix GH-11310: __debugInfo() does nothing on classes extending DateTime#12534paulfedorow wants to merge 1 commit intophp:masterfrom
Conversation
1ee23d1 to
46a5da4
Compare
…Time Makes the `__debugInfo` method work in classes that extend `DateTime` and `DateTimeImmutable`. * Implemented `__debugInfo` for `DateTime` and `DateTimeImmutable`. * Modified the `get_properties_for` handlers of `DateTime` and `DateTimeImmutable` to invoke `__debugInfo`.
46a5da4 to
54f607d
Compare
derickr
left a comment
There was a problem hiding this comment.
Is this not needed for the other Date classes?
|
|
||
| public function __unserialize(array $data): void {} | ||
|
|
||
| /** @tentative-return-type */ |
There was a problem hiding this comment.
Why does this have @tentative-return-type?
|
Any update on this? |
|
@paulfedorow Could you please rebase + update your PR according to Derick's comment? Since it seems like a useful fix (btw the same inconsistency exists in other places), so I'll finish it if you don't have time for this anymore. |
| } | ||
| } | ||
|
|
||
| class MyDateTimeZone extends DateTimeZone { |
There was a problem hiding this comment.
suggest adding a test case for MyDateTimeZone, otherwise why define the class at all?
|
Note that my patch at #16333 should fix this in a more general way |
|
I'm closing this in favor of the more general fix provided in #16333 |
Actually my comment may have been a bit premature, it seems that my more general approach may not be desirable |
Fixes GH-11310. Makes the
__debugInfomethod work in classes that extendDateTimeandDateTimeImmutable.__debugInfoforDateTimeandDateTimeImmutable.get_properties_forhandlers ofDateTimeandDateTimeImmutableto invoke__debugInfo.