Doc #53886 [Opn->Bgs]: Example is wrong

From: Date: Mon, 31 Jan 2011 10:33:41 +0000
Subject: Doc #53886 [Opn->Bgs]: Example is wrong
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-5894@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53886&edit=1 ID: 53886 Updated by: rquadling@php.net Reported by: corrie at sloot dot ca Summary: Example is wrong -Status: Open +Status: Bogus Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant Block user comment: N Private report: N New Comment: array_shift() will remove the first entry from $stack. "orange" is assigned to $fruit. Previous Comments: ------------------------------------------------------------------------ [2011-01-31 03:56:55] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53886&edit=1

« previous php.doc.bugs (#5894) next »