Skip to content

zip extension only acts when closing the archive #3717

Description

@chaar123

Description

The following code:

<?php
$archive = new ZipArchive();
// case 1: $name = '/notexistingfilename' 
// case 2: $name = '/notexisting/notexistingfilename'
$res = $archive->open($name, ZipArchive::CREATE); 
if ($res !== true) {
// ...........................
}
// ...........
$archive->close();

Resulted in this output:

case 1
ZipArchive::close(): Failure to create temporary file: Permission denied 
case 2
ZipArchive::close(): Failure to create temporary file: No such file or directory

But I expected this output instead:

case 1
ZipArchive::open(): Failure to create temporary file: Permission denied 
case 2
ZipArchive::open(): Failure to create temporary file: No such file or directory

PHP Version

PHP 8.3.7

Operating System

Fedora 39

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugDocumentation contains incorrect information

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions