SplFileObject->fgetc() properly increases linenumber

That zendtest describes the problem pretty well.