mirror of
https://github.com/php/php-src.git
synced 2024-12-04 23:34:25 +08:00
18 lines
324 B
PHP
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)
|