xref: /PHP-8.1/ext/zip/tests/bug38944.phpt (revision 74859783)
1--TEST--
2Bug #38944 (newly created ZipArchive segfaults when accessing comment property)
3--EXTENSIONS--
4zip
5--FILE--
6<?php
7
8$arc_name = __DIR__."/bug38944.zip";
9$foo = new ZipArchive;
10$foo->open($arc_name, ZIPARCHIVE::CREATE);
11
12var_dump($foo->status);
13var_dump($foo->statusSys);
14var_dump($foo->numFiles);
15var_dump($foo->filename);
16var_dump($foo->comment);
17
18var_dump($foo);
19
20echo "Done\n";
21?>
22--EXPECTF--
23int(0)
24int(0)
25int(0)
26string(%d) "%s"
27string(0) ""
28object(ZipArchive)#%d (6) {
29  ["lastId"]=>
30  int(-1)
31  ["status"]=>
32  int(0)
33  ["statusSys"]=>
34  int(0)
35  ["numFiles"]=>
36  int(0)
37  ["filename"]=>
38  string(%d) "%s"
39  ["comment"]=>
40  string(0) ""
41}
42Done
43