Re: SplDoublyLinkedList missing insertBefore/After
| From: | Levi Morrison | Date: | Thu, 29 Nov 2012 17:34:02 +0000 |
| Subject: | Re: SplDoublyLinkedList missing insertBefore/After | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-64109@lists.php.net to get a copy of this message | ||
On Thu, Nov 29, 2012 at 4:38 AM, Rafael Dohms <listas@rafaeldohms.com.br> wrote:
> I have just noticed that the current SPL inplementation of a
> DoublyLinkedList does not include methods to insert nodes into the middle
> of the list (insertBefore, insertAfter).
>
> After mentioning it I ran into a few people and other outbursts on the
> internet of more people who saw this and complained about it.
>
> I found a bug from 2009 (https://bugs.php.net/bug.php?id=48358) which
> mentions the case and has no Core response at all.
>
> I ask two questions:
>
> 1) Why was this bug never replied to, is there some reason these methods
> should not be implemented?
>
> 2) Is anyone willing to put up a patch for this? I imagine that if you are
> familiar with C and PHP source this is a quick implementation as its
> standard logic documented everywhere.
I am creating a library in PHP code that includes a linked list with
this feature
(https://github.com/morrisonlevi/PHP-Datastructures/blob/master/src/Spl/LinkedList.php).
I'd love for you to use it while you wait for the core to be patched
and give me some feedback.