Update page 'P# 1.0 Draft Specification'

2018-07-17 09:39:17 +02:00
parent f6f0b319f3
commit 4e14517dfb

@@ -223,6 +223,20 @@ Above example will create a multi-dimensional associative array containing integ
[8] => int(0),
}
### 5.13. Type Casting
Type casting in P# works much as it does in C/C++ - the name of the desired type is written in parentheses before the variable which is to be cast:
* (bool) - casts to Boolean
* (float) casts to Float
* (int) - casts to Integer
* (object) - casts to Object
* (string) - casts to String
* (unset) - casts to NULL
<%
string $str = "45";
int $integer = 7 + (int) $str; // contains value: 52
%>
## Future P# Versions
This paragraph describes an ideas for future versions of P# language specification
* Pointers support