php-standard-library/interoperability
Interfaces for converting between PSL types and native PHP stdlib and intl equivalents, providing a consistent bridge so your code can move smoothly between PSL collections, strings, and other types and their built-in PHP counterparts.
php-standard-library types (Str, Vec, Dict, DateTime, etc.). The real decision it informs is "PSL inside, native PHP at the edges," and this package is the named contract for that boundary rather than an ad-hoc convention.DateTimeInterface, and intl formatters. These interfaces give that translation a single home instead of scattering ->toString() and new DateTimeImmutable(...) through controllers and models.Adopt when:
composer.lock (typically via the main php-standard-library metapackage) and we need to hand data to stdlib/intl consumers — Eloquent casts, JSON resources, third-party SDKs, IntlDateFormatter/NumberFormatter.Look elsewhere, or skip entirely, when:
Illuminate\Contracts\* already covers those concerns; do not let "interoperability" be misread as "polyglot framework glue."Adoption gate (all should hold): PSL already present transitively; we can pin the PSL major and take coordinated upgrades; boundary serialization has test coverage; and someone owns the adapter layer.
Bottom line: conditional no by default. Reconsider only alongside a deliberate PSL pilot, not as an independent addition.
Executives: Do not fund this as a project. It is a small MIT-licensed interface package inside the PHP Standard Library whose only job is converting between PSL's specialized types and plain PHP/intl. It enters our stack only if we choose to use PSL types, and then it is the standard way to hand that data back to everything else — the adapter that keeps a specialized internal type compatible with ordinary PHP. Cost is near zero and there is no lock-in; the benefit is less bespoke glue and a cheaper exit if we reverse the decision. The honest risk is ecosystem maturity, not licensing or cost.
Engineering: Be precise about scope before anyone commits. This is not a PSR bridge, Symfony adapter, or message-bus abstraction. It is interfaces for converting PSL types to and from stdlib/intl equivalents. Practical guidance:
intl formatting. Keep PSL types in the domain; convert at the edge.How can I help you explore Laravel packages today?