https://github.com/kuria/iterable
Utilities for dealing with PHP's iterators and the iterable type
https://github.com/kuria/iterable
array iterable list php
Last synced: about 2 months ago
JSON representation
Utilities for dealing with PHP's iterators and the iterable type
- Host: GitHub
- URL: https://github.com/kuria/iterable
- Owner: kuria
- License: mit
- Created: 2018-09-16T21:42:23.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-04-22T14:38:40.000Z (about 3 years ago)
- Last Synced: 2025-08-22T01:32:23.173Z (10 months ago)
- Topics: array, iterable, list, php
- Language: PHP
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- License: LICENSE
Awesome Lists containing this project
README
Iterable
########
Utilities for dealing with PHP's iterators and the iterable type.
.. image:: https://travis-ci.com/kuria/iterable.svg?branch=master
:target: https://travis-ci.com/kuria/iterable
.. contents::
Features
********
- converting iterable values to arrays
- caching iterator
Requirements
************
- PHP 7.1+
Usage
*****
``IterableHelper::toArray()``
=============================
Convert an iterable value to an array.
.. code:: php
`_
or other non-rewindable traversables.
.. code:: php
29
[1] => 107
[2] => 249
)
Array
(
[0] => 29
[1] => 107
[2] => 249
)
int(3)
.. NOTE::
Your numbers will vary, but the output is meant to demonstrate that
the yielded pairs have indeed been cached.