Post #2195233
2025-09-17 17:11 UTC
@dgoosens@phpc.social @b_viguier@phpc.social Correct, because the enum case is a global instance that is never destroyed, and thus the Weakness of the map is never triggered.
Replies (2)
-
@dgoosens@phpc.social 2025-09-17 17:57
@Crell@phpc.social @b_viguier@phpc.social Thanks for the explanation Larry
-
@dgoosens@phpc.social 2025-09-17 17:59
@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