Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • So, you've made a fancy array? Commented Jun 8, 2012 at 19:39
  • This is not an elegant way to do this, at the very least, you need to make __construct private so none else can create monsters. Commented Jun 8, 2012 at 20:03
  • @JuanMendes agree, more correct code in Björn's answer - here is just example to show the idea. Commented Jun 8, 2012 at 20:12