|  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
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.
Block user comment
Status: Assign to:
Bug Type:
From: salsi at icosaedro dot it
New email:
PHP Version: OS:


 [2016-01-01 16:38 UTC] salsi at icosaedro dot it
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.


Add a Patch

Pull Requests

Add a Pull Request


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]
-Package: Documentation problem +Package: Bzip2 Related
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jul 19 15:01:28 2024 UTC