note 128185 added to ziparchive.setcompressionname

From: Date: Fri, 03 Feb 2023 22:19:48 +0000
Subject: note 128185 added to ziparchive.setcompressionname
Groups: php.notes 
Request: Send a blank email to php-notes+get-220141@lists.php.net to get a copy of this message
The compression level (compflags) option is, generally speaking, an integer value between 0 and 9. The behavior of the system depends on the selected method and the value of compflags and can sometimes be not you expected. The result below is from PHP 8.1 on Windows platform and may possibly be different on other systems or versions: - for the CM_DEFAULT method, always CM_DEFLATE is used with level 9, regardless of what you put as compflags, - for the CM_STORE method, for compflags 0-9 you get the same result, which is obvious because the method itself means "no compression at all". However, for compflags>9, surprisingly the CM_DEFLATE method is used instead with compression level 9. - for CM_DEFLATE method, 1 means the fastest and weakest compression, while 9 - the slowest and strongest one. compflags=0 and compflags>9 works as it if were with compflags=9, - for CM_BZIP2 method, 1 means the fastest and weakest compression, while 9 - the slowest and strongest one. compflags=0 works like compflag=9, and if you use compflags>9, the method will surprisingly switch to CM_DEFLATE level 9, - for CM_XZ method, 0 means the fastest and weakest compression, while 9 - the slowest and strongest one. For compflags>9 the method surprisingly switch to CM_DEFLATE level 9. ---- Server IP: 45.112.84.4 Probable Submitter: 45.91.158.213 (proxied: 85.221.144.172) ---- Manual Page -- https://php.net/manual/en/ziparchive.setcompressionname.php Edit -- https://main.php.net/note/edit/128185 Del: integrated -- https://main.php.net/note/delete/128185/integrated Del: useless -- https://main.php.net/note/delete/128185/useless Del: bad code -- https://main.php.net/note/delete/128185/bad+code Del: spam -- https://main.php.net/note/delete/128185/spam Del: non-english -- https://main.php.net/note/delete/128185/non-english Del: in docs -- https://main.php.net/note/delete/128185/in+docs Del: other reasons-- https://main.php.net/note/delete/128185 Reject -- https://main.php.net/note/reject/128185 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#220141) next »