note 128033 added to class.spldoublylinkedlist

From: Date: Wed, 21 Dec 2022 01:22:39 +0000
Subject: note 128033 added to class.spldoublylinkedlist
Groups: php.notes 
Request: Send a blank email to php-notes+get-219990@lists.php.net to get a copy of this message
A function which replaces some portion od doubly linked list (DLL) with items from specified array. <?php /** * Replace some portion (specified by index and length) of DLL with items * from the specified replacement array. */ public function dll_splice( \SplDoublyLinkedList $dll, int $start, int $length, array $replacement, ): void { if ($start < 0 || ($start + $length) > $dll->count()) { throw new \OutOfRangeException("Invalid range for splicing"); } for ($i = 0; $i < $length; $i++) { $dll->offsetUnset($start); } foreach ($replacement as $item) { $dll->add($start, $item); } } ?> ---- Server IP: 45.112.84.4 Probable Submitter: 185.85.3.54 (proxied: 188.175.217.55) ---- Manual Page -- https://php.net/manual/en/class.spldoublylinkedlist.php Edit -- https://main.php.net/note/edit/128033 Del: integrated -- https://main.php.net/note/delete/128033/integrated Del: useless -- https://main.php.net/note/delete/128033/useless Del: bad code -- https://main.php.net/note/delete/128033/bad+code Del: spam -- https://main.php.net/note/delete/128033/spam Del: non-english -- https://main.php.net/note/delete/128033/non-english Del: in docs -- https://main.php.net/note/delete/128033/in+docs Del: other reasons-- https://main.php.net/note/delete/128033 Reject -- https://main.php.net/note/reject/128033 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#219990) next »