xref: /PHP-8.4/ext/spl/tests/fixedarray_018.phpt (revision c6357b80)
1--TEST--
2SPL: FixedArray: overridden count()
3--FILE--
4<?php
5$obj = new SplFixedArray(2);
6var_dump(count($obj));
7class SplFixedArray2 extends SplFixedArray {
8    public function count(): int {
9        return -parent::count();
10    }
11}
12$obj = new SplFixedArray2(2);
13var_dump(count($obj));
14?>
15--EXPECT--
16int(2)
17int(-2)
18