azjezz/psl
PSL (PHP Standard Library) offers a consistent, well-typed set of safer, async-ready APIs to replace PHP primitives. Covers async, collections, networking, I/O, cryptography, terminal UI, and type-safe data validation with predictable errors.
The OS component provides type-safe operating system detection. Instead of comparing raw strings against PHP_OS_FAMILY, you work with the OperatingSystemFamily enum and convenience functions.
@example('system/os-family.php')
Quick boolean checks for the most common platforms:
@example('system/os-detection.php')
The enum covers six families: Windows, BSD, Darwin, Solaris, Linux, and Unknown. You can match against it for exhaustive platform handling:
@example('system/os-match.php')
OperatingSystemFamily::default() returns the family for the current runtime, making it useful as a dependency injection default.
See src/Psl/OS/ for the full API.
How can I help you explore Laravel packages today?