Stuka
09-06-2001, 05:19 PM
I'm having a problem with the following code:function add_part($part){
for ($i = 0; $i < count($this->part_list); $i++){
$temp =& $this->part_list[$i];
if ($temp->pn == $part->pn){
$temp->qty += $part->qty;
return;
}
}
$this->part_list[] = $part;
print_r($this->part_list);
} This runs fine here @ work (on a Win2k/IIS setup) under PHP 4.0.6. However, when I run it on the web site (pair networks FreeBSD/Apache) under PHP 4.0.3, it does weird things. Specifically, items are being deleted from the array. Is this a known issue or change, or is there something more subtle going on here?
TIA,
Stuka
for ($i = 0; $i < count($this->part_list); $i++){
$temp =& $this->part_list[$i];
if ($temp->pn == $part->pn){
$temp->qty += $part->qty;
return;
}
}
$this->part_list[] = $part;
print_r($this->part_list);
} This runs fine here @ work (on a Win2k/IIS setup) under PHP 4.0.6. However, when I run it on the web site (pair networks FreeBSD/Apache) under PHP 4.0.3, it does weird things. Specifically, items are being deleted from the array. Is this a known issue or change, or is there something more subtle going on here?
TIA,
Stuka