tidy up zend_extensions.c so that the logic and output makes good sense

some housework :)