Function try_fopen
Safely opens a PHP stream resource using a filename.
When fopen fails, PHP normally raises a warning. This function adds an error handler that checks for errors and throws an exception instead.
Namespace: GuzzleHttp\Psr7
Deprecated: try_fopen will be removed in guzzlehttp/psr7:2.0. Use Utils::tryFopen instead.
Located at functions.php
Deprecated: try_fopen will be removed in guzzlehttp/psr7:2.0. Use Utils::tryFopen instead.
Located at functions.php
Parameters summary
string |
$filename |
File to open |
string |
$mode |
Mode used to open the file |
Return value summary
resource
|
resource |
Thrown exceptions summary
RuntimeException
|
if the file cannot be opened |