wizacode / php-error-proof-unserializer
last chance php unserializer
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/wizacode/php-error-proof-unserializer
Requires
- php: ~7.4|~8.0
Requires (Dev)
- infection/infection: ^0.26.9
- phpstan/phpstan: ^1.6
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.6
This package is not auto-updated.
Last update: 2025-10-24 12:56:44 UTC
README
Intro
Notice: unserialize(): Error at offset ... of ... bytes ...
You can try this to unserialize a corrupted serialized string.
Usage
use Wizacode\ErrorProofUnserializer\ErrorProofUnserializer; // Attempt to unserialize a corrupted serialized string: $recoveredUnserializedData = ErrorProofUnserializer::process($brokenSerializedString); // Or only fix the serialized string: $fixedSerializedData = ErrorProofUnserialize::fix($brokenSerializedString);
P.S.: Don't record php serialized data in a RDBMS (or use at least a binary safe storage type)