1--TEST--
2Test that ZipArchive properties are read-only
3--EXTENSIONS--
4zip
5--FILE--
6<?php
7
8$zip = new ZipArchive();
9
10try {
11    $zip->lastId = 1;
12} catch (Error $exception) {
13    echo $exception->getMessage() . "\n";
14}
15
16try {
17    $zip->lastId += 1;
18} catch (Error $exception) {
19    echo $exception->getMessage() . "\n";
20}
21
22var_dump($zip->lastId);
23
24try {
25    $zip->status = 1;
26} catch (Error $exception) {
27    echo $exception->getMessage() . "\n";
28}
29
30var_dump($zip->status);
31
32try {
33    $zip->statusSys = 1;
34} catch (Error $exception) {
35    echo $exception->getMessage() . "\n";
36}
37
38var_dump($zip->statusSys);
39
40try {
41    $zip->numFiles = 1;
42} catch (Error $exception) {
43    echo $exception->getMessage() . "\n";
44}
45
46var_dump($zip->numFiles);
47
48try {
49    $zip->filename = "a";
50} catch (Error $exception) {
51    echo $exception->getMessage() . "\n";
52}
53
54var_dump($zip->filename);
55
56try {
57    $zip->comment = "a";
58} catch (Error $exception) {
59    echo $exception->getMessage() . "\n";
60}
61
62var_dump($zip->comment);
63
64?>
65--EXPECT--
66Cannot write read-only property ZipArchive::$lastId
67Cannot write read-only property ZipArchive::$lastId
68int(-1)
69Cannot write read-only property ZipArchive::$status
70int(0)
71Cannot write read-only property ZipArchive::$statusSys
72int(0)
73Cannot write read-only property ZipArchive::$numFiles
74int(0)
75Cannot write read-only property ZipArchive::$filename
76string(0) ""
77Cannot write read-only property ZipArchive::$comment
78string(0) ""
79