Skip to content
Advertisement

Array of objects within class in PHP

I recently realized my currently approach on a project would greatly improve with the use of better/more descriptive objects. As such, I realized that I want an array of objects to be a member of another class.

Edit: I wasn’t clear as to what my question was. My question is thus: How do I have an array in class LogFile that contains objects of type Match?

JavaScript

Eventually I want to be able to do something like:

JavaScript

How do I do what I described? In other words, what do I need to do in class LogFile to create an array that contains objects of type Match?

Advertisement

Answer

Yeah, that would work.

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement