$arrayObj = new ArrayObject(['apple', 'banana', 'cherry']); echo $arrayObj->count(); // Output: 3
$students = new ArrayObject(); $students['John'] = 'A'; $students['Mike'] = 'B'; $students['Sarah'] = 'C'; echo count($students); // Output: 3This example shows how to use an `ArrayObject` as an associative array. We add three elements to the array and use the `count` function to get the number of elements in the array. Package Library: Standard PHP Library (SPL) – http://php.net/manual/en/book.spl.php