stream_resolve_include_path()
stream_resolve_include_path() — Resolve filename against the include path.
Built-in function of PHP 8.5. The manual lists it as available in PHP 5 >= 5.3.2, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.
What it does
Resolve filename against the include path according to the same rules as fopen()/include.
Signature
stream_resolve_include_path(string $filename): string|false
Parameters
| Parameter | Type | What it takes |
|---|---|---|
| $filename | string | The filename to resolve. |
Return value
Returns a string containing the resolved absolute filename, or false on failure.
Example
A runnable snippet:
var_dump(stream_resolve_include_path("test.php"));
Output:
string(22) "/var/www/html/test.php"
All PHP 8.5 built-in functions
Reference card built from the PHP manual page stream_resolve_include_path() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.