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