count ()

Get the number of public properties in the ArrayObject.

Access

public

Returns

Type

Description

integer

The number of public properties in the ArrayObject.

Examples

example

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());
Result:
int(1)
int(3)

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback