php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77233 All functions taking Traversables should be changed to accept Iterables
Submitted: 2018-12-03 12:04 UTC Modified: -
From: Wes dot nospam at example dot org Assigned:
Status: Open Package: *Programming Data Structures
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Wes dot nospam at example dot org
New email:
PHP Version: OS:

 

 [2018-12-03 12:04 UTC] Wes dot nospam at example dot org
Description:
------------
I think all functions that currently take Traversable arguments were meant to include also arrays.

If I recall correctly, `Traversable|array` is implemented somewhere, but not everywhere.

There is no reason to be selective with Traversables only, given that both Iterables and Traversables have just marker interfaces (with no methods).

For example, iterator_to_array($iterable) should just return the array as is.

Thank you


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Wed Dec 19 03:01:26 2018 UTC