Recki-CT uses a series of system types to represent variables. These are represented by the ReckiCT\Type
class.
This is the default type. All new variables that aren't parameters are initialized using this type. It also will prevent compilation if present in output IR.
A type that specifies the lack of a type. This is different from Unknown
in that we know the type.
A type that's similar to Void, except where Void never allocates a variable, Null will always allocate one.
This is a pseudo-type that "wraps" both long
and double
types. It represents any number that could be either an integer or a float. This allows delaying the decision on which exact type to use as late as possible.
This type represents integer values. It is always 64 bit.
This type represents floating point values.
-
Addition, Subtraction and Multiplication (
+
,-
and*
):Longs are always generalized into numeric results (so
long + numeric === numeric
andlong + long === numeric
).Doubles are always specified into double results (so
long + double === double
andnumeric + double === double
). -
Division (
/
):Division always results in a double
-
Bitwise Operations and Shifts (
|
,&
,^
,<<
,>>
):With few exceptions (string inputs, etc), Bitwise operations always result in Long typed results.
Represents a variable holding a string...
Represents a variable holding a boolean. In practice, this will be compiled into a long
, but for analysis reasons it's considered a separate type.
Represents a variable of runtime-determined type. Support is presently limited.
Represents the name of a class.
Represents a numerically indexed array of something. Always requires a sub-type, which are the types of values.
Note that this is a literal array, not a PHP array. String keys are not supported, nor are sparse arrays.
Represents a PHP array. Values are always mixed.