|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-04-09 11:14 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: cmb
[2021-04-09 11:14 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 18:00:01 2025 UTC |
Description: ------------ The tenth byte of a gzip file identifies (in theory) the OS or file system on which the file was compressed. Running the test script on Linux produces a file where the byte is 0x03. On Windows, we get a somewhat strange value of 0x0A. (Meanwhile, the GnuWin utility on Windows set this byte to 0x0B for NT, while the gzip utility in Git Bash for Windows uses 0x03 as if it was Linux.) The standards document (RFC-1952) says that 0x0A is "TOPS-20", and sure enough - running the `file` utility on the resulting file shows: "test1.gz: gzip compressed data, from TOPS/20". I'm not sure if I can call this a bug, since it doesn't really matter in practice what gets written there (for example writing the same value on all platforms would be understandable), but it seems odd that we *do* get a platform-specific value, and it is for a different, long-dead platform. Test script: --------------- <?php file_put_contents('test1.gz', gzencode('Hello world')); ?>