php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #77233 All functions taking Traversables should be changed to accept Iterables
Submitted: 2018-12-03 12:04 UTC Modified: 2020-11-03 13:56 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
41 + 10 = ?
Subscribe to this entry?

 
 [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

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-03 13:56 UTC] cmb@php.net
-Type: Bug +Type: Feature/Change Request
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 13:01:28 2024 UTC