Date: 05/05/00
- Next message: Faisal Nasim: "Re: [PHP-DEV] Question about Cookies"
- Previous message: jdurham <email protected>: "[PHP-DEV] PHP 4.0 Bug #4336: Compile Error in zend_execute.h"
- Next in thread: Randy Jonasz: "Re: [PHP-DEV] CLASS Problem"
- Reply: Randy Jonasz: "Re: [PHP-DEV] CLASS Problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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>
- Next message: Faisal Nasim: "Re: [PHP-DEV] Question about Cookies"
- Previous message: jdurham <email protected>: "[PHP-DEV] PHP 4.0 Bug #4336: Compile Error in zend_execute.h"
- Next in thread: Randy Jonasz: "Re: [PHP-DEV] CLASS Problem"
- Reply: Randy Jonasz: "Re: [PHP-DEV] CLASS Problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

