inscure / collection
Installs: 19
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/inscure/collection
This package is not auto-updated.
Last update: 2025-09-27 22:12:26 UTC
README
Collection
Objective implementation of arrays in PHP
Installation
Composer
{ "require": { "inscure/collection": "1.2.1" } }
Usages
<?php $array = new Collection\Collection(array(1, 2, 3, 4, 5)); echo $array->get(4); // 5 echo count($array); // 5 foreach($array as $key => $value) { echo $key . '=>' . $value . '<br />'; } // 0 => 1 // 1 => 2 // 2 => 3 // 3 => 4 // 4 => 5 $array[0] = null; foreach($array as $key => $value) { echo $key . '=>' . $value . '<br />'; } // 0 => // 1 => 2 // 2 => 3 // 3 => 4 // 4 => 5