php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18413 Cobination of nested IF statement fails
Submitted: 2002-07-18 11:47 UTC Modified: 2002-07-18 13:41 UTC
Votes:3
Avg. Score:3.7 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:0 (0.0%)
From: mark at pictura-dp dot nl Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 4.2.1 OS: Linux SuSE 8.0
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2002-07-18 11:47 UTC] mark at pictura-dp dot nl
I think nothing's wrong with the following syntax:
<?php
  $foo="bug?";
  if($foo=="nobug"):
    echo "No Bug :)";
  elseif(substr($foo,0,3)=="bug"):
    if($foo=="bug?") {
      echo "Bug :(";
    }
  else:
    echo "No problem!";
  endif;
?>
But it results in a parse error, unexpected ':'.
Mark Lindeman
the Netherlands

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-18 13:41 UTC] sniper@php.net
Don't mix styles. If you use the old, ugly style of 'if () : endif;' stick to that, but don't try mix it with 'if () { }'

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 11:01:29 2024 UTC