I was wondering if it is allowed to create an instance of a class inside another class.
Or, do I have to create it outside and then pass it in through the constructo
It's impossible to create a class in another class in PHP. Creating an object(an instance of a class) in another object is a different thing.