PHPackages                             marcreichel/characters - 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. marcreichel/characters

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

marcreichel/characters
======================

OOP implementation of common characters

0.1.3(1y ago)314MITPHPPHP &gt;=8.4CI passing

Since Mar 2Pushed 1y ago1 watchersCompare

[ Source](https://github.com/marcreichel/characters)[ Packagist](https://packagist.org/packages/marcreichel/characters)[ RSS](/packages/marcreichel-characters/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (5)Used By (0)

The missing object-oriented characters in PHP
=============================================

[](#the-missing-object-oriented-characters-in-php)

This package aims to fix the lacking support for object-oriented characters in PHP. To allow PHP to evolve from just a scripting-language and become a full-fledged object oriented programming language, having object-oriented characters is fundamental. Period.

 [ ![Packagist Version](https://camo.githubusercontent.com/288d0da343ab913080e6dd3a03f42fd9e23b56aa4e92e279db76d2d482f6232d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6172637265696368656c2f636861726163746572733f7374796c653d666f722d7468652d6261646765) ](https://packagist.org/packages/marcreichel/characters) [ ![Packagist Downloads](https://camo.githubusercontent.com/8a39ddee052591753a7590e37696d9611e8f88e3c4d8d8148dcc58d74e29a203/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6172637265696368656c2f636861726163746572733f7374796c653d666f722d7468652d6261646765) ](https://packagist.org/packages/marcreichel/characters) [ ![CI](https://camo.githubusercontent.com/087208137d995b6d25a82b276104f3a8187e28108d6dcb45135e5342dacb9698/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d6172637265696368656c2f636861726163746572732f63692e796d6c3f6576656e743d70757368267374796c653d666f722d7468652d6261646765266c6f676f3d676974687562266c6162656c3d4349) ](https://github.com/marcreichel/characters/actions/workflows/ci.yml) [ ![Static Analysis Level](https://camo.githubusercontent.com/347d31fac5459e3029ef8c1545e038d7d8a7c82351c566b0d7c01a12dbb78f3c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6d61782d627269676874677265656e2e7376673f7374796c653d666f722d7468652d6261646765) ](https://github.com/marcreichel/characters) [ ![CodeFactor](https://camo.githubusercontent.com/fc8a2a8282393b7921c3628ea83300cd56b08e35c212d1f67ce12dad728f0867/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f6d6172637265696368656c2f636861726163746572732f62616467653f7374796c653d666f722d7468652d6261646765) ](https://www.codefactor.io/repository/github/marcreichel/characters) [ ![License](https://camo.githubusercontent.com/b9f5f0529fa0221294f1a125551556c7d24b40e9b7479532f691f456c0d8aba1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6172637265696368656c2f636861726163746572733f7374796c653d666f722d7468652d6261646765) ](https://packagist.org/packages/marcreichel/characters)

🚀 Getting started
-----------------

[](#-getting-started)

```
composer require marcreichel/characters
```

🪄 Example usage
---------------

[](#-example-usage)

```
use MarcReichel\Characters\{MultiplicationSign,Number4,Number5,Space};

$space = new Space();
$number4 = new Number4();
$multiplicationSign = new MultiplicationSign();
$number5 = new Number5();

echo "$number4$space$multiplicationSign$space$number5"; // -> "4 × 5"
```

### 🧙🏼‍♂️ Advanced usage

[](#‍️-advanced-usage)

You can even reuse the characters like this:

```
use MarcReichel\Characters\{A,B}

$a = new A();
$b = new B();

echo "$a$b$a$b$a$b"; // -> "ababab"
```

### HTML representation of a character

[](#html-representation-of-a-character)

For HTML-save output.

```
use MarcReichel\Characters\{DivisionSign,Number0,Number2,Number5,Space};

new DivisionSign()->toHtml(); // -> "&divide;"
new Number0()->toHtml();      // -> "0"
new Number2()->toHtml();      // -> "2"
new Number5()->toHtml();      // -> "5"
new Space()->toHtml();        // -> " "
```

### URL representation of a character

[](#url-representation-of-a-character)

For URL-save output.

```
use MarcReichel\Characters\{DivisionSign,Number0,Number2,Number5,Space};

new DivisionSign()->toUrl(); // -> "%C3%B7"
new Number0()->toUrl();      // -> "0"
new Number2()->toUrl();      // -> "2"
new Number5()->toUrl();      // -> "5"
new Space()->toUrl();        // -> "+"
```

### JSON representation of a character

[](#json-representation-of-a-character)

For JSON-save output.

```
use MarcReichel\Characters\{DivisionSign,Number0,Number2,Number5,Space};

json_encode([
    new Number2(),      // -> "2"
    new Number0(),      // -> "0"
    new Space(),        // -> " "
    new DivisionSign(), // -> "\u00f7"
    new Space(),        // -> " "
    new Number5(),      // -> "5"
]);
```

🧪 Testing
---------

[](#-testing)

```
composer test
```

🤝🏼 Contributing
---------------

[](#-contributing)

Missing a character you despirately need? Open an issue to request the addition to this package. If you're experienced enough you can even create the pull request, adding the character, yourself. Before creating an issue (or pull request) please make sure beforehand if the issue (or pull request) does not already exist.

- One Issue per character
- One Pull Request per character
- Issues or pull requests for multiple characters will be closed without comment.
- Always add tests for the new character. Only pull requests where all status checks succeed, will be reviewed and merged eventually.
- The chance of pull requests being approved and merged might increase if all planets in the solar system align perfectly.
- Always use Gitmojis for commit messages.

©️ License
----------

[](#️-license)

Licensed under the MIT license.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance46

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Total

4

Last Release

413d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/78a42c456514ed2ca00a19ba61baa3280b9e5c9294c6f63ca549cc3346839d65?d=identicon)[marcreichel](/maintainers/marcreichel)

---

Top Contributors

[![marcreichel](https://avatars.githubusercontent.com/u/7645035?v=4)](https://github.com/marcreichel "marcreichel (12 commits)")

---

Tags

april-foolscharacterscodehacktoberfesthelperjust-for-funoopphpsupporttrollingutf-8

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/marcreichel-characters/health.svg)

```
[![Health](https://phpackages.com/badges/marcreichel-characters/health.svg)](https://phpackages.com/packages/marcreichel-characters)
```

PHPackages © 2026

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