Hi Steve,
> $content='foo'.chr(0).'bar';
> echo strlen( file_get_contents ('variable://'.$content) );
> results a length of 3 instead of 7.
A URL cannot have a NUL character in it (it violates the spec/RFC).
You should urlencode the content before concat-ing it with the
variable:// part and then urldecode it in your stream_open function.
However, local files should still have their names interpreted
"binary-safely".
> Also when stream_read results more bytes as file_get_contents or another
> command
> requested, php results a segfault.
Oops; I'll take a look at this over the weekend.
It's possibly because your stream_read function is not returning
false when there are no more bytes to be read, but the stream wrapper
should handle this a little more gracefully!
I'm sorry the docs aren't so great for this stuff yet; they're on my
TODO.
--Wez.
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php