|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #595 Parser error in for()
Submitted: 1998-07-29 12:02 UTC Modified: 1998-07-29 13:01 UTC
From: mbrennen at fni dot com Assigned:
Status: Closed Package: Parser error
PHP Version: 3.0.2a OS: Linux 2.0.x
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.
Block user comment
Status: Assign to:
Bug Type:
From: mbrennen at fni dot com
New email:
PHP Version: OS:


 [1998-07-29 12:02 UTC] mbrennen at fni dot com
The following script gives a parser error:

for ( $i = 0;  $i < $k;  $i++; ) {  ...  }

Removing the semicolon after $i++ fixes it:

for ( $i = 0;  $i < $k;  $i++ ) {  ...  }


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1998-07-29 13:01 UTC] rasmus
How the heck is this a bug?  The 'for' construct is defined as for(expr;expr;expr) { }  An extra semi-colon does not match this definition.  Find me another language with a C-style for-construct that will accept your syntax and I will give you a cookie.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 15:01:29 2024 UTC