php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #71258 bzread(): detailed description of the returned values and errors
Submitted: 2016-01-01 16:38 UTC Modified: 2016-01-02 00:57 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: salsi at icosaedro dot it Assigned:
Status: Open Package: Bzip2 Related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: salsi at icosaedro dot it
New email:
PHP Version: OS:

 

 [2016-01-01 16:38 UTC] salsi at icosaedro dot it
Description:
------------
The "return value" section of the page describing bzread() shoutd explain more in detail what really this function may return:

- FALSE: error reading from the stream. An error of level E_WARNING is also raised in this case; you may retrieve the text of the error message from the $php_errormsg magic variable, if enabled.

- Empty string: end of the file or BZIP2 deconding error. Use feof($bz) to detect the first case, and use bzerrno($bz) != 0 to detect the latter.

- Non empty string: decoded data. Check bzerror($bz) != 0 for possible BZIP2 decoding errors. Data may still be garbage because the BZIP2 checksum is checked only after a whole block of BZIP2 data has been read or at the end of the stream, so in general data read cannot be trusted until the whole content of the file has been read.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-01-01 18:24 UTC] salsi at icosaedro dot it
-Type: Bug +Type: Documentation Problem
 [2016-01-01 18:24 UTC] salsi at icosaedro dot it
Fix my report: Bug --> Documentation Problem.
 [2016-01-02 00:57 UTC] requinix@php.net
-Package: Documentation problem +Package: Bzip2 Related
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Jan 18 22:01:22 2020 UTC