bentools/violin
A multibyte string manipulation library focused on performance.
Maintainers
Requires
- php: >=7.1
- symfony/polyfill-mbstring: ~1.1
Requires (Dev)
- php-coveralls/php-coveralls: ^2.1
- phpstan/phpstan: ^0.11.5
- phpunit/phpunit: ^7.0
- squizlabs/php_codesniffer: ^3.4
- symfony/var-dumper: ^4.1
Suggests
None
Provides
None
Conflicts
None
Replaces
None
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
