1--TEST-- 2Test compress.zlib:// scheme with the copy function: compressed to uncompressed 3--SKIPIF-- 4<?php 5if (!extension_loaded("zlib")) { 6 print "skip - ZLIB extension not loaded"; 7} 8?> 9--FILE-- 10<?php 11$inputFileName = __DIR__."/004.txt.gz"; 12$outputFileName = __FILE__.'.tmp'; 13 14$srcFile = "compress.zlib://$inputFileName"; 15$destFile = $outputFileName; 16copy($srcFile, $destFile); 17 18$h = gzopen($inputFileName, 'r'); 19$org_data = gzread($h, 4096); 20gzclose($h); 21 22// can only read uncompressed data 23$h = fopen($outputFileName, 'r'); 24$copied_data = fread($h, 4096); 25gzclose($h); 26 27if ($org_data == $copied_data) { 28 echo "OK: Copy identical\n"; 29} 30else { 31 echo "FAILED: Copy not identical"; 32} 33unlink($outputFileName); 34?> 35--EXPECT-- 36OK: Copy identical 37