ArrayObject::count
(PHP 5, PHP 7, PHP 8)
ArrayObject::count — 统计 ArrayObject 内 public 属性的数量
参数
此函数没有参数。
范例
示例 #1 ArrayObject::count() 例子
<?php
class Example {
public $public = 'prop:public';
private $prv = 'prop:private';
protected $prt = 'prop:protected';
}
$arrayobj = new ArrayObject(new Example());
var_dump($arrayobj->count());
$arrayobj = new ArrayObject(array('first','second','third'));
var_dump($arrayobj->count());
?>
以上例程会输出:
int(1) int(3)

User Contributed Notes
There are no user contributed notes for this page.