Bug 276663

Summary: "Cannot redeclare const" warning ignores program flow.
Product: [Applications] kdevelop Reporter: jay <jay>
Component: Language Support: PHPAssignee: kdevelop-bugs-null
Status: RESOLVED DUPLICATE    
Severity: normal CC: niko.sams, pprkut
Priority: NOR    
Version First Reported In: git master   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

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 ***