Skip to content
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

Fix tests on 32-bit #957

Merged
merged 1 commit into from Jan 29, 2022
Merged

Fix tests on 32-bit #957

merged 1 commit into from Jan 29, 2022

Conversation

herndlm
Copy link
Contributor

@herndlm herndlm commented Jan 29, 2022

I know this is kind of esoteric, but this was the only thing that prevented me to cleanly ran make with php 8.1 on my 32-bit raspberry pi:

$ uname -msr
Linux 5.10.90-1-rpi-legacy-ARCH armv7l

I had to add 1G of swap to make it run without freezing the system, but this would in general make the build green on 32-bit. No idea if it's really worth pursuing though, but good to know at least, that right now, even without this fix, phpstan runs still just fine on 32-bit :)

The reason is that this test defines a numeric in a string that is bigger than PHP_INT_MAX, casts it to int and then string again. and the int cast behaves different, depending on PHP_INT_SIZE. https://3v4l.org/enuv2

Only doing that because in #693 some 32/64-bit questions came up. The only important thing, I'd say, is to still support scanning code made for 32-bit, phpstan doesn't have to run on 32-bit. But right know it still could, so I'm just trying to find an answer to the question if we still should support running it on 32-bit :) And if yes - how to make sure it stays like that? If not - is it fine to just drop the runtime support then?

@ondrejmirtes ondrejmirtes merged commit e6e2797 into phpstan:master Jan 29, 2022
@ondrejmirtes
Copy link
Member

Nice, thank you!

@herndlm herndlm deleted the fix-tests-on-32-bit branch January 29, 2022 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants