array_splice() BUG or Future ?
| From: | Kachalov Anton | Date: | Wed, 03 Apr 2002 17:55:12 +0000 |
| Subject: | array_splice() BUG or Future ? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-82061@lists.php.net to get a copy of this message | ||
Hi 2 all!
I have some problems with functions, which uses low-level function php_splice() in
ext/standard/array.c
This code will produce:
Array
(
[0] => elem1
[1] => elem2
)
instead of:
Array
(
[32] => elem1
[54] => elem2
)
<?
$array =
array("32"=>"elem1","54"=>"elem2","23"=>"elem3","92"=>"elem4","3"=>"elem5");
//print_r($array); outputs array with normal key => data
echo "\n\n";
reset($array);
array_splice($array, 2); // outputs array with index => data
print_r($array);
?>
What does it mean ?
Rgds,
Anton
--
ALTLinux Team
http://www.altlinux.ru
LRN Team
http://www.lrn.ru