laminas / laminas-http

Provides an easy interface for performing Hyper-Text Transfer Protocol (HTTP) requests
https://docs.laminas.dev/laminas-http/
BSD 3-Clause "New" or "Revised" License
36 stars 27 forks source link

PHP 8.2 deprecation: dynamic property headersSent in PhpEnvironment\Response #74

Closed zerocrates closed 1 year ago

zerocrates commented 1 year ago

Bug Report

Q A
Version(s) 2.16.1, 2.17.1

Summary

PhpEnvironment\Response::sendHeaders sets a dynamic property $headersSent.

This emits a deprecation notice on PHP 8.2:

Deprecated: Creation of dynamic property Laminas\Http\PhpEnvironment\Response::$headersSent is deprecated in .../laminas/laminas-http/src/PhpEnvironment/Response.php on line 113

The property seems to be unused: the corresponding code that actually checks if headers were sent just uses PHP's headers_sent function and doesn't use this property. The set on line 113 looks to have been accidentally left in place by the long-ago change to use headers_sent which removed the property declaration: e29f84f4c8d659e9076a7c4b9966d6a97324cc52

laminas-bot commented 1 year ago

This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steering Committee. If you have a security issue, please follow our security reporting guidelines. If you wish to take on the role of maintainer, please nominate yourself

You can continue using laminas/laminas-http safely. Its successor will be PSR-7 in a later revision of laminas/laminas-mvc.

Ocramius commented 1 year ago

Consider sending a patch with a failing test case

samsonasik commented 1 year ago

Resolved at https://github.com/laminas/laminas-http/pull/75