php-standard-library/os
Type-safe OS detection for PHP via an OperatingSystemFamily enum. Quickly identify Windows, macOS, Linux, and more without brittle string checks. Part of PHP Standard Library; lightweight and focused on reliable environment detection.
php_uname() parsing) while keeping dependencies minimal and MIT-licensed.chmod vs. icacls).str_contains(php_uname(), 'Windows')).For Executives: "This package lets us build OS-aware features—like CLI tools or system integrations—without the risk of runtime bugs or tech debt. It’s a lightweight, type-safe way to handle Windows/macOS/Linux differences, reducing support costs and accelerating cross-platform releases. Think of it as ‘enums for OS detection’: safer than string checks, easier to maintain than custom logic."
For Engineering:
*"We’re replacing fragile OS detection (e.g., strpos(php_uname(), 'Darwin')) with a type-safe enum that:
OperatingSystemFamily::Windows vs. invalid values).OperatingSystemFamily::WSL later).How can I help you explore Laravel packages today?