note 11083 deleted from language.operators by jimw
| From: | jimw@php.net | Date: | Tue, 18 Dec 2001 20:51:17 +0000 |
| Subject: | note 11083 deleted from language.operators by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-23214@lists.php.net to get a copy of this message | ||
see this:
class CartItem{
var $count;
function reset(){
$this->count=0;
...
}
}
this works only in php4:
class Cart{
var $cartitems;
function reset(){
while (list ($idx,$ci ) =each($cartitems)) $this->cartitems[$idx]->reset();
....
}
}
but this trick can solve it:
var $cartitems;
function reset(){
while (list ($idx,$ci ) =each($cartitems)) $this->php3trick($cartitems[$idx]);
}
function php3trick(&$cartitem){
$cartitem->reset();
}
}
"in other words you can only use references in function calls in php3"