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
{{ message }}
Repository navigation
file_put_contents fail on strings over 4GB on Windows 10 #13203
C:\reproduce>php -r "ini_set('memory_limit', '6G'); $size = 5 * 1024 * 1024 * 1024; $str = str_repeat(\"\x00\", $size); file_put_contents('test.bin', $str);"
PHP Notice: file_put_contents(): Write of 4294967295 bytes failed with errno=0 No error in Command line code on line 1
Notice: file_put_contents(): Write of 4294967295 bytes failed with errno=0 No error in Command line code on line 1
C:\reproduce>dir
Volume in drive C has no label.
Volume Serial Number is 445C-1EDF
Directory of C:\reproduce
20/01/2024 18:41 <DIR> .
20/01/2024 18:41 <DIR> ..
20/01/2024 18:41 4,294,967,295 test.bin
1 File(s) 4,294,967,295 bytes
2 Dir(s) 2,580,218,351,616 bytes free
But I expected this output instead:
C:\reproduce>php -r "ini_set('memory_limit', '6G'); $size = 5 * 1024 * 1024 * 1024; $str = str_repeat(\"\x00\", $size); file_put_contents('test.bin', $str);"
C:\reproduce>dir
Volume in drive C has no label.
Volume Serial Number is 445C-1EDF
Directory of C:\reproduce
20/01/2024 18:41 <DIR> .
20/01/2024 18:41 <DIR> ..
20/01/2024 18:41 5,368,709,120 test.bin
1 File(s) 5,368,709,120 bytes
2 Dir(s) 2,580,218,351,616 bytes free
Activity
fix phpGH-13203 file_put_contents fail on strings over 4GB on Windows
Fix GH-13203: file_put_contents fail on strings over 4GB on Windows