azjezz/psl
PSL is a modern, well-typed standard library for PHP 8.4+, inspired by HHVM’s HSL. It offers safer, predictable APIs for async, collections, networking, I/O, crypto, terminal UI, and robust data validation—replacing brittle built-ins with consistent alternatives.
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?