PHPackages                             sergiosgc/sprintf - 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. sergiosgc/sprintf

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

sergiosgc/sprintf
=================

A decorator over sprintf to allow named arguments

125PHP

Since Apr 11Pushed 3y ago2 watchersCompare

[ Source](https://github.com/sergiosgc/php-sprintf)[ Packagist](https://packagist.org/packages/sergiosgc/sprintf)[ RSS](/packages/sergiosgc-sprintf/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

php-sprintf
===========

[](#php-sprintf)

`\sergiosgc\sprintf` adds to `sprintf` a new conversion specifier for named arguments. In regular sprintf, arguments are applied to conversion specifiers using order only:

```
$result = sprintf('%d is %s in %s', $target, $role, $container);

```

`\sergiosgc\sprintf` allows you to use named conversion specifiers:

```
$result = sprintf('% is % in %', [ 'target' => $target, 'role' => $role, 'container' => $container ]);

```

The first argument after the format string is an associative array of named arguments. You may also use classic position based conversion specifiers:

```
$result = sprintf('% mixed with %s', [ 'named' => $someVar ], $positionalArgument);

```

`\sergiosgc\printf` shares `\sergiosgc\sprintf` behavior, except it prints the result instead of returning it.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor1

Top contributor holds 68.4% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/a8b63f63e66eebd441a22d3dc5e6d46ea8759a2331de6a31d6f9e3b77dc40d2f?d=identicon)[sergiosgc](/maintainers/sergiosgc)

---

Top Contributors

[![sergiocarvalho-soomacom](https://avatars.githubusercontent.com/u/97310989?v=4)](https://github.com/sergiocarvalho-soomacom "sergiocarvalho-soomacom (13 commits)")[![sergiosgc](https://avatars.githubusercontent.com/u/174234?v=4)](https://github.com/sergiosgc "sergiosgc (6 commits)")

### Embed Badge

![Health badge](/badges/sergiosgc-sprintf/health.svg)

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

###  Alternatives

[ericclemmons/rules-bundle

Configuration-based logic for your domain models

2013.8k](/packages/ericclemmons-rules-bundle)[mouf/html.widgets.statsgrid

This PHP package contains a HTML pivot table. You provide it with a data set and the list of columns and rows and it will display a nice pivot table.

239.8k](/packages/mouf-htmlwidgetsstatsgrid)

PHPackages © 2026

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