Bug Report
Description
xzdecode() returns incomplete decompressed data (12288 bytes) while the system xz command correctly extracts the same file to the expected size of 12360 bytes.
Environment
- OS: Windows 10 x64
- PHP version: 8.0.2
- Extension version: 1.2.1
- DLL file:
php_xz-1.2.1-8.0-nts-vs16-x86_64
- Thread safety: NTS (Non-Thread Safe)
- Architecture: x64
- Compiler: VS16
Steps to Reproduce
- Take a valid
.xz file (compressed from a 12360-byte source)
- Read the file content via
file_get_contents()
- Pass the compressed data to
xzdecode()
- Compare the output length with the expected size
Minimal Test Code
$xzFilePath = 'path/to/your/file.xz';
$compressedData = file_get_contents($xzFilePath);
$decompressedData = xzdecode($compressedData);
echo 'Expected size: 12360 bytes' . PHP_EOL;
echo 'Actual size: ' . strlen($decompressedData) . ' bytes' . PHP_EOL;
[demo.zip](https://github.com/user-attachments/files/27154706/demo.zip)
Bug Report
Description
xzdecode()returns incomplete decompressed data (12288 bytes) while the systemxzcommand correctly extracts the same file to the expected size of 12360 bytes.Environment
php_xz-1.2.1-8.0-nts-vs16-x86_64Steps to Reproduce
.xzfile (compressed from a 12360-byte source)file_get_contents()xzdecode()Minimal Test Code