mirror of
https://github.com/php/php-src.git
synced 2024-12-04 23:34:25 +08:00
18 lines
309 B
PHP
18 lines
309 B
PHP
--TEST--
|
|
SPL: FixedArray: overriden count()
|
|
--FILE--
|
|
<?php
|
|
$obj = new SplFixedArray(2);
|
|
var_dump(count($obj));
|
|
class SplFixedArray2 extends SplFixedArray {
|
|
public function count() {
|
|
return -parent::count();
|
|
}
|
|
}
|
|
$obj = new SplFixedArray2(2);
|
|
var_dump(count($obj));
|
|
?>
|
|
--EXPECT--
|
|
int(2)
|
|
int(-2)
|