Thank you Barand, your code works just like mine and I was able to find the problem now that I knew the problem was not in the serialazation. What I was doing was something like this: [code] $tile = $map[$y][$x]; $tile->addToUnits($unit); [/code] When the working code was: [code] $map[$y][$x]->addToUnits($unit); [/code] So I had misunderstood how php handles variables, even $map had objects the assigment to $tile actually copied the object instead of passing reference to it. So I will be using & to get the reference instead of copy from now on. Thanks.