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
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: mark at pictura-dp dot nl
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Sat Sep 21 01:01:27 2024 UTC