Well in this example it will get to an infinite loop, but anyway like
Thomas said you must check into extending classes.
Andy
Thomas Munz wrote:
> Use 'extends' syntax for sub classes
>
> class A {
> var $some_var;
> var $class_B;
> function A(){
> $this->class_B = new B();
> $this->some_var=2;
> }
> }
>
> class B extends A {
> var $class_C;
> function B(){
> $this->A();
> $this->class_C = new C();
> // $this->some_var= some_var_from_class_A; <--
> $this->some_var contains the value allready
> }
> }
>
> class C extends A {
> function C(){
> $this->A();
> // $this->some_var= some_var_from_class_A; <--
> $this->some_var contains the value allready
> }
> }
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php