Oh, I didn't know about this! I've been using the raw library and handling cleanup myself (and understanding when and where I need to do it). It's probably a boon I started on PHP4 which basically had a 1:1 C interface for a lot of things, including manually deallocating variables to save memory and depending on variables passed by reference, so I knew what to expect even if I lacked the experience of the underlying system.
Thanks for pointing it out, I'll take a look at it.
(edit: I am using the fancy renderer in favour of the old surface manipulation; I guess that's a step up, comparing the code)