#41747 [Opn->Bgs]: Performance Issue with Array Removals
| From: | pajoye@php.net | Date: | Wed, 20 Jun 2007 09:16:47 +0000 |
| Subject: | #41747 [Opn->Bgs]: Performance Issue with Array Removals | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-113953@lists.php.net to get a copy of this message | ||
ID: 41747
Updated by: pajoye@php.net
Reported By: martinmrozster at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Performance problem
Operating System: Linux 2.6
PHP Version: 5.2.3
New Comment:
.
Previous Comments:
------------------------------------------------------------------------
[2007-06-20 09:08:37] martinmrozster at gmail dot com
Description:
------------
FOR THE LOVE OF GOD AND ALL THAT IS HOLY
I can't believe your insane stupidity. You are telling me that the
only way of REMOVING AN OBJECT FROM AN ARRAY IS TO USE YOUR OWN CODE?!
WHO IN THEIR RIGHT MIND WRITES A _____HIGH_LEVEL____ LANGUAGE AND
EXCLUDES THE MOST BASIC ARRAY FUNCTIONALITY?! WHERE IN GODS NAME DO
YOU GET THE IDEA THAT YOU ARE EVEN ALLOWED TO LIVE?!?!?!
I HAVE SPENT THE LAST HOUR FINDING OUT THAT unset() DOES NOT UPDATE
THE INICES IN AN ARRAY THAT YOU REMOVE AN OBJECT FROM - I MEAN JESUS
FUCKING CHRIST I THIS IS SO FAR BEYOND INSANE THAT YOU SHOULD BE SHOT
IN THE FACE AND LEFT TO DIE A HORRIBLE PAINFUL DEATH.
Lets calm down for a second and just think to ourselves....
Objective-C NSArray: [obj removeObjectAtIndex:] [arr removeObject]
[arr removeObjectsInRange] AND MORE
.NET: array.removeAt(), array.remove(), array.removeRange, and
FRIENDS.
Ruby: array.remove, array.remove_at
JavaScript: array.splice(index, howMany)
CoreFoundation: CFArrayRemove()
PERL: splice
PHP: INSERT FUNCTION HERE, LIKE, OH I DUNNO, MINE:
function array_remove(&$array, $key) {
$newArray = array();
foreach($array as $dumbassFuckingKey=>$value) {
if($dumbassFuckingKey != $key) {
$newArray[] = $value;
}
}
$array = $newArray;
}
Reproduce code:
---------------
function array_remove(&$array, $key) {
$newArray = array();
foreach($array as $dumbassFuckingKey=>$value) {
if($dumbassFuckingKey != $key) {
$newArray[] = $value;
}
}
$array = $newArray;
}
Expected result:
----------------
Well, I EXPECTED YOU TO PROVIDE ME A FUCKING FUNCTION TO REMOVE A VALUE
FROM A GOD DAMNED ARRAY.
Actual result:
--------------
YOU DIDNT.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41747&edit=1