Skip to content

Instantly share code, notes, and snippets.

@jakubkulhan
Created July 17, 2010 20:06
Show Gist options
  • Save jakubkulhan/479808 to your computer and use it in GitHub Desktop.
Save jakubkulhan/479808 to your computer and use it in GitHub Desktop.
<?php
class foo
{
function stream_open() { return TRUE; }
function stream_eof() { return FALSE; }
function stream_read($count)
{
var_dump($count);
return "";
}
}
stream_wrapper_register('foo', 'foo');
$handle = fopen('foo://bar', NULL);
fread($handle, 1); // int(8192)
fread($handle, 16384); // int(8192)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment