RE: [PHP-DEV] Re: [DICUSS]Cleanup resource handling APIs

From: Date: Mon, 02 Feb 2015 16:37:34 +0000
Subject: RE: [PHP-DEV] Re: [DICUSS]Cleanup resource handling APIs
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-81601@lists.php.net to get a copy of this message
> De : Xinchen Hui [mailto:laruence@php.net] > furthermore, I'd like to discuss remove the handle in zend_resource struct.. > > it may breaks some usage (use resource as long/double/string) > > case IS_RESOURCE: { > char buf[sizeof("Resource id #") + MAX_LENGTH_OF_LONG]; > int len; > > len = snprintf(buf, sizeof(buf), "Resource id #" > ZEND_LONG_FMT, (zend_long)Z_RES_HANDLE_P(op)); > return zend_string_init(buf, len, 0); > } I don't understand how you can delete the resource if you remove the handle from the zend_resource struct. Or would you store the index elsewhere ? Regards François

« previous php.internals (#81601) next »