I wish to define a class where one local variable is an instance of another class.
Consider this a way to define a complex object by the composition of more less-complex objects.
Seems the way is 'classes/objects association' (see http://www.phpbuilder.com/manual/ref.objaggregation.php)
This feature is experimental, they say.
Seem to me it's not working.
Following that definition, I write:
class Myclass1 {
var $a;
var $b;
function foo() { .... }
}
class Myclass2 {
var $obj1 = new Myclass1; //this line returns parser error
var $notobject;
}
The parser gives an error where is the comment.
Does anybody use classes associations ? Are they working ?
Is there another way to do the same without problems ?