|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #60759 SplDoublyLinkedList->clear()
Submitted: 2012-01-15 03:26 UTC Modified: 2021-07-26 16:31 UTC
Avg. Score:3.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: Assigned:
Status: Open Package: SPL related
PHP Version: 5.4.0RC5 OS: N/A
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2012-01-15 03:26 UTC]
The patch adds a reset() method to the SplDoublyLinkedList class.
This allows the internal list to be wiped cleaned for reuse.

Test script:
$d = new SplDoublyLinkedList();


Actual result:
$d = new SplDoublyLinkedList();



spl_dllist_clear (last revision 2012-01-15 22:37 UTC by
spl_dllist_reset (last revision 2012-01-15 03:26 UTC by dragoonis)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-01-15 22:29 UTC]
-Summary: SplDoublyLinkedList->reset() +Summary: SplDoublyLinkedList->clear()
 [2012-01-15 22:29 UTC]
Renaming the reset() method to clear()
 [2012-01-15 22:37 UTC]
I think it's much more appropriate to rename this to clear() as it implies wiping 
contents of something. The original idea of reset() wasn't a good one as the term 
'reset' in PHP usually refers to resetting an internal pointer of a list.

New patch attached as spl_dllist_clear.
 [2012-01-15 22:37 UTC]
The following patch has been added/updated:

Patch Name: spl_dllist_clear
Revision:   1326667071
 [2012-07-28 22:12 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: colder
 [2012-07-28 22:14 UTC]
Thanks for getting this merged into a version branch Felipe. Paul.
 [2012-07-28 22:29 UTC]
It hasn't been merged, yet. Just assigned to the SPL maintainer.
 [2014-02-27 04:54 UTC]
-Assigned To: colder +Assigned To: levim
 [2017-10-24 08:09 UTC]
-Status: Assigned +Status: Open -Assigned To: levim +Assigned To:
 [2021-07-26 16:31 UTC]
Apparently, this ticket has been forgotten.  If you're still
interested in this, I suggest to submit a pull request[1].

[1] <>
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Feb 25 20:01:28 2024 UTC