Cheating PHP integers
<p>This is in relation to my post here but taken in a completely different direction
<a href="http://stackoverflow.com/questions/5504384/charset-detection-in-php">Charset detection in PHP</a></p>

<p>essentially, i'm looking to reduce the memory that many huge arrays cause.</p>

<p>These arrays are just full of integers but seeing as PHP uses 32bit and 64 bit integers internally (depending which version you have compiled for your CPU type), it eats the memory.</p>

<p>is there a way to cheat PHP into using 8bit or 16bit integers?</p>

<p>I've thought about using pack(); to accomplish this so I can have an array of packed binary values and just unpack them as I need them (yes I know this would make it slower but is much faster than the alternative of loading and then running through each array individually as you can stream the text through so they all need to be in memory at the same time to keep speed up)</p>

<p>can you suggest any better alternatives to accomplish this? i know it's very hacky but I need to prevent huge memory surges.</p>
