Bug 276663 - "Cannot redeclare const" warning ignores program flow.
Summary: "Cannot redeclare const" warning ignores program flow.
Status: RESOLVED DUPLICATE of bug 267246
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: PHP (show other bugs)
Version: git master
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-28 08:26 UTC by jay
Modified: 2017-02-21 14:03 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jay 2011-06-28 08:26:39 UTC
Version:           git master (using KDE 4.6.2) 
OS:                Linux

parser is unable to see program flow in defining constants.

Reproducible: Always

Steps to Reproduce:
<?php
if( true ){
  define('FOO', true);
}else{
  define('FOO', false);
}
?>

Actual Results:  
Cannot redeclare const bool FOO, already declared .....

Expected Results:  
no warning.
Comment 1 Niko Sams 2011-06-28 10:48:46 UTC
The parser only parses the code, it doesn't execute. The only solution would be not to report an error.
Comment 2 Heinz Wiesinger 2017-02-21 14:03:37 UTC

*** This bug has been marked as a duplicate of bug 267246 ***