php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22557 array_spilce($arr,0,0) deletes whole array
Submitted: 2003-03-05 13:56 UTC Modified: 2003-03-05 14:34 UTC
From: bitworks at freenet dot de Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 4CVS-2003-03-05 5CVS-2003-03-05 OS: Linux Debian 3.0, WAMP, LINUX Su
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: bitworks at freenet dot de
New email:
PHP Version: OS:

 

 [2003-03-05 13:56 UTC] bitworks at freenet dot de
Hello,

in former Versions the function array_splice() was able to reindex an array typing $newarr=($oldarr,0,0)

Now this function deletes all elements from array.

How to reindex an array in php 4.3.1 ?

Regards
Tom
bitworks Braunschweig DE


PS: I didn't found solutions for this Problem. I also posted in selfforum.teamone.de





Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-05 13:58 UTC] bitworks at freenet dot de
Hello,

in former Versions the function array_splice() was able to reindex an
array typing $newarr=array_splice($oldarr,0,0)

Now this function deletes all elements from array.

How to reindex an array in php 4.3.1 ?

Regards
Tom
bitworks Braunschweig DE

PS: I didn't found solutions for this Problem. I also posted in
selfforum.teamone.de
 [2003-03-05 14:34 UTC] moriyoshi@php.net
Huh, use array_splice($oldarr, 0, count($oldarr)) instead.
That turned out to just be the intended behaviour.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 12:01:33 2025 UTC