(PHP 8)
get_resource_id — Returns an integer identifier for the given resource
This function provides a type-safe way for generating the integer identifier for a resource.
resource
The evaluated resource handle.
The int identifier for the given resource
.
This function is essentially an int cast of
resource
to make it easier to retrieve the resource ID.
Example #1 get_resource_id() produces the same result as an int cast
<?php
$handle = fopen("php://stdout", "w");
echo (int) $handle . "\n";
echo get_resource_id($handle);
?>
The above example will output something similar to:
698 698
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant