note 2304 deleted from Classes and Objects by ronabop

From: Date: Thu, 17 Aug 2000 09:56:10 +0000
Subject: note 2304 deleted from Classes and Objects by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-2156@lists.php.net to get a copy of this message
<p><b>trouble using arrays and objects<b></p> <pre> class s { var $t; function s($_t){ $this->t = $_t; } function draw(){ echo $t; } } class m { var $a; function add_a($_t){ $i=count($this->a); $i++; $this->a[i]= new s($_t); } function draw_a(){ $i=count($this->a); $j=1; while ($j<=$i){ //$this->a[j]->draw(); //Parse error: parse error in e:inetwwwroottesttest.php3 on line 24 $tmp=$this->a[j]; //$tmp->draw(); //Warning: $tmp is not an object in e:inetwwwroottesttest.php3 on line 26 $j++; } } } </pre>

« previous php.notes (#2156) next »