Skip to content

Calling ob_clean() after ob_start('gz_handler') does not set Content-Encoding #7953

Closed
@timint

Description

@timint

Description

The following code:

<?php

  ob_start('ob_gzhandler');
  ob_clean();
  
  echo 'Hello World';

Resulted in this output:

��� �H���W��/�I�V��J�

But I expected this output instead:

Hello World

There is no mention anywhere in the documentation that clearing the output buffer resets the Content-Encoding HTTP Header. If this is by design it should be stated, but it feels like an error.

PHP Version

PHP 8.0.10

Operating System

Windows 11 x64

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions