rsrc_id = zend_list_insert( rsrc_pointer, rsrc_type); if (rsrc_result) {rsrc_result - value.lval = rsrc_id; rsrc_result - type = IS_RESOURCE;} return rsrc_id;
What is really going on when you register a new resource is it gets inserted in an internal list in Zend and the result is just stored in the given zval * container: