note 11084 rejected from language.oop by sander

From: Date: Sat, 06 Apr 2002 18:57:15 +0000
Subject: note 11084 rejected from language.oop by sander
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-28730@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"

« previous php.notes (#28730) next »