Method sizeof()


Method sizeof

int(0..) sizeof(string arg)
int(0..) sizeof(array arg)
int(0..) sizeof(mapping arg)
int(0..) sizeof(multiset arg)
int(0..) sizeof(object arg)

Description

Size query.

Returns

The result will be as follows:

arg can have any of the following types:
string

The number of characters in arg will be returned.

array|multiset

The number of elements in arg will be returned.

mapping

The number of key-value pairs in arg will be returned.

object

If arg implements lfun::_sizeof(), that function will be called. Otherwise the number of non-protected (ie public) symbols in arg will be returned.

See also

lfun::_sizeof()