Post #2195235
2025-09-17 17:59 UTC
@Crell@phpc.social @b_viguier@phpc.social
This also explains why, when creating two instances of an enum::case and using them as keys, there will only be one entry in both weakmap or splstorageobjects
But if you use multiple instances of the same class, each one will have its entry
Replies (1)
-
@Crell@phpc.social 2025-09-17 18:13
@dgoosens@phpc.social @b_viguier@phpc.social Correct. Every enum case is, essentially, an instance of its enum class stored on the class as a public constant. That dictates how the rest of the language interacts with it.