|
Posted by C. on 10/08/06 09:34
Jayman777@gmail.com wrote:
>
> $this->array_of_days = array();
> for ($i = 1; $i < num_days_in_month + 1; $i++)
> {
> $this->array_of_days[$i] = new Day(mktime(00, 00, 00, $in_date['mon'],
> $i, $in_date['year']));
> }
> /* Unrelated code */
> $day_object = $this->array_of_days[$index];
> $day_object->addEvent($event);
>
It's kind of weird in PHP4 - even though objects are passed as copies
by default, arrays only seem to hold references. You could explicitly
assign a reference to the variable but unless you've got a good reason
to create another reference to the object, just use the one youv'e got
already:
$this->array_of_days[$index]->addEvent($event);
C.
Navigation:
[Reply to this message]
|