Bug #78274 [Com]: iterator_to_array($array) should return the $array

From: Date: Thu, 11 Jul 2019 07:32:24 +0000
Subject: Bug #78274 [Com]: iterator_to_array($array) should return the $array
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-221700@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78274&edit=1 ID: 78274 Comment by: daverandom@php.net Reported by: Wes dot nospam at example dot org Summary: iterator_to_array($array) should return the $array Status: Open Type: Bug Package: *General Issues PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Worth noting that the function is named *iterator*_to_array(), not *iterable*_to_array(). I'm not necessarily against extending the functionality like this, but in that case for consistency I would rather rename this function iterable_to_array() and retain iterator_to_array() as an alias. Previous Comments: ------------------------------------------------------------------------ [2019-07-11 06:51:13] Wes dot nospam at example dot org Description: ------------ Argument 1 passed to iterator_to_array() must implement interface Traversable, array given. Would be great to improve the behavior, possibly as follows: iterator_to_array($array, TRUE); must return the array as is, iterator_to_array($array, FALSE); must return array_values($array) Thank you in advance ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78274&edit=1

« previous php.bugs (#221700) next »