mirror of
https://github.com/php/php-src.git
synced 2024-10-19 15:34:25 +00:00
35 lines
592 B
Plaintext
35 lines
592 B
Plaintext
|
--TEST--
|
||
|
Test function readgzfile() reading a gzip relative file
|
||
|
--SKIPIF--
|
||
|
<?php
|
||
|
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
|
||
|
?>
|
||
|
--FILE--
|
||
|
<?php
|
||
|
$plaintxt = b<<<EOT
|
||
|
hello world
|
||
|
is a very common test
|
||
|
for all languages
|
||
|
|
||
|
EOT;
|
||
|
$dirname = 'readgzfile_temp';
|
||
|
$filename = $dirname.'/plainfile.txt.gz';
|
||
|
mkdir($dirname);
|
||
|
$h = gzopen($filename, 'w');
|
||
|
gzwrite($h, $plaintxt);
|
||
|
gzclose($h);
|
||
|
|
||
|
|
||
|
var_dump(readgzfile( $filename ) );
|
||
|
|
||
|
unlink($filename);
|
||
|
rmdir($dirname);
|
||
|
?>
|
||
|
===DONE===
|
||
|
--EXPECT--
|
||
|
hello world
|
||
|
is a very common test
|
||
|
for all languages
|
||
|
int(52)
|
||
|
===DONE===
|