-
-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support 32-bit PHP versions in event listing #814
Conversation
limit 'next_all' to PHP_INT_MAX
warum verwenden wir nicht direkt |
Weil das auf 64bit-Systemen viel zu groß ist und zu einem Memory-Problem bei unendlichen wiederholten Events führen würde. (Wir hatten es zuerst mit |
Es gibt noch einige andere Stellen, an denen wir |
Stimmt, du hast natürlich recht. I was about to apply the changes everywhere, but honestly I think we should just set the value to This way databases created under 64bit systems are interchangeable with 32bit ones. Alternatively we could change the values to floats everywhere, but than we would probably also need to change method signatures (BC...) and introduce another class of problems (precision). |
The whole point of #510 was not to use |
Right. I'll see if there is another approach. |
@leofeyer Can we safely change the annotated types in the legacy code (see example below) without breaking BC? Integers passed in by 3rd party code would coerce to floats - we wouldn't be able to add type hints in the method signature, though. /*
* @param integer $value
*/
function someFunction($value)
{
// ...
} → /*
* @param float $value
*/
function someFunction($value)
{
// ...
} This way we would not need to differentiate between platforms. |
This reverts commit 38a0333.
This is a tricky one. For a simple fix it would be enough to allow the model's repository functions to work with floats as well. In fact there is only one location where this fails, namely here (due to the explicit cast): contao/calendar-bundle/src/Resources/contao/models/CalendarEventsModel.php Lines 243 to 244 in 7a886bc
For now I changed the models method signatures to also allow floats. With this, however, we silently ignore that 32 bit PHP will apply type juggling in the code before calling these functions ( I don't see how this could be easily changed though. There is even a hook where the values are passed around. If implementers type hint against an integer there, the code will break. 🤷♂️ |
See #918. |
see #811