Skip to content

Instantly share code, notes, and snippets.

@szyku
Created April 14, 2019 15:43
Show Gist options
  • Save szyku/d43c28bd229fb48f69bba704bd41a55a to your computer and use it in GitHub Desktop.
Save szyku/d43c28bd229fb48f69bba704bd41a55a 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