Skip to content

Fix precision loss deprecation on float to int conversion #5370

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

Merged

Conversation

paulbalandan
Copy link
Member

Description
Related to #4883

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@paulbalandan paulbalandan mentioned this pull request Nov 21, 2021
15 tasks
Copy link
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So basically we are embracing the loss and circumventing the warning?

@paulbalandan paulbalandan force-pushed the float-to-int-precision-loss branch from 5302549 to 147fc9d Compare November 23, 2021 04:44
@paulbalandan
Copy link
Member Author

So basically we are embracing the loss and circumventing the warning?

Basically, yes. And we're just making it explicit now. Previously, because of loose typing, float got coerced to int implicitly but because this behavior is now deprecated, we're making it explicit to match with existing bahavior. If ever this would be buggy in the future, then we can adjust later.

@paulbalandan paulbalandan merged commit d1515aa into codeigniter4:develop Nov 23, 2021
@paulbalandan paulbalandan deleted the float-to-int-precision-loss branch November 23, 2021 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants