Justtechjobs.com Find a programming school near you






Online Campus Both


php-windows | 2003112

[PHP-WIN] Class question From: Alex (alexandr <email protected>)
Date: 11/29/03

Hello ALL!
 I tried to make a class in another class something like:

<?php
class A{
  function a(){
    echo "Hello from class A a subclass of ".$this->parent->var1;
  }
}

class B{
  function b(){
    $this->var1="Class B";
    $this->var2=new A();
  }
}

$c=new b();
?>

In this script I use class A inside class B and I want to use
variable from B inside A.

I wanted: Hello from class A a subclass of Class B
But the result is: Hello from class A a subclass of

Is it possible something like: $this->parent->var1 or similar?

-- 
Best regards,
 Alex

-- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php