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

Bug 322336

Summary: [CA] any CA for Type Casting operators
Product: z_Archived Reporter: Silver Zachara <silver.zachara>
Component: PDTAssignee: PHP Core <php.core-inbox>
Status: REOPENED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: ganoro, silviya, wywrzal
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
patch
none
unit tests
none
patch none

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