|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1373 mixed if: endif; /if{} blocks parse error when nested
Submitted: 1999-05-03 14:22 UTC Modified: 1999-06-20 20:33 UTC
From: markjr at easydns dot com Assigned:
Status: Closed Package: Parser error
PHP Version: 3.0 Latest CVS (03/05/1999) OS: Redhat 5.2
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: markjr at easydns dot com
New email:
PHP Version: OS:


 [1999-05-03 14:22 UTC] markjr at easydns dot com
(I've commented out the rest of this class and look at
it with application/x-httpd-php3-source .phps)

This parses fine:

if($this->fp = fsockopen($this->SERVER, $this->PORT, &$this->ERRNO, &$this->ERRMSG)):
        fputs($fp, "GET $this->REQUEST $this->PROTO\n\n");
        while(!feof($this->fp)) {
                    $this->result.= fgets($this->fp,128);
         # if($this->DEBUG) { echo $this->result; } 
        logit( "ERROR: submitting $field[domain] message was: $this->ERRMSG");

Now uncomment the line with if($this->DEBUG), I get
a parser error. I've noticed this happened to me on
occassion before, but I never got around to paring it
down to a few lines to reproduce it.

Move that exact uncommented line outside of the nesting
if:/endif; block and it also parses fine. In fact, moving
it into the else: block and it also parses fine. 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1999-06-20 20:33 UTC] jim at cvs dot php dot net
The problem is that you can't do "if (cond) { stuff; } else: something_else();",
which is what you are trying to do. With your line commented
out, the "else:" gets associated with the initial "if():".

 [1999-06-20 20:33 UTC] jim at cvs dot php dot net
Whoops, forgot to close.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Oct 01 10:01:24 2023 UTC