You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the EnumMap is based on SplObjectStorage.
For whatever reason SplObjectStorage implements Serializable but the enumerator objects are not serializable (by default).
public function testEnumMapSerializable()
{
$enumMap = new EnumMap(EnumBasic::class);
$this->assertTrue($enumMap instanceof Serializable);
$enumMap->offsetSet(EnumBasic::ONE, 'one');
serialize($enumMap);
}
// -> LogicException: Enums are not serializable