xref: /php-src/ext/spl/tests/fixedarray_010.phpt (revision 9c144e0d)
1--TEST--
2SPL: FixedArray: Setting size
3--FILE--
4<?php
5
6$a = new SplFixedArray(0);
7$a = new SplFixedArray(3);
8
9$a[0] = 1;
10
11$a->setSize(2);
12$a->setSize(3);
13$a->setSize(0);
14
15$a = new SplFixedArray(0);
16$a->setSize(0);
17var_dump($a->getSize());
18
19$a = new SplFixedArray(10);
20$a->setSize(10);
21var_dump($a->getSize());
22
23$a = new SplFixedArray(1);
24$a->setSize(5);
25var_dump($a->getSize());
26
27$a = new SplFixedArray(20);
28$a->setSize(3);
29var_dump($a->getSize());
30
31$a = new SplFixedArray(3);
32
33$a[0] = "test";
34$a[1] = array(1,2,"blah");
35$a[2] = 1;
36$a[0] = "test";
37
38$a->setSize(0);
39var_dump($a->getSize());
40
41print "ok\n";
42
43?>
44--EXPECT--
45int(0)
46int(10)
47int(5)
48int(3)
49int(0)
50ok
51