php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #74002 Add function for deleting item from array by value
Submitted: 2017-01-26 11:41 UTC Modified: 2017-01-27 18:40 UTC
From: kevas777 at mail dot ru Assigned:
Status: Suspended Package: Arrays related
PHP Version: 7.1.1 OS: *
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-01-26 11:41 UTC] kevas777 at mail dot ru
Description:
------------
Please add new function with deleting item from array by value. i know that i can find key of item and then unset it...or flit keys and values unset, and again i must to flip array. In any case i must to right 3-4 lines of code only for deleting item from array. Please i want func that delete it without this lines. For example array_delete_item(array &$arr, object $value)

Test script:
---------------
$arr = array_flip($arr);
unset($arr[$value]);
$arr=array_flip($arr);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-27 18:40 UTC] cmb@php.net
-Summary: Please add new function with deleting item from array +Summary: Add function for deleting item from array by value -Status: Open +Status: Suspended -Package: *General Issues +Package: Arrays related -Operating System: WIndows 7 +Operating System: *
 [2017-01-27 18:40 UTC] cmb@php.net
IMO, adding yet another array function (particularly one that can
easily implemented in userland) should require the RFC process[1],
so please do that. Meanwhile, I'm suspending this ticket.

[1] <https://wiki.php.net/rfc/howto>
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Aug 14 21:01:24 2020 UTC