xref: /PHP-7.3/ext/zip/tests/bug38944.phpt (revision 782352c5)
1--TEST--
2Bug #38944 (newly created ZipArchive segfaults when accessing comment property)
3--SKIPIF--
4<?php if (!extension_loaded("zip")) print "skip"; ?>
5--FILE--
6<?php
7
8$arc_name = dirname(__FILE__)."/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 (5) {
29  ["status"]=>
30  int(0)
31  ["statusSys"]=>
32  int(0)
33  ["numFiles"]=>
34  int(0)
35  ["filename"]=>
36  string(%d) "%s"
37  ["comment"]=>
38  string(0) ""
39}
40Done
41