-
Notifications
You must be signed in to change notification settings - Fork 356
Fix support for 32bits PHP #817
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
@nicolas-grekas I won't expect these changes to work as the flags are part of a bitmask. Wouldn't it suffice to lower the |
I promise this works. The binary representation of -1 is all ones. |
public const ERROR_DOCUMENT_VALIDATION = 0x00000001; | ||
public const ERROR_SCHEMA_VALIDATION = 0x00000002; | ||
public const ERROR_NONE = 0; | ||
public const ERROR_ALL = -1; |
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.
self::ERROR_DOCUMENT_VALIDATION | self::ERROR_SCHEMA_VALIDATION
also should work here no? Or just hardcode 3
because frankly this is very unlikely to change, so if a new type is added with 4 then you just gotta update the ERROR_ALL.. Doesn't sound that hard 🤷🏻
public const ERROR_ALL = -1; | |
public const ERROR_ALL = self::ERROR_DOCUMENT_VALIDATION | self::ERROR_SCHEMA_VALIDATION; |
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.
It makes more sense to me to use -1 for an E_ALL level. Like error_reporting(-1)
is a common way to turn on all error levels for the engine...
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.
Yup, works for me with -1 too.. Not sure why PHPStan complains though, but I tried on my machine and wasn't able to quiet it down. Seems like the 0xFFFFFFFF makes it give up on some checks.
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.
Phpstan complains because it doesn’t support int-ranges from binary & and | operator yet.
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.
Ok thanks, i thought i saw this work but must remember it wrong then :)
@DannyvdSluijs I know you might be busy with other stuff and that's fine if that's the case, but if you are able to get this into a release in the next couple hours then I could also do a Composer one :) |
I'll go ahead and trust @nicolas-grekas and @Seldaek on this one (both being high valued members in the PHP community). |
Version 6.4.1 has been released |
Thank you! |
Thanks! And just to prove this so https://3v4l.org/VbvJ3 ;) |
Fix #816