azjezz/psl
PSL is a PHP standard library inspired by hhvm/hsl, offering consistent, well-typed, async-ready APIs for collections, networking, I/O, cryptography, terminal UI, and type-safe validation—replacing fragile PHP primitives with predictable alternatives. Requires PHP 8.4+.
ReactPHP/Amp with a more idiomatic PHP solution).Type\shape() for DTOs). The new Type\numeric() validates integers, floats, and numeric strings while preserving the input type—useful when API contracts require "1.23" to remain a string.HTTP\Client fixes reject invalid Transfer-Encoding and conflicting Content-Length fields, reducing exposure to malformed or ambiguous HTTP responses in integrations and service-to-service calls.Vec, Dict) and async networking (TCP, HTTP).Hash, Random), type-safe input validation for APIs, and stricter HTTP response validation in the client.Vec\map() instead of array_map()).Adopt PSL if:
Look elsewhere if:
ext-curl for low-level HTTP) that PSL doesn’t wrap.*"PSL is a game-changer for PHP’s scalability—it lets us build faster, safer, and more maintainable systems by replacing ad-hoc code with a batteries-included standard library. Think of it as PHP’s answer to Rust’s std or JavaScript’s util—but with structured concurrency (no more callback spaghetti), type-safe data handling (catching bugs at compile time), and a hardened HTTP client that rejects malformed protocol responses.
Async and Graph components instead of stitching together ReactPHP + custom validation logic."**"PSL gives us superpowers for PHP development:
Async\main() and Async\concurrently()—no promises, no callbacks. Example: Spin up 100 TCP connections in one line.Type\shape(), plus Type\numeric() for numbers and numeric strings without losing the original type. No more runtime array_key_exists() hacks.Vec, Dict, and Tree make state management predictable—critical for reactive apps or event sourcing.stream_socket_server() boilerplate), and rely on stricter HTTP client validation for Transfer-Encoding and Content-Length.map/filter on Vec) differ from imperative PHP.Vec\map() instead of array_map()).
Recommendation: Start with one component (e.g., Type for validation or Async for a CLI tool) and expand as the team adopts it."*Key Selling Points:
How can I help you explore Laravel packages today?