Currently browsing

MVC Developers Part 9 – Varien Data Collections

Originally as a PHP programmer, if you wanted to gather together a group of related variables that you had a choice, the venerable Array. Although it shares a name with C's array of memory addresses, a PHP array is a general purpose dictionary like object with the behavior of a numerically indexed array variable.

In other languages, the choice is not so simple. You have several data structures to choose from, each with specific advantages in storage, speed and semantics. The PHP philosophy was to remove that choice from the client programmer and give them a useful data structure that was “good enough”. I have long held that PHP arrays are a major reason for the popularity of the platform.