As one can see on the frequent updates on this blog I don't have much to say, now there's this twitter thing, until recently I didn't understand it. Whenever I visit the site I see mostly pointless (imo) stuff like "preparing my pizza", "eating my pizza", "done with my pizza". The other thing I see there are people telling me what errors in their applications they are currently fixing. I can't see why that's interesting. But as people seem to be interested I found out that I have stuff to say, too, or better my PHP has, since sometimes I have errors there, too. But well, I'm lazy so I don't want to "twitter" them myself, instead of that I wrote a little PHP extension intercepting the error handling and sending the error messages to my twitter profile. While doing that I found out that this saves a whole lot of monitoring infrastructure as twitter then can send you a SMS telling you your app broke, great no? (Disclaimer: I won't use it on a production box as it makes the error reporting way slower and twitter seems, from what I've heard, to be down quite often)
While going through some old backups I found some funny stuff I did back in the times when I was a bit bored (or maybe just frustrated?) A PHP extension written using mostly Assembler instead of C.
If you are interested in scary and useless stuff you can fetch the code and try it. There is some C code in it to create two required structures (which makes no sense doing in assembler imo - while this doesn't mean that thing makes any sense) but all functions and everything else is done using Assembler in the nasm syntax for 32bit x86 machines. If you really want to try t you need nasm and a PHP built environment. After running phpize and configure, just as for any other extension, you might need to edit the Makefile holding two rules for the .s file (remove the one using gas as assembler)
The extension exports a single function confirm_asmext_compiled() which prints some stuff using PHP's output mechanism and returns an integer, which is a bit tricky using Assembler since from the C perspective the return value is returned using some zval * structure passed by reference (making it a zval **) to the function so you need to dereference it and need to check/find out how the C compiler arranges the zval structure...
Yes for doing such a thing you have to be real bored (or maybe just extremly frustrated....) I'm happy this being a few years ago but I wanted to archive it somewhere