assert() usage is a controversial concept at best. docref() is something quite a few of us strong disagree with. suspending this until further discussion.
emalloc() and friends in place of the standard C library functions.
PHP_FUNCTION -> ZEND_FUNCTION
Added more description for use of assert().
some misguided RINIT and RSHUTDOWN calls in a few fringe extensions
There are a few touch-ups in this commit, too.