Are PHP resource IDs unique? -


Are PHP resource IDs unique to PHP examples? Casting of all types of resources to string returns "Resource ID #X" (where X is a few decimal numbers)? Is there any work that returns to the resource ID (I know about getting the processing type, but nothing has been found like get_resouce_id () ), or should it be ?

function get_resource_id ($ resource) {returns is_resource ($ resouce)? Substrate (string) $ resource, 13 / * strollon ("resource id #") * /): null; }

Jacob, yes PHP will always give you a unique ID for every resource which is present Is in use in When no resource is set () or such as freed Then that ID is available again and PHP can reuse these resources again.

Be careful if you want to keep the resource ID in the "caching" or session and reuse them because PHP can free a resource, then a new resource with that ID and your The old resource ID is pointing to something new.

So you have this, the resources are unique, but not forever!

Hope this helps in disrupting resources for you type in PHP.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -