title: Extremely Large Integers in PHP
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/211345/working-with-large-numbers-in-php">Working with large numbers in PHP.</a>  </p>
  </blockquote>
  
  
  
  <p>I run a completely useless Facebook app. I'm having a problem with PHP's support for integers. Basically, users give themselves ridiculous numbers of points. The current "king" has 102,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,002,557,529,927 points.</p>
  
  <p>PHP does not seem to play well with large integers. When someone tries to add more than a certain amount of points it will fail because PHP treats those numbers as infinite.</p>
  
  <p>Is there some math library for working with ridiculously large numbers? Should I treat the numbers as strings and write my own?</p>
  
  <p>We're talking numbers which are 2^20 digits <strong>in length</strong> or longer. They don't need to be accurate (any errors are chalked up to the low quality of the app in general) nor does it need to be high performance. I just need something which allows much longer numbers.</p>
  
  <p>(For those of you who are curious, we store our numbers in the cloud, so storage cost isn't a huge issue.)</p>