PHP Dev
mindplay's profile
Rasmus Schultz@mindplayโ€ขDec 13, 2024
420
Post cover image

PHP: rfc:generic-arrays

From wiki.php.netโ€ขDec 13, 2024โ€ข12m read time

PHP lacks support for generics, posing challenges for typed arrays which are essential for frameworks and tools relying on precise type definitions. The proposal aims to introduce a native solution for typed arrays using syntax like `array<Type>` to enhance both runtime type-checking and IDE support for array types. This proposal ensures compatibility with potential future generic additions and provides various examples to demonstrate the behaviors and principles of typed arrays, such as value-passing, type-casting, nesting, and interaction with existing PHP type systems. Performance impacts and future optimizations are also considered.

3 Comments

Sort:

mindplay's user avatar
Rasmus Schultz
@mindplay
Joinedย Oct 15. 2024
420

Full stack web development since 1998. Learning UI/UX design.

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • ยฉ 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard