php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #1878 array does not work
Submitted: 1999-07-26 10:11 UTC Modified: 1999-07-26 15:38 UTC
From: frank at freestyling dot de Assigned:
Status: Closed Package: Documentation problem
PHP Version: 3.0.11 OS: freebsd 3.0
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: frank at freestyling dot de
New email:
PHP Version: OS:

 

 [1999-07-26 10:11 UTC] frank at freestyling dot de
$fruits = array("lemon","orange","banana","apple");
                        sort($fruits);
                        for(reset($fruits); $key = key($fruits); next($fruits)) {
                            echo "fruits[$key] = ".$fruits[$key]."\n";
                        }

does not work !!!!
there is no ouput !!!

++ plus 

the FAQ on www.php3.de is not correctly displayed

<b>Fatal error</b>:  Call to unsupported or undefined function set_magic_quotes_runtime() in <b>/home/pages/php3.de/phpweb/FAQ.php3</b> on line <b>9</b><br>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-07-26 15:38 UTC] rasmus at cvs dot php dot net
The key of the first array element will be 0 and thus your condition for looping will be false.
Use: while(list($key,$value)=each($fruits)) { echo "fruits[$key] = ".$value."\n"; }
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 26 16:01:30 2024 UTC