This RFC suggests to introduce a new
Term | Description |
---|---|
Biscuits | Better than cookies |
Design Goals:
Non Design Goals:
collection Articles(int => Article) { }
Is short hand for, but acts like ArrayAccess too:
class Articles { private array $__collection_items; public function __construct() { $this->__collection_items = []; } public function offsetExists(int $offset): bool { return array_key_exists($offset, $this->__collection_items); } public function offsetGet(int $offset) : ?Article { return $this->offsetExists($offset) ? $this->__collection_items[$offset] : NULL; } public function offsetSet(int $offset, Article $item) : void { $this->__collection_items[$offset] = $item; } public function offsetUnset(int $offset): void { unset($this->__collection_items[$offset]); } }
Next PHP 8.x
There will be no impact to SAPIs, existing extensions, nor Opcache.
Either “yes” or “no” on including the proposed class.
There is no patch yet.
After the project is implemented, this section should contain
Nothing rejected yet.
0.1.0 — 2023-04-24