php-src/ext/spl/tests/array_024.phpt
2008-07-06 23:45:56 +00:00

18 lines
324 B
PHP

--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)