It's supposed to be a feature. There is a 4th parameter (has been there
since 4.0.4 or so), which specifies the type of read to perform. If you
want to simply read ignoring any delimiters, specify PHP_BINARY_READ for
the parameter. Or you can use recv() which performs the same function


> From:             [EMAIL PROTECTED]
> Operating system: RedHat Linux
> PHP version:      4.0.4pl1
> PHP Bug Type:     Sockets related
> Bug description:  read() called with 'length' parameter reads until byte with ascii 
>10 or 13
> read($sockfd, $in, $length); If I read an arbitrary byte stream from the socket and 
>it happens to be ascii code (decimal) 10 or 13, the length parameter does not have 
>any affect on the number of bytes read from the socket. It stops at the first 
>occurence of the "magic" byte. To continue reading you have to call read again. It 
>does not look like so in the manual for the read() function. However, bytes following 
>ascii \0 and \t are succesfully read.
> Is this is the feature or a bug?
> PHP compiled --with-apxs --enable-sockets

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to