Re: Proposal for aggregation vs. MI

From: Date: Thu, 11 Apr 2002 22:42:26 +0000
Subject: Re: Proposal for aggregation vs. MI
References: 1 2 3  Groups: php.dev 
Request: Send a blank email to php-dev+get-82632@lists.php.net to get a copy of this message
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

« previous php.dev (#82632) next »