Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64109 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31256 invoked from network); 29 Nov 2012 17:34:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Nov 2012 17:34:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.170 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.217.170 mail-lb0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:37218] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BA/C5-08727-D8C97B05 for ; Thu, 29 Nov 2012 12:34:06 -0500 Received: by mail-lb0-f170.google.com with SMTP id j14so12188443lbo.29 for ; Thu, 29 Nov 2012 09:34:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=F0DyAEQUAhE3qVgEwa5olflCvhLH5g92dFRsqB7MXk8=; b=PdEQSl5K6OVTievjWHFEil0WgXvNr/jODEirk4VmFSoELe8Hsucme8q5ZNY70UJSI+ nC9vdStkroXBfJrhRxhM0THElUukxM98VbEhMQpgH6klMTueOPmrF7LIjwW77tasSuJu YYQhy+Sasapn12TvCqf5zLDlhLk6n83KA6J2U4sjFe6ubmRuEZn7SU11jst4vcP8b2U8 Fq0xaGnhbDFAqt74mby232lwAi0hUi/S4f/VLQKbML9BVAuUDn3IsFIplP7UT3T85qnI 6FRCl4Ov+wUk8oNqXt5qB5YrgnQUWti5uOhgTMWqn3EEPe3lVkuSHnt90meM2WejHmCQ BI+Q== MIME-Version: 1.0 Received: by 10.112.49.202 with SMTP id w10mr9399026lbn.2.1354210442875; Thu, 29 Nov 2012 09:34:02 -0800 (PST) Received: by 10.112.23.4 with HTTP; Thu, 29 Nov 2012 09:34:02 -0800 (PST) In-Reply-To: References: Date: Thu, 29 Nov 2012 10:34:02 -0700 Message-ID: To: Rafael Dohms Cc: PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] SplDoublyLinkedList missing insertBefore/After From: morrison.levi@gmail.com (Levi Morrison) On Thu, Nov 29, 2012 at 4:38 AM, Rafael Dohms 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.