PHP Classes

Simple Array: Manage arrays with keys of any type

Recommend this page to a friend!
  Info   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 488 All time: 5,877 This week: 361Up
Version License PHP version Categories
simple-array 1.0.0GNU General Publi...5.3PHP 5, Data types


This class can manage arrays with keys of any type.

It provides interfaces to access arrays with regular PHP array functions but internally it stores array keys and entry values in separate arrays, so it avoids PHP automatic casting of array keys to integer or string values.

The class can find entries with given key values by searching the internal keys array, so entries with keys of different types represent different array entries.

Innovation Award
PHP Programming Innovation award nominee
January 2012
Number 3

Prize: One copy of the Zend Studio
In PHP arrays may have keys of either integer or string types. If you use values of other types as keys, PHP will cast the type of key values.

This class provides a workaround to this limitation by implementing an array interface that internally uses a separate array for keys and another for values, so keys can be of any type.

Manuel Lemos
Picture of Martin Lacroix
Name: Martin Lacroix <contact>
Classes: 4 packages by
Country: France France
Age: 47
All time rank: 178751 in France France
Week rank: 398 Up12 in France France Up
Innovation award
Innovation award
Nominee: 2x

  Files folder image Files  
File Role Description
Accessible without login Plain text file Example.php Example Short example
Plain text file SimpleArray.php Class Main class - With description

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:5,877
This week:361Up