mirror of
https://github.com/php/php-src.git
synced 2024-11-25 10:54:15 +08:00
83 lines
2.1 KiB
PHP
83 lines
2.1 KiB
PHP
--TEST--
|
|
gzfile(), gzreadfile()
|
|
--SKIPIF--
|
|
<?php /* $Id$ */
|
|
if (!extension_loaded("zlib")) print "skip"; ?>
|
|
--FILE--
|
|
<?php
|
|
$original = <<<EOD
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
|
|
EOD;
|
|
|
|
$filename = tempnam("/tmp", "phpt");
|
|
|
|
$fp = gzopen($filename, "wb");
|
|
gzwrite($fp, $original);
|
|
var_dump(strlen($original));
|
|
fclose($fp);
|
|
|
|
readgzfile($filename);
|
|
|
|
echo "\n";
|
|
|
|
$lines = gzfile($filename);
|
|
|
|
unlink($filename);
|
|
|
|
foreach ($lines as $line) {
|
|
echo $line;
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
int(560)
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|
|
blah blah blah blah blah blah blah
|