At 00:12 12/04/2002 +0200, Stig S. Bakken wrote:

>* Dealing with possible loops:
>
>class a aggregates b {}
>class b aggregates a {}
>
>$a = new a;
>$a->unknown_method();
>
>Should it be illegal to "loop-aggregate" classes, or should it be
>detected at runtime?  I'm not sure.

It can't really be detected but it's the same as doing:

class foo {
         function foo()
         {
                 $this->bar = new foo();
         }
}

There are lots of ways of shooting yourself in the foot. Simple recursion 
will do the trick too.

Andi


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to