Q:

Can't read bytes from file PHP

I have a problem, even I use "rb" in fopen(), it doesn't read bytes.  For example when in file were digits 1234 or letters.  I had got the same as in file. 
<? php

error_reporting(-1);

class Archivator 
{
    public function readFile($file)
    {
        $stream = fopen($file, "rb");
        while ($byteStr = fread($stream, 1)){
            var_dump($byteStr);
            echo $byteStr. "\n";
        }
    }
}

$arch = new Archivator();
$arch->readFile('d:\\ok\\vas.txt');

$x=fgets(STDIN);

A:

I'm not exactly sure what are you up to, but fread will read a character as string.  If you want to display its byte value (ASCII) you can use ord and optionally dechex:
while ($char = fread($stream, 1)){
    printf("Byte value of '%s' is %d (%s hex)\n", $char, ord($char), dechex(ord($char)));
}

Also, don't forget to close the file when you're done with fclose($stream).