Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369779 - Array containing a class instance dereferencing
Summary: Array containing a class instance dereferencing
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PHP Core CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-26 04:29 EST by itay friedman CLA
Modified: 2020-05-14 11:16 EDT (History)
2 users (show)

See Also:


Attachments
example test (258 bytes, application/octet-stream)
2012-01-26 04:29 EST, itay friedman CLA
jacek.pospychala: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description itay friedman CLA 2012-01-26 04:29:33 EST
Created attachment 210103 [details]
example test

When creating an array which contains an instance of a class like so:
$arr= [0,new myClass,2];
The class methods aren't shown in code assist for $arr[1]->|.
It will apear however if the array is defined by
$arr= [0,$o,2];
when $o is an instance of myClass.

The example test attached produces:

junit.framework.AssertionFailedError: 
EXPECTED COMPLETIONS LIST:
-----------------------------
method(foo)

ACTUAL COMPLETIONS LIST:
-----------------------------
Comment 1 Zhongwei Zhao CLA 2012-02-06 23:00:50 EST
fixed
Comment 2 Sylvia Tancheva CLA 2012-07-06 10:07:57 EDT
Verified. The example should be changed like this:
<?php
class myClass{
	function foo(){
		return 0;
	}
} 
$arr= array (0, new myClass(), 3);
echo $arr[1]->|

Closing.