You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
588 B
PHP
21 lines
588 B
PHP
<?php
|
|
|
|
use jrosset\Collections\InsensitiveCaseKeyCollection;
|
|
use jrosset\Collections\InsensitiveCaseKeyImmutableCollection;
|
|
|
|
require_once __DIR__ . '/../vendor/autoload.php';
|
|
|
|
$readOnlyCollection = new InsensitiveCaseKeyImmutableCollection(
|
|
[
|
|
'Foo' => 'bar',
|
|
'foo' => 'foobar',
|
|
]
|
|
);
|
|
|
|
echo 'Size : ' . $readOnlyCollection->count() . PHP_EOL;
|
|
echo 'Foo = ' . $readOnlyCollection->get('Foo') . PHP_EOL;
|
|
echo '-----' . PHP_EOL;
|
|
|
|
$collection = new InsensitiveCaseKeyCollection($readOnlyCollection);
|
|
$collection->add(28);
|
|
echo 'Size : ' . $collection->count() . PHP_EOL; |