This is not true. It actually makes something even more dumb. Here is a snippet of PHP source code:
switch(whence) { case SEEK_CUR: offset = stream->position + offset; whence = SEEK_SET; break; }
This is in the guts implementation for PHP fseek . What happens here: if you tell PHP to search from the current position, this translates it into an "equivalent" search from the beginning of the file. This only works when the offset calculation is not overloaded; if so, well, offset is a signed integer, so the behavior is undefined.
And, well, this is because PHP buffers the streams inside, so they need to do something. But it should not be.
You are probably best off trying to do your work in a language that actually does what you tell him.
Alex
source share