Unserializing the ‘S’ format is deprecated¶
Description¶
When using the unserialize() function, the string should not use S (upper case S) to format a string. It should only use s (lower case S).
Other formats, such as i, b or N are already case sensitive.
Example¶
<?php
$encoded = 'S:3:"abc";';
unserialize($encoded);
?>
Solutions¶
Turn the
Sinto lower cases. This might be tricky.Serialize all over the stored strings with lower case.
Changed Behavior¶
This error may appear following an evolution in behavior, in previous versions. See unserialize_S.