Czy atrybut klasy moze byc klasa

Mówiąc inaczej, czy poniższe bedzie poprawne?
Kod
class A {
......
}
class B {
var atrybut;
......
function Nowa() {
$this->atrybut= new A();
....
}
}
......
}
class B {
var atrybut;
......
function Nowa() {
$this->atrybut= new A();
....
}
}