note 74270 deleted from function.count by bjori
| From: | bjori@php.net | Date: | Tue, 03 Apr 2007 12:01:01 +0000 |
| Subject: | note 74270 deleted from function.count by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-125034@lists.php.net to get a copy of this message | ||
Note Submitter: david_kw
Reason: in docs
----
@bobo: Try again. Couple bugs in your example.
<?php
class A{
private $arr_of_objs = array();
public function __construct(){
$this->arr_of_objs[0] = new SomeClass();
$this->arr_of_objs[1] = new SomeClass();
}
public function getNumOfObjs(){
echo count($this->arr_of_objs); // This returns 2
echo "<br>";
echo sizeof($this->arr_of_objs); // This also returns 2.
}
}
$myObj = new A();
$myObj->getNumOfObjs();
?>
It appears that count and sizeof are actually the same in this instance as the manual says.