To remove a resource, you usually want to
use the following macro:
int zend_list_delete(int id)
The macro is passed the id of the resource, and returns either SUCCESS or
FAILURE. If the resource exists, prior to removing it from the Zend resource list,
it will call the registered destructor for the resource type. Therefore, in our
example, you don’t have to obtain the file pointer and fclose() it before remov-
ing the resource, but you can just go ahead and delete it.
Using this macro, we can now implement file_close(): (more…)
