PHPackages                             clayfreeman/string-stream - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. clayfreeman/string-stream

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

clayfreeman/string-stream
=========================

A library that facilitates interacting with strings using the PSR-7 stream interface.

2.0.0(1y ago)033[1 PRs](https://github.com/clayfreeman/string-stream/pulls)1MITPHPPHP &gt;=8.1CI failing

Since Oct 27Pushed 3mo agoCompare

[ Source](https://github.com/clayfreeman/string-stream)[ Packagist](https://packagist.org/packages/clayfreeman/string-stream)[ RSS](/packages/clayfreeman-string-stream/feed)WikiDiscussions 2.1.x Synced 1w ago

READMEChangelog (3)Dependencies (4)Versions (9)Used By (1)

[![Testing](https://github.com/clayfreeman/string-stream/workflows/Testing/badge.svg)](https://github.com/clayfreeman/string-stream/workflows/Testing/badge.svg)[![Maintainability](https://camo.githubusercontent.com/41a6f0e0bd7d726e7a91f1f0a1bc1f488a3d3d5ee7bbf632e9f090c179f087df/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f31663862383665363566663962333535623839342f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/clayfreeman/string-stream/maintainability)[![Test Coverage](https://camo.githubusercontent.com/01aabfa2070d650544e34c16fe9126e7cf51b7ec4078ce072b5fc25bf5871039/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f31663862383665363566663962333535623839342f746573745f636f766572616765)](https://codeclimate.com/github/clayfreeman/string-stream/test_coverage)

string-stream
=============

[](#string-stream)

This package provides a library to facilitate interacting with strings using the [PSR-7 stream interface](https://www.php-fig.org/psr/psr-7/#34-psrhttpmessagestreaminterface).

The goal of this package is to provide similar functionality in PHP to that of C++'s `iostream`; Analagous methods are intended to behave similarly.

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

[](#installation)

To install this package using Composer, run the following command.

```
composer require clayfreeman/string-stream
```

Alternatively, the package may be downloaded from the [release page](https://github.com/clayfreeman/string-stream/releases) on GitHub.

Usage
-----

[](#usage)

Some general usage examples are shown below. For more detailed information, please refer to the [PSR-7 stream interface](https://www.php-fig.org/psr/psr-7/#34-psrhttpmessagestreaminterface).

```
use ClayFreeman\StringStream\StringStream;

$stream = new StringStream('sample string');
var_export((string) $stream); // 'sample string'

// Reset the stream offset to the beginning.
var_export($stream->read(2)); // 'sa'
var_export($stream->getContents()); // 'mple string'

$stream->write('some more contents');
var_export((string) $stream); // 'sample stringsome more contents'
```

Testing
-------

[](#testing)

Tests for this package are written using PHPUnit. To run the tests, you'll need to have PHP and Composer installed:

```
git clone https://github.com/clayfreeman/string-stream.git
cd string-stream && ./vendor/bin/phpunit
```

License
=======

[](#license)

This project is subject to the terms of The MIT License. Please refer to `LICENSE.txt` for more information, or visit the following URL to get a copy of the license:

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance65

Regular maintenance activity

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity68

Established project with proven stability

 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 ~230 days

Recently: every ~320 days

Total

8

Last Release

419d ago

Major Versions

1.1.x-dev → 2.0.02025-03-24

PHP version history (3 changes)1.0.0PHP ^7.4

1.1.0PHP ^8.0 || ^7.4

2.0.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/23ac013c9e01441cfb5d67ed6cacc41a7d155f24f41bec16eb04ac10f8423d9f?d=identicon)[clayfreeman](/maintainers/clayfreeman)

---

Top Contributors

[![clayfreeman](https://avatars.githubusercontent.com/u/182658?v=4)](https://github.com/clayfreeman "clayfreeman (77 commits)")

---

Tags

composerphpstring-stream

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/clayfreeman-string-stream/health.svg)

```
[![Health](https://phpackages.com/badges/clayfreeman-string-stream/health.svg)](https://phpackages.com/packages/clayfreeman-string-stream)
```

###  Alternatives

[google/cloud-core

Google Cloud PHP shared dependency, providing functionality useful to all components.

343121.4M79](/packages/google-cloud-core)[aimeos/aimeos-base

Aimeos base layer for abstracting from host environments

2.1k134.0k1](/packages/aimeos-aimeos-base)[phpgt/dom

Modern DOM API.

12412.2M18](/packages/phpgt-dom)[anthropic-ai/sdk

Anthropic PHP SDK

129134.7k5](/packages/anthropic-ai-sdk)[jaxon-php/jaxon-core

Jaxon is an open source PHP library for easily creating Ajax web applications

73142.3k25](/packages/jaxon-php-jaxon-core)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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