kba-team / byte-debug
A simple class for debugging bytes by converting them to a printable string.
Requires
- php: ^8.1
Requires (Dev)
- phpstan/phpstan: ^2.2.3
- phpunit/phpunit: ^9.6.33
- squizlabs/php_codesniffer: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-02 14:08:15 UTC
README
A simple class for debugging bytes by converting them to a printable string.
This is useful for all kinds of debugging, in case you receive strings containig all sorts of non-printable characters mixed into printable ones.
Usage
Add the package to your repository:
composer require kba-team/byte-debug
Use:
<?php echo \kbATeam\ByteDebug\ToString::fromString('hello'.chr(10).'world!'); //output: hellox0Aworld!
Development
All development commands (install, test, lint, analyze, beautify, sniff, audit,
validate) run via Docker through the Makefile, so no local PHP installation is
needed. Run make help to list all targets. Most targets require PHP_VERSION,
e.g.:
make install PHP_VERSION=8.1