PHPackages                             atk14/string-buffer - 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. atk14/string-buffer

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

atk14/string-buffer
===================

StringBuffer is a PHP class providing operations for efficient string buffering

v1.2.4(4y ago)128.7k↑22.2%15MITPHPPHP &gt;=5.3.0

Since Jan 24Pushed 2y ago2 watchersCompare

[ Source](https://github.com/atk14/StringBuffer)[ Packagist](https://packagist.org/packages/atk14/string-buffer)[ Docs](https://github.com/atk14/StringBuffer)[ RSS](/packages/atk14-string-buffer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (10)Used By (5)

StringBuffer
============

[](#stringbuffer)

[![Build Status](https://camo.githubusercontent.com/5bb0408764572cde90c9ca5b5343d7342441f427cd669b0d6ae405880f31ce77/68747470733a2f2f6170702e7472617669732d63692e636f6d2f61746b31342f537472696e674275666665722e7376673f6272616e63683d6d6173746572)](https://app.travis-ci.com/atk14/StringBuffer)

StringBuffer is a PHP class providing operations for efficient string buffering

Basic usage
-----------

[](#basic-usage)

```
$sb = new StringBuffer();
$sb->addString("Hello World!\n");
$sb->addFile("path/to/file");
$length = $sb->getLength();
$sb->printOut();

```

Converting StringBuffer into a string:

```
$string = (string)$sb;
// or
$string = "$sb";
// or
$string = $sb->toString();

```

Temporary buffer
----------------

[](#temporary-buffer)

You can use StringBuffer to store and manipulate large chunks of data without consuming excessive memory.

```
$buffer = new StringBufferTemporary();

// read something big in chunks
$buffer->add($megabyte);
$buffer->add($megabyte);
$buffer->add($megabyte);
$buffer->add($megabyte);
$buffer->add($megabyte);
// and so on... :)

$buffer->printOut();
// or
$buffer->writeToFile($target_filename);

```

Constant TEMP can be defined in order to specify the desired temporary directory for storing string buffer items.

```
define("TEMP","/path/to/temp/");

```

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

[](#installation)

Use the Composer to install StringBuffer.

```
cd path/to/your/project/
composer require atk14/string-buffer

```

Licence
-------

[](#licence)

StringBuffer is free software distributed [under the terms of the MIT license](http://www.opensource.org/licenses/mit-license)

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity64

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

Recently: every ~26 days

Total

9

Last Release

1820d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6304dffbd91d7a978f98632b0e4e30d662dcdb691daadb1388a58984e98faf5c?d=identicon)[yarri](/maintainers/yarri)

---

Top Contributors

[![yarri](https://avatars.githubusercontent.com/u/974278?v=4)](https://github.com/yarri "yarri (35 commits)")

---

Tags

stringstringsBufferbuffering

### Embed Badge

![Health badge](/badges/atk14-string-buffer/health.svg)

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

###  Alternatives

[doctrine/inflector

PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.

11.4k855.8M711](/packages/doctrine-inflector)[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[coduo/php-to-string

Simple library that converts PHP value into strings

27112.7M10](/packages/coduo-php-to-string)[kwn/number-to-words

Multi language standalone PHP number to words converter. Fully tested, open for extensions and new languages.

4235.0M21](/packages/kwn-number-to-words)[opis/string

Multibyte strings as objects

7420.9M7](/packages/opis-string)[delight-im/str

Convenient object-oriented operations on strings

68336.2k2](/packages/delight-im-str)

PHPackages © 2026

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