Building an Array Object Class

July 31st, 2018  –  Comments Off on Building an Array Object Class

Having spent several years now working with the excellent Laravel platform, one of the features I tend to miss the most on non-Laravel projects is the Collection class. Sometimes I end up building my own, or going in search of some similar solution built by someone else, but today I thought I would demonstrate how someone might build an array manipulation class for themselves.

You should be somewhat familiar with the basic concept of PHP classes and objects since this lesson will make extensive use of class methods. But, if you aren’t familiar with them, maybe this lesson can help you understand the power that they can hold.

So, with no further introduction, let’s dive right in.

Read the rest of this entry »