Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Form] Fix INT64 cast to float in IntegerType. #18077

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

Closed
wants to merge 2 commits into from

Conversation

ovrflo
Copy link
Contributor

@ovrflo ovrflo commented Mar 9, 2016

Hello,

This is my fix for #18067. I also added a test for this bug.

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #18067
License MIT

Thanks !

@jakzal
Copy link
Contributor

jakzal commented Mar 9, 2016

@ovrflo this change broke tests on windows, most likely because it's run on 32bit system.

@ovrflo
Copy link
Contributor Author

ovrflo commented Mar 9, 2016

@jakzal thanks for noticing :)

I added a fix that will make the tests pass. I mean, my last commit will revert to the old behaviour for 32-bit PHP, but that's not really a fix, is it ?

Another way to do it would be to check with strlen for big numbers on 32-bit and decide between INT32 and INT64 (for INT64 it will be casted to float).

// I'm starting to understand why doctrine refuses to cast my BIGINT columns to PHP's int :)

So, what now ?

@webmozart
Copy link
Contributor

@nicolas-grekas Do you have any input here?

@nicolas-grekas nicolas-grekas changed the title bug #18067 [Form] Fix INT64 cast to float in IntegerType. [Form] Fix INT64 cast to float in IntegerType. Mar 15, 2016
@nicolas-grekas
Copy link
Member

Now included in #18179
Thank you @ovrflo

nicolas-grekas added a commit that referenced this pull request Mar 15, 2016
…sform with big integers (ovrflo, nicolas-grekas)

This PR was merged into the 2.3 branch.

Discussion
----------

[Form] Fix NumberToLocalizedStringTransformer::reverseTransform with big integers

| Q             | A
| ------------- | ---
| Branch        | 2.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #18077, #18067
| License       | MIT
| Doc PR        | -

Commits
-------

03c008c [Form] Fix NumberToLocalizedStringTransformer::reverseTransform with big integers
6b6073f [Form] Fix INT64 cast to float in IntegerType.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants