|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
24 + 41 = ?
Subscribe to this entry?

 [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-2023 The PHP Group
All rights reserved.
Last updated: Sun Dec 03 02:01:26 2023 UTC