--TEST-- close() called twice --SKIPIF-- --FILE-- getMessage(), "\n"; } echo "Object\n"; $zip = new ZipArchive(); if (!$zip->open(__DIR__ . '/test.zip')) { die('Failure'); } if ($zip->status == ZIPARCHIVE::ER_OK) { var_dump($zip->close()); try { $zip->close(); } catch (ValueError $err) { echo $err->getMessage(), PHP_EOL; } } else { die("Failure"); } ?> Done --EXPECTF-- Procedural Deprecated: Function zip_open() is deprecated in %s on line %d Deprecated: Function zip_close() is deprecated in %s on line %d NULL Deprecated: Function zip_close() is deprecated in %s on line %d zip_close(): supplied resource is not a valid Zip Directory resource Object bool(true) Invalid or uninitialized Zip object Done