how to do this with class?

From: Date: Fri, 15 Sep 2000 14:32:06 +0000
Subject: how to do this with class?
Groups: php.dev 
Request: Send a blank email to php-dev+get-33295@lists.php.net to get a copy of this message
Hello i've 2 class : class TC1 {
        var $a = "A";
}; class TC2 {
        var $parent;
        function TC2($p) {
                $this->parent=$p;
                }
        };
c1 = new TC1; c2 = nex TC2($c2); and i will to show $c1->a using $c2 i've tried : echo "$c2->parent->a"; but it doesn't works. i've to use another variable, like this : $aparent=$c2->parent; echo "$aparent->a"; how to do show variable a when calling directly class TC2? Thanks. Olivier ZILLER CRI - Service Informatique de Gestion Universite NANCY2 25 rue Baron Louis BP 454 NANCY CEDEX tel: 03 83 34 46 04 / 06.85.74.89.77 fax : 03 83 30 05 65 e-mail : Olivier.Ziller@univ-nancy2.fr

« previous php.dev (#33295) next »