NYCPHP Meetup

NYPHP.org

[nycphp-talk] Unserializing big objects

Jim Musil jmusil at villagevoice.com
Fri Feb 13 10:11:47 EST 2004


Hi,

I have flat files with serialized generic objects that are quite large --
over 100k. These flat files are written as PHP scripts like so:

<?php 

$foo = 'O:8:"stdClass":23:{s:2:"id";s:1:"2";s:5:"email";s:17:"email ...
 
... 100 kb of serialized data ...

?>

Once included I try to unserialize $foo and it doesn't work. Strangely, it
gives no error either. It works for shorter amounts of data, but there
appears to be a limit.

Is this a limit of unserialize or include?

Since all the data is on one very long line, I tried chunk_split but
unserialize doesn't like the new line characters being inserted into the
data.

Any ideas?

Jim





More information about the talk mailing list