xref: /PHP-7.3/ext/spl/tests/array_024.phpt (revision 0eea0a05)
1--TEST--
2SPL: ArrayObject with overriden count()
3--FILE--
4<?php
5$obj = new ArrayObject(array(1,2));
6var_dump(count($obj));
7class ArrayObject2 extends ArrayObject {
8    public function count() {
9        return -parent::count();
10    }
11}
12$obj = new ArrayObject2(array(1,2));
13var_dump(count($obj));
14?>
15--EXPECT--
16int(2)
17int(-2)
18