deser-php
Support for PHP's serialization format (the format of PHP's serialize
and unserialize) for deser.
use ;
let input = br#"a:2:{s:7:"user_id";i:42;s:5:"roles";a:1:{i:0;s:5:"admin";}}"#;
let session: Session = from_slice.unwrap;
assert_eq!;
assert_eq!;
- Reads everything
unserializereads: arrays, objects (with their class and the visibility of their properties out of band), enum cases, custom serialized objects and the old escaped strings (S:). Arrays whose keys are0,1, ... are sequences, all others maps. - Never instantiates classes or runs code: objects are maps.
- Writes what
serializewrites, including PHP's float formatting. - References (
r:andR:) are passed through as markers and are not resolved, which makes them mostly useless beyond writing the input back unchanged.
License and Links
- Documentation
- Issue Tracker
- License: Apache-2.0