xref: /PHP-7.2/ext/bz2/tests/bug72613.phpt (revision f1d7e3ca)
1--TEST--
2Bug #72613 (Inadequate error handling in bzread())
3--SKIPIF--
4<?php if (!extension_loaded("bz2")) print "skip"; ?>
5--FILE--
6<?php
7$fp = bzopen(__DIR__.'/72613.bz2', 'r');
8if ($fp === FALSE) {
9    exit("ERROR: bzopen()");
10}
11$data = "";
12while (!feof($fp)) {
13    $res = bzread($fp);
14    if ($res === FALSE) {
15        exit("ERROR: bzread()");
16    }
17    $data .= $res;
18}
19bzclose($fp);
20?>
21DONE
22--EXPECT--
23DONE
24