<?php
chdir(realpath(__DIR__.'/../..'));
require_once './vendor/autoload.php';
use Ite\Collection\ArrayCollection;
$collection = new ArrayCollection();
$collection->set(12);
$collection->set("A");
//var_dump($collection->toArray());
$collection->set("B");
//var_dump($collection->toArray());
$collection2 = new ArrayCollection([1,44,'asd', 5 => PHP_INT_MAX]);
$collection->merge($collection2);
var_dump($collection->toArray());
//$max = $collection->remove(PHP_INT_MAX);
//var_dump($collection->toArray(), $max);
foreach ($collection as $key => $val) {
echo $key.': '.$val.PHP_EOL;
}
|