|  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
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.
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-2023 The PHP Group
All rights reserved.
Last updated: Tue Nov 28 20:01:27 2023 UTC