xref: /PHP-8.0/ext/zip/tests/bug53885.phpt (revision a4d12f46)
1--TEST--
2Bug #53885 (ZipArchive segfault with FL_UNCHANGED on empty archive)
3--SKIPIF--
4<?php
5if(!extension_loaded('zip')) die('skip');
6?>
7--FILE--
8<?php
9$fname = __DIR__."/test53885.zip";
10if(file_exists($fname)) unlink($fname);
11touch($fname);
12$nx=new ZipArchive();
13$nx->open($fname);
14$nx->locateName("a",ZIPARCHIVE::FL_UNCHANGED);
15$nx->statName("a",ZIPARCHIVE::FL_UNCHANGED);
16?>
17==DONE==
18--CLEAN--
19<?php
20$fname = __DIR__."/test53885.zip";
21unlink($fname);
22?>
23--EXPECTF--
24Deprecated: ZipArchive::open(): Using empty file as ZipArchive is deprecated in %s
25==DONE==
26