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
The text was updated successfully, but these errors were encountered:
marc-mabe
changed the title
EnumMap implements Serializable bit it's not serializable
EnumMap implements Serializable but it's not serializable
Sep 19, 2017
Currently the
EnumMap
is based onSplObjectStorage
.For whatever reason
SplObjectStorage
implementsSerializable
but the enumerator objects are not serializable (by default).The text was updated successfully, but these errors were encountered: