Re: simple question

From: Date: Tue, 26 Jun 2001 21:24:10 +0000
Subject: Re: simple question
References: 1  Groups: php.gtk 
Request: Send a blank email to php-gtk+get-1976@lists.php.net to get a copy of this message
Try.. class example { var $i; function example(){ $this->i=0; } function plus(){ $this->i++; } function minus(){ $this->i--; } } Regards MarkL On Tue, 26 Jun 2001 16:20:30 +0200 "Thetten David" <dthetten@hotmail.com> wrote: > i have a > class example > { > var $i; > function example() > { $i=0; } > function plus > { $i++; } > function moins > { $i--; } > } > but when i call function moins after function plus , $i has taken the zero > value ; i suppose this is because of the garbage collector but i need to > know how to make $i keep its value ( like in c++ for example ) > can anyone help me > thanks > david > > > _________________________________________________________________________ > Get Your Private, Free E-mail from MSN Hotmail at > http://www.hotmail.com. > > > -- > PHP GTK Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-gtk-unsubscribe@lists.php.net > For additional commands, e-mail: php-gtk-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.gtk (#1976) next »