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

Bug 311357

Summary: PHP 5.3 - Show tooltip description gets broken over a reference of a class constant
Product: z_Archived Reporter: Kalin <kalin.a>
Component: PDTAssignee: PHP UI <php.ui-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: gadi, zhaozhongwei
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
myscreen
none
Bad tooltip description none

Description Kalin CLA 2010-05-03 07:51:48 EDT
Build Identifier: 2.2.0.v20100427




Reproducible: Always

Steps to Reproduce:
1. Have the following code in a php file in a PHP 5.3 project.
<?php
class MyClass {
    const myconstant = 'constant value';
    
    function showCons1tant() {
        echo self::myconstant;
    }
}

$class = new MyClass ();
$class->showConstant ();
echo $class::myconstant;
?>

2. Put the cursor in myconstant at line 12. Go to main menu | Edit | Show Tooltip description

Expected:
A relevant tooltip should be displayed in the launched pop-up pane.

Actual:
The tooltip seems broken.
Comment 1 Kalin CLA 2010-05-03 07:52:18 EDT
Created attachment 166768 [details]
myscreen
Comment 2 Kalin CLA 2010-05-03 07:53:22 EDT
The code is inspired by example 1 in http://php.net/manual/en/language.oop5.constants.php
Comment 3 Gadi Goldbarg CLA 2010-05-03 08:02:16 EDT
related to bug 206022
Comment 4 Zhongwei Zhao CLA 2010-05-03 23:14:13 EDT
Hi Kalin

I fixed your case.But I found other two cases related to this.
1.when you hover myconstant in statement echo $class::myconstant; ,you get the wrong description--"Occurrence of 'myconstant'".
2.when you type CTRL+click,there is no hyperlink available at all.

if I use echo MyClass::myconstant;,I get the right result.And I will fix the above two cases before I mark this bug fixed.
Comment 5 Zhongwei Zhao CLA 2010-05-04 01:23:01 EDT
fixed in head
Comment 6 Gadi Goldbarg CLA 2010-05-17 10:45:16 EDT
Re-tested at PDT-2.2.0.v20100517

Again it is reproducible and not only at myconstant - almost at all of elements

see attached
Comment 7 Gadi Goldbarg CLA 2010-05-17 10:46:14 EDT
Created attachment 168739 [details]
Bad tooltip description

Attached by
Teodor Kirkov
Comment 8 Zhongwei Zhao CLA 2010-05-17 11:27:32 EDT
fixed in head:)
Comment 9 Gadi Goldbarg CLA 2010-05-26 08:34:10 EDT
Tested in EclipsePdt-2.2.0.v20100521
Verified fixed.

Kalin Yanev
kalin.a@zend.com