Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Conditional Class Declaration Error
Conditional Class Declaration Error [message #1790496] Mon, 11 June 2018 20:11 Go to next message
Steve Hughes is currently offline Steve HughesFriend
Messages: 2
Registered: June 2018
Junior Member
I'm coming back to both Eclipse and a project after several years and can't figure out how to fix an error that didn't exist before. Here is a simple example:

<?php
class Base {}
class Base2 {}

if (class_exists("Base")) {
    class Upper extends Base
    {
      function __construct() {echo "Exists".PHP_EOL;}
    }
} else {
    class Upper extends Base2
    {
      function __construct() {echo "Doesn't Exist".PHP_EOL;}
    }
}

$a=new Upper();
?>


This works on the CLI with and without the Base declaration but in Eclipse 4.7.3 the second occurrence of 'Upper' is flagged as an error because 'Upper' already exists.

Can anyone help me figure this out? thx
Re: Conditional Class Declaration Error [message #1790581 is a reply to message #1790496] Wed, 13 June 2018 08:52 Go to previous messageGo to next message
Dawid Pakula is currently offline Dawid PakulaFriend
Messages: 243
Registered: March 2013
Senior Member
Please report this as a bug: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=PDT

Re: Conditional Class Declaration Error [message #1790645 is a reply to message #1790581] Wed, 13 June 2018 20:18 Go to previous messageGo to next message
Steve Hughes is currently offline Steve HughesFriend
Messages: 2
Registered: June 2018
Junior Member
Is it a bug if it worked previously?
Re: Conditional Class Declaration Error [message #1790647 is a reply to message #1790645] Wed, 13 June 2018 20:40 Go to previous message
Dawid Pakula is currently offline Dawid PakulaFriend
Messages: 243
Registered: March 2013
Senior Member
Previously we haven't semantic validation.

Previous Topic:respoitory - Smarty Feature 0.9.3
Next Topic:Breakpoints are skipped
Goto Forum:
  


Current Time: Sun Sep 23 17:41:19 GMT 2018

Powered by FUDForum. Page generated in 0.01930 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top