PHPackages                             coduo/php-to-string - 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. coduo/php-to-string

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

coduo/php-to-string
===================

Simple library that converts PHP value into strings

3.2.2(5mo ago)27112.7M↓10.4%710MITPHPPHP &gt;=7.2CI passing

Since May 8Pushed 3mo ago3 watchersCompare

[ Source](https://github.com/coduo/php-to-string)[ Packagist](https://packagist.org/packages/coduo/php-to-string)[ Fund](https://flow-php.com/sponsor)[ GitHub Sponsors](https://github.com/norberttech)[ RSS](/packages/coduo-php-to-string/feed)WikiDiscussions 3.x Synced 1mo ago

READMEChangelog (10)DependenciesVersions (18)Used By (10)

PHP To String
=============

[](#php-to-string)

Simple library that converts PHP values into strings.

Status:

[![Build Status](https://github.com/coduo/php-to-string/workflows/Tests/badge.svg?branch=3.x)](https://github.com/coduo/php-to-string/workflows/Tests/badge.svg?branch=3.x)[![Latest Stable Version](https://camo.githubusercontent.com/4826782ba78e911f2b5c08475fc955bdfa94c7be90bf8d51a4c325d228c947e1/68747470733a2f2f706f7365722e707567782e6f72672f636f64756f2f7068702d746f2d737472696e672f762f737461626c65)](https://packagist.org/packages/coduo/php-to-string)[![Total Downloads](https://camo.githubusercontent.com/4d09242883a5e2cfd048fbf86c5935e7310f800e76bd806fad7fce2227fcadef/68747470733a2f2f706f7365722e707567782e6f72672f636f64756f2f7068702d746f2d737472696e672f646f776e6c6f616473)](https://packagist.org/packages/coduo/php-to-string)[![Latest Unstable Version](https://camo.githubusercontent.com/82886fa2caed072fcb0d9017bd08bab92f6c6ef697e4fc543f52bb56d4574ca8/68747470733a2f2f706f7365722e707567782e6f72672f636f64756f2f7068702d746f2d737472696e672f762f756e737461626c65)](https://packagist.org/packages/coduo/php-to-string)[![License](https://camo.githubusercontent.com/4227e89436579636fc084ac5328e75e899550fd9ba5be63768dc4ed19ab65afa/68747470733a2f2f706f7365722e707567782e6f72672f636f64756f2f7068702d746f2d737472696e672f6c6963656e7365)](https://packagist.org/packages/coduo/php-to-string)

Simple library that allows you to cast any php value into string

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

[](#installation)

```
composer require coduo/php-to-string

```

Usage
-----

[](#usage)

Supported types:

- string
- integer
- float/double
- object
- callable
- array
- resource

```
use Coduo\ToString\StringConverter;

$string = new StringConverter('foo');
echo $string; // "foo"

$double = new StringConverter(1.12312);
echo $double; // "1.12312"

$integer = new StringConverter(1);
echo $integer; // "1"

$datetime = new StringConverter(new \DateTime());
echo $datetime; // "\DateTime"

$array = new StringConverter(['foo', 'bar', 'baz']);
echo $array; // "Array(3)"

$res = fopen(sys_get_temp_dir() . "/foo", "w");
$resource = new StringConverter($res);
echo $resource; // "Resource(stream)"
```

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance75

Regular maintenance activity

Popularity63

Solid adoption and visibility

Community29

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 58.2% 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 ~285 days

Recently: every ~487 days

Total

16

Last Release

110d ago

Major Versions

v0.1.0 → 1.0.12014-10-18

1.0.2 → 2.0.02015-12-13

2.0.2 → 3.0.x-dev2019-11-23

PHP version history (3 changes)1.0.0PHP &gt;=5.3.0

3.0.x-devPHP ^7.2

3.1.x-devPHP &gt;=7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/52325810?v=4)[norbert-tech](/maintainers/norbert-tech)[@norbert-tech](https://github.com/norbert-tech)

![](https://www.gravatar.com/avatar/6b69a1ca71c5d2ed554cb1da909c737cb4a88151bf67ca894b80379976085689?d=identicon)[defrag](/maintainers/defrag)

---

Top Contributors

[![norberttech](https://avatars.githubusercontent.com/u/1921950?v=4)](https://github.com/norberttech "norberttech (32 commits)")[![aeon-automation](https://avatars.githubusercontent.com/u/77585774?v=4)](https://github.com/aeon-automation "aeon-automation (12 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![sdaoudi](https://avatars.githubusercontent.com/u/4227015?v=4)](https://github.com/sdaoudi "sdaoudi (1 commits)")[![smoench](https://avatars.githubusercontent.com/u/183530?v=4)](https://github.com/smoench "smoench (1 commits)")[![teklakct](https://avatars.githubusercontent.com/u/1399832?v=4)](https://github.com/teklakct "teklakct (1 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")[![jakzal](https://avatars.githubusercontent.com/u/190447?v=4)](https://github.com/jakzal "jakzal (1 commits)")

---

Tags

castphpstringphpstringto stringto

### Embed Badge

![Health badge](/badges/coduo-php-to-string/health.svg)

```
[![Health](https://phpackages.com/badges/coduo-php-to-string/health.svg)](https://phpackages.com/packages/coduo-php-to-string)
```

###  Alternatives

[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)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2516.7k](/packages/iteks-laravel-enum)

PHPackages © 2026

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