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
 [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-2020 The PHP Group
All rights reserved.
Last updated: Wed Apr 08 16:01:25 2020 UTC