# php5: Unserialize Large Objects with References

- Thread: https://externals.io/message/7522
- Original archive: https://news-web.php.net/php.internals/7522
- Started by David Giffin on 2004-02-03T23:44:17+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #7522 — David Giffin — 2004-02-03T23:44:17+00:00

URL: https://externals.io/message/7522#7522

Hi there,

I've been using the unserialize and serialize methods in php5 on some
rather large objects it seems that the larger object get the following
errors:

	Notice: `unserialize()`: Error at offset 6167 of 31195 bytes in
	/root/doServerStates.php on line 37

Different smaller object:

	Notice: `unserialize()`: Error at offset 6179 of 21955 bytes in
	/root/doServerStates.php on line 37


The error offset is different based on the the size of the total file. I'm
trying to put together a test case to replicate the issue. I wanted to
see if anyone has already identified this issue before taking the time to
do the test case.

Thanks,
David

---

## #7533 — Pierre-Alain Joye — 2004-02-04T11:36:21+00:00

URL: https://externals.io/message/7522#7533 · In reply to: #7522

On Tue, 3 Feb 2004 15:44:17 -0800 (PST)
david@agent911.com (David Giffin) wrote:

> 
> Hi there,
> 
> I've been using the unserialize and serialize methods in php5 on some
> rather large objects it seems that the larger object get the following
> errors:
> 
> 	Notice: `unserialize()`: Error at offset 6167 of 31195 bytes in
> 	/root/doServerStates.php on line 37
> 
> Different smaller object:
> 
> 	Notice: `unserialize()`: Error at offset 6179 of 21955 bytes in
> 	/root/doServerStates.php on line 37
> 

Do you store the serialized data in a file betweep the ops? If yes,
check that you use binary mode only. I got similar errors in the past.

pierre
