php.net |  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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
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++ ) {  ...  }

Patches

Pull Requests

History

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-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 06:01:27 2025 UTC