You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHP 8.4.11 (cli) (built: Aug 3 2025 08:42:03) (NTS)
Copyright (c) The PHP Group
Built by Debian
Zend Engine v4.4.11, Copyright (c) Zend Technologies
with Zend OPcache v8.4.11, Copyright (c), by Zend Technologies
Hi @thbley. Is this a real-world issue? It happens because of an unsigned -> signed overflow, but even fixing that will break again at 4GB. The real fix is simple (switching to 64-bit integers), but it's ABI-breaking and thus is not possible for <=8.4. Might be worth adjusting for 8.5 at least. /cc @php/release-managers-85
@thbley New functions won't help unless we also duplicate the tokenizer code, which is not something we want. I don't quite understand why the Pest workaround with eval() works, since it's using the same tokenizer. Regardless, a fix for Pest could be to only use eval() if the file exceeds a certain size.
Activity
iluuu1994 commentedon Aug 21, 2025
Hi @thbley. Is this a real-world issue? It happens because of an unsigned -> signed overflow, but even fixing that will break again at 4GB. The real fix is simple (switching to 64-bit integers), but it's ABI-breaking and thus is not possible for <=8.4. Might be worth adjusting for 8.5 at least. /cc @php/release-managers-85
Details
thomas-0816 commentedon Aug 21, 2025
yes, people seem to write code coverage information as serialized string to files with >2GB.
Later reading these files is done with
$code .= fread()andeval($code)instead of require $file.see
pestphp/pest@49bf000 (fread+eval at the end)
pestphp/pest#1442
thomas-0816 commentedon Aug 21, 2025
maybe other option would be new functions supporting >2GB input/output, binary file format and compression:
iluuu1994 commentedon Aug 21, 2025
@thbley New functions won't help unless we also duplicate the tokenizer code, which is not something we want. I don't quite understand why the Pest workaround with
eval()works, since it's using the same tokenizer. Regardless, a fix for Pest could be to only useeval()if the file exceeds a certain size.Fix signed int overflow in scanner
iluuu1994 commentedon Aug 21, 2025
I created #19545, targeting 8.3. This will at least address fix the problem for <=4GB string literals. >=4GB can only be fixed on master.
Fix signed int overflow in scanner
thomas-0816 commentedon Aug 29, 2025
Thanks, the PR was closed without merging?
iluuu1994 commentedon Aug 29, 2025
It was merged manually. See 0a12aaa. GitHubs merged indicator is unreliable.
thomas-0816 commentedon Aug 29, 2025
Thanks!
LamentXU123 commentedon Jul 21, 2026
Now the issue should be
require() with >4GB:)The overflow issue is fixed. Closing.