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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kevas777 at mail dot ru
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Fri Mar 14 15:01:30 2025 UTC