products forums blog support careers about
  History | Log In     View a printable version of the current page.  
PRO USERS, to ensure 'PRIORITY SUPPORT' make sure that your ASAP account is "tagged" when you file the request. Click here for instructions on how to tag your account.
Issue Details (XML | Word | Printable)

Key: PHP-147
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Pavel Petrochenko
Reporter: Don Smith
Votes: 3
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
Aptana PHP

PHP editor incorrectly picks up PHP code that has been commented out.

Created: 21/May/08 11:34 AM   Updated: 24/Feb/09 07:58 AM
Component/s: Editor: PHP
Affects Version/s: 0.9.0
Fix Version/s: 1.1

Impact on Workflow: Critical
Specific Build Number: 1.1.6.009905
Studio Install Type: Standalone
Operating System: Windows XP
Participants: Don Smith, Kevin Cormier, Mark Thomson, Pavel Petrochenko, Scott S, Shalom Gibly and Svetlana Shcherbina


 Description  « Hide
Put the following in a PHP file withing Aptana Studio and you'll see the problem. The commented line is receiving the following error... <langname> is not recognized!

<?php
// preg_match('/<option value="(?P<langid>.?)".?>(?P<langname>.*?)</si', $body)
echo 'Hello World';
?>



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Pavel Petrochenko - 21/May/08 12:37 PM
Hi Don,

<?php
// preg_match('/<option value="(?P<langid>.?)".?>(?P<langname>.*?)</si', $body)
echo 'Hello World';
?>
All that is after ?> in your snippet is 'html' code actually (?> closes single line comment and php block).

Regards,
Pavel.


Don Smith - 21/May/08 12:51 PM
This is a regular expression that I temporarily commented out. Even if I use /* ... */ to close the comment I still get the same results. I think it's pretty strange to have to modify the contents of a comment to make Aptana think it's a comment. That defeats the purpose of a comment when you want to quickly comment out a line of code. In my case if I modify the regular expression so that Aptana doesn't think it's PHP and come back to it a few days later I may not remember what the original structure of the regular expression was.

Svetlana Shcherbina - 05/Jun/08 04:40 AM
Hello, Don.

This is not the problem of Aptana Studio, but PHP language itself. Symbols "?>" are recognized as the end of PHP script. If it is possible use "*>" please.

Thank you,
Svetlana


Don Smith - 05/Jun/08 10:57 AM
I'm not sure if you guys understand how crazy you sound with your replies. This is a bug plain and simple. I don't care what language you're programming in a comment is a comment period. The content of a comment should NEVER be interpreted as code. I've been developing software for 30 years and I've never come across an editor that has inadvertently interpreted a comment as code. In PHP these are comments:

// preg_match('/<option value="(?P<langid>.?)".?>(?P<langname>.*?)</si', $body)

/*
preg_match('/<option value="(?P<langid>.?)".?>(?P<langname>.*?)</si', $body)
*/

and just because they happen to contain actual code doesn't mean they should be interpreted any differently from other comments. If you've done software development then I'm pretty sure you've temporarily commented out a line of code while debugging. This is exactly what I've done in the PHP snippet above.

This is a BUG plain and simple.


Shalom Gibly - 28/Oct/08 04:41 PM
Reopening.

You do have a point here, however, it's not completely accurate.
We have to distinguish between one-line comment and a block comment.
One line comment in PHP ends with a new line or with a PHP closing tag.
However, this rule does not apply for block comment, so this part is indeed a bug and we will take care of that.

Thanks
Shalom G.


Shalom Gibly - 13/Nov/08 03:30 PM - edited
See also PHP-477, PHP-494

Mark Thomson - 06/Dec/08 12:33 PM
I understand that there is need to get the 1.0 issue out quickly as possible, and so some bugs have to be deferred to be fixed later.

I just want to make sure you are aware that this bug effectively makes Aptana unusable with some of the premier open source PHP projects. Drupal and Wordpress come to mind, but I'm sure there are others.

I can wait myself but you'd probably get better reviews and buzz on your 1.0 release if this bug was fixed.

Also note that this problem isn't limited to <?php ?> tags inside comment blocks but <script> tags (and possibly others as well).

Just my $0.02


Scott S - 26/Dec/08 08:59 AM
=== PHP Open/Close Tags Not Ignored When Inside Multi-Line Comments ===

Was gonna add my own bug report, but found this and a couple others first, so I'll add my nuisance here as well. This is an important issue that has limited me from using any IDE with the exception of Adobe Dreamweaver, which honestly seems to be the only IDE that does this correctly, and I've tried a loooot of different editors of the years. This REALLY DOES hold me back from moving forward towards any commercial version, which I'd gladly pay for if it weren't for that issue. I pay for and use Dreamweaver because of that.

But I digress...


Kevin Cormier - 25/Jan/09 08:20 AM
This problem exists as well in the stand alone 32 bit version 1.2.1.020234 for linux.

Pavel Petrochenko - 24/Feb/09 04:21 AM
done.

Shalom Gibly - 24/Feb/09 07:58 AM
Guys, to elaborate on Pavel's note, this issue is now resolved and the fixed version will be available with the 1.1 release.
Thank you, and of course, many thanks to Pavel!
Cheers,
-Shalom G.