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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
47 - 7 = ?
Subscribe to this entry?

 
 [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: Sun Apr 28 16:01:31 2024 UTC