summaryrefslogtreecommitdiff
path: root/ext/zlib/tests/gzopen_variation7.phpt
blob: 7eef44a702bdc51963046a4cf5f2cd1d47d056a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--TEST--
Test function gzopen() by calling it twice on the same file and not closing one of them at the end of the script
--SKIPIF--
<?php
if (!extension_loaded("zlib")) {
    print "skip - ZLIB extension not loaded";
}
?>
--FILE--
<?php

$f = __DIR__."/004.txt.gz";
$h1 = gzopen($f, 'r');
$h2 = gzopen($f, 'r');

var_dump(gzread($h1, 30));
var_dump(gzread($h2, 10));
var_dump(gzread($h1, 15));
gzclose($h1);
var_dump(gzread($h2, 50));
// deliberately do not close $h2
?>
--EXPECT--
string(30) "When you're taught through fee"
string(10) "When you'r"
string(15) "lings
Destiny f"
string(50) "e taught through feelings
Destiny flying high abov"