1--TEST-- 2Bug #8700 (getFromIndex(0) fails) 3--EXTENSIONS-- 4zip 5--FILE-- 6<?php 7$thisdir = __DIR__; 8$filename = $thisdir . "/bug8009.zip"; 9 10$zip = new ZipArchive(); 11 12if ($zip->open($filename) === FALSE) { 13 exit("cannot open $filename\n"); 14} 15$contents_from_idx = $zip->getFromIndex(0); 16$contents_from_name = $zip->getFromName('1.txt'); 17if ($contents_from_idx != $contents_from_name) { 18 echo "failed:"; 19 var_dump($content_from_idx, $content_from_name); 20} 21 22$zip->close(); 23echo "status: " . $zip->status . "\n"; 24echo "\n"; 25?> 26--EXPECT-- 27status: 0 28