xref: /PHP-8.0/ext/zip/tests/bug38943.phpt (revision 6f536052)
1--TEST--
2#38943, properties in extended class cannot be set (5.3+)
3--SKIPIF--
4<?php
5if(!extension_loaded('zip')) die('skip');
6?>
7--FILE--
8<?php
9class myZip extends ZipArchive {
10    private $test = 0;
11    public $testp = 1;
12    private $testarray = array();
13
14    public function __construct() {
15        $this->testarray[] = 1;
16        var_dump($this->testarray);
17    }
18}
19
20$z = new myZip;
21$z->testp = "foobar";
22var_dump($z);
23
24?>
25--EXPECTF--
26array(1) {
27  [0]=>
28  int(1)
29}
30object(myZip)#1 (%d) {
31  ["test":"myZip":private]=>
32  int(0)
33  ["testp"]=>
34  string(6) "foobar"
35  ["testarray":"myZip":private]=>
36  array(1) {
37    [0]=>
38    int(1)
39  }
40  ["lastId"]=>
41  int(-1)
42  ["status"]=>
43  int(0)
44  ["statusSys"]=>
45  int(0)
46  ["numFiles"]=>
47  int(0)
48  ["filename"]=>
49  string(0) ""
50  ["comment"]=>
51  string(0) ""
52}
53