Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322336 - [CA] any CA for Type Casting operators
Summary: [CA] any CA for Type Casting operators
Status: REOPENED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: PHP Core CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-11 06:40 EDT by Silver Zachara CLA
Modified: 2020-05-14 10:16 EDT (History)
3 users (show)

See Also:


Attachments
patch (6.46 KB, patch)
2010-12-06 00:27 EST, xu jiaxi CLA
no flags Details | Diff
unit tests (1.24 KB, patch)
2010-12-06 00:27 EST, xu jiaxi CLA
no flags Details | Diff
patch (6.46 KB, patch)
2010-12-06 00:36 EST, xu jiaxi CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Silver Zachara CLA 2010-08-11 06:40:48 EDT
Hi,

any CA for *Type Casting* as is e.g. *(int)* , *(float)* , *(bool)* , etc., as is described here:
http://cz.php.net/manual/en/language.types.type-juggling.php#language.types.typecasting
Comment 1 xu jiaxi CLA 2010-12-06 00:27:14 EST
Created attachment 184571 [details]
patch
Comment 2 xu jiaxi CLA 2010-12-06 00:27:40 EST
Created attachment 184572 [details]
unit tests
Comment 3 xu jiaxi CLA 2010-12-06 00:36:08 EST
Created attachment 184573 [details]
patch
Comment 4 Zhongwei Zhao CLA 2011-01-13 03:25:15 EST
after reviewing the patch,I saw it only consider such condition if I am right:
(|)$blabla
my question is do we need to support:
(|)ABC::getBoolean()
Comment 5 Zhongwei Zhao CLA 2011-06-07 23:08:55 EDT
the patch has been applied
Comment 6 Michal Niewrzal CLA 2015-01-22 15:19:17 EST
Patch looks to be applied.
Comment 7 Sylvia Tancheva CLA 2015-02-10 05:49:58 EST
The fix in my opinion somewhat partial. Consider the following example (from the link):
<?php
$foo = 10;   // $foo is an integer
$bar = (boolean) $foo;   // $bar is a boolean

The fix will work in case you type all except the type cast and then call CA inside the ():
$bar = (|) $foo; // here CA will show the types

But the fix will not work in case of normal typing, e.g. you type
$bar = (|) // CA will not show the types in this case before you type the variable after the ()

I think that it should show in any case between the ().
Reopening the issue