PHPackages                             alexpts/mutable-psr7 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. alexpts/mutable-psr7

ActiveLibrary[HTTP &amp; Networking](/categories/http)

alexpts/mutable-psr7
====================

A fast PHP7 implementation of PSR-7

0.2.1(5y ago)1633[1 issues](https://github.com/alexpts/php-mutable-psr7/issues)[1 PRs](https://github.com/alexpts/php-mutable-psr7/pulls)4MITPHPPHP ~8.0

Since Jun 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/alexpts/php-mutable-psr7)[ Packagist](https://packagist.org/packages/alexpts/mutable-psr7)[ RSS](/packages/alexpts-mutable-psr7/feed)WikiDiscussions master Synced today

READMEChangelog (8)Dependencies (5)Versions (11)Used By (4)

[![Build Status](https://camo.githubusercontent.com/342f279ae45f52db64757dad540509db17677a27e38afe0c9059c50f55fa9563/68747470733a2f2f6170702e7472617669732d63692e636f6d2f616c65787074732f7068702d6d757461626c652d707372372e7376673f6272616e63683d6d6173746572)](https://app.travis-ci.com/alexpts/php-mutable-psr7)[![Code Coverage](https://camo.githubusercontent.com/f8427ceefb5652bb237b103095d3be1695cf659b77a616e59241d64bd44b456a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616c65787074732f7068702d6d757461626c652d707372372f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/alexpts/php-mutable-psr7/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/33e07cd23569a699ca3cfb28df946e5bcba2d9343a6c51d6f66af0634046b062/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616c65787074732f7068702d6d757461626c652d707372372f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/alexpts/php-mutable-psr7/?branch=master)

### Mutable

[](#mutable)

The package is based on . The package is mutable. If you need immutable implementation please to see `nyholm/psr7`.

A super lightweight PSR-7 implementation. Very strict and very fast.

Installation
------------

[](#installation)

```
composer require alexpts/mutable-psr7
```

If you are using Symfony Flex then you get all message factories registered as services.

Usage
-----

[](#usage)

The PSR-7 objects do not contain any other public methods than those defined in the [PSR-7 specification](https://www.php-fig.org/psr/psr-7/).

### Create objects

[](#create-objects)

Use the PSR-17 factory to create requests, streams, URIs etc.

```
$psr17Factory = new \PTS\Psr7\Factory\Psr17Factory();
$request = $psr17Factory->createRequest('GET', 'http://some.com');
$stream = $psr17Factory->createStream('foobar');
```

### Sending a request

[](#sending-a-request)

With [HTTPlug](http://httplug.io/) or any other PSR-18 (HTTP client) you may send requests like:

```
composer require kriswallsmith/buzz
```

```
$psr17Factory = new \PTS\Psr7\Factory\Psr17Factory();
$psr18Client = new \Buzz\Client\Curl($psr17Factory);

$request = $psr17Factory->createRequest('GET', 'http://some.com');
$response = $psr18Client->sendRequest($request);
```

### Create server requests

[](#create-server-requests)

The [`nyholm/psr7-server`](https://github.com/Nyholm/psr7-server) package can be used to create server requests from PHP superglobals.

```
composer require nyholm/psr7-server
```

```
$psr17Factory = new \PTS\Psr7\Factory\Psr17Factory();

$creator = new \Nyholm\Psr7Server\ServerRequestCreator(
    $psr17Factory, // ServerRequestFactory
    $psr17Factory, // UriFactory
    $psr17Factory, // UploadedFileFactory
    $psr17Factory  // StreamFactory
);

$serverRequest = $creator->fromGlobals();
```

### Emitting a response

[](#emitting-a-response)

```
composer require laminas/laminas-httphandlerrunner
```

```
$psr17Factory = new \PTS\Psr7\Factory\Psr17Factory();

$responseBody = $psr17Factory->createStream('Hello world');
$response = $psr17Factory->createResponse(200)->withBody($responseBody);
(new \Laminas\HttpHandlerRunner\Emitter\SapiEmitter())->emit($response);
```

### Benchmark Tests

[](#benchmark-tests)

`composer bench`

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance9

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~33 days

Recently: every ~52 days

Total

8

Last Release

1982d ago

PHP version history (2 changes)0.0.1PHP &gt;=7.4

0.1.0PHP ~8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/31106536118e11bf9d0c9d7f467db5b534efa9c46ee76680b308f0c39d9a798c?d=identicon)[alexpts](/maintainers/alexpts)

---

Top Contributors

[![alexpts](https://avatars.githubusercontent.com/u/1306916?v=4)](https://github.com/alexpts "alexpts (29 commits)")

---

Tags

phppsr-7psr-7psr-17mutable

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alexpts-mutable-psr7/health.svg)

```
[![Health](https://phpackages.com/badges/alexpts-mutable-psr7/health.svg)](https://phpackages.com/packages/alexpts-mutable-psr7)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.1B4.0k](/packages/guzzlehttp-psr7)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[mezzio/mezzio

PSR-15 Middleware Microframework

3923.8M125](/packages/mezzio-mezzio)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28150.5k](/packages/phpro-http-tools)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[laminas/laminas-stratigility

PSR-7 middleware foundation for building and dispatching middleware pipelines

587.2M101](/packages/laminas-laminas-stratigility)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
