php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77080 Deflate not working
Submitted: 2018-10-29 14:27 UTC Modified: 2018-10-30 08:57 UTC
From: huisman at comandi dot nl Assigned:
Status: Open Package: Zlib related
PHP Version: PHP 7.2.11 OS: Ubuntu 18.04.1 LTS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: huisman at comandi dot nl
New email:
PHP Version: OS:

 

 [2018-10-29 14:27 UTC] huisman at comandi dot nl
Description:
------------
`stream_filter_append` in combination with `zlib.deflate` no longer works as expected in PHP 7.2 and produces an empty string instead of the expected compressed string. (see test script).

Test script:
---------------
<?php

$stream = fopen('php://temp', 'w+');

fwrite($stream, 'something something');

stream_filter_append($stream, 'zlib.deflate', STREAM_FILTER_READ, ['level' => 6]);

rewind($stream);

$contents = fread($stream, 1024);


Expected result:
----------------
A compressed string

Actual result:
--------------
An empty string

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-10-29 22:39 UTC] cmb@php.net
Works here: <https://3v4l.org/RRJ8b>.
 [2018-10-29 22:40 UTC] cmb@php.net
-Summary: Defalate not working +Summary: Deflate not working
 [2018-10-30 08:56 UTC] huisman at comandi dot nl
-PHP Version: 7.2Git-2018-10-29 (Git) +PHP Version: PHP 7.2.11
 [2018-10-30 08:56 UTC] huisman at comandi dot nl
Strange, ran on PHP 7.2.11-3+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Oct 25 2018 06:44:08) ( NTS ) in a script it's working.

The following zlib configuration is set:

zlib

ZLib Support => enabled
Stream Wrapper => compress.zlib://
Stream Filter => zlib.inflate, zlib.deflate
Compiled Version => 1.2.11
Linked Version => 1.2.11

Directive => Local Value => Master Value
zlib.output_compression => Off => Off
zlib.output_compression_level => -1 => -1
zlib.output_handler => no value => no value
 [2018-10-30 08:57 UTC] huisman at comandi dot nl
Strange, when ran on PHP 7.2.11-3+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Oct 25 2018 06:44:08) ( NTS ) in a script it's not working.

The following zlib configuration is set:

zlib

ZLib Support => enabled
Stream Wrapper => compress.zlib://
Stream Filter => zlib.inflate, zlib.deflate
Compiled Version => 1.2.11
Linked Version => 1.2.11

Directive => Local Value => Master Value
zlib.output_compression => Off => Off
zlib.output_compression_level => -1 => -1
zlib.output_handler => no value => no value
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Feb 23 23:01:26 2019 UTC