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

Bug 369779

Summary: Array containing a class instance dereferencing
Product: z_Archived Reporter: itay friedman <itay.f>
Component: PDTAssignee: PHP Core <php.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jacek.pospychala, silviya
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
example test jacek.pospychala: iplog+

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.