php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #1591 bigmanual.html -- rsort example
Submitted: 1999-06-23 17:36 UTC Modified: 1999-06-23 17:39 UTC
From: joel at mobila dot cx Assigned:
Status: Closed Package: Documentation problem
PHP Version: 3.0.9 OS: Linux 2.2.9
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: joel at mobila dot cx
New email:
PHP Version: OS:

 

 [1999-06-23 17:36 UTC] joel at mobila dot cx
This is the example code for rsort:
    $fruits = array("lemon","orange","banana","apple");
    rsort($fruits);
    for(reset($fruits); ($key,$value) = each($fruits); ) {
        echo "fruits[$key] = ".$value."\n";
    }

When I tried this I got the following error:
Parse error: parse error in /home/www/htdocs/test.php3 on line 6

Sorry. But I have no idea what causes this problem. I began learning PHP3 today... =) (...and I'm allready reporting bugs :)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-06-23 17:39 UTC] andrey at cvs dot php dot net
You need to have:
list($key, $value)

instead of

($key, $value)

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 29 09:01:30 2024 UTC