php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #53886 Example is wrong
Submitted: 2011-01-31 03:56 UTC Modified: 2011-01-31 21:29 UTC
From: corrie at sloot dot ca Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS:
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: corrie at sloot dot ca
New email:
PHP Version: OS:

 

 [2011-01-31 03:56 UTC] corrie at sloot dot ca
Description:
------------
---
From manual page: http://www.php.net/function.array-shift#Examples
---
$stack = array("orange", "banana", "apple", "raspberry");
$fruit = array_shift($stack);
print_r($stack);

the last line should be:

print_r($fruit);

otherwise "orange" would also be shown




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-31 11:33 UTC] rquadling@php.net
-Status: Open +Status: Bogus
 [2011-01-31 11:33 UTC] rquadling@php.net
array_shift() will remove the first entry from $stack. "orange" is assigned to $fruit.
 [2011-01-31 21:29 UTC] corrie at sloot dot ca
My bad.  Please ignore.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 22:01:29 2024 UTC