php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12116 Array_slice acts as array_splice
Submitted: 2001-07-12 17:37 UTC Modified: 2001-07-12 18:05 UTC
From: tom at fluxxx dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.0.6 OS: Win2k Server Advance/ IIS 5.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tom at fluxxx dot com
New email:
PHP Version: OS:

 

 [2001-07-12 17:37 UTC] tom at fluxxx dot com
//returns pear
$f=array("orange","apple","pear","banana");
$output=array_splice($f,2,1);
foreach($output as $d){
	echo $d."<BR>";
}

//also returns pear
$f=array("orange","apple","pear","banana");
$output=array_slice($f,2,1);
foreach($output as $d){
	echo $d."<BR>";
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-12 17:44 UTC] tom at fluxxx dot com
I misunderstood the functionality of array_slice and array_splice.  This behavior is as intended.
 [2001-07-12 18:05 UTC] derick@php.net
Not a bug, so bogus
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 23:01:26 2024 UTC