1--TEST-- 2Test gzopen() function : variation: try opening with possibly invalid modes 3--EXTENSIONS-- 4zlib 5--FILE-- 6<?php 7echo "*** Testing gzopen() : variation ***\n"; 8 9$modes = array('r+', 'rf', 'w+' , 'e'); 10 11$file = __DIR__."/004.txt.gz"; 12 13foreach ($modes as $mode) { 14 echo "mode=$mode\n"; 15 $h = gzopen($file, $mode); 16 echo "gzopen="; 17 var_dump($h); 18 if ($h !== false) { 19 gzclose($h); 20 } 21 echo "\n"; 22} 23?> 24--EXPECTF-- 25*** Testing gzopen() : variation *** 26mode=r+ 27 28Warning: gzopen(): Cannot open a zlib stream for reading and writing at the same time! in %s on line %d 29gzopen=bool(false) 30 31mode=rf 32gzopen=resource(%d) of type (stream) 33 34mode=w+ 35 36Warning: gzopen(): Cannot open a zlib stream for reading and writing at the same time! in %s on line %d 37gzopen=bool(false) 38 39mode=e 40 41Warning: gzopen(%s/004.txt.gz): Failed to open stream: %s in %s on line %d 42gzopen=bool(false) 43 44