-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Date validator problem vant validate big unix timestamps #6359
Conversation
32bit version of php converts large integers to doubles fixes zendframework#6352
not sure about tests maybe someone can help? |
ping @DASPRiD |
@@ -70,8 +70,10 @@ public function datesDataProvider() | |||
// int | |||
array(0, null, true), | |||
array(1340677235, null, true), | |||
// Commenting out, as value appears to vary based on OS | |||
// array(999999999999, null, true), | |||
// 32bit version of php will convert this to double |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this affect the outcome?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes in 32-bit 999,999,999,999 was converted to 2,147,483,647 when casting to double. you can see the examples in this issue: #6352
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if gmp can help here... is the value already broken when leaving the data-provider?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read this entirely wrong; this test uncomments a test set. We're covered, and verified this passes.
My notes:
My take is: no, the framework should not handle this detail. The reason is that the value passed as a timestamp to This means we cannot pass a string (e.g., for use with bcmath) or GMP instance and expect reliable results. At the same time, we need to test sufficiently large numbers in order to verify everything works as expected. My take would be to test using |
Date validator problem vant validate big unix timestamps
Merged to develop for release with 2.4. |
Date validator problem vant validate big unix timestamps
fixes #6352