Download the PHP package antharuu/phyx without Composer
On this page you can find all versions of the php package antharuu/phyx. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download antharuu/phyx
More information about antharuu/phyx
Files in antharuu/phyx
Package phyx
Short Description A modern PHP library that rethinks native functions around a more coherent, readable, and predictable API.
License MIT
Homepage https://github.com/antharuu/Phyx
Informations about the package phyx
Phyx
Phyx is a modern PHP utility library that rethinks native PHP functions around a more coherent, readable, and predictable API.
It keeps the good parts of PHP: arrays, strings, paths, URLs, JSON, HTML, numbers, bytes. It removes as much historical friction as possible: inconsistent argument order, false|int return values, magic flags, multibyte traps, ambiguous parsing, and function names that were never designed as one standard library.
Phyx is not a framework, not a runtime, and not a new language. It is a pragmatic standard-library layer for everyday PHP code.
Why Phyx?
PHP already has the building blocks. Phyx makes them feel designed together.
A few rules guide the whole library:
- target value first: string first, array first, URL first, path first;
- predictable missing values:
nullinstead of PHP'sfalse|intstyle sentinels; - explicit enums instead of boolean soup and integer flags when they clarify intent;
- multibyte string operations by default;
- pure helpers first: methods return values instead of printing, mutating, or hiding side effects;
- small façades over focused traits, so each domain stays organized internally.
Install
Requirements:
- PHP
^8.1 ext-intlext-mbstring
PHP 8.3 conveniences such as json_validate, str_increment, and str_decrement are polyfilled where Phyx needs them, so the public API remains available on every supported PHP version.
Stability
Phyx is preparing its first public release as v0.1.0. The library is tested, statically analyzed, and intended for real projects, but the public API may still receive small adjustments before 1.0.0.
The surface area
Phyx is organized by everyday domains rather than by PHP's historical function families.
| Façade | Focus |
|---|---|
Phyx\Str |
strings, casing, search, slicing, replace, formatting, hashes, HTML-safe helpers |
Phyx\Arr |
array access, paths, transforms, grouping, sorting, set operations, shape changes |
Phyx\Json |
encode/decode, validation, typed decode helpers, lightweight path access |
Phyx\Html |
escaping, entities, tags, attributes, simple fragments |
Phyx\Url |
parse, build, query strings, encoding, validation, normalization, comparison |
Phyx\Path |
joining, normalization, segments, extensions, filesystem-aware checks |
Phyx\Num |
aggregates, predicates, formatting, ranges, rounding, trigonometry |
Phyx\Bytes |
binary-safe length, hex, base64, packing, random bytes, checksums |
This README shows the shape of the API. The complete method reference lives in docs/.
Strings that behave like strings
Phyx\Str is the largest façade. It wraps common string work with consistent naming, multibyte behavior, and explicit options.
Arrays without hidden mutation
Phyx\Arr treats arrays as values. Access, path updates and transformations return a result; they do not mutate your original array by surprise.
JSON with clear failure modes
Native JSON functions mix optional exceptions, global error state, flags, and ambiguous null values. Phyx separates the strict methods from the safe try* methods.
URLs that are more than strings
Phyx\Url keeps parsing, components, query strings, encoding, validation and normalization in one vocabulary.
Paths without filesystem confusion
Phyx\Path separates syntactic path manipulation from methods that actually touch the filesystem.
HTML, numbers and bytes included
The smaller façades follow the same philosophy: concise names, clear returns, explicit options.
Design principles
Phyx deliberately stays boring in the best way:
- static façades: easy to import, easy to read, no container required;
- focused domains:
Str,Arr,Json,Url,Path,Html,Num,Bytes; - orthogonal enums: one method with an explicit policy beats five near-duplicates;
- documented edge cases: every public method carries PHPDoc with examples and native references;
- no surprise I/O: helpers return data unless their name clearly says they inspect the filesystem;
- no framework coupling: Phyx is meant to fit into plain PHP, libraries, CLIs and applications.
Documentation
The README is a tour, not the manual. For full method lists, signatures, return types and edge cases, see:
docs/Str.mddocs/Arr.mddocs/Json.mddocs/Html.mddocs/Url.mddocs/Path.mddocs/Num.mddocs/Bytes.md
Release notes
See CHANGELOG.md for tagged release history.
License
Phyx is released under the MIT License.
Development
Phyx aims to keep its public API clean enough for open-source use: readable names, complete PHPDoc, tests, static analysis, and predictable behavior before cleverness.
All versions of phyx with dependencies
ext-intl Version *
ext-mbstring Version *