Friday Aug 29 2008 3:32 pm by Smokinn
PHP arrays have pretty huge size overhead so I ported this ruby class to PHP and use it as my vector of bits.
I threw up all the code on google code so you can check it out if you're interested.
PHP arrays have pretty huge size overhead so I ported this ruby class to PHP and use it as my vector of bits.
I threw up all the code on google code so you can check it out if you're interested.
Sorry, but due to spambots, to post I'll need you to prove you're human.
Of the six following animals, just select the two that are not fluffy






How difficult is it to make a PHP class that is coded in C/C++? That would reduce the overhead bigtime.
I don't think it can be done... As far as I know, if you want to write something in C and access it in PHP you have to write a PECL extension and recompile PHP to include it.
Maybe I should try writing a PECL extension.
It tells you how to install them here:
http://ca3.php.net/manual/en/install.pecl.php
You don't need to recompile PHP to do it, that's just one of the options.
I could whip up a pretty good C bitfield system for you if you want ;) You can make them pretty fast with pointer magic and bit operations.
Thanks for the offer.
I should probably do it myself since I haven't written any C in years but if yours turns out to be faster I'll put it up on google code.