now that the user got his resource at some point he is passing it back to one of your functions the valuelval inside the zval * container contains the key to your resource and thus can be used to fetch the resource with the following macro zend _ fetch _ resource 