|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-05-09 13:59 UTC] bc at benjamin-cremer dot de
Description:
------------
When using `unserialize()` on a serialized string missing the trailing semicolon a notice will be triggered and `false` will be returned.
This is a backwards compatibility break introduced in 5.6.21 and 7.0.6.
Test script:
---------------
var_dump(unserialize('s:4:"test"'));
Expected result:
----------------
string(4) "test"
Actual result:
--------------
PHP Notice: unserialize(): Error at offset 10 of 10 bytes in php shell code on line 1
bool(false)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 22 02:00:01 2025 UTC |
I agree with laruence, this is not a bug. The offending code should perform $value = serialize("basic"); dynamically instead of hardcoding its output.