Doc #63554 [Nab]: Is SplObjectStorage ordered?
| From: | francois dot gannaz at silecs dot info | Date: | Mon, 14 Jan 2013 14:49:04 +0000 |
| Subject: | Doc #63554 [Nab]: Is SplObjectStorage ordered? | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-9401@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63554&edit=1
ID: 63554
User updated by: francois dot gannaz at silecs dot info
Reported by: francois dot gannaz at silecs dot info
Summary: Is SplObjectStorage ordered?
Status: Not a bug
Type: Documentation Problem
Package: SPL related
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Thank you for your comment. Would it be possible to add this explanation to the documentation? Even
one short sentence would be make it clearer that the map may not be iterable by insertion order.
Previous Comments:
------------------------------------------------------------------------
[2013-01-12 05:00:31] frozenfire@php.net
SplObjectStorage is implemented using an array as its internal storage mechanism,
so one could consider it ordered. However, its purpose is more for to provide a
mechanism whereby an object exist in the set or not, with no concerns for
duplication in the set.
I do not believe that the order of the set is relevant to its purpose. Its order
in the set is determined entirely by the order in which the objects were
attached. This is incidental, rather than intentional.
------------------------------------------------------------------------
[2012-11-18 20:19:48] francois dot gannaz at silecs dot info
Description:
------------
The documentation describes SplObjectStorage as "a map from objects to data". Is this map
ordered or not? As it seems to be ordered, at least with the PHP version I tested with, can we rely
on this undocumented feature for future releases and different OS? Please detail this main
characteristic.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63554&edit=1