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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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: Sat Sep 28 23:01:27 2024 UTC