Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6725653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:50:00+00:00 2026-05-26T09:50:00+00:00

I have been trying to unserialize on a 32-bit server an object that was

  • 0

I have been trying to unserialize on a 32-bit server an object that was serialized on a 64-bit server. I have isolated my problem to an integer in the object. Here is a small reproduction of the problem.

On a 64-bit machine:

$i = serialize('20110510134021'); //i:20110510134021;

On a 32-bit machine:

$i = unserialize('i:20110510134021;');

Gives the error

Notice: unserialize(): Error at offset 0 of 16 bytes

Now I understand that those serialization method shouldn’t be used for cross system data transmition. However, we are merely trying to migrate the data to another system, not use it actively for transfers. This is a one time thing.

I would think that this might be due to integer overflow, but even on the 32-bit server I can do something like

$i = 20110510134021;
echo $i;

And it will work fine. I’m guessing PHP integer types scale to some double type or something like that. But why doesn’t it do that when it unserializes?

How can I unserialize those objects? If I can’t, is there any way to convert them to something else? Finally, has anyone written a deserialize method in PHP itself? Or has details on the protocol? I could use that and have a custom case for those integers.

Thanks.

Note: I do not have access to the original data, only the serialized result.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:50:01+00:00Added an answer on May 26, 2026 at 9:50 am

    The max integer on 32 bit system is 4294967296;
    $i = 20110510134021; works because PHP converts the variable to double.

    So replace i with d

    $i = unserialize('d:20110510134021;');
    

    If you run this script, you will see the correct represenation of the variable on the system you are running (d: on 32 bit system, i: on 64 bit system):

    $int = 20110510134021;
    var_dump(serialize($int));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have been trying to fix this problem I have here. Basically I have a
I have been trying to have a small login widget that I embed within
I have been trying to solve this problem for a while, could not find
I have been trying to solve this problem for three days now, it's really
I have been trying to create a simple app that parse an entire channel
Have been trying to fix this for the past hour. Here goes: <script type=text/javascript>
I have been trying to get a response from a server sending a GET
I have been trying to fix this for a bit, and I must be
I have been trying to connect sphinx server with nodejs and limestone module. But
I have been trying to write a script that may help me to comment

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.