Are PHP resource IDs unique?
<p>Are PHP resource IDs unique per PHP instance? Does casting all kinds of resources to string returns "Resource id #X" (where <code>X</code> is some decimal number)? Is there a function that returns resource ID (I know about <a href="http://php.net/get_resource_type" rel="nofollow"><code>get_resource_type()</code></a> to get resource typem, but didn't find anything like <code>get_resouce_id()</code>), or does it have to be done like this?</p>

<pre><code>function get_resource_id($resource)
{
    return is_resource($resouce) 
           ? substr((string) $resource, 13 /* strlen("Resource id #") */)
           : NULL;
}
</code></pre>
