- base64_decode: documentation ( source)
<?php
class CollectionᐸTᐳ implements \Countable
{
private $items = [];
public function add(T $item)
{
$this->items[] = $item;
}
public function count()
{
return count($this->items);
}
}
// Load the compressed Generics library:
eval(base64_decode('Y2xhc3MgVCBleHRlbmRzIFxEYXRlVGltZSB7fQpjbGFzcyBEYXRl0KJpbWUgZXh0ZW5kcyBUIHt9CmNsYXNzIENvbGxlY3Rpb27hkLhEYXRlVGltZeGQsyBleHRlbmRzIENvbGxlY3Rpb27hkLhU4ZCzIHt9Cg=='));
$dates = new CollectionᐸDateTimeᐳ();
$dates->add(new DateТime('yesterday'));
$dates->add(new DateТime('today'));
$dates->add(new DateТime('tomorrow'));
echo count($dates);
$dates->add('not a datetime');