|  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
From manual page:
$stack = array("orange", "banana", "apple", "raspberry");
$fruit = array_shift($stack);

the last line should be:


otherwise "orange" would also be shown


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-31 11:33 UTC]
-Status: Open +Status: Bogus
 [2011-01-31 11:33 UTC]
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-2021 The PHP Group
All rights reserved.
Last updated: Tue Aug 03 08:01:25 2021 UTC