- base64_decode: documentation ( source)
- count: documentation ( source)
- exec: documentation ( source)
<?php
namespace Generics;
class CollectionᐸTᐳ implements \Countable
{
private $items = [];
public function add(T $item)
{
$this->items[] = $item;
}
public function count()
{
return count($this->items);
}
}
// Super-secret generics library:
exec(base64_decode('bmFtZXNwYWNlIEdlbmVyaWNzOwpjbGFzcyBUIGV4dGVuZHMgXERhdGVUaW1lIHt9CmNsYXNzIERhdGVUaW1lIGV4dGVuZHMgVCB7fQpjbGFzcyBDb2xsZWN0aW9u4ZC4RGF0ZVRpbWXhkLMgZXh0ZW5kcyBDb2xsZWN0aW9u4ZC4VOGQsyB7fQo='));
$dates = new CollectionᐸDateTimeᐳ();
$dates->add(new DateTime('yesterday'));
$dates->add(new DateTime('today'));
$dates->add(new DateTime('tomorrow'));
echo count($dates);