[PHP-DEV] CLASS Problem From: Bocskai Stefan (bebe <email protected>)
Date: 05/05/00

Hi,
I'm a beginer in PHP and I already have a greate problem with the classes:

Please see this example:

<?

class xx{
var $child;
var $table = array();
var $i;

function xx($i){
  $this->i = $i;
   if ($i<10) $this->child = new xx($i+1);

 }// end of constructor

function propag()
 {
 // this function is auto porpaging into objects
 // and set the value of $table["ABC"];
 $this->table["ABC"] = "1234567890";
 $u = $this->child;
 if (gettype($u) == "object" )
         $u->propag();
 }
 

}//end of class xx

// and then ....

$test = new xx(0);
$test->propag();

$child = $test->child;

$child2 = $child->child;

echo "The value of child is : ".$child2->table["ABC"];
echo "<br> level: ".$child2->i;

?>

Whay I cannot see the value of table["ABC"]? At the same time the
"level" apear ....

Thank you,
Bebe

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>