Resources

Opmerking :








The return value is an unique integer ID for your



The passed rsrc is a pointer to the following structure:



The member void *ptr is the actual pointer to your resource.




Our resource destruction handler is probably going to look something like this:







Opmerking :



we can go on and do the rest of the steps:








The return value is an unique integer identifier for that resource.




The returned rsrc_id uniquly identifies the newly registered resource. You can use the macro RETURN_RESOURE to return it to the user:



Opmerking :






This macro has no return value. It is for the developers convenience and takes care of TSRMLS arguments passing and also does check if the resource could be fetched. It throws a warning message and returns the current PHP function with NULL if there was a problem retrieving the resource.