bentools/violin

A multibyte string manipulation library focused on performance.

Maintainers

πŸ‘ bpolaszek

Package info

github.com/bpolaszek/violin

pkg:composer/bentools/violin

Statistics

Installs: 1 422

Dependents: 2

Suggesters: 0

Stars: 1

Open Issues: 0

dev-master / 1.0.x-dev 2019-05-07 14:37 UTC

Requires

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 538d8e527642412288cf0dbc3dfb31c3b748c353

OOPutf8utf-8multibytestringasciistringsmanipulationmbstringstr

This package is auto-updated.

Last update: 2026-06-08 07:08:02 UTC


README

πŸ‘ Latest Stable Version
πŸ‘ License
πŸ‘ Build Status
πŸ‘ Coverage Status
πŸ‘ Quality Score
πŸ‘ Total Downloads

Violin 🎻

Violin is a multibyte-compliant, OOP string manipulation library.

It is heavily inspired by Stringy, with a main focus on performance: when dealing with thousands of strings, it is sometimes counter-productive to rely on mb_* functions, which perform up to 4 times slower than normal str_* functions, when you manipulate ASCII strings.

Violin will detect the string's encoding, then decide wether or not to use the mbstring extension (or the Symfony polyfill if the extension is not loaded).

Installation

PHP 7.1+ is required.

composer require bentools/violin 1.0.x-dev

Tests

./vendor/bin/phpunit

Usage

use BenTools\Violin\Violin;

$str = 'fΓ²ΓΆbΓ Ε™ πŸ€—';
print Violin::tune($str)
 ->toUpperCase()
 ->ensureLeft('Welcome ')
 ->collapseWhitespace(); // Welcome FΓ’Γ–BΓ€Ε˜ πŸ€—

License

MIT