Skip to content

Instantly share code, notes, and snippets.

@tsh-code
Forked from szyku/naive2.php
Created June 10, 2019 09:37
Show Gist options
  • Save tsh-code/ddf3d67298bce87636c7dfa590c11453 to your computer and use it in GitHub Desktop.
Save tsh-code/ddf3d67298bce87636c7dfa590c11453 to your computer and use it in GitHub Desktop.
naivefopen2
<?php
class XYZ {
// ...
public static function openForRead(string $id): ?resouce
{
$resource = @fopen($id, 'r');
return $resource ? $resource : null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment