Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 177933

Summary: Enable/disable short tags
Product: z_Archived Reporter: Jorrit Schippers <eclipsebugs>
Component: PDTAssignee: PHP UI <php.ui-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: assid, eric.caron, euthanasia_waltz, ganoro, ian, jostick, karl, moses.lecce, moshe, s.barnett.cormack, silviya, spektom, vadim.p
Version: unspecifiedKeywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Sample HTML file that should be valid none

Description Jorrit Schippers CLA 2007-03-18 10:31:02 EDT
I am working on a project for which short tags (<? and ?>, as well as the <?=$var?> construct) are disabled, because a lot of files contain the conflicting XML prolog. It would be very useful if PDT could include an option similar to the "Use ASP tags as PHP tags" option for short tags.
Comment 1 Ian Knight CLA 2007-11-01 08:55:45 EDT
This is definitly something needed as it triggers an error on things like this

$xmlstr = <<<XML
<?xml version='1.0' standalone='no'?>
...
...
XML;

The ability to tell it that shorttags is not enabled would be very useful.
Comment 2 Satish Alwani CLA 2008-04-12 05:43:05 EDT
We need something for this, perhaps make it dependant on a php.ini which is customizable?
Comment 3 Christoph CLA 2009-03-17 13:11:29 EDT
This Bug makes it impossible to 
Comment 4 Christoph CLA 2009-03-17 13:17:07 EDT
I'd like to push this bug back to top. 
PHP is a web programming language and therfore pdt should accept <?xml without mark it as syntax error.
Workarounds as described in https://bugs.eclipse.org/bugs/show_bug.cgi?id=195162  don't solve that problem and make the code invalid. That's why I ask you to solve it.
(BTW: This problem exists since 2007)

Thanks.
Comment 5 Roy Ganor CLA 2009-03-17 14:41:59 EDT
ok, let's try pushing this issue up, asking also from the community to contribute a fix...
 
Comment 6 Michael Spector CLA 2009-05-29 03:16:48 EDT
I see no errors produced from this piece of code (in 2.1.0RC2):

<?
$xmlstr = <<<XML
<?xml version='1.0' standalone='no'?>
...
...
XML;
echo "Hello";
?>

Probably this bug was fixed already.
Comment 7 Karl Debisschop CLA 2009-05-30 14:26:46 EDT
Created attachment 137759 [details]
Sample HTML file that should be valid

This was marked resolved, but IMO should not have been.

To me, the basic issue is that PDT should not mark files that are valid PHP and valid XHTML as invalid. But it does because it throws and error when it encounters a legitimate XML prolog. This is an issue because not all of our users are in eclipse - some use XML editors that want this XML prolog.

A sample file is attached.
Comment 8 Roy Ganor CLA 2009-06-14 12:32:51 EDT
this was not resolved.

a simple case will be a php file including this code

<?xml version='1.0' standalone='no'?>
Comment 9 Vadim Punski CLA 2009-12-29 10:17:34 EST
Moving it to 2.2.0M1.
Comment 10 Zhongwei Zhao CLA 2010-08-12 00:20:32 EDT
fixed in head and branch
Comment 11 Sylvia Tancheva CLA 2010-08-31 09:11:00 EDT
The option is available in Project -> Properties -> PHP Interpreter
Enable Project Specific Settings -> disable Use Short tags and rebuild.
Verified on 2.2.1.v20100822